gen_listenerdemo: Fix inadequate check of the return value of recv()
This commit is contained in:
parent
6b30dd8bf9
commit
3ab69700ac
|
@ -62,7 +62,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(buf);
|
||||
|
|
Loading…
Reference in New Issue