In this function, passing string
as an argument (which is having the huge amount of data as a string)...
SendBytes method is defined like this
bool NetOutputBuffer_c::SendBytes ( const void * pBuf, int iLen )
{
BYTE * pMy = (BYTE*)pBuf;
while ( iLen>0 && !m_bError )
{
int iLeft = m_iBufferSize - ( m_pBufferPtr-m_pBuffer );
if ( iLen<=iLeft )
{
printf("iLen is %d\n",iLen);
memcpy ( m_pBufferPtr, pMy, iLen );
m_pBufferPtr += iLen;
break;
}
ResizeIf ( iLen );
}
return !m_bError;
}
bool NetOutputBuffer_c::SendCompressedString ( std::string sStr )
{
std::cout << sStr << endl;
const char *cStr = sStr.c_str();
std::cout << cStr <<endl;
int iLen = cStr ? strlen(cStr) : 0;
SendInt ( iLen );
return SendBytes ( cStr, iLen );
}
Tried printing the value of sStr to check whether it has proper data or not.
Then converting the std::string
to const char *
After converting it,tried printing the value of cStr. But it(cStr) actually contains 5% of the actual data(sStr)...
what shall I need to do in order to get the whole data?
Can someone guide me in this regard?