diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-06 13:58:20 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-06 13:58:20 +0000 |
commit | 46a53191c1ad11a41c948594e972568e62d155b4 (patch) | |
tree | 7e57e6f7093fb0de766fe13a933d2f9231433e4d /src/modules/netlib/netlibopenconn.cpp | |
parent | 1fe5acae909ea64a1de9ac9f58cae5a3c2d3ad1f (diff) |
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@332 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/netlib/netlibopenconn.cpp')
-rw-r--r-- | src/modules/netlib/netlibopenconn.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp index 5ee3200308..086269c021 100644 --- a/src/modules/netlib/netlibopenconn.cpp +++ b/src/modules/netlib/netlibopenconn.cpp @@ -168,7 +168,7 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib buf[0]=5; //yep, socks5
buf[1]=1; //one auth method
buf[2]=nlu->settings.useProxyAuth?2:0;
- if(NLSend(nlc,(char*)buf,3,MSG_DUMPPROXY)==SOCKET_ERROR) {
+ if (NLSend(nlc,(char*)buf,3,MSG_DUMPPROXY)==SOCKET_ERROR) {
NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLSend",GetLastError());
return 0;
}
@@ -178,13 +178,13 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
return 0;
}
- if((buf[1]!=0 && buf[1]!=2)) {
+ if ((buf[1]!=0 && buf[1]!=2)) {
SetLastError(ERROR_INVALID_ID_AUTHORITY);
NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLRecv",GetLastError());
return 0;
}
- if(buf[1]==2) { //rfc1929
+ if (buf[1]==2) { //rfc1929
int nUserLen,nPassLen;
PBYTE pAuthBuf;
@@ -196,7 +196,7 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib memcpy(pAuthBuf+2,nlu->settings.szProxyAuthUser,nUserLen);
pAuthBuf[2+nUserLen]=nPassLen;
memcpy(pAuthBuf+3+nUserLen,nlu->settings.szProxyAuthPassword,nPassLen);
- if(NLSend(nlc,(char*)pAuthBuf,3+nUserLen+nPassLen,MSG_DUMPPROXY)==SOCKET_ERROR) {
+ if (NLSend(nlc,(char*)pAuthBuf,3+nUserLen+nPassLen,MSG_DUMPPROXY)==SOCKET_ERROR) {
NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLSend",GetLastError());
mir_free(pAuthBuf);
return 0;
@@ -207,7 +207,7 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
return 0;
}
- if(buf[1]) {
+ if (buf[1]) {
SetLastError(ERROR_ACCESS_DENIED);
NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"RecvUntilTimeout",GetLastError());
return 0;
@@ -222,7 +222,7 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib if (nlc->dnsThroughProxy)
{
hostIP = inet_addr(nloc->szHost);
- if(hostIP == INADDR_NONE)
+ if (hostIP == INADDR_NONE)
nHostLen = lstrlenA(nloc->szHost)+1;
else nHostLen = 4;
}
@@ -237,7 +237,7 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib pInit[0]=5; //SOCKS5
pInit[1]= nloc->flags & NLOCF_UDP ? 3 : 1; //connect or UDP
pInit[2]=0; //reserved
- if(hostIP==INADDR_NONE) { //DNS lookup through proxy
+ if (hostIP==INADDR_NONE) { //DNS lookup through proxy
pInit[3]=3;
pInit[4]=nHostLen-1;
memcpy(pInit+5,nloc->szHost,nHostLen-1);
@@ -247,7 +247,7 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc,struct Netlib *(PDWORD)(pInit+4)=hostIP;
}
*(PWORD)(pInit+4+nHostLen)=htons(nloc->wPort);
- if(NLSend(nlc,(char*)pInit,6+nHostLen,MSG_DUMPPROXY)==SOCKET_ERROR) {
+ if (NLSend(nlc,(char*)pInit,6+nHostLen,MSG_DUMPPROXY)==SOCKET_ERROR) {
NetlibLogf(nlu,"%s %d: %s() failed (%u)",__FILE__,__LINE__,"NLSend",GetLastError());
mir_free(pInit);
return 0;
|