allow line processer to return -1 to signal graceful disconnect
This commit is contained in:
parent
08ee05a41e
commit
34316a0b80
1 changed files with 1 additions and 1 deletions
2
tcp.c
2
tcp.c
|
@ -104,7 +104,7 @@ tcp_line_read(tcp_session_t *ses, tcp_line_input_t *callback)
|
|||
buf[--i] = 0;
|
||||
|
||||
if((err = callback(ses, buf)) != 0) {
|
||||
tcp_disconnect(ses, err);
|
||||
tcp_disconnect(ses, err < 0 ? 0 : err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue