You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by br...@apache.org on 2002/01/27 20:12:57 UTC
cvs commit: httpd-2.0/modules/http http_core.c
brianp 02/01/27 11:12:57
Modified: include http_core.h
modules/http http_core.c
Log:
Replaced some more ap_add_output_filter() calls with
ap_add_output_filter_handle() for efficiency
Revision Changes Path
1.61 +4 -0 httpd-2.0/include/http_core.h
Index: http_core.h
===================================================================
RCS file: /home/cvs/httpd-2.0/include/http_core.h,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- http_core.h 27 Jan 2002 02:13:10 -0000 1.60
+++ http_core.h 27 Jan 2002 19:12:56 -0000 1.61
@@ -578,6 +578,10 @@
extern ap_filter_rec_t *ap_content_length_filter_handle;
extern ap_filter_rec_t *ap_net_time_filter_handle;
extern ap_filter_rec_t *ap_core_input_filter_handle;
+extern ap_filter_rec_t *ap_http_input_filter_handle;
+extern ap_filter_rec_t *ap_http_header_filter_handle;
+extern ap_filter_rec_t *ap_chunk_filter_handle;
+extern ap_filter_rec_t *ap_byterange_filter_handle;
/**
* This hook provdes a way for modules to provide metrics/statistics about
1.292 +26 -11 httpd-2.0/modules/http/http_core.c
Index: http_core.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/http/http_core.c,v
retrieving revision 1.291
retrieving revision 1.292
diff -u -r1.291 -r1.292
--- http_core.c 27 Jan 2002 12:52:07 -0000 1.291
+++ http_core.c 27 Jan 2002 19:12:56 -0000 1.292
@@ -66,6 +66,7 @@
#include "httpd.h"
#include "http_config.h"
#include "http_connection.h"
+#include "http_core.h"
#include "http_protocol.h" /* For index_of_response(). Grump. */
#include "http_request.h"
@@ -76,6 +77,12 @@
#include "mod_core.h"
+/* Handles for core filters */
+ap_filter_rec_t *ap_http_input_filter_handle;
+ap_filter_rec_t *ap_http_header_filter_handle;
+ap_filter_rec_t *ap_chunk_filter_handle;
+ap_filter_rec_t *ap_byterange_filter_handle;
+
static const char *set_keep_alive_timeout(cmd_parms *cmd, void *dummy,
const char *arg)
{
@@ -261,8 +268,8 @@
{ return DEFAULT_HTTP_PORT; }
static int ap_pre_http_connection(conn_rec *c)
{
- ap_add_input_filter("CORE_IN", NULL, NULL, c);
- ap_add_output_filter("CORE", NULL, NULL, c);
+ ap_add_input_filter_handle(ap_core_input_filter_handle, NULL, NULL, c);
+ ap_add_output_filter_handle(ap_core_output_filter_handle, NULL, NULL, c);
return OK;
}
static int ap_process_http_connection(conn_rec *c)
@@ -303,9 +310,12 @@
static void ap_http_insert_filter(request_rec *r)
{
if (!r->main) {
- ap_add_output_filter("BYTERANGE", NULL, r, r->connection);
- ap_add_output_filter("CONTENT_LENGTH", NULL, r, r->connection);
- ap_add_output_filter("HTTP_HEADER", NULL, r, r->connection);
+ ap_add_output_filter_handle(ap_byterange_filter_handle,
+ NULL, r, r->connection);
+ ap_add_output_filter_handle(ap_content_length_filter_handle,
+ NULL, r, r->connection);
+ ap_add_output_filter_handle(ap_http_header_filter_handle,
+ NULL, r, r->connection);
}
}
@@ -319,12 +329,17 @@
ap_hook_http_method(http_method,NULL,NULL,APR_HOOK_REALLY_LAST);
ap_hook_default_port(http_port,NULL,NULL,APR_HOOK_REALLY_LAST);
ap_hook_insert_filter(ap_http_insert_filter, NULL, NULL, APR_HOOK_REALLY_LAST);
- ap_register_input_filter("HTTP_IN", ap_http_filter, AP_FTYPE_CONNECTION);
- ap_register_output_filter("HTTP_HEADER", ap_http_header_filter,
- AP_FTYPE_HTTP_HEADER);
- ap_register_output_filter("CHUNK", chunk_filter, AP_FTYPE_TRANSCODE);
- ap_register_output_filter("BYTERANGE", ap_byterange_filter,
- AP_FTYPE_HTTP_HEADER);
+ ap_http_input_filter_handle =
+ ap_register_input_filter("HTTP_IN", ap_http_filter,
+ AP_FTYPE_CONNECTION);
+ ap_http_header_filter_handle =
+ ap_register_output_filter("HTTP_HEADER", ap_http_header_filter,
+ AP_FTYPE_HTTP_HEADER);
+ ap_chunk_filter_handle =
+ ap_register_output_filter("CHUNK", chunk_filter, AP_FTYPE_TRANSCODE);
+ ap_byterange_filter_handle =
+ ap_register_output_filter("BYTERANGE", ap_byterange_filter,
+ AP_FTYPE_HTTP_HEADER);
}
module AP_MODULE_DECLARE_DATA http_module = {