fixed some crashes (with vc80)

This commit is contained in:
Necroalbert 2007-03-05 20:30:53 +00:00
parent 7aaac21eca
commit 10e6b70c4d
4 changed files with 161 additions and 161 deletions

View File

@ -30,7 +30,7 @@ class ByteBuffer
{
};
const static size_t DEFAULT_SIZE = 0x1000;
const static size_t DEFAULT_SIZE = 0xFF;
ByteBuffer(): _rpos(0), _wpos(0)
{

View File

@ -126,7 +126,7 @@ void RealmSocket::_HandleRealmList(void)
{
std::string realmAddr;
ByteBuffer realmbuf;
realmbuf.reserve(ibuf.GetLength());
realmbuf.resize(ibuf.GetLength());
ibuf.Read((char*)realmbuf.contents(), ibuf.GetLength());
uint32 unk;

View File

@ -36,7 +36,7 @@ void WorldSocket::OnRead()
{
TcpSocket::OnRead();
uint32 len = ibuf.GetLength();
//printf("WorldSocket::OnRead() %u bytes\n",len);
printf("WorldSocket::OnRead() %u bytes\n",len);
if(!len)
{
this->CloseAndDelete();
@ -116,7 +116,7 @@ void WorldSocket::SendWorldPacket(WorldPacket &pkt)
_crypt.EncryptSend((uint8*)&hdr, 6);
ByteBuffer final(pkt.size()+6);
final.append((uint8*)&hdr,sizeof(ClientPktHeader));
final.append(pkt.contents(),pkt.size());
final.append(pkt);
SendBuf((char*)final.contents(),final.size());
}