Changeset 9a9bc1e in mod_gnutls for src


Ignore:
Timestamp:
Sep 25, 2011, 8:13:55 PM (11 years ago)
Author:
Dash Shendy <neuromancer@…>
Branches:
asyncio, debian/master, debian/stretch-backports, jessie-backports, main, master, msva, proxy-ticket, upstream
Children:
84e07cc
Parents:
7e92bbb
Message:

Added fix for unclean shutdowns, we're now ignoring SIGPIPE Signals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_io.c

    r7e92bbb r9a9bc1e  
    569569    apr_read_type_e rblock = APR_NONBLOCK_READ;
    570570
     571    /* Block SIGPIPE Signals */
     572    status = apr_signal_block(SIGPIPE);
     573    if(status != APR_SUCCESS) {
     574        /* error sending output */
     575        ap_log_error(APLOG_MARK,APLOG_INFO,ctxt->output_rc,ctxt->c->base_server,
     576                "GnuTLS: Error Blocking SIGPIPE Signal!");       
     577        return status;
     578    }
     579   
    571580    if (f->c->aborted) {
    572581        apr_brigade_cleanup(bb);
     
    587596        if (APR_BUCKET_IS_EOS(bucket)) {
    588597            return ap_pass_brigade(f->next, bb);
    589         } else if (APR_BUCKET_IS_FLUSH(bucket)) {
     598        } else if (APR_BUCKET_IS_FLUSH(bucket)) {       
    590599            /* Try Flush */
    591600            if (write_flush(ctxt) < 0) {
     
    594603            }
    595604            /* cleanup! */
    596             apr_bucket_delete(bucket);
     605            apr_bucket_delete(bucket);               
    597606        } else if (AP_BUCKET_IS_EOC(bucket)) {
    598607            /* End Of Connection */
     
    600609                /* Try A Clean Shutdown */
    601610                do {
    602                     ret = gnutls_bye(ctxt->session,
    603                             GNUTLS_SHUT_WR);
    604                 } while (ret == GNUTLS_E_INTERRUPTED ||
    605                         ret == GNUTLS_E_AGAIN);
     611                    ret = gnutls_bye(ctxt->session, GNUTLS_SHUT_WR);
     612                } while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
    606613                /* De-Initialize Session */
    607614                gnutls_deinit(ctxt->session);
    608615                ctxt->session = NULL;
    609616            }
     617            /* cleanup! */
     618            apr_bucket_delete(bucket);           
    610619            /* Pass next brigade! */
    611620            return ap_pass_brigade(f->next, bb);
     
    615624            apr_size_t len;
    616625
    617             status =
    618                     apr_bucket_read(bucket, &data, &len, rblock);
     626            status = apr_bucket_read(bucket, &data, &len, rblock);
    619627
    620628            if (APR_STATUS_IS_EAGAIN(status)) {
Note: See TracChangeset for help on using the changeset viewer.