httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <wr...@rowe-clan.net>
Subject Re: svn commit: r952724 - /httpd/httpd/trunk/server/log.c
Date Tue, 08 Jun 2010 19:56:46 GMT
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/log.c?rev=952724&r1=952723&r2=952724&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/log.c (original)
> +++ httpd/httpd/trunk/server/log.c Tue Jun  8 16:26:39 2010
> @@ -628,12 +628,17 @@ static void log_error_core(const char *f
>                              "[%s] ", priorities[level_and_mask].t_name);
>  
>          len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
> -                            "[%" APR_PID_T_FMT, getpid());
> +                            "[pid %" APR_PID_T_FMT, getpid());
>  #if APR_HAS_THREADS
>          {
> -            apr_os_thread_t tid = apr_os_thread_current();
> -            len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
> -                                ":%pT", &tid);
> +            int result;
> +
> +            if (ap_mpm_query(AP_MPMQ_IS_THREADED, &result) == 0
> +                && result == AP_MPMQ_STATIC) {
> +                apr_os_thread_t tid = apr_os_thread_current();
> +                len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
> +                                    ":tid %pT", &tid);
> +            }
>          }
>  #endif
>          errstr[len++] = ']';

Question; where is the best place to perform this query once; and then to set
aside the ap_mpm_query result as a static?  Hitting an mpm_query on each and
every log entry isn't exactly efficient.

Ideas?

Mime
View raw message