Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 85145 invoked by uid 500); 17 Dec 2001 10:13:03 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 85104 invoked from network); 17 Dec 2001 10:13:03 -0000 Date: Mon, 17 Dec 2001 02:13:10 -0800 (PST) From: Dirk-Willem van Gulik X-X-Sender: dirkx@titatovenaar.sfo.covalent.net To: dev@httpd.apache.org Subject: server/listen.c / alloc_listen() does not pass back errors ? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Confused about 2.0 - could someone who has stayed current with the tide help me understand here :-) When coming across a Listen: in the config we call ap_set_listener() which calls (void) alloc_listener() to get the actual socket() opened: const char *ap_set_listener(cmd_parms *cmd, void *dummy, const char *ips) { ... alloc_listener(); return; } The funcition alloc_listen() seems to be only used within the above function. I.e. just during config read. However it contains things like: void alloc_listner() { ... if ((status = apr_socket_create(&new->sd, new->bind_addr->sa.sin.sin_family, SOCK_STREAM, process->pool)) != APR_SUCCESS) { ap_log_perror(APLOG_MARK, APLOG_CRIT, status, process->pool, "alloc_listener: failed to get a socket for %s", addr); return; } to trap errors. Now it is not clear to me that ap_log_error() at that point already logs things that reliably to the right log file that early during parse ? Or am I making some apache 1.3 assumption which no longer holds ? And secondly, like all good config routines; ap_set_listener() kind of expects a "error string" as the return value. So any reason not to let alloc_listener() return a char *; and let ap_set_listnener end with return alloc_listener(); so that we can barf with an error on "Listen foem:1234" ? Dw