diff options
author | George Hazan <ghazan@miranda.im> | 2017-02-07 00:16:55 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-02-07 00:16:55 +0300 |
commit | 45dddaa51b79bbb2d5dc999e4849951a1e7f0ae3 (patch) | |
tree | bac17acc10e71a9203c126de0614f6d0147be3b3 | |
parent | f7cfd1068128e6a7da7d69d1de035b6c70028e17 (diff) |
code cleaning
-rw-r--r-- | protocols/IcqOscarJ/src/icq_direct.h | 89 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/oscar_filetransfer.h | 21 |
3 files changed, 53 insertions, 59 deletions
diff --git a/protocols/IcqOscarJ/src/icq_direct.h b/protocols/IcqOscarJ/src/icq_direct.h index 4b3da88a79..1b469c991b 100644 --- a/protocols/IcqOscarJ/src/icq_direct.h +++ b/protocols/IcqOscarJ/src/icq_direct.h @@ -28,32 +28,29 @@ struct filetransfer: public basic_filetransfer
{
- int status;
- int sending;
- int iCurrentFile;
- int currentIsDir;
- DWORD dwCookie;
- DWORD dwUin;
- DWORD dwRemotePort;
- MCONTACT hContact;
- char *szFilename;
- char *szDescription;
- char *szSavePath;
- char *szThisFile;
- char *szThisSubdir;
- char **pszFiles;
- DWORD dwThisFileSize;
- DWORD dwThisFileDate;
- DWORD dwTotalSize;
- DWORD dwFileCount;
- DWORD dwTransferSpeed;
- DWORD dwBytesDone, dwFileBytesDone;
- int fileId;
- HNETLIBCONN hConnection;
- DWORD dwLastNotify;
- int nVersion; // Was this sent with a v7 or a v8 packet?
- BOOL bDC; // Was this received over a DC or through server?
- BOOL bEmptyDesc; // Was the description empty ?
+ int status;
+ int sending;
+ int currentIsDir;
+ DWORD dwUin;
+ DWORD dwRemotePort;
+ char *szFilename;
+ char *szDescription;
+ char *szSavePath;
+ char *szThisFile;
+ char *szThisSubdir;
+ char **pszFiles;
+ DWORD dwThisFileSize;
+ DWORD dwThisFileDate;
+ DWORD dwTotalSize;
+ DWORD dwFileCount;
+ DWORD dwTransferSpeed;
+ DWORD dwBytesDone, dwFileBytesDone;
+ int fileId;
+ HNETLIBCONN hConnection;
+ DWORD dwLastNotify;
+ int nVersion; // Was this sent with a v7 or a v8 packet?
+ BOOL bDC; // Was this received over a DC or through server?
+ BOOL bEmptyDesc; // Was the description empty ?
};
#define DIRECTCONN_STANDARD 0
@@ -64,27 +61,27 @@ struct filetransfer: public basic_filetransfer struct directconnect
{
- MCONTACT hContact;
- HNETLIBCONN hConnection;
- DWORD dwConnectionCookie;
- int type;
- WORD wVersion;
- int incoming;
- int wantIdleTime;
- int packetPending;
- DWORD dwRemotePort;
- DWORD dwRemoteUin;
- DWORD dwRemoteExternalIP;
- DWORD dwRemoteInternalIP;
- DWORD dwLocalExternalIP;
- DWORD dwLocalInternalIP;
- int initialised;
- int handshake;
- DWORD dwThreadId;
- filetransfer *ft;
- DWORD dwReqId; // Reverse Connect request cookie
+ MCONTACT hContact;
+ HNETLIBCONN hConnection;
+ DWORD dwConnectionCookie;
+ int type;
+ WORD wVersion;
+ int incoming;
+ int wantIdleTime;
+ int packetPending;
+ DWORD dwRemotePort;
+ DWORD dwRemoteUin;
+ DWORD dwRemoteExternalIP;
+ DWORD dwRemoteInternalIP;
+ DWORD dwLocalExternalIP;
+ DWORD dwLocalInternalIP;
+ int initialised;
+ int handshake;
+ DWORD dwThreadId;
+ filetransfer *ft;
+ DWORD dwReqId; // Reverse Connect request cookie
};
-int DecryptDirectPacket(directconnect* dc, PBYTE buf, size_t wLen);
+int DecryptDirectPacket(directconnect *dc, PBYTE buf, size_t wLen);
#endif /* __ICQ_DIRECT_H */
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 0c0f989102..7e9971925b 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -522,7 +522,7 @@ int __cdecl CIcqProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) icq_CancelFileTransfer((filetransfer*)hTransfer);
return 0; // Success
}
- else if (ft->ft_magic == FT_MAGIC_OSCAR) { // cancel oscar file transfer
+ if (ft->ft_magic == FT_MAGIC_OSCAR) { // cancel oscar file transfer
return oftFileCancel(hContact, hTransfer);
}
}
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.h b/protocols/IcqOscarJ/src/oscar_filetransfer.h index b01dabd2b0..2bf921cb9f 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.h +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.h @@ -36,7 +36,10 @@ struct basic_filetransfer
{
cookie_message_data pMessage;
- BYTE ft_magic;
+ BYTE ft_magic;
+ MCONTACT hContact;
+ int iCurrentFile;
+ DWORD dwCookie;
};
#define OFT_BUFFER_SIZE 8192
@@ -61,13 +64,11 @@ char *FindFilePathContainer(const char **files, int iFile, char *szContainer); struct oscar_filetransfer: public basic_filetransfer
{
- MCONTACT hContact;
int flags; // combination of OFTF_*
int containerCount;
char **file_containers;
oft_file_record *files;
char **files_list; // sending only
- int iCurrentFile;
int currentIsDir;
int bUseProxy;
DWORD dwProxyIP;
@@ -79,7 +80,6 @@ struct oscar_filetransfer: public basic_filetransfer char *szThisFile;
char *szThisPath;
// Request sequence
- DWORD dwCookie;
WORD wReqNum;
// OFT2 header data
WORD wEncrypt, wCompress;
@@ -118,8 +118,6 @@ struct oscar_filetransfer: public basic_filetransfer #define OFT_TYPE_RESUMEREADY 0x0106 // Ok, I am ready to send it
#define OFT_TYPE_RESUMEACK 0x0207 // Fine, ready to receive
-void SafeReleaseFileTransfer(void **ft);
-
struct oscar_connection
{
MCONTACT hContact;
@@ -150,14 +148,13 @@ struct oscar_connection #define OCS_PROXY 8
#define OCS_WAITING 10
-struct oscar_listener
+struct oscar_listener
{
- CIcqProto *ppro;
- WORD wPort;
- HNETLIBBIND hBoundPort;
- oscar_filetransfer *ft;
+ CIcqProto *ppro;
+ WORD wPort;
+ HNETLIBBIND hBoundPort;
+ oscar_filetransfer *ft;
};
-
#endif /* __OSCAR_FILETRANSFER_H */
|