httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r664227 - in /httpd/httpd/trunk: include/mod_request.h modules/filters/mod_request.c
Date Sat, 07 Jun 2008 01:02:31 GMT
Author: wrowe
Date: Fri Jun  6 18:02:31 2008
New Revision: 664227

URL: http://svn.apache.org/viewvc?rev=664227&view=rev
Log:
You don't export the fn hooked or registered as an optional fn

Modified:
    httpd/httpd/trunk/include/mod_request.h
    httpd/httpd/trunk/modules/filters/mod_request.c

Modified: httpd/httpd/trunk/include/mod_request.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/mod_request.h?rev=664227&r1=664226&r2=664227&view=diff
==============================================================================
--- httpd/httpd/trunk/include/mod_request.h (original)
+++ httpd/httpd/trunk/include/mod_request.h Fri Jun  6 18:02:31 2008
@@ -52,26 +52,6 @@
     int keep_body_set;
 } request_dir_conf;
 
-/* Handles for core filters */
-extern AP_DECLARE_DATA ap_filter_rec_t *ap_keep_body_input_filter_handle;
-extern AP_DECLARE_DATA ap_filter_rec_t *ap_kept_body_input_filter_handle;
-
-/* Filter to set aside a kept body on subrequests */
-AP_DECLARE(apr_status_t) ap_keep_body_filter(ap_filter_t *f, apr_bucket_brigade *b,
-                                             ap_input_mode_t mode, apr_read_type_e block,
-                                             apr_off_t readbytes);
-
-/* Filter to insert a kept body on subrequests */
-AP_DECLARE(apr_status_t) ap_kept_body_filter(ap_filter_t *f, apr_bucket_brigade *b,
-                                             ap_input_mode_t mode, apr_read_type_e block,
-                                             apr_off_t readbytes);
-
-/* Optional function to add either the keep body filter or kept body filter as appropriate
*/
-AP_DECLARE(void) ap_request_insert_filter(request_rec * r);
-
-/* Optional function to remove either the keep body filter or kept body filter as appropriate
*/
-AP_DECLARE(void) ap_request_remove_filter(request_rec * r);
-
 /**
  * Structure to store the contents of an HTTP form of the type
  * application/x-www-form-urlencoded.
@@ -117,9 +97,6 @@
  * NOTE: File upload is not yet supported, but can be without change
  * to the function call.
  */
-AP_DECLARE(int) ap_parse_request_form(request_rec * r, ap_filter_t * f, 
-                                      apr_array_header_t ** ptr,
-                                      apr_size_t num, apr_size_t size);
 
 APR_DECLARE_OPTIONAL_FN(int, ap_parse_request_form, (request_rec * r, ap_filter_t * f, 
                                                      apr_array_header_t ** ptr,

Modified: httpd/httpd/trunk/modules/filters/mod_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_request.c?rev=664227&r1=664226&r2=664227&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_request.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_request.c Fri Jun  6 18:02:31 2008
@@ -34,8 +34,8 @@
 #include "mod_request.h"
 
 /* Handles for core filters */
-AP_DECLARE_DATA ap_filter_rec_t *ap_keep_body_input_filter_handle;
-AP_DECLARE_DATA ap_filter_rec_t *ap_kept_body_input_filter_handle;
+static ap_filter_rec_t *keep_body_input_filter_handle;
+static ap_filter_rec_t *kept_body_input_filter_handle;
 
 static apr_status_t bail_out_on_error(apr_bucket_brigade *bb,
                                       ap_filter_t *f,
@@ -62,9 +62,10 @@
  * This is the KEEP_BODY_INPUT filter for HTTP requests, for times when the
  * body should be set aside for future use by other modules.
  */
-AP_DECLARE(apr_status_t) ap_keep_body_filter(ap_filter_t *f, apr_bucket_brigade *b,
-                                             ap_input_mode_t mode, apr_read_type_e block,
-                                             apr_off_t readbytes)
+static apr_status_t keep_body_filter(ap_filter_t *f, apr_bucket_brigade *b,
+                                     ap_input_mode_t mode,
+                                     apr_read_type_e block,
+                                     apr_off_t readbytes)
 {
     apr_bucket *e;
     keep_body_ctx_t *ctx = f->ctx;
@@ -197,9 +198,11 @@
  * If a body has been previously kept by the request, and if a subrequest wants
  * to re-insert the body into the request, this input filter makes it happen.
  */
-AP_DECLARE(apr_status_t) ap_kept_body_filter(ap_filter_t *f, apr_bucket_brigade *b,
-                                             ap_input_mode_t mode, apr_read_type_e block,
-                                             apr_off_t readbytes) {
+static apr_status_t kept_body_filter(ap_filter_t *f, apr_bucket_brigade *b,
+                                     ap_input_mode_t mode, 
+                                     apr_read_type_e block,
+                                     apr_off_t readbytes)
+{
     request_rec *r = f->r;
     apr_bucket_brigade *kept_body = r->kept_body;
     kept_body_ctx_t *ctx = f->ctx;
@@ -307,9 +310,9 @@
  * NOTE: File upload is not yet supported, but can be without change
  * to the function call.
  */
-AP_DECLARE(int) ap_parse_request_form(request_rec * r, ap_filter_t * f, 
-                                      apr_array_header_t ** ptr,
-                                      apr_size_t num, apr_size_t size)
+static int ap_parse_request_form(request_rec * r, ap_filter_t * f, 
+                                 apr_array_header_t ** ptr,
+                                 apr_size_t num, apr_size_t size)
 {
     apr_bucket_brigade *bb = NULL;
     int seen_eos = 0;
@@ -499,20 +502,20 @@
  * 
  * @param r The request
  */
-AP_DECLARE(void) ap_request_insert_filter(request_rec * r)
+static void ap_request_insert_filter(request_rec * r)
 {
     request_dir_conf *conf = ap_get_module_config(r->per_dir_config,
                                                   &request_module);
 
     if (r->kept_body) {
-        if (!request_is_filter_present(r, ap_kept_body_input_filter_handle)) {
-            ap_add_input_filter_handle(ap_kept_body_input_filter_handle,
+        if (!request_is_filter_present(r, kept_body_input_filter_handle)) {
+            ap_add_input_filter_handle(kept_body_input_filter_handle,
                                        NULL, r, r->connection);
         }
     }
     else if (conf->keep_body) {
-        if (!request_is_filter_present(r, ap_kept_body_input_filter_handle)) {
-            ap_add_input_filter_handle(ap_keep_body_input_filter_handle,
+        if (!request_is_filter_present(r, kept_body_input_filter_handle)) {
+            ap_add_input_filter_handle(keep_body_input_filter_handle,
                                        NULL, r, r->connection);
         }
     }
@@ -522,12 +525,12 @@
 /**
  * Remove the kept_body and keep body filters from this specific request.
  */
-AP_DECLARE(void) ap_request_remove_filter(request_rec * r)
+static void ap_request_remove_filter(request_rec * r)
 {
     ap_filter_t * f = r->input_filters;
     while (f) {
-        if (f->frec->filter_func.in_func == ap_kept_body_filter ||
-                f->frec->filter_func.in_func == ap_keep_body_filter) {
+        if (f->frec->filter_func.in_func == kept_body_filter ||
+                f->frec->filter_func.in_func == keep_body_filter) {
             ap_remove_input_filter(f);
         }
         f = f->next;
@@ -579,11 +582,11 @@
 
 static void register_hooks(apr_pool_t *p)
 {
-    ap_keep_body_input_filter_handle =
-        ap_register_input_filter(KEEP_BODY_FILTER, ap_keep_body_filter,
+    keep_body_input_filter_handle =
+        ap_register_input_filter(KEEP_BODY_FILTER, keep_body_filter,
                                  NULL, AP_FTYPE_RESOURCE);
-    ap_kept_body_input_filter_handle =
-        ap_register_input_filter(KEPT_BODY_FILTER, ap_kept_body_filter,
+    kept_body_input_filter_handle =
+        ap_register_input_filter(KEPT_BODY_FILTER, kept_body_filter,
                                  kept_body_filter_init, AP_FTYPE_RESOURCE);
     ap_hook_insert_filter(ap_request_insert_filter, NULL, NULL, APR_HOOK_LAST);
     APR_REGISTER_OPTIONAL_FN(ap_parse_request_form);



Mime
View raw message