Re: webapp WebAppDeploy root + other webapps

2002-02-03 Thread Troy A. Griffitts

OK, here's a simple patch to make this work.  I hope this is useful and
meets your code requirements:



Troy A. Griffitts wrote:
 
 I've seen many questions about this in the FAQ and none have good
 answers.
 
 Can anyone tell me how I might make this work:
 
 WebAppDeploy sword  warpConnection  /sword
 WebAppDeploy crosswire  warpConnection  /
 
 The crosswire webapp overrides the /sword webapp.
 
 I've seen a response about regular expressions like ^/^(sword) on the
 second WebAppDeploy, but I may have MANY webapps deployed in the future
 and this is not an acceptable means.  mod_webapp should be smart enough
 to resolve webapps accordingly.
 
 Please let me know if there is a solution, or point me to the correct
 place in mod_webapp so I might make the enhancements myself.
 
 Thank you,
 
 -Troy.
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]

diff -Pru webapp-module-1.0.1-tc401.orig/apache-1.3/mod_webapp.c 
webapp-module-1.0.1-tc401/apache-1.3/mod_webapp.c
--- webapp-module-1.0.1-tc401.orig/apache-1.3/mod_webapp.c  Thu Nov  1 15:20:51 
2001
+++ webapp-module-1.0.1-tc401/apache-1.3/mod_webapp.c   Sun Feb  3 01:48:23 2002
@@ -386,6 +386,9 @@
 wa_virtualhost *host=NULL;
 wa_application *appl=NULL;
 wa_chain *elem=NULL;
+wa_chain *matchelem=NULL;
+int matchlen = 0;
+int len = 0;
 
 /* Paranoid check */
 if (!wam_initialized) return(DECLINED);
@@ -398,12 +401,20 @@
 elem=host-apps;
 while(elem!=NULL) {
 appl=(wa_application *)elem-curr;
-if (strncmp(appl-rpth,r-uri,strlen(appl-rpth))==0) break;
-
-appl=NULL;
+len=strlen(appl-rpth);
+if (strncmp(appl-rpth,r-uri,len)==0) {
+/* if we match, let's see if we're more specific than any previous
+   match */
+if (len  matchlen) {
+matchlen=len;
+matchelem=elem;
+}
+}
 elem=elem-next;
 }
-if (appl==NULL) return(DECLINED);
+if (matchelem==NULL) return(DECLINED);
+
+appl=(wa_application *)matchelem-curr;
 
 /* The uri path is matched: set the handler and return */
 r-handler=ap_pstrdup(r-pool,webapp-handler);
diff -Pru webapp-module-1.0.1-tc401.orig/apache-2.0/mod_webapp.c 
webapp-module-1.0.1-tc401/apache-2.0/mod_webapp.c
--- webapp-module-1.0.1-tc401.orig/apache-2.0/mod_webapp.c  Thu Nov  1 15:20:51 
2001
+++ webapp-module-1.0.1-tc401/apache-2.0/mod_webapp.c   Sun Feb  3 01:55:11 2002
@@ -392,6 +392,9 @@
 wa_virtualhost *host=NULL;
 wa_application *appl=NULL;
 wa_chain *elem=NULL;
+wa_chain *matchelem=NULL;
+int matchlen = 0;
+int len = 0;
 
 /* Paranoid check */
 if (!wam_initialized) return(DECLINED);
@@ -404,12 +407,20 @@
 elem=host-apps;
 while(elem!=NULL) {
 appl=(wa_application *)elem-curr;
-if (strncmp(appl-rpth,r-uri,strlen(appl-rpth))==0) break;
-
-appl=NULL;
+len=strlen(appl-rpth);
+if (strncmp(appl-rpth,r-uri,len)==0) {
+/* if we match, let's see if we're more specific than any previous
+   match */
+if (len  matchlen) {
+matchlen=len;
+matchelem=elem;
+}
+}
 elem=elem-next;
 }
-if (appl==NULL) return(DECLINED);
+if (matchelem==NULL) return(DECLINED);
+
+appl=(wa_application *)matchelem-curr;
 
 /* The uri path is matched: set the handler and return */
 r-handler=apr_pstrdup(r-pool,webapp-handler);



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]


webapp WebAppDeploy root + other webapps

2002-02-02 Thread Troy A. Griffitts

I've seen many questions about this in the FAQ and none have good
answers.

Can anyone tell me how I might make this work:

WebAppDeploy sword  warpConnection  /sword
WebAppDeploy crosswire  warpConnection  /



The crosswire webapp overrides the /sword webapp.

I've seen a response about regular expressions like ^/^(sword) on the
second WebAppDeploy, but I may have MANY webapps deployed in the future
and this is not an acceptable means.  mod_webapp should be smart enough
to resolve webapps accordingly.

Please let me know if there is a solution, or point me to the correct
place in mod_webapp so I might make the enhancements myself.


Thank you,

-Troy.

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]