Redone network packet abstraction. Prepared for easy access to packet data.

This commit is contained in:
lotodore
2007-04-08 16:18:20 +00:00
parent 6f458ec012
commit 2f5c8d7da1
14 changed files with 656 additions and 230 deletions
+3 -3
View File
@@ -71,11 +71,11 @@ SenderThread::Main()
if (IS_VALID_SOCKET(tmpData.second))
m_curSocket = tmpData.second;
u_int16_t tmpLen = ntohs(tmpData.first->GetData()->length);
u_int16_t tmpLen = tmpData.first->GetLen();
if (tmpLen <= MAX_PACKET_SIZE)
{
m_tmpOutBufSize = tmpLen;
memcpy(m_tmpOutBuf, tmpData.first->GetData(), m_tmpOutBufSize);
memcpy(m_tmpOutBuf, tmpData.first->GetRawData(), tmpLen);
}
}
}
@@ -109,7 +109,7 @@ SenderThread::Main()
}
else if ((unsigned)bytesSent < m_tmpOutBufSize)
{
m_tmpOutBufSize = m_tmpOutBufSize - (unsigned)bytesSent;
m_tmpOutBufSize -= (unsigned)bytesSent;
memmove(m_tmpOutBuf, m_tmpOutBuf + bytesSent, m_tmpOutBufSize);
}
else