summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/icq_direct.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-07-09 13:32:06 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-07-09 13:32:06 +0000
commita35f8740e62fc7953e4aa94601646e1999e639ed (patch)
tree7700ab1791c6de1aa5c7a5aeba550963f767def3 /protocols/IcqOscarJ/src/icq_direct.cpp
parent6a7a48d4e44f271406a7a9fd2c196ca7e4b554af (diff)
- advanced diagnostics;
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@9747 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/icq_direct.cpp')
-rw-r--r--protocols/IcqOscarJ/src/icq_direct.cpp30
1 files changed, 9 insertions, 21 deletions
diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp
index 0369bdd8b9..fb4a57ea66 100644
--- a/protocols/IcqOscarJ/src/icq_direct.cpp
+++ b/protocols/IcqOscarJ/src/icq_direct.cpp
@@ -20,13 +20,8 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-//
-// -----------------------------------------------------------------------------
-// DESCRIPTION:
-//
-// Describe me here please...
-//
// -----------------------------------------------------------------------------
+
#include "icqoscar.h"
struct directthreadstartinfo
@@ -52,10 +47,8 @@ void CIcqProto::CloseContactDirectConns(MCONTACT hContact)
{
icq_lock l(directConnListMutex);
- for ( int i = 0; i < directConns.getCount(); i++)
- {
- if (!hContact || directConns[i]->hContact == hContact)
- {
+ for (int i = 0; i < directConns.getCount(); i++) {
+ if (!hContact || directConns[i]->hContact == hContact) {
HANDLE hConnection = directConns[i]->hConnection;
directConns[i]->hConnection = NULL; // do not allow reuse
@@ -481,16 +474,13 @@ void __cdecl CIcqProto::icq_directThread( directthreadstartinfo *dtsi )
}
// End of packet receiving loop
-
NetLib_SafeCloseHandle(&hPacketRecver);
CloseDirectConnection(&dc);
- if (dc.ft)
- {
- if (dc.ft->fileId != -1)
- {
+ if (dc.ft) {
+ if (dc.ft->fileId != -1) {
_close(dc.ft->fileId);
- ProtoBroadcastAck(dc.ft->hContact, ACKTYPE_FILE, dc.ft->dwBytesDone==dc.ft->dwTotalSize ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, dc.ft, 0);
+ ProtoBroadcastAck(dc.ft->hContact, ACKTYPE_FILE, dc.ft->dwBytesDone == dc.ft->dwTotalSize ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, dc.ft, 0);
}
else if (dc.ft->hConnection)
ProtoBroadcastAck(dc.ft->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, dc.ft, 0);
@@ -500,13 +490,11 @@ void __cdecl CIcqProto::icq_directThread( directthreadstartinfo *dtsi )
}
LBL_Exit:
- { // remove from DC connection list
- icq_lock l(directConnListMutex);
- directConns.remove( &dc );
- }
+ // remove from DC connection list
+ icq_lock l(directConnListMutex);
+ directConns.remove(&dc);
}
-
void CIcqProto::handleDirectPacket(directconnect* dc, PBYTE buf, WORD wLen)
{
if (wLen < 1)