You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@attglobal.net> on 2002/07/10 14:29:03 UTC

[PATCH] define proxy-specific hook macros

This defines macros similar to the AP_ counterparts in ap_config.h.  I
was playing with a new proxy hook and optionally implementing the hook
in a non-proxy module when I encountered the need to use APR_ hook
macros to make it work.

It would seem to be consistent and friendly to define these new PROXY_
hook macros, but it is not absolutely required.

Opinions?

Index: modules/proxy/mod_proxy.h
===================================================================
RCS file: /cvs/phoenix/2.0.39/modules/proxy/mod_proxy.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 mod_proxy.h
--- modules/proxy/mod_proxy.h	20 Jun 2002 13:12:20 -0000	1.1.1.1
+++ modules/proxy/mod_proxy.h	10 Jul 2002 12:13:42 -0000
@@ -241,6 +241,21 @@
 #define PROXY_DECLARE_DATA             __declspec(dllimport)
 #endif
 
+/**
+ * Hook an optional proxy hook.  Unlike static hooks, this uses a macro
+ * instead of a function.
+ */
+#define PROXY_OPTIONAL_HOOK(name,fn,pre,succ,order) \
+        APR_OPTIONAL_HOOK(proxy,name,fn,pre,succ,order)
+/**
+ * Declare a proxy hook function
+ * @param ret The return type of the hook
+ * @param name The hook's name (as a literal)
+ * @param args The arguments the hook function takes, in brackets.
+ */
+#define PROXY_DECLARE_HOOK(ret,name,args) \
+	APR_DECLARE_EXTERNAL_HOOK(proxy,PROXY,ret,name,args)
+
 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, scheme_handler, (request_rec *r, 
                           proxy_server_conf *conf, char *url, 
                           const char *proxyhost, apr_port_t proxyport))
@@ -249,6 +264,9 @@
 
 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, create_req, (request_rec *r, request_rec *pr))
 APR_DECLARE_EXTERNAL_HOOK(proxy, PROXY, int, fixups, (request_rec *r)) 
 
 /* proxy_util.c */
 

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Re: [PATCH] define proxy-specific hook macros

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 07:29 AM 7/10/2002, you wrote:
>This defines macros similar to the AP_ counterparts in ap_config.h.  I
>was playing with a new proxy hook and optionally implementing the hook
>in a non-proxy module when I encountered the need to use APR_ hook
>macros to make it work.
>
>It would seem to be consistent and friendly to define these new PROXY_
>hook macros, but it is not absolutely required.

Nope, not required.  But we have grown quite a few hooks over in Proxy,
haven't we :-?

+1.

Bill