Added check for SINGLE_IMAGE if ReadData() detects the socket closed by remote side to return 0 instead of -1.

This commit is contained in:
Matt Durant 2016-08-31 20:56:30 -05:00
parent 3320ad24ea
commit 350352d956
1 changed files with 2 additions and 0 deletions

View File

@ -192,6 +192,8 @@ int RemoteCameraHttp::ReadData( Buffer &buffer, int bytes_expected )
if ( total_bytes_to_read == 0 )
{
if( mode == SINGLE_IMAGE )
return( 0 );
// If socket is closed locally, then select will fail, but if it is closed remotely
// then we have an exception on our socket.. but no data.
Debug( 3, "Socket closed remotely" );