mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +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 );
|
||||||
len -= sz;
|
switch( sz )
|
||||||
buf += sz;
|
{
|
||||||
|
case 0:
|
||||||
|
return false;
|
||||||
|
case -1:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
len -= sz;
|
||||||
|
buf += sz;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user