gen_echoserver: Fix inadequate check of the return value of recv()
This commit is contained in:
parent
cd6b5cb478
commit
3441525838
|
@ -58,7 +58,7 @@ static void my_rhandler(connection_t * cptr)
|
|||
{
|
||||
char buf[BUFSIZE * 2];
|
||||
|
||||
if (!my_read(cptr, buf))
|
||||
if (my_read(cptr, buf) <= 0)
|
||||
connection_close(cptr);
|
||||
else
|
||||
do_packet(cptr, buf);
|
||||
|
|
Loading…
Reference in New Issue