Changeset be41ee4 in mod_gnutls for src/gnutls_io.c


Ignore:
Timestamp:
May 26, 2016, 5:09:31 PM (3 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
6868585
Parents:
c6cfe6e
git-author:
Thomas Klute <thomas2.klute@…> (05/26/16 16:57:31)
git-committer:
Thomas Klute <thomas2.klute@…> (05/26/16 17:09:31)
Message:

Set GnuTLS session errno on errors in mgs_transport_write()

Sunil Mohan Adapa reported retry loops during session shutdown in
cleanup_gnutls_session() due to gnutls_bye() returning
GNUTLS_E_INTERRUPTED or GNUTLS_E_AGAIN. mgs_transport_write() did not
set errno, so the value must have been left over from a previous error
in mgs_transport_read(). Properly setting session errno in
mgs_transport_write() fixes the problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_io.c

    rc6cfe6e rbe41ee4  
    869869    APR_BRIGADE_INSERT_TAIL(ctxt->output_bb, bucket);
    870870
    871     if (write_flush(ctxt) < 0) {
     871    if (write_flush(ctxt) < 0)
     872    {
     873        /* We encountered an error. APR_EINTR or APR_EAGAIN can be
     874         * handled, treat everything else as a generic I/O error. */
     875        int err = EIO;
     876        if (APR_STATUS_IS_EAGAIN(ctxt->output_rc)
     877            || APR_STATUS_IS_EINTR(ctxt->output_rc))
     878            err = EAI_APR_TO_RAW(ctxt->output_rc);
     879
     880        gnutls_transport_set_errno(ctxt->session, err);
    872881        return -1;
    873882    }
Note: See TracChangeset for help on using the changeset viewer.