File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ SOCK_get_next_byte(SocketClass *self)
286
286
{
287
287
if (self -> buffer_read_in >= self -> buffer_filled_in )
288
288
{
289
- /* there are no more bytes left in the buffer -> */
289
+ /* there are no more bytes left in the buffer, so */
290
290
/* reload the buffer */
291
291
292
292
self -> buffer_read_in = 0 ;
@@ -296,17 +296,19 @@ SOCK_get_next_byte(SocketClass *self)
296
296
mylog ("read %d, global_socket_buffersize=%d\n" ,
297
297
self -> buffer_filled_in , globals .socket_buffersize );
298
298
299
- if (self -> buffer_filled_in == -1 )
299
+ if (self -> buffer_filled_in < 0 )
300
300
{
301
301
self -> errornumber = SOCKET_READ_ERROR ;
302
302
self -> errormsg = "Error while reading from the socket." ;
303
303
self -> buffer_filled_in = 0 ;
304
+ return 0 ;
304
305
}
305
306
if (self -> buffer_filled_in == 0 )
306
307
{
307
308
self -> errornumber = SOCKET_CLOSED ;
308
309
self -> errormsg = "Socket has been closed." ;
309
310
self -> buffer_filled_in = 0 ;
311
+ return 0 ;
310
312
}
311
313
}
312
314
return self -> buffer_in [self -> buffer_read_in ++ ];
You can’t perform that action at this time.
0 commit comments