Commit 9520bb67 authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

Various fixes for log message tags:

- Remove tags in ssl_log_ssl_error() and ssl_log_cert_error()
- Instead add tags to various ssl_log_xerror, ssl_log_cxerror
  calls (ssl_log_rxerror is unused).
- likewise for modssl_proxy_info_log()

- Fix spelling of APLOG_NOERRNO in coccinelle script
- add support for ssl_log_*error and ap_log_cserror

- add some more tags missing due to APLOG_NOERRNO spelling error

- Remove tags from example modules (we don't want people to blindly copy
  those)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1211680 13f79535-47bb-0310-9956-ffa450edef68
parent 07f475e4
Loading
Loading
Loading
Loading
+59 −2
Changes for docs/log-message-tags/find-messages.cocci: 59 added lines, 2 removed lines.
Original line number Diff line number Diff line
@r@
@r1@
expression rv, s;
constant char [] format;
identifier level =~ "^APLOG_(EMERG|ALERT|CRIT|ERR|WARNING|NOTICE|INFO|STARTUP|DEBUG)$";
@@ -9,10 +9,67 @@ identifier fn =~ "^ap_log_(|r|c|p)error$";
(
        level
|
        level|APLOG_NOERROR
        level|APLOG_NOERRNO
|
        level|APLOG_STARTUP
)
        ,rv, s
+       , APLOGNO()
        ,format, ...)

@r2@
expression rv, s, c;
constant char [] format;
identifier level =~ "^APLOG_(EMERG|ALERT|CRIT|ERR|WARNING|NOTICE|INFO|STARTUP|DEBUG)$";

@@
        ap_log_cserror( APLOG_MARK ,
(
        level
|
        level|APLOG_NOERRNO
|
        level|APLOG_STARTUP
)
        ,rv, s, c
+       , APLOGNO()
        ,format, ...)

@r3@
expression rv, p, s, cert;
constant char [] format;
identifier level =~ "^APLOG_(EMERG|ALERT|CRIT|ERR|WARNING|NOTICE|INFO|STARTUP|DEBUG)$";

@@
        ssl_log_xerror( SSLLOG_MARK ,
(
        level
|
        level|APLOG_NOERRNO
|
        level|APLOG_STARTUP
)
        ,rv, p, s , cert
+       , APLOGNO()
        ,format, ...)

@r4@
expression rv, rc, cert;
constant char [] format;
identifier level =~ "^APLOG_(EMERG|ALERT|CRIT|ERR|WARNING|NOTICE|INFO|STARTUP|DEBUG)$";
identifier fn =~ "^ssl_log_(r|c)xerror$";

@@
        fn( SSLLOG_MARK ,
(
        level
|
        level|APLOG_NOERRNO
|
        level|APLOG_STARTUP
)
        ,rv, rc , cert
+       , APLOGNO()
        ,format, ...)

+1 −1
Changes for docs/log-message-tags/next-number: 1 added line, 1 removed line.
Original line number Diff line number Diff line
2270
2286
+3 −2
Changes for modules/cluster/mod_heartmonitor.c: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -684,7 +684,7 @@ static int hm_post_config(apr_pool_t *p, apr_pool_t *plog,
            storage = ap_lookup_provider(AP_SLOTMEM_PROVIDER_GROUP, "shm",
                                         AP_SLOTMEM_PROVIDER_VERSION);
            if (!storage) {
                ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s,
                ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(02284)
                             "failed to lookup provider 'shm' for '%s', "
                             "maybe you need to load mod_slotmem_shm?",
                             AP_SLOTMEM_PROVIDER_GROUP);
@@ -692,7 +692,8 @@ static int hm_post_config(apr_pool_t *p, apr_pool_t *plog,
            }
            storage->create(&slotmem, "mod_heartmonitor", sizeof(hm_slot_server_t), maxworkers, AP_SLOTMEM_TYPE_PREGRAB, p);
            if (!slotmem) {
                ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, "slotmem_create for status failed");
                ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(02285)
                             "slotmem_create for status failed");
                return !OK;
            }
        }
+1 −2
Changes for modules/examples/mod_example_hooks.c: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -328,8 +328,7 @@ static x_cfg *our_cconfig(const conn_rec *c)
static void example_log_each(apr_pool_t *p, server_rec *s, const char *note)
{
    if (s != NULL) {
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02062) "mod_example: %s",
                     note);
        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "mod_example: %s", note);
    } else {
        apr_file_t *out = NULL;
        apr_file_open_stderr(&out, p);
+5 −5
Changes for modules/examples/mod_example_ipc.c: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ static int exipc_post_config(apr_pool_t *pconf, apr_pool_t *plog,
     */
    rs = apr_temp_dir_get(&tempdir, pconf);
    if (APR_SUCCESS != rs) {
        ap_log_error(APLOG_MARK, APLOG_ERR, rs, s, APLOGNO(02063)
        ap_log_error(APLOG_MARK, APLOG_ERR, rs, s,
                     "Failed to find temporary directory");
        return HTTP_INTERNAL_SERVER_ERROR;
    }
@@ -159,7 +159,7 @@ static int exipc_post_config(apr_pool_t *pconf, apr_pool_t *plog,
    rs = apr_shm_create(&exipc_shm, sizeof(exipc_data),
                        (const char *) shmfilename, pconf);
    if (APR_SUCCESS != rs) {
        ap_log_error(APLOG_MARK, APLOG_ERR, rs, s, APLOGNO(02064)
        ap_log_error(APLOG_MARK, APLOG_ERR, rs, s,
                     "Failed to create shared memory segment on file %s",
                     shmfilename);
        return HTTP_INTERNAL_SERVER_ERROR;
@@ -204,7 +204,7 @@ static void exipc_child_init(apr_pool_t *p, server_rec *s)
                                     apr_global_mutex_lockfile(exipc_mutex),
                                     p);
    if (APR_SUCCESS != rs) {
        ap_log_error(APLOG_MARK, APLOG_CRIT, rs, s, APLOGNO(02065)
        ap_log_error(APLOG_MARK, APLOG_CRIT, rs, s,
                     "Failed to reopen mutex %s in child",
                     exipc_mutex_type);
        /* There's really nothing else we can do here, since This
@@ -261,14 +261,14 @@ static int exipc_handler(request_rec *r)
                break; /* Out of the loop */
            } else {
                /* Some error, log and bail */
                ap_log_error(APLOG_MARK, APLOG_ERR, rs, r->server, APLOGNO(02066)
                ap_log_error(APLOG_MARK, APLOG_ERR, rs, r->server,
                             "Child %ld failed to acquire lock",
                             (long int)getpid());
                break; /* Out of the loop without having the lock */
            }
        } else {
            /* Some other error, log and bail */
            ap_log_error(APLOG_MARK, APLOG_ERR, rs, r->server, APLOGNO(02067)
            ap_log_error(APLOG_MARK, APLOG_ERR, rs, r->server,
                         "Child %ld failed to try and acquire lock",
                         (long int)getpid());
            break; /* Out of the loop without having the lock */
Loading