You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2010/06/06 19:01:30 UTC
svn commit: r951896 - in /httpd/httpd/trunk/modules/ssl: ssl_engine_io.c
ssl_engine_kernel.c
Author: sf
Date: Sun Jun 6 17:01:29 2010
New Revision: 951896
URL: http://svn.apache.org/viewvc?rev=951896&view=rev
Log:
Use new loglevel accessor macros to simplify code
Modified:
httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c
Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_io.c?rev=951896&r1=951895&r2=951896&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_io.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_io.c Sun Jun 6 17:01:29 2010
@@ -1015,7 +1015,7 @@ static void ssl_filter_io_shutdown(ssl_f
SSL_smart_shutdown(ssl);
/* and finally log the fact that we've closed the connection */
- if (mySrvFromConn(c)->loglevel >= APLOG_INFO) {
+ if (APLOGcinfo(c)) {
ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, c,
"Connection closed to child %ld with %s shutdown "
"(server %s)",
@@ -1740,8 +1740,7 @@ void ssl_io_filter_init(conn_rec *c, req
apr_pool_cleanup_register(c->pool, (void*)filter_ctx,
ssl_io_filter_cleanup, apr_pool_cleanup_null);
- if ((s->loglevel >= APLOG_DEBUG)
- && (sc->ssl_log_level >= SSL_LOG_IO)) {
+ if (APLOGcdebug(c) && (sc->ssl_log_level >= SSL_LOG_IO)) {
BIO_set_callback(SSL_get_rbio(ssl), ssl_io_data_cb);
BIO_set_callback_arg(SSL_get_rbio(ssl), (void *)ssl);
}
Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c?rev=951896&r1=951895&r2=951896&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c Sun Jun 6 17:01:29 2010
@@ -231,8 +231,8 @@ int ssl_hook_ReadReq(request_rec *r)
/*
* Log information about incoming HTTPS requests
*/
- if (r->server->loglevel >= APLOG_INFO && ap_is_initial_req(r)) {
- ap_log_error(APLOG_MARK, APLOG_INFO, 0, r->server,
+ if (APLOGrinfo(r) && ap_is_initial_req(r)) {
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
"%s HTTPS request received for child %ld (server %s)",
(r->connection->keepalives <= 0 ?
"Initial (No.1)" :
@@ -1541,7 +1541,7 @@ int ssl_callback_SSLVerify_CRL(int ok, X
* Log information about CRL
* (A little bit complicated because of ASN.1 and BIOs...)
*/
- if (s->loglevel >= APLOG_DEBUG) {
+ if (APLOGdebug(s)) {
char buff[512]; /* should be plenty */
BIO *bio = BIO_new(BIO_s_mem());
@@ -1633,11 +1633,11 @@ int ssl_callback_SSLVerify_CRL(int ok, X
ASN1_INTEGER *sn = X509_REVOKED_get_serialNumber(revoked);
if (!ASN1_INTEGER_cmp(sn, X509_get_serialNumber(cert))) {
- if (s->loglevel >= APLOG_DEBUG) {
+ if (APLOGdebug(s)) {
char *cp = X509_NAME_oneline(issuer, NULL, 0);
long serial = ASN1_INTEGER_get(sn);
- ap_log_error(APLOG_MARK, APLOG_INFO, 0, s,
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
"Certificate with serial %ld (0x%lX) "
"revoked per CRL from issuer %s",
serial, serial, cp);
@@ -1669,7 +1669,7 @@ static void modssl_proxy_info_log(server
X509_NAME *name;
char *dn;
- if (s->loglevel < APLOG_DEBUG) {
+ if (!APLOGdebug(s)) {
return;
}
@@ -1766,7 +1766,7 @@ static void ssl_session_log(server_rec *
char buf[SSL_SESSION_ID_STRING_LEN];
char timeout_str[56] = {'\0'};
- if (s->loglevel < APLOG_DEBUG) {
+ if (!APLOGdebug(s)) {
return;
}
@@ -2012,7 +2012,7 @@ void ssl_callback_Info(MODSSL_INFO_CB_AR
}
s = mySrvFromConn(c);
- if (s && s->loglevel >= APLOG_DEBUG) {
+ if (s && APLOGdebug(s)) {
log_tracing_state(ssl, c, s, where, rc);
}
}
@@ -2141,7 +2141,7 @@ static int ssl_find_vhost(void *serverna
* (and the first vhost doesn't use APLOG_DEBUG), then
* we need to set that callback here.
*/
- if (s->loglevel >= APLOG_DEBUG) {
+ if (APLOGdebug(s)) {
BIO_set_callback(SSL_get_rbio(ssl), ssl_io_data_cb);
BIO_set_callback_arg(SSL_get_rbio(ssl), (void *)ssl);
}
Re: svn commit: r951896 - in /httpd/httpd/trunk/modules/ssl: ssl_engine_io.c ssl_engine_kernel.c
Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Wednesday 09 June 2010, Ruediger Pluem wrote:
> On 06/09/2010 09:55 PM, Stefan Fritsch wrote:
> > On Wed, 9 Jun 2010, Ruediger Pluem wrote:
> >> On 06/06/2010 07:01 PM, sf@apache.org wrote:
> >>> Author: sf
> >>> Date: Sun Jun 6 17:01:29 2010
> >>> New Revision: 951896
> >>>
> >>> URL: http://svn.apache.org/viewvc?rev=951896&view=rev
> >>> Log:
> >>> Use new loglevel accessor macros to simplify code
> >>>
> >>> Modified:
> >>> httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
> >>> httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c
> >>>
> >>> Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
> >>> URL:
> >>> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_
> >>> engine_io.c?rev=951896&r1=951895&r2=951896&view=diff
> >>>
> >>> ===============================================================
> >>> ===============
> >>>
> >>> --- httpd/httpd/trunk/modules/ssl/ssl_engine_io.c (original)
> >>> +++ httpd/httpd/trunk/modules/ssl/ssl_engine_io.c Sun Jun 6
> >>> 17:01:29 2010
> >>> @@ -1015,7 +1015,7 @@ static void ssl_filter_io_shutdown(ssl_f
> >>>
> >>> SSL_smart_shutdown(ssl);
> >>>
> >>> /* and finally log the fact that we've closed the
> >>> connection */
> >>>
> >>> - if (mySrvFromConn(c)->loglevel >= APLOG_INFO) {
> >>> + if (APLOGcinfo(c)) {
> >>
> >> IMHO you need to use APLOGinfo(mySrvFromConn(c)) as otherwise
> >> you might choose the base_server
> >> which might not be what mySrvFromConn(c) returns.
> >
> > I think it is even more complicated than that and it affects many
> > places in mod_ssl. If c has a loglevel configuration, we should
> > probably use that. If not, we should use mySrvFromConn(c). But
> > in both cases, the log message should be tied to the connection,
> > to ensure that things like the client IP are logged. Maybe we
> > need a ap_log_scerror that accepts both a server_rec and
> > conn_rec.
>
> Makes sense.
Done in r954611.
>
> > AIUI, c->base_server is the default virtual host for the relevant
> > IP/port. Without SNI, mySrvFromConn(c) is the same but with SNI,
> > mySrvFromConn(c) may be a different name-based virtual host with
> > the same IP/port. So, mySrvFromConn(c) is basically r->server?
> > Is that correct?
>
> Yes, but a this point of time we may not have a request (yet), so
> mySrvFromConn(c) is the same as what r->server will be later
> during request processing.
>
> Regards
>
> Rüdiger
Re: svn commit: r951896 - in /httpd/httpd/trunk/modules/ssl: ssl_engine_io.c
ssl_engine_kernel.c
Posted by Ruediger Pluem <rp...@apache.org>.
On 06/09/2010 09:55 PM, Stefan Fritsch wrote:
> On Wed, 9 Jun 2010, Ruediger Pluem wrote:
>> On 06/06/2010 07:01 PM, sf@apache.org wrote:
>>> Author: sf
>>> Date: Sun Jun 6 17:01:29 2010
>>> New Revision: 951896
>>>
>>> URL: http://svn.apache.org/viewvc?rev=951896&view=rev
>>> Log:
>>> Use new loglevel accessor macros to simplify code
>>>
>>> Modified:
>>> httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
>>> httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c
>>>
>>> Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
>>> URL:
>>> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_io.c?rev=951896&r1=951895&r2=951896&view=diff
>>>
>>> ==============================================================================
>>>
>>> --- httpd/httpd/trunk/modules/ssl/ssl_engine_io.c (original)
>>> +++ httpd/httpd/trunk/modules/ssl/ssl_engine_io.c Sun Jun 6 17:01:29
>>> 2010
>>> @@ -1015,7 +1015,7 @@ static void ssl_filter_io_shutdown(ssl_f
>>> SSL_smart_shutdown(ssl);
>>>
>>> /* and finally log the fact that we've closed the connection */
>>> - if (mySrvFromConn(c)->loglevel >= APLOG_INFO) {
>>> + if (APLOGcinfo(c)) {
>>
>> IMHO you need to use APLOGinfo(mySrvFromConn(c)) as otherwise you
>> might choose the base_server
>> which might not be what mySrvFromConn(c) returns.
>
> I think it is even more complicated than that and it affects many places
> in mod_ssl. If c has a loglevel configuration, we should probably use
> that. If not, we should use mySrvFromConn(c). But in both cases, the log
> message should be tied to the connection, to ensure that things like the
> client IP are logged. Maybe we need a ap_log_scerror that accepts both a
> server_rec and conn_rec.
Makes sense.
>
> AIUI, c->base_server is the default virtual host for the relevant
> IP/port. Without SNI, mySrvFromConn(c) is the same but with SNI,
> mySrvFromConn(c) may be a different name-based virtual host with the
> same IP/port. So, mySrvFromConn(c) is basically r->server? Is that correct?
Yes, but a this point of time we may not have a request (yet), so mySrvFromConn(c)
is the same as what r->server will be later during request processing.
Regards
Rüdiger
Re: svn commit: r951896 - in /httpd/httpd/trunk/modules/ssl:
ssl_engine_io.c ssl_engine_kernel.c
Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Wed, 9 Jun 2010, Ruediger Pluem wrote:
> On 06/06/2010 07:01 PM, sf@apache.org wrote:
>> Author: sf
>> Date: Sun Jun 6 17:01:29 2010
>> New Revision: 951896
>>
>> URL: http://svn.apache.org/viewvc?rev=951896&view=rev
>> Log:
>> Use new loglevel accessor macros to simplify code
>>
>> Modified:
>> httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
>> httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c
>>
>> Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
>> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_io.c?rev=951896&r1=951895&r2=951896&view=diff
>> ==============================================================================
>> --- httpd/httpd/trunk/modules/ssl/ssl_engine_io.c (original)
>> +++ httpd/httpd/trunk/modules/ssl/ssl_engine_io.c Sun Jun 6 17:01:29 2010
>> @@ -1015,7 +1015,7 @@ static void ssl_filter_io_shutdown(ssl_f
>> SSL_smart_shutdown(ssl);
>>
>> /* and finally log the fact that we've closed the connection */
>> - if (mySrvFromConn(c)->loglevel >= APLOG_INFO) {
>> + if (APLOGcinfo(c)) {
>
> IMHO you need to use APLOGinfo(mySrvFromConn(c)) as otherwise you might choose the base_server
> which might not be what mySrvFromConn(c) returns.
I think it is even more complicated than that and it affects many places
in mod_ssl. If c has a loglevel configuration, we should probably use
that. If not, we should use mySrvFromConn(c). But in both cases, the log
message should be tied to the connection, to ensure that things like the
client IP are logged. Maybe we need a ap_log_scerror that accepts both a
server_rec and conn_rec.
AIUI, c->base_server is the default virtual host for the relevant IP/port.
Without SNI, mySrvFromConn(c) is the same but with SNI, mySrvFromConn(c)
may be a different name-based virtual host with the same IP/port. So,
mySrvFromConn(c) is basically r->server? Is that correct?
>
>> ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, c,
>> "Connection closed to child %ld with %s shutdown "
>> "(server %s)",
>> @@ -1740,8 +1740,7 @@ void ssl_io_filter_init(conn_rec *c, req
>> apr_pool_cleanup_register(c->pool, (void*)filter_ctx,
>> ssl_io_filter_cleanup, apr_pool_cleanup_null);
>>
>> - if ((s->loglevel >= APLOG_DEBUG)
>> - && (sc->ssl_log_level >= SSL_LOG_IO)) {
>> + if (APLOGcdebug(c) && (sc->ssl_log_level >= SSL_LOG_IO)) {
>
> Same as above.
>
>> BIO_set_callback(SSL_get_rbio(ssl), ssl_io_data_cb);
>> BIO_set_callback_arg(SSL_get_rbio(ssl), (void *)ssl);
>> }
>>
>
> Regards
>
> Rüdiger
>
Re: svn commit: r951896 - in /httpd/httpd/trunk/modules/ssl: ssl_engine_io.c
ssl_engine_kernel.c
Posted by Ruediger Pluem <rp...@apache.org>.
On 06/06/2010 07:01 PM, sf@apache.org wrote:
> Author: sf
> Date: Sun Jun 6 17:01:29 2010
> New Revision: 951896
>
> URL: http://svn.apache.org/viewvc?rev=951896&view=rev
> Log:
> Use new loglevel accessor macros to simplify code
>
> Modified:
> httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
> httpd/httpd/trunk/modules/ssl/ssl_engine_kernel.c
>
> Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_io.c?rev=951896&r1=951895&r2=951896&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/ssl/ssl_engine_io.c (original)
> +++ httpd/httpd/trunk/modules/ssl/ssl_engine_io.c Sun Jun 6 17:01:29 2010
> @@ -1015,7 +1015,7 @@ static void ssl_filter_io_shutdown(ssl_f
> SSL_smart_shutdown(ssl);
>
> /* and finally log the fact that we've closed the connection */
> - if (mySrvFromConn(c)->loglevel >= APLOG_INFO) {
> + if (APLOGcinfo(c)) {
IMHO you need to use APLOGinfo(mySrvFromConn(c)) as otherwise you might choose the base_server
which might not be what mySrvFromConn(c) returns.
> ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, c,
> "Connection closed to child %ld with %s shutdown "
> "(server %s)",
> @@ -1740,8 +1740,7 @@ void ssl_io_filter_init(conn_rec *c, req
> apr_pool_cleanup_register(c->pool, (void*)filter_ctx,
> ssl_io_filter_cleanup, apr_pool_cleanup_null);
>
> - if ((s->loglevel >= APLOG_DEBUG)
> - && (sc->ssl_log_level >= SSL_LOG_IO)) {
> + if (APLOGcdebug(c) && (sc->ssl_log_level >= SSL_LOG_IO)) {
Same as above.
> BIO_set_callback(SSL_get_rbio(ssl), ssl_io_data_cb);
> BIO_set_callback_arg(SSL_get_rbio(ssl), (void *)ssl);
> }
>
Regards
Rüdiger