Changeset 0e13d67 in mod_gnutls


Ignore:
Timestamp:
Jun 13, 2009, 11:00:34 AM (10 years ago)
Author:
Nokis Mavrogiannopoulos <nmav@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, msva, upstream
Children:
7e67487
Parents:
7ef38d4
git-author:
Nikos Mavrogiannopoulos <nmav@…> (06/13/09 11:00:34)
git-committer:
Nokis Mavrogiannopoulos <nmav@…> (06/13/09 11:00:34)
Message:

do not try to send empty packs using TLS. This this has a special meaning and could result in clients closing connections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_io.c

    r7ef38d4 r0e13d67  
    588588                break;
    589589            }
    590 
    591             do {
    592                 ret = gnutls_record_send(ctxt->session, data, len);
    593             }
    594             while(ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
    595 
    596             if (ret < 0) {
    597                 /* error sending output */
    598                 ap_log_error(APLOG_MARK, APLOG_INFO, ctxt->output_rc,
     590           
     591            if (len > 0) {
     592
     593                do {
     594                    ret = gnutls_record_send(ctxt->session, data, len);
     595                }
     596                while(ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
     597
     598                if (ret < 0) {
     599                    /* error sending output */
     600                    ap_log_error(APLOG_MARK, APLOG_INFO, ctxt->output_rc,
    599601                             ctxt->c->base_server,
    600602                             "GnuTLS: Error writing data."
    601603                             " (%d) '%s'", (int)ret, gnutls_strerror(ret));
    602                 if (ctxt->output_rc == APR_SUCCESS) {
    603                     ctxt->output_rc = APR_EGENERAL;
    604                 }
    605             }
    606             else if (ret != len) {
    607                 /* Not able to send the entire bucket,
    608                    split it and send it again. */
    609                 apr_bucket_split(bucket, ret);
     604                    if (ctxt->output_rc == APR_SUCCESS) {
     605                        ctxt->output_rc = APR_EGENERAL;
     606                    }
     607                }
     608                else if (ret != len) {
     609                    /* Not able to send the entire bucket,
     610                       split it and send it again. */
     611                    apr_bucket_split(bucket, ret);
     612                }
    610613            }
    611614
Note: See TracChangeset for help on using the changeset viewer.