From: dgaudet Date: Fri, 6 Aug 1999 00:55:28 +0000 (+0000) Subject: merge the differences in apache-1.3 from tag apache-apr-merge-3 up X-Git-Tag: apache-1_3-merge-1-post~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0ad84fbe89cfbd103570465d30ff14b87903f26;p=thirdparty%2Fapache%2Fhttpd.git merge the differences in apache-1.3 from tag apache-apr-merge-3 up 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 --- diff --git a/os/unix/unixd.c b/os/unix/unixd.c index 5af54ec011b..c7ce9b82de0 100644 --- a/os/unix/unixd.c +++ b/os/unix/unixd.c @@ -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 diff --git a/server/connection.c b/server/connection.c index ed81e446c03..98d521721f4 100644 --- a/server/connection.c +++ b/server/connection.c @@ -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; diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 1832a7bca3e..2316cf75118 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -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,