Changeset 265eafc in mod_gnutls for src


Ignore:
Timestamp:
Feb 3, 2015, 3:35:48 AM (5 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
d7a8286
Parents:
4261999
Message:

gnutls_io.c: Log connection start/end and unusual input filter events

This helps keeping track of connection status while debugging, but would
create far too much data in production, so log only at level "debug".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_io.c

    r4261999 r265eafc  
    3737                               sizeof(HTTP_ON_HTTPS_PORT) - 1, \
    3838                               alloc)
     39
     40#define IS_PROXY_STR(c) \
     41    ((c->is_proxy == GNUTLS_ENABLED_TRUE) ? "proxy " : "")
    3942
    4043static apr_status_t gnutls_io_filter_error(ap_filter_t * f,
     
    485488        apr_bucket_brigade * bb,
    486489        ap_input_mode_t mode,
    487         apr_read_type_e block, apr_off_t readbytes) {
     490        apr_read_type_e block, apr_off_t readbytes)
     491{
    488492    apr_status_t status = APR_SUCCESS;
    489493    mgs_handle_t *ctxt = (mgs_handle_t *) f->ctx;
     
    494498                apr_bucket_eos_create(f->c->bucket_alloc);
    495499        APR_BRIGADE_INSERT_TAIL(bb, bucket);
     500        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, ctxt->c,
     501                      "%s: %sconnection aborted",
     502                      __func__, IS_PROXY_STR(ctxt));
    496503        return APR_ECONNABORTED;
    497504    }
     
    499506    if (ctxt->status == 0) {
    500507        gnutls_do_handshake(ctxt);
     508        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, ctxt->c,
     509                      "%s: TLS %sconnection opened.",
     510                      __func__, IS_PROXY_STR(ctxt));
    501511    }
    502512
    503513    if (ctxt->status < 0) {
     514        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, ctxt->c,
     515                      "%s %s: ap_get_brigade", __func__, IS_PROXY_STR(ctxt));
    504516        return ap_get_brigade(f->next, bb, mode, block, readbytes);
    505517    }
     
    595607    if (ctxt->status == 0) {
    596608        gnutls_do_handshake(ctxt);
     609        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, ctxt->c,
     610                      "%s: TLS %sconnection opened.",
     611                      __func__, IS_PROXY_STR(ctxt));
    597612    }
    598613
     
    621636                    ret = gnutls_bye(ctxt->session, GNUTLS_SHUT_WR);
    622637                } while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
     638                ap_log_cerror(APLOG_MARK, APLOG_DEBUG, ret, ctxt->c,
     639                              "%s: TLS %sconnection closed.",
     640                              __func__, IS_PROXY_STR(ctxt));
    623641                /* De-Initialize Session */
    624642                gnutls_deinit(ctxt->session);
Note: See TracChangeset for help on using the changeset viewer.