mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Handle connection closed/no data in Socket::Read().
This commit is contained in:
parent
efd66bb609
commit
037a4d7fac
@ -146,8 +146,17 @@ bool Socket::Read( void* _buf, int len, const timeval* tv, bool(*exitCb)() )
|
|||||||
{
|
{
|
||||||
if( exitCb() ) return false;
|
if( exitCb() ) return false;
|
||||||
const auto sz = Recv( buf, len, tv );
|
const auto sz = Recv( buf, len, tv );
|
||||||
|
switch( sz )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return false;
|
||||||
|
case -1:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
len -= sz;
|
len -= sz;
|
||||||
buf += sz;
|
buf += sz;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user