Skip to content

Commit 1991d17

Browse files
committed
Reverted change to comms handling
1 parent 14f63be commit 1991d17

File tree

3 files changed

+5
-23
lines changed

3 files changed

+5
-23
lines changed

doc.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,18 +1345,15 @@ CString str = strText;
13451345

13461346
}
13471347

1348-
void CMUSHclientDoc::ReceiveMsg(char * buff, int count)
1348+
void CMUSHclientDoc::ReceiveMsg()
13491349
{
1350+
char buff [1000]; // must be less than COMPRESS_BUFFER_LENGTH or it won't fit
1351+
int count = m_pSocket->Receive (buff, sizeof (buff) - 1);
13501352

13511353
Frame.CheckTimerFallback (); // see if time is up for timers to fire
13521354

13531355
if (count == SOCKET_ERROR)
13541356
{
1355-
1356-
DWORD errcode = GetLastError();
1357-
if (errcode == WSAEWOULDBLOCK || errcode == 0)
1358-
return; // it's ok, nothing to do
1359-
13601357
// don't delete the socket if we are already closing it
13611358
if (m_iConnectPhase == eConnectDisconnecting)
13621359
return;

doc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ class CMUSHclientDoc : public CDocument
14061406
const bool bEchoIt,
14071407
const bool bQueueIt,
14081408
const bool bLogIt);
1409-
void ReceiveMsg(char * buff, int count);
1409+
void ReceiveMsg();
14101410
void DisplayMsg(LPCTSTR lpszText, int size, const int flags);
14111411
void AddToLine (LPCTSTR lpszText, const int flags);
14121412
void StartNewLine_KeepPreviousStyle (const int flags);

worldsock.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,7 @@ CWorldSocket::CWorldSocket(CMUSHclientDoc* pDoc)
2929

3030
void CWorldSocket::OnReceive(int nErrorCode)
3131
{
32-
33-
char buff [1000]; // must be less than COMPRESS_BUFFER_LENGTH or it won't fit
34-
35-
while (true)
36-
{
37-
int count = m_pDoc->m_pSocket->Receive (buff, sizeof (buff) - 1);
38-
m_pDoc->ReceiveMsg(buff, count);
39-
40-
if (count == 0) // connection closed or nothing left
41-
break;
42-
43-
if (count == SOCKET_ERROR)
44-
break; // some error or other
45-
46-
} // end of while
47-
32+
m_pDoc->ReceiveMsg();
4833
CAsyncSocket::OnReceive(nErrorCode);
4934
}
5035

0 commit comments

Comments
 (0)