aboutsummaryrefslogtreecommitdiffstats
path: root/src/gnutls_io.c
diff options
context:
space:
mode:
authorGravatar Paul Querna 2004-12-10 06:08:52 +0000
committerGravatar Paul Querna 2004-12-10 06:08:52 +0000
commita66e1478c77fc8c8a7ab831916ab3d1c3aacb539 (patch)
tree328f6b0d0ef4303719cab9f2949c5a7a2c65681e /src/gnutls_io.c
parent76bd3bfed0fda6fb670cb14c16bcdfd47453dfe5 (diff)
working support for a ssl session cache via memcached.
Diffstat (limited to 'src/gnutls_io.c')
-rw-r--r--src/gnutls_io.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/gnutls_io.c b/src/gnutls_io.c
index e1c84be..e92646b 100644
--- a/src/gnutls_io.c
+++ b/src/gnutls_io.c
@@ -273,10 +273,16 @@ static apr_status_t gnutls_io_input_read(mod_gnutls_handle_t * ctxt,
273 } 273 }
274 else { 274 else {
275 /* Some Other Error. Report it. Die. */ 275 /* Some Other Error. Report it. Die. */
276 ap_log_error(APLOG_MARK, APLOG_INFO, ctxt->input_rc, 276 if(gnutls_error_is_fatal(rc)) {
277 ctxt->c->base_server, 277 ap_log_error(APLOG_MARK, APLOG_INFO, ctxt->input_rc,
278 "GnuTLS: Error reading data. (%d) '%s'", rc, 278 ctxt->c->base_server,
279 gnutls_strerror(rc)); 279 "GnuTLS: Error reading data. (%d) '%s'", rc,
280 gnutls_strerror(rc));
281 }
282 else if(*len > 0) {
283 ctxt->input_rc = APR_SUCCESS;
284 break;
285 }
280 } 286 }
281 287
282 if (ctxt->input_rc == APR_SUCCESS) { 288 if (ctxt->input_rc == APR_SUCCESS) {
@@ -449,9 +455,10 @@ apr_status_t mod_gnutls_filter_output(ap_filter_t * f,
449 455
450 while (!APR_BRIGADE_EMPTY(bb)) { 456 while (!APR_BRIGADE_EMPTY(bb)) {
451 apr_bucket *bucket = APR_BRIGADE_FIRST(bb); 457 apr_bucket *bucket = APR_BRIGADE_FIRST(bb);
452 if (APR_BUCKET_IS_EOS(bucket)) { 458 if (APR_BUCKET_IS_EOS(bucket) || AP_BUCKET_IS_EOC(bucket)) {
453 459
454 /* gnutls_bye(ctxt->session, GNUTLS_SHUT_RDWR); */ 460 gnutls_bye(ctxt->session, GNUTLS_SHUT_WR);
461 gnutls_deinit(ctxt->session);
455 462
456 if ((status = ap_pass_brigade(f->next, bb)) != APR_SUCCESS) { 463 if ((status = ap_pass_brigade(f->next, bb)) != APR_SUCCESS) {
457 return status; 464 return status;
@@ -464,17 +471,6 @@ apr_status_t mod_gnutls_filter_output(ap_filter_t * f,
464 return status; 471 return status;
465 } 472 }
466 break; 473 break;
467
468 }
469 else if (AP_BUCKET_IS_EOC(bucket)) {
470
471 gnutls_bye(ctxt->session, GNUTLS_SHUT_WR);
472 gnutls_deinit(ctxt->session);
473 if ((status = ap_pass_brigade(f->next, bb)) != APR_SUCCESS) {
474 return status;
475 }
476 break;
477
478 } 474 }
479 else { 475 else {
480 /* filter output */ 476 /* filter output */