Skip to content

Commit 30794f3

Browse files
authored
Merge pull request #4887 from sysown/v3.0_shutdown_debug
Avoid crash on slow shutdown
2 parents 6ab8cb3 + c6b8485 commit 30794f3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/Base_Thread.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,13 @@ S Base_Thread::create_new_session_and_client_data_stream(int _fd) {
9292
int prevflags = fcntl(_fd, F_GETFL, 0);
9393
if (prevflags == -1) {
9494
proxy_error("For FD %d fcntl() returned -1 errno %d\n", _fd, errno);
95-
if (shutdown == 0)
95+
if (
96+
(shutdown == 0)
97+
&&
98+
(glovars.shutdown == 0) // this is specific for modules that do not refresh `shutdown`
99+
) {
96100
assert(prevflags != -1);
101+
}
97102
}
98103
int nb = fcntl(_fd, F_SETFL, prevflags | O_NONBLOCK);
99104
if (nb == -1) {

0 commit comments

Comments
 (0)