summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorLogan Dethrow <log@lindenlab.com>2011-07-13 16:46:36 -0400
committerLogan Dethrow <log@lindenlab.com>2011-07-13 16:46:36 -0400
commitcb24dff9e36a963af280be1aead9424be8a678b6 (patch)
tree921bcf6a9fc3478c62d37df4518f7a230bc57593 /indra/llmessage
parentcfce3686dea74dfa2a6c92dbd1e8e1ae8518f259 (diff)
Code cleanup for the SOCKS 5 proxy viewer.
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llcurl.cpp10
-rw-r--r--indra/llmessage/llpacketring.cpp2
-rw-r--r--indra/llmessage/llproxy.cpp6
-rw-r--r--indra/llmessage/llproxy.h2
-rw-r--r--indra/llmessage/net.cpp2
5 files changed, 11 insertions, 11 deletions
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 25249e9444..a7ce4310c1 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -206,7 +206,7 @@ namespace boost
void intrusive_ptr_release(LLCurl::Responder* p)
{
- if(p && 0 == --p->mReferenceCount)
+ if (p && 0 == --p->mReferenceCount)
{
delete p;
}
@@ -406,11 +406,11 @@ const char* LLCurl::Easy::getErrorBuffer()
void LLCurl::Easy::setCA()
{
- if(!sCAPath.empty())
+ if (!sCAPath.empty())
{
setoptString(CURLOPT_CAPATH, sCAPath);
}
- if(!sCAFile.empty())
+ if (!sCAFile.empty())
{
setoptString(CURLOPT_CAINFO, sCAFile);
}
@@ -546,7 +546,7 @@ void LLCurl::Easy::prepRequest(const std::string& url,
if (LLProxy::getInstance()->getHTTPProxyType() == LLPROXY_SOCKS)
{
setopt(CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
- if(LLProxy::getInstance()->getSelectedAuthMethod() == METHOD_PASSWORD)
+ if (LLProxy::getInstance()->getSelectedAuthMethod() == METHOD_PASSWORD)
{
setoptString(CURLOPT_PROXYUSERPWD, LLProxy::getInstance()->getProxyUserPwdCURL());
}
@@ -568,7 +568,7 @@ void LLCurl::Easy::prepRequest(const std::string& url,
setopt(CURLOPT_HEADERDATA, (void*)this);
// Allow up to five redirects
- if(responder && responder->followRedir())
+ if (responder && responder->followRedir())
{
setopt(CURLOPT_FOLLOWLOCATION, 1);
setopt(CURLOPT_MAXREDIRS, MAX_REDIRECTS);
diff --git a/indra/llmessage/llpacketring.cpp b/indra/llmessage/llpacketring.cpp
index a86b7b4370..ba82957b47 100644
--- a/indra/llmessage/llpacketring.cpp
+++ b/indra/llmessage/llpacketring.cpp
@@ -237,6 +237,8 @@ S32 LLPacketRing::receivePacket (S32 socket, char *datap)
proxywrap_t * header = reinterpret_cast<proxywrap_t *>(buffer);
mLastSender.setAddress(header->addr);
mLastSender.setPort(ntohs(header->port));
+
+ packet_size -= SOCKS_HEADER_SIZE; // The unwrapped packet size
}
else
{
diff --git a/indra/llmessage/llproxy.cpp b/indra/llmessage/llproxy.cpp
index 0143803f2b..11a5c480f0 100644
--- a/indra/llmessage/llproxy.cpp
+++ b/indra/llmessage/llproxy.cpp
@@ -110,7 +110,7 @@ S32 LLProxy::proxyHandshake(LLHost proxy, U32 message_port)
authmethod_password_reply_t password_reply;
- result = tcp_handshake(mProxyControlChannel, password_auth, request_size, (char*)&password_reply, sizeof(authmethod_password_reply_t));
+ result = tcp_handshake(mProxyControlChannel, password_auth, request_size, (char*)&password_reply, sizeof(password_reply));
delete[] password_auth;
if (result != 0)
@@ -142,7 +142,7 @@ S32 LLProxy::proxyHandshake(LLHost proxy, U32 message_port)
// "If the client is not in possession of the information at the time of the UDP ASSOCIATE,
// the client MUST use a port number and address of all zeros. RFC 1928"
- result = tcp_handshake(mProxyControlChannel, (char*)&connect_request, sizeof(socks_command_request_t), (char*)&connect_reply, sizeof(socks_command_response_t));
+ result = tcp_handshake(mProxyControlChannel, (char*)&connect_request, sizeof(connect_request), (char*)&connect_reply, sizeof(connect_reply));
if (result != 0)
{
LL_WARNS("Proxy") << "SOCKS connect request failed, error on TCP control channel : " << result << LL_ENDL;
@@ -202,7 +202,7 @@ void LLProxy::stopProxy()
// then we must shut down any HTTP proxy operations. But it is allowable if web
// proxy is being used to continue proxying HTTP.
- if(LLPROXY_SOCKS == mProxyType)
+ if (LLPROXY_SOCKS == mProxyType)
{
sHTTPProxyEnabled = false;
}
diff --git a/indra/llmessage/llproxy.h b/indra/llmessage/llproxy.h
index 7893545b9d..cf2dfdc60e 100644
--- a/indra/llmessage/llproxy.h
+++ b/indra/llmessage/llproxy.h
@@ -191,7 +191,7 @@ public:
void enableHTTPProxy(LLHost httpHost, LLHttpProxyType type);
// Stop proxying HTTP packets
- void disableHTTPProxy() { sHTTPProxyEnabled = false; };
+ void disableHTTPProxy() { sHTTPProxyEnabled = false; }
// Get the UDP proxy address and port
LLHost getUDPProxy() const { return mUDPProxy; }
diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp
index f8ab55143c..85aef5da00 100644
--- a/indra/llmessage/net.cpp
+++ b/indra/llmessage/net.cpp
@@ -50,8 +50,6 @@
#include "lltimer.h"
#include "indra_constants.h"
-#include "llproxy.h"
-
// Globals
#if LL_WINDOWS