summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/direct_connect.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-18 21:52:06 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-18 21:52:06 +0000
commit47e5e82a35999401cc7676cd19a4b8b289a2024c (patch)
tree20449be9036d3d2503b49f4c2ba481be99261c66 /protocols/AimOscar/direct_connect.cpp
parentbb7bf61220abb44c385deabda02daed66e9e2389 (diff)
sync
git-svn-id: http://svn.miranda-ng.org/main/trunk@1030 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar/direct_connect.cpp')
-rw-r--r--protocols/AimOscar/direct_connect.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/protocols/AimOscar/direct_connect.cpp b/protocols/AimOscar/direct_connect.cpp
index e6b2996ffb..4552b461cf 100644
--- a/protocols/AimOscar/direct_connect.cpp
+++ b/protocols/AimOscar/direct_connect.cpp
@@ -1,6 +1,6 @@
/*
Plugin of Miranda IM for communicating with users of the AIM protocol.
-Copyright (c) 2008-2009 Boris Krasnovskiy
+Copyright (c) 2008-2012 Boris Krasnovskiy
Copyright (C) 2005-2006 Aaron Myles Landwehr
This program is free software; you can redistribute it and/or
@@ -66,23 +66,18 @@ void __cdecl CAimProto::aim_dc_helper(void* param) //only called when we are ini
ft_list.remove_by_ft(ft);
}
-void aim_direct_connection_initiated(HANDLE hNewConnection, DWORD dwRemoteIP, CAimProto* ppro)//for receiving stuff via dc
+void aim_direct_connection_initiated(HANDLE hNewConnection, DWORD, void* extra)//for receiving stuff via dc
{
+ CAimProto* ppro = (CAimProto*)extra;
file_transfer *ft;
- char cip[20];
- ppro->LOG("Buddy connected from IP: %s", long_ip_to_char_ip(dwRemoteIP, cip));
+ NETLIBCONNINFO connInfo = { sizeof(connInfo) };
+ CallService(MS_NETLIB_GETCONNECTIONINFO, (WPARAM)hNewConnection, (LPARAM)&connInfo);
- //okay someone connected to us or we initiated the connection- we need to figure out who they are and if they belong
- for (int i=21; --i; )
- {
- ft = ppro->ft_list.find_by_ip(dwRemoteIP);
-
- if (ft == NULL) ft = ppro->ft_list.find_suitable();
- if (ft || Miranda_Terminated()) break;
- Sleep(100);
- }
+ ppro->LOG("Buddy connected: %s", connInfo.szIpPort);
+ // okay someone connected to us or we initiated the connection- we need to figure out who they are and if they belong
+ ft = ppro->ft_list.find_by_port(connInfo.wPort);
if (ft)
{
ft->hConn = hNewConnection;