mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
fix socket half close (#1263)
Co-authored-by: zixun <lvzxiun@gmail.com>
This commit is contained in:
@@ -1357,8 +1357,14 @@ forward_message_tcp(struct socket_server *ss, struct socket *s, struct socket_lo
|
|||||||
}
|
}
|
||||||
if (n==0) {
|
if (n==0) {
|
||||||
FREE(buffer);
|
FREE(buffer);
|
||||||
force_close(ss, s, l, result);
|
if (nomore_sending_data(s)) {
|
||||||
return SOCKET_CLOSE;
|
force_close(ss,s,l,result);
|
||||||
|
return SOCKET_CLOSE;
|
||||||
|
} else {
|
||||||
|
s->type = SOCKET_TYPE_HALFCLOSE;
|
||||||
|
shutdown(s->fd, SHUT_RD);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->type == SOCKET_TYPE_HALFCLOSE) {
|
if (s->type == SOCKET_TYPE_HALFCLOSE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user