Fix setBuffer of InputMessage class
This commit is contained in:
parent
322c6fde3e
commit
779eb56068
|
@ -38,11 +38,11 @@ void InputMessage::reset()
|
||||||
void InputMessage::setBuffer(const std::string& buffer)
|
void InputMessage::setBuffer(const std::string& buffer)
|
||||||
{
|
{
|
||||||
int len = buffer.size();
|
int len = buffer.size();
|
||||||
checkWrite(MAX_HEADER_SIZE + len);
|
reset();
|
||||||
memcpy(m_buffer + MAX_HEADER_SIZE, buffer.c_str(), len);
|
checkWrite(len);
|
||||||
m_readPos = MAX_HEADER_SIZE;
|
memcpy((char*)(m_buffer + m_readPos), buffer.c_str(), len);
|
||||||
m_headerPos = MAX_HEADER_SIZE;
|
m_readPos += len;
|
||||||
m_messageSize = len;
|
m_messageSize += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 InputMessage::getU8()
|
uint8 InputMessage::getU8()
|
||||||
|
|
Loading…
Reference in New Issue