You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Roy Fielding <fi...@hyperreal.com> on 1997/02/18 09:06:16 UTC
cvs commit: apache/src http_main.c
fielding 97/02/18 00:06:15
Modified: src http_main.c
Log:
Avoid rare but potential problems if errno is reset while syncing scoreboard
or if timeout intercepts after lingering_close.
Reviewed by: Marc Slemko, Jim Jagielski, Chuck Murcko, Randy Terbush
Revision Changes Path
1.123 +5 -1 apache/src/http_main.c
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_main.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -C3 -r1.122 -r1.123
*** http_main.c 1997/02/17 11:05:02 1.122
--- http_main.c 1997/02/18 08:06:14 1.123
***************
*** 323,329 ****
/* Prevent a slow-drip client from holding us here indefinitely */
- kill_timeout(r); /* Remove any leftover timeouts */
hard_timeout("lingering_close", r);
/* Send any leftover data to the client, but never try to again */
--- 323,328 ----
***************
*** 341,346 ****
--- 340,346 ----
if (errno != ENOTCONN)
log_unixerr("shutdown", NULL, "lingering_close", r->server);
bclose(r->connection->client);
+ kill_timeout(r);
return;
}
***************
*** 1583,1588 ****
--- 1583,1589 ----
#endif
while (1) {
+ int errsave;
BUFF *conn_io;
request_rec *r;
***************
*** 1629,1638 ****
--- 1630,1642 ----
#else
srv = select(listenmaxfd+1, &main_fds, NULL, NULL, NULL);
#endif
+ errsave = errno;
+
sync_scoreboard_image();
if (scoreboard_image->global.exit_generation >= generation)
exit(0);
+ errno = errsave;
if (srv < 0 && errno != EINTR)
log_unixerr("select", "(listen)", NULL, server_conf);