Fixing gcc problem with EncodeToBuf-function.

This commit is contained in:
lotodore
2013-09-15 23:11:15 +02:00
parent 36eeaee5d7
commit 84b9b56d6a
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ public:
virtual void AsyncSendNextPacket(boost::shared_ptr<SessionData> session);
void AsyncSendNextPacket(boost::shared_ptr<boost::asio::ip::tcp::socket> socket);
virtual void InternalStorePacket(boost::shared_ptr<SessionData> session, boost::shared_ptr<NetPacket> packet);
int EncodeToBuf(boost::shared_ptr<SessionData> session, const void *data, size_t size);
int EncodeToBuf(const void *data, size_t size);
virtual void HandleWrite(boost::shared_ptr<boost::asio::ip::tcp::socket> socket, const boost::system::error_code &error);
+2 -2
View File
@@ -105,12 +105,12 @@ AsioSendBuffer::InternalStorePacket(boost::shared_ptr<SessionData> session, boos
google::protobuf::uint8 *buf = new google::protobuf::uint8[packetSize + NET_HEADER_SIZE];
*((uint32_t *)buf) = htonl(packetSize);
packet->GetMsg()->SerializeWithCachedSizesToArray(&buf[NET_HEADER_SIZE]);
EncodeToBuf(session, buf, packetSize + NET_HEADER_SIZE);
EncodeToBuf(buf, packetSize + NET_HEADER_SIZE);
delete[] buf;
}
int
AsioSendBuffer::EncodeToBuf(boost::shared_ptr<SessionData> /*session*/, const void *data, size_t size)
AsioSendBuffer::EncodeToBuf(const void *data, size_t size)
{
// Realloc buffer if necessary.
while (GetSendBufLeft() < size) {
+1 -1
View File
@@ -273,7 +273,7 @@ ChatCleanerManager::SendMessageToServer(ChatCleanerMessage &msg)
google::protobuf::uint8 *buf = new google::protobuf::uint8[packetSize + CLEANER_NET_HEADER_SIZE];
*((uint32_t *)buf) = htonl(packetSize);
msg.SerializeWithCachedSizesToArray(&buf[CLEANER_NET_HEADER_SIZE]);
m_sendManager->EncodeToBuf(NULL, buf, packetSize + CLEANER_NET_HEADER_SIZE);
m_sendManager->EncodeToBuf(buf, packetSize + CLEANER_NET_HEADER_SIZE);
delete[] buf;
m_sendManager->AsyncSendNextPacket(m_socket);