scope/style cleanup
if ReadData returns -1, be sure to not append(-1)
This commit is contained in:
@@ -580,14 +580,17 @@ void ScreenPackages::HTTPUpdate()
|
|||||||
//as there may be need to "if" it out some time.
|
//as there may be need to "if" it out some time.
|
||||||
/* If you need a conditional for a large block of code, stick it in
|
/* If you need a conditional for a large block of code, stick it in
|
||||||
* a function and return. */
|
* a function and return. */
|
||||||
int Size = 1;
|
while(1)
|
||||||
while( Size > 0 )
|
|
||||||
{
|
{
|
||||||
char Buffer[1024];
|
char Buffer[1024];
|
||||||
Size = m_wSocket.ReadData( Buffer, 1024 );
|
int iSize = m_wSocket.ReadData( Buffer, 1024 );
|
||||||
m_sBUFFER.append( Buffer, Size );
|
if( iSize <= 0 )
|
||||||
BytesGot += Size;
|
break;
|
||||||
|
|
||||||
|
m_sBUFFER.append( Buffer, iSize );
|
||||||
|
BytesGot += iSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !m_bGotHeader )
|
if( !m_bGotHeader )
|
||||||
{
|
{
|
||||||
m_sStatus = "Waiting for header.";
|
m_sStatus = "Waiting for header.";
|
||||||
|
|||||||
Reference in New Issue
Block a user