mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-26 20:38:25 +00:00
Merge pull request #437 from jhnwkmn/nsf-close-immediately
If socket is about to be closed do not add to [read|write]_set.
This commit is contained in:
commit
d244a7fdfd
1 file changed
+3
-2
+3
-2
@@ -1024,6 +1024,9 @@ time_t ns_mgr_poll(struct ns_mgr *mgr, int milli) {
|
|||||||
if (!(conn->flags & (NSF_LISTENING | NSF_CONNECTING))) {
|
if (!(conn->flags & (NSF_LISTENING | NSF_CONNECTING))) {
|
||||||
ns_call(conn, NS_POLL, ¤t_time);
|
ns_call(conn, NS_POLL, ¤t_time);
|
||||||
}
|
}
|
||||||
|
if (conn->flags & NSF_CLOSE_IMMEDIATELY) {
|
||||||
|
ns_close_conn(conn);
|
||||||
|
} else {
|
||||||
if (!(conn->flags & NSF_WANT_WRITE)) {
|
if (!(conn->flags & NSF_WANT_WRITE)) {
|
||||||
//DBG(("%p read_set", conn));
|
//DBG(("%p read_set", conn));
|
||||||
ns_add_to_set(conn->sock, &read_set, &max_fd);
|
ns_add_to_set(conn->sock, &read_set, &max_fd);
|
||||||
@@ -1034,8 +1037,6 @@ time_t ns_mgr_poll(struct ns_mgr *mgr, int milli) {
|
|||||||
//DBG(("%p write_set", conn));
|
//DBG(("%p write_set", conn));
|
||||||
ns_add_to_set(conn->sock, &write_set, &max_fd);
|
ns_add_to_set(conn->sock, &write_set, &max_fd);
|
||||||
}
|
}
|
||||||
if (conn->flags & NSF_CLOSE_IMMEDIATELY) {
|
|
||||||
ns_close_conn(conn);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user