3434** _________________________________________________________________
3535*/
3636
37- static struct {
38- char * cpPattern ;
39- char * cpAnnotation ;
37+ static const struct {
38+ const char * cpPattern ;
39+ const char * cpAnnotation ;
4040} ssl_log_annotate [] = {
4141 { "*envelope*bad*decrypt*" , "wrong pass phrase!?" },
4242 { "*CLIENT_HELLO*unknown*protocol*" , "speaking not SSL to HTTPS port!?" },
@@ -51,19 +51,15 @@ static struct {
5151 { NULL , NULL }
5252};
5353
54- static char * ssl_log_annotation (char * error )
54+ static const char * ssl_log_annotation (const char * error )
5555{
56- char * errstr ;
57- int i ;
56+ int i = 0 ;
5857
59- errstr = NULL ;
60- for (i = 0 ; ssl_log_annotate [i ].cpPattern != NULL ; i ++ ) {
61- if (ap_strcmp_match (error , ssl_log_annotate [i ].cpPattern ) == 0 ) {
62- errstr = ssl_log_annotate [i ].cpAnnotation ;
63- break ;
64- }
65- }
66- return errstr ;
58+ while (ssl_log_annotate [i ].cpPattern != NULL
59+ && ap_strcmp_match (error , ssl_log_annotate [i ].cpPattern ) != 0 )
60+ i ++ ;
61+
62+ return ssl_log_annotate [i ].cpAnnotation ;
6763}
6864
6965void ssl_die (void )
@@ -84,19 +80,20 @@ void ssl_log_ssl_error(const char *file, int line, int level, server_rec *s)
8480 unsigned long e ;
8581
8682 while ((e = ERR_get_error ())) {
87- char err [256 ], * annotation ;
83+ const char * annotation ;
84+ char err [256 ];
8885
8986 ERR_error_string_n (e , err , sizeof err );
9087 annotation = ssl_log_annotation (err );
9188
9289 if (annotation ) {
9390 ap_log_error (file , line , level , 0 , s ,
94- "SSL Library Error: %ld %s %s" ,
91+ "SSL Library Error: %lu %s %s" ,
9592 e , err , annotation );
9693 }
9794 else {
9895 ap_log_error (file , line , level , 0 , s ,
99- "SSL Library Error: %ld %s" ,
96+ "SSL Library Error: %lu %s" ,
10097 e , err );
10198 }
10299 }
0 commit comments