From 3f23417a1099f73dc28ec1b7d6ec2a1a7fc2b7a2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Jun 2012 20:53:59 +0000 Subject: - PLUGININFO structure removed at all; - Options_AddPage & UserInfo_AddPage replaced MS_OPT_ADDPAGE & MS_USERINFO_ADDPAGE services respectively - total internal redesign of options' translation - code reformatting git-svn-id: http://svn.miranda-ng.org/main/trunk@477 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/netlib/netlibbind.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/modules/netlib/netlibbind.cpp') diff --git a/src/modules/netlib/netlibbind.cpp b/src/modules/netlib/netlibbind.cpp index 22e3876e42..ada02da36e 100644 --- a/src/modules/netlib/netlibbind.cpp +++ b/src/modules/netlib/netlibbind.cpp @@ -82,7 +82,7 @@ bool BindSocketToPort(const char *szPorts, SOCKET s, SOCKET s6, int* portn) ++portnum; if (s == INVALID_SOCKET) continue; - if (!before && portnum <= *portn) continue; + if ( !before && portnum <= *portn) continue; if (before && portnum >= *portn) { LeaveCriticalSection(&csNetlibUser); @@ -163,7 +163,7 @@ static unsigned __stdcall NetlibBindAcceptThread(void* param) } char *szHostA = NetlibAddressToString(&sin); - NetlibLogf(nlbp->nlu, "New incoming connection on port %u from %s (%p )", nlbp->wPort, szHostA, s); + NetlibLogf(nlbp->nlu, "New incoming connection on port %u from %s (%p)", nlbp->wPort, szHostA, s); mir_free(szHostA); nlc = (NetlibConnection*)mir_calloc(sizeof(NetlibConnection)); nlc->handleType = NLH_CONNECTION; @@ -191,7 +191,7 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) int foundPort = 0; UINT dwThreadId; - if (GetNetlibHandleType(nlu) != NLH_USER || !(nlu->user.flags & NUF_INCOMING) || + if (GetNetlibHandleType(nlu) != NLH_USER || !(nlu->user.flags & NUF_INCOMING) || nlb == NULL || nlb->pfnNewConnection == NULL) { SetLastError(ERROR_INVALID_PARAMETER); @@ -224,7 +224,7 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) they better have given wPort == 0, let's hope so */ if (nlu->settings.specifyIncomingPorts && nlu->settings.szIncomingPorts && nlb->wPort == 0) { - if (!BindSocketToPort(nlu->settings.szIncomingPorts, nlbp->s, nlbp->s6, &nlu->outportnum)) + if ( !BindSocketToPort(nlu->settings.szIncomingPorts, nlbp->s, nlbp->s6, &nlu->outportnum)) { NetlibLogf(nlu, "Netlib bind: Not enough ports for incoming connections specified"); SetLastError(WSAEADDRINUSE); @@ -246,7 +246,7 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) { SOCKADDR_IN sin = {0}; int len = sizeof(sin); - if (!getsockname(nlbp->s, (PSOCKADDR)&sin, &len)) + if ( !getsockname(nlbp->s, (PSOCKADDR)&sin, &len)) sin6.sin6_port = sin.sin_port; foundPort = 1; } @@ -254,7 +254,7 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) if (bind(nlbp->s6, (PSOCKADDR)&sin6, sizeof(sin6)) == 0) foundPort = 1; } - if (!foundPort) + if ( !foundPort) { NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "bind", WSAGetLastError()); closesocket(nlbp->s); @@ -284,12 +284,12 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) { SOCKADDR_INET_M sin = {0}; int len = sizeof(sin); - if (!getsockname(nlbp->s, (PSOCKADDR)&sin, &len)) + if ( !getsockname(nlbp->s, (PSOCKADDR)&sin, &len)) { nlb->wPort = ntohs(sin.Ipv4.sin_port); nlb->dwInternalIP = ntohl(sin.Ipv4.sin_addr.S_un.S_addr); } - else if (!getsockname(nlbp->s6, (PSOCKADDR)&sin, &len)) + else if ( !getsockname(nlbp->s6, (PSOCKADDR)&sin, &len)) nlb->wPort = ntohs(sin.Ipv6.sin6_port); else { -- cgit v1.2.3