aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikos Mavrogiannopoulos 2009-06-13 15:00:34 +0000
committerGravatar Nokis Mavrogiannopoulos 2009-06-13 15:00:34 +0000
commit0e13d67991fe10019f7fb1fa848f1788a4679b53 (patch)
treebcd0960afbb1f40d1268d089c5644cfae5fdc3a3 /src
parent7ef38d4e50d58d0e9e2494b8f71cf16a85b13b17 (diff)
do not try to send empty packs using TLS. This this has a special meaning and could result in clients closing connections.
Diffstat (limited to 'src')
-rw-r--r--src/gnutls_io.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/gnutls_io.c b/src/gnutls_io.c
index 4f8e486..65e128d 100644
--- a/src/gnutls_io.c
+++ b/src/gnutls_io.c
@@ -587,26 +587,29 @@ apr_status_t mgs_filter_output(ap_filter_t * f,
587 if (!APR_STATUS_IS_EOF(status) && (status != APR_SUCCESS)) { 587 if (!APR_STATUS_IS_EOF(status) && (status != APR_SUCCESS)) {
588 break; 588 break;
589 } 589 }
590
591 if (len > 0) {
590 592
591 do { 593 do {
592 ret = gnutls_record_send(ctxt->session, data, len); 594 ret = gnutls_record_send(ctxt->session, data, len);
593 } 595 }
594 while(ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN); 596 while(ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
595 597
596 if (ret < 0) { 598 if (ret < 0) {
597 /* error sending output */ 599 /* error sending output */
598 ap_log_error(APLOG_MARK, APLOG_INFO, ctxt->output_rc, 600 ap_log_error(APLOG_MARK, APLOG_INFO, ctxt->output_rc,
599 ctxt->c->base_server, 601 ctxt->c->base_server,
600 "GnuTLS: Error writing data." 602 "GnuTLS: Error writing data."
601 " (%d) '%s'", (int)ret, gnutls_strerror(ret)); 603 " (%d) '%s'", (int)ret, gnutls_strerror(ret));
602 if (ctxt->output_rc == APR_SUCCESS) { 604 if (ctxt->output_rc == APR_SUCCESS) {
603 ctxt->output_rc = APR_EGENERAL; 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);
604 } 612 }
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);
610 } 613 }
611 614
612 apr_bucket_delete(bucket); 615 apr_bucket_delete(bucket);