summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_netlib.h15
-rw-r--r--plugins/HTTPServer/src/main.cpp2
-rw-r--r--protocols/IRCG/src/irclib.cpp8
-rw-r--r--protocols/JabberG/src/jabber_byte.cpp2
-rw-r--r--protocols/JabberG/src/jabber_file.cpp2
-rw-r--r--src/mir_app/src/netlib.h2
-rw-r--r--src/mir_app/src/netlibbind.cpp6
7 files changed, 16 insertions, 21 deletions
diff --git a/include/m_netlib.h b/include/m_netlib.h
index 73b0ff2ff7..9bfcce8a41 100644
--- a/include/m_netlib.h
+++ b/include/m_netlib.h
@@ -262,23 +262,18 @@ EXTERN_C MIR_APP_DLL(int) Netlib_CloseHandle(HANDLE h);
/* pExtra was added during 0.3.4+, prior its just two args, since we use the cdecl convention
it shouldnt matter */
-typedef void (*NETLIBNEWCONNECTIONPROC_V2)(HNETLIBCONN hNewConnection, DWORD dwRemoteIP, void *pExtra);
-typedef void (*NETLIBNEWCONNECTIONPROC)(HNETLIBCONN hNewConnection, DWORD dwRemoteIP);
+typedef void (*NETLIBNEWCONNECTIONPROC)(HNETLIBCONN hNewConnection, DWORD dwRemoteIP, void *pExtra);
struct NETLIBBIND
{
- union { // new code should use V2
- NETLIBNEWCONNECTIONPROC pfnNewConnection;
- NETLIBNEWCONNECTIONPROC_V2 pfnNewConnectionV2;
- };
-
+ NETLIBNEWCONNECTIONPROC pfnNewConnection;
+
// function to call when there's a new connection. Params are: the
// new connection, IP of remote machine (host byte order)
DWORD dwInternalIP; // set on return, host byte order
- WORD wPort; // set on return, host byte order
- void *pExtra; // argument is sent to callback
DWORD dwExternalIP; // set on return, host byte order
- WORD wExPort; // set on return, host byte order
+ WORD wPort, wExPort; // set on return, host byte order
+ void *pExtra; // argument is sent to callback
};
EXTERN_C MIR_APP_DLL(HNETLIBBIND) Netlib_BindPort(HNETLIBUSER nlu, NETLIBBIND *nlb);
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp
index 80b12983a3..d6a4a78566 100644
--- a/plugins/HTTPServer/src/main.cpp
+++ b/plugins/HTTPServer/src/main.cpp
@@ -566,7 +566,7 @@ void __cdecl HandleNewConnection(CLHttpUser *pclUser)
// Developer : KN
/////////////////////////////////////////////////////////////////////
-void ConnectionOpen(HNETLIBCONN hNewConnection, DWORD dwRemoteIP)
+void ConnectionOpen(HNETLIBCONN hNewConnection, DWORD dwRemoteIP, void*)
{
in_addr stAddr;
stAddr.S_un.S_addr = htonl(dwRemoteIP);
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp
index e72df9fa90..4c4ac7e045 100644
--- a/protocols/IRCG/src/irclib.cpp
+++ b/protocols/IRCG/src/irclib.cpp
@@ -342,7 +342,7 @@ void CIrcProto::InsertIncomingEvent(wchar_t* pszRaw)
void CIrcProto::createMessageFromPchar(const char* p)
{
- wchar_t* ptszMsg;
+ wchar_t *ptszMsg;
if (codepage != CP_UTF8 && m_utfAutodetect) {
if (mir_utf8decodecp(NEWSTR_ALLOCA(p), codepage, &ptszMsg) == nullptr)
ptszMsg = mir_a2u_cp(p, codepage);
@@ -360,7 +360,7 @@ void CIrcProto::DoReceive()
if (m_info.bIdentServer && m_info.iIdentServerPort != NULL) {
NETLIBBIND nb = {};
- nb.pfnNewConnectionV2 = DoIdent;
+ nb.pfnNewConnection = DoIdent;
nb.pExtra = this;
nb.wPort = m_info.iIdentServerPort;
@@ -866,7 +866,7 @@ int CDccSession::SetupConnection()
// create a listening socket for outgoing chat/send requests. The remote computer connects to this computer. Used for both chat and filetransfer.
if (di->bSender && !di->bReverse) {
NETLIBBIND nb = {};
- nb.pfnNewConnectionV2 = DoIncomingDcc; // this is the (helper) function to be called once an incoming connection is made. The 'real' function that is called is IncomingConnection()
+ nb.pfnNewConnection = DoIncomingDcc; // this is the (helper) function to be called once an incoming connection is made. The 'real' function that is called is IncomingConnection()
nb.pExtra = this;
hBindPort = Netlib_BindPort(m_proto->hNetlibDCC, &nb);
@@ -942,7 +942,7 @@ int CDccSession::SetupConnection()
// hack for passive filetransfers
if (di->iType == DCC_SEND && !di->bSender && di->bReverse) {
NETLIBBIND nb = {};
- nb.pfnNewConnectionV2 = DoIncomingDcc; // this is the (helper) function to be called once an incoming connection is made. The 'real' function that is called is IncomingConnection()
+ nb.pfnNewConnection = DoIncomingDcc; // this is the (helper) function to be called once an incoming connection is made. The 'real' function that is called is IncomingConnection()
nb.pExtra = this;
hBindPort = Netlib_BindPort(m_proto->hNetlibDCC, &nb);
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp
index 7228b16fc1..58fabd9362 100644
--- a/protocols/JabberG/src/jabber_byte.cpp
+++ b/protocols/JabberG/src/jabber_byte.cpp
@@ -197,7 +197,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt)
localAddr = getStringA("BsDirectAddr");
NETLIBBIND nlb = {};
- nlb.pfnNewConnectionV2 = JabberByteSendConnection;
+ nlb.pfnNewConnection = JabberByteSendConnection;
nlb.pExtra = this;
nlb.wPort = 0; // Use user-specified incoming port ranges, if available
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index aff4a01567..1d0f2e007e 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -240,7 +240,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
ft->type = FT_OOB;
NETLIBBIND nlb = {};
- nlb.pfnNewConnectionV2 = JabberFileServerConnection;
+ nlb.pfnNewConnection = JabberFileServerConnection;
nlb.pExtra = this;
nlb.wPort = 0; // Use user-specified incoming port ranges, if available
diff --git a/src/mir_app/src/netlib.h b/src/mir_app/src/netlib.h
index 2b03691dcc..61546574e1 100644
--- a/src/mir_app/src/netlib.h
+++ b/src/mir_app/src/netlib.h
@@ -119,7 +119,7 @@ struct NetlibBoundPort : public MZeroedObject
WORD wPort;
WORD wExPort;
NetlibUser *nlu;
- NETLIBNEWCONNECTIONPROC_V2 pfnNewConnectionV2;
+ NETLIBNEWCONNECTIONPROC pfnNewConnection;
HANDLE hThread;
void *pExtra;
};
diff --git a/src/mir_app/src/netlibbind.cpp b/src/mir_app/src/netlibbind.cpp
index a6152adf09..ca551c20e1 100644
--- a/src/mir_app/src/netlibbind.cpp
+++ b/src/mir_app/src/netlibbind.cpp
@@ -172,8 +172,8 @@ static void __cdecl NetlibBindAcceptThread(NetlibBoundPort *nlbp)
nlc->nlu = nlbp->nlu;
nlc->s = s;
- if (nlbp->pfnNewConnectionV2)
- nlbp->pfnNewConnectionV2(nlc, ntohl(sin.sin_addr.S_un.S_addr), nlbp->pExtra);
+ if (nlbp->pfnNewConnection)
+ nlbp->pfnNewConnection(nlc, ntohl(sin.sin_addr.S_un.S_addr), nlbp->pExtra);
}
NetlibUPnPDeletePortMapping(nlbp->wExPort, "TCP");
@@ -310,7 +310,7 @@ NetlibBoundPort::NetlibBoundPort(HNETLIBUSER _nlu, NETLIBBIND *nlb)
: handleType(NLH_BOUNDPORT),
nlu(_nlu)
{
- pfnNewConnectionV2 = nlb->pfnNewConnectionV2;
+ pfnNewConnection = nlb->pfnNewConnection;
pExtra = nlb->pExtra;
s = socket(PF_INET, SOCK_STREAM, 0);