summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDash Shendy <neuromancer@dash.za.net>2011-07-08 21:04:16 (GMT)
committer Dash Shendy <neuromancer@dash.za.net>2011-07-08 21:04:16 (GMT)
commit60cf11c4c8c984d7fafd369171bfa950eefd3c4f (patch)
treefd08c8ee8fafa75d143273a7e24c0a0b6898e13a
parentb4a875b12ad2ef07f38ae23b3d3e853b5a59bf89 (diff)
Proxy (TLS termination) patch
Signed-off-by: Dash Shendy <neuromancer@dash.za.net>
-rw-r--r--src/gnutls_hooks.c14
-rw-r--r--src/gnutls_io.c6
2 files changed, 11 insertions, 9 deletions
diff --git a/src/gnutls_hooks.c b/src/gnutls_hooks.c
index 2999aae..4b9e964 100644
--- a/src/gnutls_hooks.c
+++ b/src/gnutls_hooks.c
@@ -738,8 +738,9 @@ int mgs_hook_pre_connection(conn_rec * c, void *csd)
738 738
739 _gnutls_log(debug_log_fp, "%s: %d\n", __func__, __LINE__); 739 _gnutls_log(debug_log_fp, "%s: %d\n", __func__, __LINE__);
740 740
741 if (c == NULL) 741 if (c == NULL) {
742 return DECLINED; 742 return DECLINED;
743 }
743 744
744 sc = (mgs_srvconf_rec *) ap_get_module_config(c->base_server-> 745 sc = (mgs_srvconf_rec *) ap_get_module_config(c->base_server->
745 module_config, 746 module_config,
@@ -749,10 +750,11 @@ int mgs_hook_pre_connection(conn_rec * c, void *csd)
749 return DECLINED; 750 return DECLINED;
750 } 751 }
751 752
752 if (c->remote_addr->hostname) 753 if (c->remote_addr->hostname || apr_strnatcmp(c->remote_ip,c->local_ip) == 0) {
753 /* Connection initiated by Apache (mod_proxy) => ignore */ 754 /* Connection initiated by Apache (mod_proxy) => ignore */
754 return OK; 755 return OK;
755 756 }
757
756 ctxt = create_gnutls_handle(c->pool, c); 758 ctxt = create_gnutls_handle(c->pool, c);
757 759
758 ap_set_module_config(c->conn_config, &gnutls_module, ctxt); 760 ap_set_module_config(c->conn_config, &gnutls_module, ctxt);
diff --git a/src/gnutls_io.c b/src/gnutls_io.c
index 4a550c3..a434eb5 100644
--- a/src/gnutls_io.c
+++ b/src/gnutls_io.c
@@ -666,9 +666,9 @@ ssize_t mgs_transport_read(gnutls_transport_ptr_t ptr,
666 ctxt->input_rc = APR_SUCCESS; 666 ctxt->input_rc = APR_SUCCESS;
667 667
668 /* If Len = 0, we don't do anything. */ 668 /* If Len = 0, we don't do anything. */
669 if (!len) 669 if (!len || buffer == NULL) {
670 return 0; 670 return 0;
671 671 }
672 if (!ctxt->input_bb) { 672 if (!ctxt->input_bb) {
673 ctxt->input_rc = APR_EOF; 673 ctxt->input_rc = APR_EOF;
674 return -1; 674 return -1;