tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From G√ľnter Knauf <efl...@gmx.net>
Subject Re: [PATHCH] ./jk/native2/server/apache2/jk_service_apache2.c
Date Thu, 22 Jan 2004 20:08:48 GMT
Hi Henri,
> Thanks to resubmit the latest patch for jk/jk2 on Apache 2 to see if
> everybody agree
ok.
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):
# 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();

===================================================================
There's an outstanding patch in bugzilla:
http://nagoya.apache.org/bugzilla/showattachment.cgi?attach_id=8969

--- jk/native2/server/apache2/jk_service_apache2.c 30 Sep 2003 13:42:02 -00001.36
+++ jk/native2/server/apache2/jk_service_apache2.c 7 Nov 2003 00:20:16 -0000
@@ -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;
@@ -373,12 +372,10 @@
     s->remote_addr  = NULL_FOR_EMPTY(r->connection->remote_ip);
 
     /* get server name */
-    s->server_name= (char *)(r->hostname ? r->hostname :
-                             r->server->server_hostname);
+    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 = ap_get_server_port(r);
 
     s->server_software = (char *)ap_get_server_version();
 
with this patch I'm also fine since it uses an API which still exists in APR 1.0 (just compiled
with httpd-2.1-dev); but since I've no NAT setup for testing the issue described in bugzilla
I cant tell if the patch solves the isssue, nor if it hurts something else....
but according to the 5 votes in bugzilla it seems to solve their problems, so I tend to this
patch now ...

once it is decided what we use now, I will create the other patches for mod_jk again...


thanks, 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