summaryrefslogtreecommitdiff
path: root/src/modules/netlib
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-06 08:20:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-06 08:20:31 +0000
commit1ba3fd86fd226554722db54232620faf529438e2 (patch)
tree589072b61ef323de367311476aefb9b81ca49dc0 /src/modules/netlib
parent0750bd2a0d25bed656d21eb65e6ca6627e7a6b66 (diff)
misprint in service name
git-svn-id: http://svn.miranda-ng.org/main/trunk@6368 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/netlib')
-rw-r--r--src/modules/netlib/netlib.cpp8
-rw-r--r--src/modules/netlib/netlibopenconn.cpp4
-rw-r--r--src/modules/netlib/netlibsock.cpp14
3 files changed, 9 insertions, 17 deletions
diff --git a/src/modules/netlib/netlib.cpp b/src/modules/netlib/netlib.cpp
index e56cf59811..5825bc9801 100644
--- a/src/modules/netlib/netlib.cpp
+++ b/src/modules/netlib/netlib.cpp
@@ -359,15 +359,13 @@ INT_PTR NetlibStringToAddressSrv(WPARAM wParam, LPARAM lParam)
INT_PTR NetlibAddressToStringSrv(WPARAM wParam, LPARAM lParam)
{
- if (wParam)
- {
+ if (wParam) {
SOCKADDR_INET_M iaddr = {0};
iaddr.Ipv4.sin_family = AF_INET;
iaddr.Ipv4.sin_addr.s_addr = htonl((unsigned)lParam);
return (INT_PTR)NetlibAddressToString(&iaddr);
}
- else
- return (INT_PTR)NetlibAddressToString((SOCKADDR_INET_M*)lParam);
+ return (INT_PTR)NetlibAddressToString((SOCKADDR_INET_M*)lParam);
}
INT_PTR NetlibGetConnectionInfoSrv(WPARAM wParam, LPARAM lParam)
@@ -526,7 +524,7 @@ int LoadNetlibModule(void)
CreateServiceFunction(MS_NETLIB_GETMOREPACKETS, NetlibPacketRecverGetMore);
CreateServiceFunction(MS_NETLIB_SETPOLLINGTIMEOUT, NetlibHttpSetPollingTimeout);
CreateServiceFunction(MS_NETLIB_STARTSSL, NetlibStartSsl);
- CreateServiceFunction(MS_NETLIB_STARINGTOADDRESS, NetlibStringToAddressSrv);
+ CreateServiceFunction(MS_NETLIB_STRINGTOADDRESS, NetlibStringToAddressSrv);
CreateServiceFunction(MS_NETLIB_ADDRESSTOSTRING, NetlibAddressToStringSrv);
CreateServiceFunction(MS_NETLIB_GETCONNECTIONINFO, NetlibGetConnectionInfoSrv);
CreateServiceFunction(MS_NETLIB_GETMYIP, NetlibGetMyIp);
diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp
index 86fafd0755..b8d0f440e5 100644
--- a/src/modules/netlib/netlibopenconn.cpp
+++ b/src/modules/netlib/netlibopenconn.cpp
@@ -569,9 +569,7 @@ static bool my_connectIPv6(NetlibConnection *nlc, NETLIBOPENCONNECTION * nloc)
}
for (ai = air; ai && !Miranda_Terminated(); ai = ai->ai_next) {
- char* szIp = NetlibAddressToString((SOCKADDR_INET_M*)ai->ai_addr);
- NetlibLogf(nlc->nlu, "(%p) Connecting to ip %s ....", nlc, szIp);
- mir_free(szIp);
+ NetlibLogf(nlc->nlu, "(%p) Connecting to ip %s ....", nlc, ptrA( NetlibAddressToString((SOCKADDR_INET_M*)ai->ai_addr)));
retry:
nlc->s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if (nlc->s == INVALID_SOCKET)
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp
index 2611ea9f37..c88715da50 100644
--- a/src/modules/netlib/netlibsock.cpp
+++ b/src/modules/netlib/netlibsock.cpp
@@ -224,20 +224,17 @@ bool NetlibStringToAddress(const char* str, SOCKADDR_INET_M* addr)
char* NetlibAddressToString(SOCKADDR_INET_M* addr)
{
char saddr[128];
-
DWORD len = sizeof(saddr);
if ( !WSAAddressToStringA((PSOCKADDR)addr, sizeof(*addr), NULL, saddr, &len))
return mir_strdup(saddr);
- if (addr->si_family == AF_INET)
- {
+
+ if (addr->si_family == AF_INET) {
char *szIp = inet_ntoa(addr->Ipv4.sin_addr);
- if (addr->Ipv4.sin_port != 0)
- {
+ if (addr->Ipv4.sin_port != 0) {
mir_snprintf(saddr, sizeof(saddr), "%s:%d", szIp, htons(addr->Ipv4.sin_port));
return mir_strdup(saddr);
}
- else
- return mir_strdup(szIp);
+ return mir_strdup(szIp);
}
return NULL;
}
@@ -249,8 +246,7 @@ void NetlibGetConnectionInfo(NetlibConnection* nlc, NETLIBCONNINFO *connInfo)
SOCKADDR_INET_M sin = {0};
int len = sizeof(sin);
- if ( !getsockname(nlc->s, (PSOCKADDR)&sin, &len))
- {
+ if ( !getsockname(nlc->s, (PSOCKADDR)&sin, &len)) {
connInfo->wPort = ntohs(sin.Ipv4.sin_port);
connInfo->dwIpv4 = sin.si_family == AF_INET ? htonl(sin.Ipv4.sin_addr.s_addr) : 0;