|
|||||||||||
|
[PATCH] Reverse Proxy HTTP Hooks
From: Ian Holsman <IanH(at)cnet.com>
Date: Wed May 16 2001 - 11:28:01 EDT the main reason me doing this via a hook instead of a filter, is that I couldn't see an 'easy' way to tell apache to set filters on a Reverse Proxy call.
#include "mod_proxy.h"
module AP_MODULE_DECLARE_DATA proxy_http_module;
@@ -483,7 +483,7 @@
e = apr_bucket_pool_create(buf, strlen(buf), p);
APR_BRIGADE_INSERT_TAIL(bb, e);
}
- +proxy_http_run_pre_request( r );
/* handle Via */
if (conf->viaopt == via_block) {
/* Block all outgoing Via: headers */ @@ -613,7 +613,7 @@ */
rp = make_fake_req(origin, r);
if (APR_SUCCESS != (rv = ap_proxy_string_read(origin, bb, buffer, sizeof(buffer), &eos))) {
NULL, /* command apr_table_t */
ap_proxy_http_register_hook /* register hooks */
};
+ + +APR_HOOK_STRUCT( + APR_HOOK_LINK(pre_request) + APR_HOOK_LINK(post_request) +) + +APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(proxy_http, PROXY_HTTP, int, pre_request, + (request_rec *r),(r),DECLINED) +APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(proxy_http, PROXY_HTTP, int, post_request, + (request_rec *r),(r),DECLINED) + -- proxy_http.h #ifndef _PROXY_HTTP_H #define _PROXY_HTTP_H 1 #if !defined(WIN32) #define PROXY_HTTP_DECLARE(type) type #define PROXY_HTTP_DECLARE_NONSTD(type) type #define PROXY_HTTP_DECLARE_DATA #elif defined(PROXY__HTTP_DECLARE_STATIC) #define PROXY_HTTP_DECLARE(type) type __stdcall #define PROXY_HTTP_DECLARE_NONSTD(type) type #define PROXY_HTTP_DECLARE_DATA #elif defined(PROXY_HTTP_DECLARE_EXPORT) #define PROXY_HTTP_DECLARE(type) __declspec(dllexport) type __stdcall #define PROXY_HTTP_DECLARE_NONSTD(type) __declspec(dllexport) type #define PROXY_HTTP_DECLARE_DATA __declspec(dllexport) #else #define PROXY_HTTP_DECLARE(type) __declspec(dllimport) type __stdcall #define PROXY_HTTP_DECLARE_NONSTD(type) __declspec(dllimport) type #define PROXY_HTTP_DECLARE_DATA __declspec(dllimport)#endif /* typedef int proxy_http_HOOK_pre_request_t (request_rec *r); PROXY_HTTP_DECLARE(void) proxy_http_hook_pre_request(proxy_http_HOOK_pre_request_t *pf, const char * const *aszPre, const char * const *aszSucc, int nOrder); PROXY_HTTP_DECLARE(int) proxy_http_run_pre_request (request_rec *r); PROXY_HTTP_DECLARE(apr_array_header_t *) proxy_http_hook_get_pre_request(void); typedef struct proxy_http_LINK_pre_request_t { proxy_http_HOOK_pre_request_t *pFunc; const char *szName; const char * const *aszPredecessors; const char * const *aszSuccessors; int nOrder; } proxy_http_LINK_pre_request_t;
typedef int proxy_http_HOOK_post_request_t (request_rec *r); PROXY_HTTP_DECLARE(void) proxy_http_hook_post_request(proxy_http_HOOK_post_request_t *pf, const char * const *aszPre, const char * const *aszSucc, int nOrder); PROXY_HTTP_DECLARE(int) proxy_http_run_post_request (request_rec *r); PROXY_HTTP_DECLARE(apr_array_header_t *) proxy_http_hook_get_post_request(void); typedef struct proxy_http_LINK_post_request_t { proxy_http_HOOK_post_request_t *pFunc; const char *szName; const char * const *aszPredecessors; const char * const *aszSuccessors; int nOrder; } proxy_http_LINK_post_request_t;
*/
(request_rec *r))
APR_DECLARE_EXTERNAL_HOOK(proxy_http, PROXY_HTTP, int, post_request,
(request_rec *r))
#endif /* PROXY_HTTP */ -- Ian Holsman Performance Measurement & Analysis 415-364-8608Received on Wed May 16 15:34:28 2001 This archive was generated by hypermail 2.1.8 : Thu Aug 24 2006 - 14:53:16 EDT |
||||||||||
|
|||||||||||