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