Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 6717 invoked by uid 6000); 17 Oct 1997 02:55:23 -0000 Received: (qmail 6695 invoked from network); 17 Oct 1997 02:55:21 -0000 Received: from topaz.decus.org (HELO DECUS.Org) (192.67.173.1) by taz.hyperreal.org with SMTP; 17 Oct 1997 02:55:21 -0000 Received: from Master.DECUS.Org (master.process.com) by DECUS.Org (PMDF V4.2-13 #26234) id <01IOW3PX5GI88WWC94@DECUS.Org>; Thu, 16 Oct 1997 22:54:51 EDT Date: Thu, 16 Oct 1997 22:52:12 -0400 From: coar@decus.org (Rodent of Unusual Size) Subject: [PATCH] Slight cleanup of logging of bad directives To: New-HTTPd@apache.org, Coar@decus.org Message-id: <97101622521289@decus.org> X-VMS-To: NH X-VMS-Cc: COAR Content-transfer-encoding: 7BIT Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org In doing some testing, I got offended by some of the artifactual errno stuff reported when the config parser encountered a bogus directive. Due to the call tree, though, it isn't safe to remove the errno stuff from the error logging, so instead I just force errno to "invalid argument" in this particular case. Also a wee bit of cleanup.. if this gets voted in, there'll be a *lot* of indent changes on this due to TABs. I know you prefer TABs to spaces, Dean, but the style guide calls for spaces. Go ahead and re-open that can of wrigglies if you like, but in the meantime *every*one should be trying to comply, regardless of their personal preferences.. #ken P-)} Index: main/http_config.c =================================================================== RCS file: /export/home/cvs/apachen/src/main/http_config.c,v retrieving revision 1.81 diff -u -b -r1.81 http_config.c --- http_config.c 1997/10/07 19:33:58 1.81 +++ http_config.c 1997/10/17 02:51:24 @@ -803,7 +803,9 @@ do { if (!(cmd = find_command_in_modules(cmd_name, &mod))) { - return pstrcat(parms->pool, "Invalid command ", cmd_name, NULL); + errno = EINVAL; + return pstrcat(parms->pool, "Invalid command '", cmd_name, "'", + NULL); } else { void *mconfig = get_module_config(config, mod); @@ -835,9 +837,10 @@ while (!(cfg_getline(l, MAX_STRING_LEN, parms->infile))) { const char *errmsg = handle_command(parms, config, l); - if (errmsg) + if (errmsg) { return errmsg; } + } return NULL; } @@ -991,8 +994,9 @@ pfclose(r->pool, f); if (errmsg) { - aplog_error(APLOG_MARK, APLOG_ALERT, r->server, "%s: %s", filename, errmsg); - return SERVER_ERROR; + aplog_error(APLOG_MARK, APLOG_ALERT, r->server, "%s: %s", + filename, errmsg); + return HTTP_INTERNAL_SERVER_ERROR; } *result = dc;