Skip to content
Snippets Groups Projects
Commit 0a18b90f authored by jwindley's avatar jwindley
Browse files

Don't report EOF as error

parent fb15bacc
No related branches found
No related tags found
No related merge requests found
...@@ -47,14 +47,16 @@ prefix_courier_t::receive( void ) ...@@ -47,14 +47,16 @@ prefix_courier_t::receive( void )
char *buf; char *buf;
// * Read the packet size. // * Read the packet size.
if ( read_bytes( header, 9 ) != 9 ) { if ( courier_t::read_bytes( header, 9 ) != 9 ) {
debug( "prefix_courier::receive: malformed message header" ); if ( errno != 0 )
debug( "prefix_courier::receive: malformed header (wire)" );
return NULL; return NULL;
} }
// * Convert to binary. // * Convert to binary.
if ( sscanf( header, "%ul", &size ) != 1 ) { if ( sscanf( header, "%ul", &size ) != 1 ) {
debug( "prefix_courier::receive: malformed message header" ); if ( errno != 0 )
debug( "prefix_courier::receive: malformed header (decode)" );
return NULL; return NULL;
} }
...@@ -63,7 +65,7 @@ prefix_courier_t::receive( void ) ...@@ -63,7 +65,7 @@ prefix_courier_t::receive( void )
xassert( buf ); xassert( buf );
// * Read the actual packet data. // * Read the actual packet data.
if ( read_bytes( buf, size ) != size ) { if ( courier_t::read_bytes( buf, size ) != size ) {
debug( "prefix_courier::receive: unable to receive fixed-length data" ); debug( "prefix_courier::receive: unable to receive fixed-length data" );
delete [] buf; delete [] buf;
return NULL; return NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment