add a new folder structure redesign organized by packages

This commit is contained in:
Eduardo Bart
2011-07-17 08:52:20 -03:00
parent b1a881eb06
commit ab7394f357
56 changed files with 586 additions and 212 deletions

View File

@@ -87,6 +87,6 @@ std::string InputMessage::getString()
bool InputMessage::canRead(int bytes)
{
if((m_readPos + bytes > m_messageSize) || (m_readPos + bytes > BUFFER_MAXSIZE))
fatal("[InputMessage::canRead()]: Cant read. Message is finished or read position has reached buffer's maximum size.");
logFatal("[InputMessage::canRead()]: Cant read. Message is finished or read position has reached buffer's maximum size.");
return true;
}

View File

@@ -105,6 +105,6 @@ void OutputMessage::addPaddingBytes(int bytes, uint8 byte)
bool OutputMessage::canWrite(int bytes)
{
if(m_writePos + bytes > BUFFER_MAXSIZE)
fatal("[OutputMessage::canWrite()]: Can't write. Write position has reached buffer's maxium size.");
logFatal("[OutputMessage::canWrite()]: Can't write. Write position has reached buffer's maxium size.");
return true;
}

View File

@@ -64,7 +64,7 @@ void Protocol::onRecv(InputMessage *inputMessage)
uint32 checksum = getAdlerChecksum(inputMessage->getBuffer() + InputMessage::DATA_POS, inputMessage->getMessageSize() - InputMessage::CHECKSUM_LENGTH);
if(inputMessage->getU32() != checksum) {
// error
error("Checksum is invalid.");
logError("Checksum is invalid.");
return;
}
@@ -74,7 +74,7 @@ void Protocol::onRecv(InputMessage *inputMessage)
void Protocol::onError(const boost::system::error_code& err)
{
error("PROTOCOL ERROR: ", err.message());
logError("PROTOCOL ERROR: ", err.message());
// invalid hostname
// connection timeouted