Changeset 398d1a0 in mod_gnutls for src


Ignore:
Timestamp:
Jan 28, 2015, 7:34:35 AM (5 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
4261999
Parents:
4fefa39
Message:

Improved logging for gnutls_io_input_read

  • Log if something tried to read from a NULL session
  • Use ap_log_cerror instead of ap_log_error for existing log messages, because TLS input is connection specific
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_io.c

    r4fefa39 r398d1a0  
    184184
    185185static apr_status_t gnutls_io_input_read(mgs_handle_t * ctxt,
    186         char *buf, apr_size_t * len) {
     186        char *buf, apr_size_t * len)
     187{
    187188    apr_size_t wanted = *len;
    188189    apr_size_t bytes = 0;
     
    223224
    224225    if (ctxt->session == NULL) {
     226        ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, ctxt->c,
     227                      "%s: GnuTLS session is NULL!", __func__);
    225228        return APR_EGENERAL;
    226229    }
     
    268271            if (rc == GNUTLS_E_REHANDSHAKE) {
    269272                /* A client has asked for a new Hankshake. Currently, we don't do it */
    270                 ap_log_error(APLOG_MARK, APLOG_INFO,
     273                ap_log_cerror(APLOG_MARK, APLOG_INFO,
    271274                        ctxt->input_rc,
    272                         ctxt->c->base_server,
     275                        ctxt->c,
    273276                        "GnuTLS: Error reading data. Client Requested a New Handshake."
    274277                        " (%d) '%s'", rc,
     
    276279            } else if (rc == GNUTLS_E_WARNING_ALERT_RECEIVED) {
    277280                rc = gnutls_alert_get(ctxt->session);
    278                 ap_log_error(APLOG_MARK, APLOG_INFO,
     281                ap_log_cerror(APLOG_MARK, APLOG_INFO,
    279282                        ctxt->input_rc,
    280                         ctxt->c->base_server,
     283                        ctxt->c,
    281284                        "GnuTLS: Warning Alert From Client: "
    282285                        " (%d) '%s'", rc,
     
    284287            } else if (rc == GNUTLS_E_FATAL_ALERT_RECEIVED) {
    285288                rc = gnutls_alert_get(ctxt->session);
    286                 ap_log_error(APLOG_MARK, APLOG_INFO,
     289                ap_log_cerror(APLOG_MARK, APLOG_INFO,
    287290                        ctxt->input_rc,
    288                         ctxt->c->base_server,
     291                        ctxt->c,
    289292                        "GnuTLS: Fatal Alert From Client: "
    290293                        "(%d) '%s'", rc,
     
    295298                /* Some Other Error. Report it. Die. */
    296299                if (gnutls_error_is_fatal(rc)) {
    297                     ap_log_error(APLOG_MARK,
     300                    ap_log_cerror(APLOG_MARK,
    298301                            APLOG_INFO,
    299302                            ctxt->input_rc,
    300                             ctxt->c->base_server,
     303                            ctxt->c,
    301304                            "GnuTLS: Error reading data. (%d) '%s'",
    302305                            rc,
Note: See TracChangeset for help on using the changeset viewer.