aboutsummaryrefslogtreecommitdiff
path: root/src/trinityrealm/AuthSocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/trinityrealm/AuthSocket.cpp')
-rw-r--r--src/trinityrealm/AuthSocket.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/trinityrealm/AuthSocket.cpp b/src/trinityrealm/AuthSocket.cpp
index 3dc6b3a5c28..8c9eab653ec 100644
--- a/src/trinityrealm/AuthSocket.cpp
+++ b/src/trinityrealm/AuthSocket.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
+ * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -173,7 +173,7 @@ typedef struct AuthHandler
#endif
/// Launch a thread to transfer a patch to the client
-class PatcherRunnable: public ZThread::Runnable
+class PatcherRunnable: public ACE_Based::Runnable
{
public:
PatcherRunnable(class AuthSocket *);
@@ -236,7 +236,8 @@ AuthSocket::AuthSocket(ISocketHandler &h) : TcpSocket(h)
/// Close patch file descriptor before leaving
AuthSocket::~AuthSocket()
{
- ZThread::Guard<ZThread::Mutex> g(patcherLock);
+ ACE_Guard<ACE_Thread_Mutex> g(patcherLock);
+
if(pPatch)
fclose(pPatch);
}
@@ -912,7 +913,7 @@ bool AuthSocket::_HandleXferResume()
ibuf.Read((char*)&start,sizeof(start));
fseek(pPatch,start,0);
- ZThread::Thread u(new PatcherRunnable(this));
+ ACE_Based::Thread u(*new PatcherRunnable(this));
return true;
}
@@ -924,7 +925,6 @@ bool AuthSocket::_HandleXferCancel()
///- Close and delete the socket
ibuf.Remove(1); //clear input buffer
- //ZThread::Thread::sleep(15);
SetCloseAndDelete();
return true;
@@ -946,8 +946,7 @@ bool AuthSocket::_HandleXferAccept()
ibuf.Remove(1); //clear input buffer
fseek(pPatch,0,0);
- ZThread::Thread u(new PatcherRunnable(this));
-
+ ACE_Based::Thread u(*new PatcherRunnable(this));
return true;
}
@@ -965,7 +964,8 @@ PatcherRunnable::PatcherRunnable(class AuthSocket * as)
/// Send content of patch file to the client
void PatcherRunnable::run()
{
- ZThread::Guard<ZThread::Mutex> g(mySocket->patcherLock);
+ ACE_Guard<ACE_Thread_Mutex> g(mySocket->patcherLock);
+
XFER_DATA_STRUCT xfdata;
xfdata.opcode = XFER_DATA;
@@ -974,7 +974,7 @@ void PatcherRunnable::run()
///- Wait until output buffer is reasonably empty
while(mySocket->Ready() && mySocket->IsLag())
{
- ZThread::Thread::sleep(1);
+ ACE_Based::Thread::Sleep(1);
}
///- And send content of the patch file to the client
xfdata.data_size=fread(&xfdata.data,1,ChunkSize,mySocket->pPatch);
@@ -1092,4 +1092,3 @@ Patcher::~Patcher()
for(Patches::iterator i = _patches.begin(); i != _patches.end(); i++ )
delete i->second;
}
-