1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

* 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102927 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Joe Orton
2004-03-10 21:54:17 +00:00
parent 6895aee838
commit ddecd8ab9e

View File

@@ -34,9 +34,9 @@
** _________________________________________________________________ ** _________________________________________________________________
*/ */
static struct { static const struct {
char *cpPattern; const char *cpPattern;
char *cpAnnotation; const char *cpAnnotation;
} ssl_log_annotate[] = { } ssl_log_annotate[] = {
{ "*envelope*bad*decrypt*", "wrong pass phrase!?" }, { "*envelope*bad*decrypt*", "wrong pass phrase!?" },
{ "*CLIENT_HELLO*unknown*protocol*", "speaking not SSL to HTTPS port!?" }, { "*CLIENT_HELLO*unknown*protocol*", "speaking not SSL to HTTPS port!?" },
@@ -51,19 +51,15 @@ static struct {
{ NULL, NULL } { NULL, NULL }
}; };
static char *ssl_log_annotation(char *error) static const char *ssl_log_annotation(char *error)
{ {
char *errstr; int i = 0;
int i;
errstr = NULL; while (ssl_log_annotate[i].cpPattern != NULL
for (i = 0; ssl_log_annotate[i].cpPattern != NULL; i++) { && ap_strcmp_match(error, ssl_log_annotate[i].cpPattern) != 0)
if (ap_strcmp_match(error, ssl_log_annotate[i].cpPattern) == 0) { i++;
errstr = ssl_log_annotate[i].cpAnnotation;
break; return ssl_log_annotate[i].cpAnnotation;
}
}
return errstr;
} }
void ssl_die(void) void ssl_die(void)
@@ -84,7 +80,8 @@ void ssl_log_ssl_error(const char *file, int line, int level, server_rec *s)
unsigned long e; unsigned long e;
while ((e = ERR_get_error())) { while ((e = ERR_get_error())) {
char err[256], *annotation; const char *annotation;
char err[256];
ERR_error_string_n(e, err, sizeof err); ERR_error_string_n(e, err, sizeof err);
annotation = ssl_log_annotation(err); annotation = ssl_log_annotation(err);