]> granicus.if.org Git - apache/commitdiff
Stopped the CORE filter from sending off an HTTP response when a
authorGraham Leggett <minfrin@apache.org>
Sun, 8 Apr 2001 22:18:31 +0000 (22:18 +0000)
committerGraham Leggett <minfrin@apache.org>
Sun, 8 Apr 2001 22:18:31 +0000 (22:18 +0000)
CONNECT tunnel was closed. Fixed some filter definition madness that
proves that I need some sleep.
PR:
Obtained from:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88770 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy.c
modules/proxy/mod_proxy.h
modules/proxy/proxy_connect.c
modules/proxy/proxy_ftp.c

index f780db32398bc876fcc8a9756191dc24636df25f..ff4195021bf1c8b698adb20014fb891bd34c37fb 100644 (file)
@@ -56,6 +56,8 @@
  * University of Illinois, Urbana-Champaign.
  */
 
+#define CORE_PRIVATE
+
 #include "mod_proxy.h"
 
 /*
@@ -717,10 +719,9 @@ static void register_hooks(apr_pool_t *p)
     ap_hook_handler(proxy_handler, NULL, NULL, APR_HOOK_FIRST);
     /* filename-to-URI translation */
     ap_hook_translate_name(proxy_trans, NULL, NULL, APR_HOOK_FIRST);
-#ifdef FTP_FILTER
     /* filters */
     ap_register_output_filter("PROXY_SEND_DIR", ap_proxy_send_dir_filter, AP_FTYPE_CONNECTION);
-#endif
+    ap_register_output_filter("PROXY_NULL", ap_proxy_null_filter, AP_FTYPE_NETWORK);
     /* fixups */
     ap_hook_fixups(proxy_fixup, NULL, NULL, APR_HOOK_FIRST);
     /* post read_request handling */
index 93d5bd8c1e4b00123337b4bf6a7c869e02801156..7b61bbf9f793c6165308e2e9b04186e38f820148 100644 (file)
 #include "apr_pools.h"
 #include "apr_strings.h"
 
-#include "util_filter.h"
-#include "util_date.h"
-#include "util_uri.h"
 #include "httpd.h"
 #include "http_config.h"
-#include "http_protocol.h"
 #include "ap_config.h"
-#include "http_log.h"
-#include "http_main.h"
 #include "http_core.h"
-#include "http_connection.h"
-#include "http_vhost.h"
+#include "http_protocol.h"
 #include "http_request.h"
+#include "http_vhost.h"
+#include "http_main.h"
+#include "http_log.h"
+#include "http_connection.h"
+#include "util_filter.h"
+#include "util_date.h"
+#include "util_uri.h"
 #include "mod_core.h"
 
 
@@ -223,12 +223,13 @@ typedef struct {
 
 int ap_proxy_connect_handler(request_rec *r, char *url,
                          const char *proxyhost, int proxyport);
+apr_status_t ap_proxy_null_filter(ap_filter_t *f, apr_bucket_brigade *bb);
 
 /* proxy_ftp.c */
 
 int ap_proxy_ftp_canon(request_rec *r, char *url);
 int ap_proxy_ftp_handler(request_rec *r, char *url);
-apr_status_t ap_proxy_send_dir_filter(ap_filter_t *f, apr_bucket_brigade *bb, ap_input_mode_t mode);
+apr_status_t ap_proxy_send_dir_filter(ap_filter_t *f, apr_bucket_brigade *bb);
 
 /* proxy_http.c */
 
index d7e18ba9fe96f192db8302f1cbc1e46ec97a831b..43425fe84207e06f7d86572cdbfe24f82b2c5a2b 100644 (file)
@@ -58,6 +58,8 @@
 
 /* CONNECT method for Apache proxy */
 
+#define CORE_PRIVATE
+
 #include "mod_proxy.h"
 
 #if 0
@@ -102,6 +104,11 @@ allowed_port(proxy_server_conf *conf, int port)
     return 0;
 }
 
+/* a NULL filter for the connect tunnel */
+apr_status_t ap_proxy_null_filter(ap_filter_t *f, apr_bucket_brigade *bb)
+{
+    return APR_SUCCESS;
+}
 
 int ap_proxy_connect_handler(request_rec *r, char *url,
                          const char *proxyname, int proxyport)
@@ -254,14 +261,14 @@ int ap_proxy_connect_handler(request_rec *r, char *url,
      * Send the HTTP/1.1 CONNECT request to the remote server
      */
 
-    /* XXXX FIXME: we are acting as a tunnel - the output filter stack should ideally
+    /* we are acting as a tunnel - the output filter stack should
      * be completely empty, because when we are done here we are done completely.
-     * Is there such a thing as a NULL filter?
+     * We add the NULL filter to the stack to do this...
      */
-/*    r->output_filters = NULL;
   r->connection->output_filters = NULL;
*   ap_add_output_filter("NULL", NULL, r, r->connection);
- */
+    r->output_filters = NULL;
+    r->connection->output_filters = NULL;
   ap_add_output_filter("PROXY_NULL", NULL, r, r->connection);
+
 
     /* If we are connecting through a remote proxy, we need to pass
      * the CONNECT request on to it.
index 0b3dc7b720f47021ad4642ff9520b21207321b96..19b2f7f29645757299888c4836c0108316b08fc6 100644 (file)
@@ -253,7 +253,7 @@ static int ftp_getrc_msg(conn_rec *c, apr_bucket_brigade *bb, char *msgbuf, int
  * all in good time...! :)
  */
 
-apr_status_t ap_proxy_send_dir_filter(ap_filter_t *f, apr_bucket_brigade *bb, ap_input_mode_t mode)
+apr_status_t ap_proxy_send_dir_filter(ap_filter_t *f, apr_bucket_brigade *bb)
 {
     conn_rec *c = f->r->connection;
     apr_pool_t *p = f->r->pool;