Changeset 92cb0cc in mod_gnutls


Ignore:
Timestamp:
Dec 12, 2018, 4:15:40 PM (3 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
debian/master, master
Children:
2038b76
Parents:
5c56e5b
Message:

Handle APR_TIMEUP return value from blocking ap_get_brigade() call

The API documentation does not say under which conditions this may
happen, so I have to replicate mod_ssl behavior here, which is
basically the same as for APR_EAGAIN.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_io.c

    r5c56e5b r92cb0cc  
    878878        }
    879879
     880        /* Blocking ap_get_brigade() can return a timeout status,
     881         * sometimes after a very short time. "Don't give up, just
     882         * return the timeout" is what mod_ssl does. */
     883        if (ctxt->input_block == APR_BLOCK_READ
     884            && APR_STATUS_IS_TIMEUP(rc)
     885            && APR_BRIGADE_EMPTY(ctxt->input_bb))
     886        {
     887            ctxt->input_rc = rc;
     888            gnutls_transport_set_errno(ctxt->session, EAGAIN);
     889            return -1;
     890        }
     891
    880892        if (rc != APR_SUCCESS)
    881893        {
    882894            /* Unexpected errors discard the brigade */
     895            ap_log_cerror(APLOG_MARK, APLOG_INFO, rc, ctxt->c,
     896                          "%s: Unexpected error!", __func__);
    883897            apr_brigade_cleanup(ctxt->input_bb);
    884898            ctxt->input_bb = NULL;
Note: See TracChangeset for help on using the changeset viewer.