]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
merge the differences in apache-1.3 from tag apache-apr-merge-3 up
authordgaudet <dgaudet@unknown>
Fri, 6 Aug 1999 00:55:28 +0000 (00:55 +0000)
committerdgaudet <dgaudet@unknown>
Fri, 6 Aug 1999 00:55:28 +0000 (00:55 +0000)
to mpm-merge-1 onto the mpm tree

prior to the merge, the mpm tree was tagged with apache-1_3-merge-1-pre
and after the merge, the mpm tree will be tagged with apache-1_3-merge-1-post

note: none of htdocs/manual is present in mpm at this point.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83587 13f79535-47bb-0310-9956-ffa450edef68

os/unix/unixd.c
server/connection.c
server/mpm/prefork/prefork.c

index 5af54ec011b240efe0ede2ecc203d47b06157c40..c7ce9b82de0f1d3eafaddc8693d417a07c052081 100644 (file)
@@ -198,7 +198,7 @@ int unixd_setup_child(void)
        if (setuid(unixd_config.user_id) == -1) {
            GETUSERMODE();
            ap_log_error(APLOG_MARK, APLOG_ALERT, NULL,
-                       "setuid: unable to change uid");
+                       "setuid: unable to change to uid: %d", unixd_config.user_id);
            exit(1);
        }
        GETUSERMODE();
@@ -211,7 +211,7 @@ int unixd_setup_child(void)
 #endif
        setuid(unixd_config.user_id) == -1)) {
        ap_log_error(APLOG_MARK, APLOG_ALERT, NULL,
-                   "setuid: unable to change uid");
+                   "setuid: unable to change to uid: %d", unixd_config.user_id);
        return -1;
     }
 #endif
index ed81e446c03aa5c2866d067e9ee13abc77c6ec3f..98d521721f4cfe86fca312a6f00450c2b34345b7 100644 (file)
@@ -270,6 +270,8 @@ conn_rec *ap_new_connection(pool *p, server_rec *server, BUFF *inout,
 
     conn->pool = p;
     conn->local_addr = *saddr;
+    conn->local_ip = ap_pstrdup(conn->pool,
+                               inet_ntoa(conn->local_addr.sin_addr));
     conn->base_server = server;
     conn->client = inout;
 
index 1832a7bca3e093e2dcb4e5dfc6ce3271d2fcfad4..2316cf75118cbe91e6e28573bbf823fb7c67ef84 100644 (file)
@@ -669,6 +669,8 @@ static void accept_mutex_child_init(pool *p)
        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, server_conf,
                    "Child cannot open lock semaphore, rc=%d", rc);
        clean_child_exit(APEXIT_CHILDINIT);
+    } else {
+        ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup);
     }
 }
 
@@ -2204,6 +2206,9 @@ static void child_main(int child_num_arg)
                break;          /* We have a socket ready for reading */
            else {
 
+/* TODO: this accept result handling stuff should be abstracted...
+ * it's already out of date between the various unix mpms
+ */
                /* Our old behaviour here was to continue after accept()
                 * errors.  But this leads us into lots of troubles
                 * because most of the errors are quite fatal.  For
@@ -2255,6 +2260,27 @@ static void child_main(int child_num_arg)
                case ENETUNREACH:
 #endif
                     break;
+#ifdef ENETDOWN
+               case ENETDOWN:
+                    /*
+                     * When the network layer has been shut down, there
+                     * is not much use in simply exiting: the parent
+                     * would simply re-create us (and we'd fail again).
+                     * Use the CHILDFATAL code to tear the server down.
+                     * @@@ Martin's idea for possible improvement:
+                     * A different approach would be to define
+                     * a new APEXIT_NETDOWN exit code, the reception
+                     * of which would make the parent shutdown all
+                     * children, then idle-loop until it detected that
+                     * the network is up again, and restart the children.
+                     * Ben Hyde noted that temporary ENETDOWN situations
+                     * occur in mobile IP.
+                     */
+                   ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
+                       "accept: giving up.");
+                   clean_child_exit(APEXIT_CHILDFATAL);
+#endif /*ENETDOWN*/
+
 #ifdef TPF
                case EINACT:
                    ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,