Changeset ac49b95 in mod_gnutls


Ignore:
Timestamp:
Aug 13, 2021, 4:16:35 PM (2 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
master
Children:
272833c
Parents:
866273c
git-author:
Fiona Klute <fiona.klute@…> (08/13/21 15:51:58)
git-committer:
Fiona Klute <fiona.klute@…> (08/13/21 16:16:35)
Message:

Avoid log spam if connection is aborted while sending

  • Don't try to close the TLS session if the transport connection has been aborted, it only causes another push function error.
  • Adjust log levels. Error conditions frequently caused by clients don't need more than "debug".
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_hooks.c

    r866273c rac49b95  
    11001100    /* check if session needs closing */
    11011101    mgs_handle_t *ctxt = (mgs_handle_t *) data;
    1102     if (ctxt->session != NULL)
     1102    if (ctxt->session == NULL)
     1103        return APR_SUCCESS;
     1104
     1105    if (ctxt->c->aborted)
     1106    {
     1107        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, ctxt->c,
     1108                      "%s: TLS %sconnection aborted, cleaning up.",
     1109                      __func__, IS_PROXY_STR(ctxt));
     1110    }
     1111    else
    11031112    {
    11041113        ap_log_cerror(APLOG_MARK, APLOG_WARNING, APR_ECONNABORTED, ctxt->c,
     
    11121121        while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
    11131122        if (ret != GNUTLS_E_SUCCESS)
    1114             ap_log_cerror(APLOG_MARK, APLOG_INFO, APR_EGENERAL, ctxt->c,
     1123            ap_log_cerror(APLOG_MARK, APLOG_DEBUG, APR_EGENERAL, ctxt->c,
    11151124                          "%s: error while closing TLS %sconnection: %s (%d)",
    11161125                          __func__, IS_PROXY_STR(ctxt),
     
    11201129                          "%s: TLS %sconnection closed.",
    11211130                          __func__, IS_PROXY_STR(ctxt));
    1122         /* De-Initialize Session */
    1123         gnutls_deinit(ctxt->session);
    1124         ctxt->session = NULL;
    1125     }
     1131    }
     1132
     1133    /* De-Initialize Session */
     1134    gnutls_deinit(ctxt->session);
     1135    ctxt->session = NULL;
    11261136    return APR_SUCCESS;
    11271137}
  • src/gnutls_io.c

    r866273c rac49b95  
    778778                if (ret < 0) {
    779779                    /* error sending output */
    780                     ap_log_cerror(APLOG_MARK, APLOG_INFO, ctxt->output_rc,
     780                    ap_log_cerror(APLOG_MARK, APLOG_DEBUG, ctxt->output_rc,
    781781                                  ctxt->c,
    782782                                  "GnuTLS: Error writing data. (%d) '%s'",
Note: See TracChangeset for help on using the changeset viewer.