From f91d40c25949ee8c5b1d5c1babab62d6dd90d0c8 Mon Sep 17 00:00:00 2001 From: Logan Dethrow Date: Wed, 22 Jun 2011 14:35:31 -0400 Subject: Merge, fixed build issues by refactoring SOCKS 5 code. --- indra/llmessage/net.cpp | 59 ------------------------------------------------- 1 file changed, 59 deletions(-) (limited to 'indra/llmessage/net.cpp') diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp index 366a1835ca..e2d185b959 100644 --- a/indra/llmessage/net.cpp +++ b/indra/llmessage/net.cpp @@ -664,63 +664,4 @@ BOOL send_packet(int hSocket, const char * sendBuffer, int size, U32 recipient, #endif -int tcp_handshake(LLSocket::ptr_t handle, char * dataout, apr_size_t outlen, char * datain, apr_size_t maxinlen) -{ - apr_socket_t* apr_socket = handle->getSocket(); - apr_status_t rv; - - apr_size_t expected_len = outlen; - - apr_socket_opt_set(apr_socket, APR_SO_NONBLOCK, -5); // Blocking connection, 5 second timeout - apr_socket_timeout_set(apr_socket, (APR_USEC_PER_SEC * 5)); - - rv = apr_socket_send(apr_socket, dataout, &outlen); - if (rv != APR_SUCCESS || expected_len != outlen) - { - llwarns << "Error sending data to proxy control channel" << llendl; - ll_apr_warn_status(rv); - return -1; - } - - expected_len = maxinlen; - do - { - rv = apr_socket_recv(apr_socket, datain, &maxinlen); - llinfos << "Receiving packets." << llendl; - llwarns << "Proxy control channel status: " << rv << llendl; - } while (APR_STATUS_IS_EAGAIN(rv)); - - if (rv != APR_SUCCESS) - { - llwarns << "Error receiving data from proxy control channel, status: " << rv << llendl; - llwarns << "Received " << maxinlen << " bytes." << llendl; - ll_apr_warn_status(rv); - return rv; - } - else if (expected_len != maxinlen) - { - llwarns << "Incorrect data received length in proxy control channel" << llendl; - return -1; - } - - return 0; -} - -LLSocket::ptr_t tcp_open_channel(LLHost host) -{ - LLSocket::ptr_t socket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); - bool connected = socket->blockingConnect(host); - if (!connected) - { - tcp_close_channel(socket); - } - - return socket; -} - -void tcp_close_channel(LLSocket::ptr_t handle) -{ - handle.reset(); -} - //EOF -- cgit v1.2.3