You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by dg...@hyperreal.org on 1998/07/08 18:54:38 UTC
cvs commit: apache-1.3/src/main http_main.c rfc1413.c
dgaudet 98/07/08 09:54:37
Modified: src CHANGES
src/main http_main.c rfc1413.c
Log:
yet more signal race conditions
Revision Changes Path
1.953 +3 -0 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.952
retrieving revision 1.953
diff -u -r1.952 -r1.953
--- CHANGES 1998/07/08 00:46:03 1.952
+++ CHANGES 1998/07/08 16:54:31 1.953
@@ -1,5 +1,8 @@
Changes with Apache 1.3.1
+ *) Fix yet another signal-based race condition involving nested timers.
+ Signals suck. [Dean Gaudet]
+
*) suexec's error messages have been clarified a little bit. [Ken Coar]
*) PORT: Apache is not 8-bit clean in many settings, a problem we're
1.370 +13 -5 apache-1.3/src/main/http_main.c
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.369
retrieving revision 1.370
diff -u -r1.369 -r1.370
--- http_main.c 1998/06/29 11:41:48 1.369
+++ http_main.c 1998/07/08 16:54:34 1.370
@@ -953,7 +953,13 @@
*/
request_rec *log_req = timeout_req;
+ request_rec *save_req = timeout_req;
+ /* avoid looping... if ap_log_transaction started another
+ * timer (say via rfc1413.c) we could loop...
+ */
+ timeout_req = NULL;
+
while (log_req->main || log_req->prev) {
/* Get back to original request... */
if (log_req->main)
@@ -965,8 +971,8 @@
if (!current_conn->keptalive)
ap_log_transaction(log_req);
- ap_bsetflag(timeout_req->connection->client, B_EOUT, 1);
- ap_bclose(timeout_req->connection->client);
+ ap_bsetflag(save_req->connection->client, B_EOUT, 1);
+ ap_bclose(save_req->connection->client);
if (!ap_standalone)
exit(0);
@@ -975,6 +981,7 @@
}
else { /* abort the connection */
ap_bsetflag(current_conn->client, B_EOUT, 1);
+ ap_bclose(current_conn->client);
current_conn->aborted = 1;
}
}
@@ -1045,9 +1052,11 @@
alarm_expiry_time = time(NULL) + x;
}
#else
- if (x) {
- alarm_fn = fn;
+ if (alarm_fn && x && fn != alarm_fn) {
+ ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, NULL,
+ "ap_set_callback_and_alarm: possible nested timer!");
}
+ alarm_fn = fn;
#ifndef OPTIMIZE_TIMEOUTS
old = alarm(x);
#else
@@ -3390,7 +3399,6 @@
*/
ap_kill_timeout(0); /* Cancel any outstanding alarms. */
- timeout_req = NULL; /* No request in progress */
current_conn = NULL;
ap_clear_pool(ptrans);
1.25 +1 -2 apache-1.3/src/main/rfc1413.c
Index: rfc1413.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/rfc1413.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- rfc1413.c 1998/05/18 21:56:11 1.24
+++ rfc1413.c 1998/07/08 16:54:34 1.25
@@ -229,9 +229,8 @@
if (get_rfc1413(sock, &conn->local_addr, &conn->remote_addr, user, srv) >= 0)
result = user;
-
- ap_set_callback_and_alarm(NULL, 0);
}
+ ap_set_callback_and_alarm(NULL, 0);
ap_pclosesocket(conn->pool, sock);
conn->remote_logname = result;