[core] stay in CON_STATE_CLOSE until done with req
Do not switch to CON_STATE_ERROR upon idle timeout if already in CON_STATE_CLOSE. Changing to CON_STATE_ERROR might keep resetting con->close_timeout_ts if repeated calls to shutdown() succeed.personal/stbuehler/mod-csrf-old
parent
78c79ead4a
commit
cb468d333c
10
src/server.c
10
src/server.c
|
@ -1590,7 +1590,11 @@ int main (int argc, char **argv) {
|
|||
int changed = 0;
|
||||
int t_diff;
|
||||
|
||||
if (waitevents & FDEVENT_IN) {
|
||||
if (con->state == CON_STATE_CLOSE) {
|
||||
if (srv->cur_ts - con->close_timeout_ts > HTTP_LINGER_TIMEOUT) {
|
||||
changed = 1;
|
||||
}
|
||||
} else if (waitevents & FDEVENT_IN) {
|
||||
if (con->request_count == 1 || con->state != CON_STATE_READ) { /* e.g. CON_STATE_READ_POST || CON_STATE_WRITE */
|
||||
if (srv->cur_ts - con->read_idle_ts > con->conf.max_read_idle) {
|
||||
/* time - out */
|
||||
|
@ -1649,10 +1653,6 @@ int main (int argc, char **argv) {
|
|||
}
|
||||
}
|
||||
|
||||
if (con->state == CON_STATE_CLOSE && (srv->cur_ts - con->close_timeout_ts > HTTP_LINGER_TIMEOUT)) {
|
||||
changed = 1;
|
||||
}
|
||||
|
||||
/* we don't like div by zero */
|
||||
if (0 == (t_diff = srv->cur_ts - con->connection_start)) t_diff = 1;
|
||||
|
||||
|
|
Loading…
Reference in New Issue