tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Günter Knauf <efl...@gmx.net>
Subject compile mod_jk/mod_jk2 with APR 1.0 - Take 3
Date Thu, 29 Jan 2004 12:05:45 GMT
Hi,
With APR 1.0 apr_sockaddr_port_get() was removed without replacement. 
I believe that the patch below is the correct replacement to archive _same_ behaviour as with
apr_sockaddr_port_get() before, and I tested that it also works with APR 0.9.x (Apache 2.0.48
tested); 
and here's also a reference to the httpd-2.0 sources:
http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/proxy/proxy_ftp.c?r1=1.134&r2=1.135

===================================================================
# patch for APR 1.0 compatiblity
#
--- jk_service_apache2.c.orig	Tue Sep 30 18:16:14 2003
+++ jk_service_apache2.c	Wed Jan 21 17:43:14 2004
@@ -343,7 +343,6 @@
 static int JK_METHOD jk2_init_ws_service(jk_env_t *env, jk_ws_service_t *s,
                                          jk_worker_t *worker, void *serverObj)
 {
-    apr_port_t port;
     char *ssl_temp      = NULL;
     jk_workerEnv_t *workerEnv;
     request_rec *r=serverObj;
@@ -377,8 +376,7 @@
                              r->server->server_hostname);
 
     /* get the real port (otherwise redirect failed) */
-    apr_sockaddr_port_get(&port,r->connection->local_addr);
-    s->server_port = port;
+    s->server_port = r->connection->local_addr->port;
 
     s->server_software = (char *)ap_get_server_version();

===================================================================
--- mod_jk.c.orig	Wed Nov 05 12:15:18 2003
+++ mod_jk.c	Tue Jan 27 22:46:30 2004
@@ -482,8 +482,6 @@
 {
     request_rec *r      = private_data->r;
 
-    apr_port_t port;
-
     char *ssl_temp      = NULL;
     s->jvm_route        = NULL;    /* Used for sticky session routing */
 
@@ -518,8 +516,7 @@
     s->server_name  = (char *)ap_get_server_name(r);
 
     /* get the real port (otherwise redirect failed) */
-    apr_sockaddr_port_get(&port,r->connection->local_addr);
-    s->server_port = port;
+    s->server_port = r->connection->local_addr->port;
     /* XXX : à la jk2 ???*/
     /* s->server_port  = ap_get_server_port(r); */

===================================================================

patches available here (my attachments are replaced by the nice list trailer):
http://www.gknw.com/test/jk_service_apache2.c.diff
http://www.gknw.com/test/mod_jk.c.diff

Guenter.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message