Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 20172 invoked from network); 10 Mar 2004 21:54:20 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 10 Mar 2004 21:54:20 -0000 Received: (qmail 18028 invoked by uid 500); 10 Mar 2004 21:54:07 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 17841 invoked by uid 500); 10 Mar 2004 21:54:06 -0000 Mailing-List: contact cvs-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 cvs@httpd.apache.org Received: (qmail 17828 invoked by uid 500); 10 Mar 2004 21:54:06 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 17824 invoked from network); 10 Mar 2004 21:54:06 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 10 Mar 2004 21:54:06 -0000 Received: (qmail 20104 invoked by uid 1582); 10 Mar 2004 21:54:17 -0000 Date: 10 Mar 2004 21:54:17 -0000 Message-ID: <20040310215417.20103.qmail@minotaur.apache.org> From: jorton@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/modules/ssl ssl_engine_log.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N jorton 2004/03/10 13:54:17 Modified: modules/ssl ssl_engine_log.c Log: * modules/ssl/ssl_engine_log.c (ssl_log_annotate, ssl_log_annotation, ssl_log_ssl_error): const-ify annotation strings and simplify ssl_log_annotation. Revision Changes Path 1.30 +12 -15 httpd-2.0/modules/ssl/ssl_engine_log.c Index: ssl_engine_log.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_log.c,v retrieving revision 1.29 retrieving revision 1.30 diff -w -d -u -r1.29 -r1.30 --- ssl_engine_log.c 4 Mar 2004 21:54:09 -0000 1.29 +++ ssl_engine_log.c 10 Mar 2004 21:54:17 -0000 1.30 @@ -34,9 +34,9 @@ ** _________________________________________________________________ */ -static struct { - char *cpPattern; - char *cpAnnotation; +static const struct { + const char *cpPattern; + const char *cpAnnotation; } ssl_log_annotate[] = { { "*envelope*bad*decrypt*", "wrong pass phrase!?" }, { "*CLIENT_HELLO*unknown*protocol*", "speaking not SSL to HTTPS port!?" }, @@ -51,19 +51,15 @@ { NULL, NULL } }; -static char *ssl_log_annotation(char *error) +static const char *ssl_log_annotation(char *error) { - char *errstr; - int i; + int i = 0; - errstr = NULL; - for (i = 0; ssl_log_annotate[i].cpPattern != NULL; i++) { - if (ap_strcmp_match(error, ssl_log_annotate[i].cpPattern) == 0) { - errstr = ssl_log_annotate[i].cpAnnotation; - break; - } - } - return errstr; + while (ssl_log_annotate[i].cpPattern != NULL + && ap_strcmp_match(error, ssl_log_annotate[i].cpPattern) != 0) + i++; + + return ssl_log_annotate[i].cpAnnotation; } void ssl_die(void) @@ -84,7 +80,8 @@ unsigned long e; while ((e = ERR_get_error())) { - char err[256], *annotation; + const char *annotation; + char err[256]; ERR_error_string_n(e, err, sizeof err); annotation = ssl_log_annotation(err);