diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-06 12:58:08 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-06 12:58:08 +0000 |
commit | 91003eb7373b4cb9e340be5ecdbbb7884a5e973f (patch) | |
tree | c23c5bd46135e8ce4bff21251794936e17f1c5fa /protocols/Tlen/src/tlen_file.cpp | |
parent | 39955d4f87fbf76691b4fd2cb7e46940608a2a90 (diff) |
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@6372 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tlen/src/tlen_file.cpp')
-rw-r--r-- | protocols/Tlen/src/tlen_file.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp index fed69c8ae6..d2f44dddf1 100644 --- a/protocols/Tlen/src/tlen_file.cpp +++ b/protocols/Tlen/src/tlen_file.cpp @@ -152,9 +152,9 @@ static void TlenFileReceiveParse(TLEN_FILE_TRANSFER *ft) }
}
-static void TlenFileReceivingConnection(TLEN_SOCKET hConnection, DWORD dwRemoteIP, void * pExtra)
+static void TlenFileReceivingConnection(HANDLE hConnection, DWORD dwRemoteIP, void * pExtra)
{
- TLEN_SOCKET slisten;
+ HANDLE slisten;
TLEN_FILE_TRANSFER *ft;
TlenProtocol *proto = (TlenProtocol *)pExtra;
@@ -187,16 +187,14 @@ static void TlenFileReceivingConnection(TLEN_SOCKET hConnection, DWORD dwRemoteI static void __cdecl TlenFileReceiveThread(TLEN_FILE_TRANSFER *ft)
{
- NETLIBOPENCONNECTION nloc;
- TLEN_SOCKET s;
TlenLog(ft->proto, "Thread started: type=file_receive server='%s' port='%d'", ft->hostName, ft->wPort);
ft->mode = FT_RECV;
- nloc.cbSize = NETLIBOPENCONNECTION_V1_SIZE;//sizeof(NETLIBOPENCONNECTION);
+
+ NETLIBOPENCONNECTION nloc = { sizeof(nloc) };
nloc.szHost = ft->hostName;
nloc.wPort = ft->wPort;
- nloc.flags = 0;
ProtoBroadcastAck(ft->proto->m_szModuleName, ft->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTING, ft, 0);
- s = (HANDLE) CallService(MS_NETLIB_OPENCONNECTION, (WPARAM) ft->proto->hNetlibUser, (LPARAM) &nloc);
+ HANDLE s = (HANDLE) CallService(MS_NETLIB_OPENCONNECTION, (WPARAM) ft->proto->hNetlibUser, (LPARAM) &nloc);
if (s != NULL) {
ft->s = s;
TlenLog(ft->proto, "Entering file receive loop");
@@ -395,9 +393,9 @@ static void TlenFileSendParse(TLEN_FILE_TRANSFER *ft) }
}
-static void TlenFileSendingConnection(TLEN_SOCKET hConnection, DWORD dwRemoteIP, void * pExtra)
+static void TlenFileSendingConnection(HANDLE hConnection, DWORD dwRemoteIP, void * pExtra)
{
- TLEN_SOCKET slisten;
+ HANDLE slisten;
TLEN_FILE_TRANSFER *ft;
TlenProtocol *proto = (TlenProtocol *)pExtra;
@@ -462,7 +460,7 @@ int TlenFileCancelAll(TlenProtocol *proto) static void __cdecl TlenFileSendingThread(TLEN_FILE_TRANSFER *ft)
{
- TLEN_SOCKET s = NULL;
+ HANDLE s = NULL;
HANDLE hEvent;
char *nick;
@@ -494,15 +492,13 @@ static void __cdecl TlenFileSendingThread(TLEN_FILE_TRANSFER *ft) TlenLog(ft->proto, "ft->s is NULL");
if (ft->state == FT_SWITCH) {
- NETLIBOPENCONNECTION nloc;
- TLEN_SOCKET s;
TlenLog(ft->proto, "Sending as client...");
ft->state = FT_CONNECTING;
- nloc.cbSize = NETLIBOPENCONNECTION_V1_SIZE;//sizeof(NETLIBOPENCONNECTION);
+
+ NETLIBOPENCONNECTION nloc = { sizeof(nloc) };
nloc.szHost = ft->hostName;
nloc.wPort = ft->wPort;
- nloc.flags = 0;
- s = (HANDLE) CallService(MS_NETLIB_OPENCONNECTION, (WPARAM) ft->proto->hNetlibUser, (LPARAM) &nloc);
+ HANDLE s = (HANDLE) CallService(MS_NETLIB_OPENCONNECTION, (WPARAM) ft->proto->hNetlibUser, (LPARAM) &nloc);
if (s != NULL) {
ProtoBroadcastAck(ft->proto->m_szModuleName, ft->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTING, ft, 0);
ft->s = s;
|