mturk 2004/08/03 06:19:39 Modified: ajp/proxy mod_proxy.c Log: Allow parsing lbfactor for ProxyPassReverse in the form ProxyPassReverse scheme://uri/path(lbfactor). The lbfactor is number 1...100 inside braces. Revision Changes Path 1.4 +22 -0 jakarta-tomcat-connectors/ajp/proxy/mod_proxy.c Index: mod_proxy.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/proxy/mod_proxy.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- mod_proxy.c 3 Aug 2004 12:10:56 -0000 1.3 +++ mod_proxy.c 3 Aug 2004 13:19:39 -0000 1.4 @@ -28,6 +28,8 @@ APR_DECLARE_OPTIONAL_FN(int, ssl_engine_disable, (conn_rec *)); #endif +module AP_MODULE_DECLARE_DATA proxy_module; + #ifndef MAX #define MAX(x,y) ((x) >= (y) ? (x) : (y)) #endif @@ -624,10 +626,29 @@ char *r, *f, *scheme; regex_t *reg = NULL; int port; + char *lb; + int lbfactor = 0; r = apr_pstrdup(cmd->pool, r1); scheme = apr_pstrdup(cmd->pool, r1); f = apr_pstrdup(cmd->pool, f1); + lb = strchr(r, '('); + if (lb) { + char *rb; + if (!(rb = strchr(lb + 1, ')'))) { + if (regex) + return "ProxyRemoteMatch: Bad syntax for a remote proxy server (missing right brace)"; + else + return "ProxyRemote: Bad syntax for a remote proxy server (missing right brace)"; + } + if (sscanf(lb + 1, "%d", &lbfactor) != 1 || lbfactor > 100 || lbfactor < 1) { + if (regex) + return "ProxyRemoteMatch: Bad syntax for a remote proxy server (bad lbfactor number)"; + else + return "ProxyRemote: Bad syntax for a remote proxy server (bad lbfactor number)"; + } + *lb = '\0'; + } p = strchr(r, ':'); if (p == NULL || p[1] != '/' || p[2] != '/' || p[3] == '\0') { if (regex) @@ -672,6 +693,7 @@ new->port = port; new->regexp = reg; new->use_regex = regex; + new->lbfactor = lbfactor; return NULL; }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]