At 01:13 AM 12/23/2004, William A. Rowe, Jr. wrote:
>At 03:36 AM 12/17/2004, Mladen Turk wrote:
>
>>The 1.2.8-rc-1 will add no new features.
>>
>That's cool, but the handling of in_addr_t is totally bogus and
>has been for some time.  Some platforms declare struct in_addr_t 
>as a typedef - but others don't.  The crossplatform solution is
>to ignore the typedef and use in_addr_t, but instead, the code
>currently does some crap with uint for win32 and ignores HP/UX
>and a host of other platforms.

I ment use struct in_addr.  In any case, attached is the patch
for your perusal - it fixes one other non-conformant typedef
(that didn't match the pattern throughout jk) in jk_pool.h.
Please consider both for a much cleaner source pattern.

Bill

Index: jk/native/common/jk_connect.c
===================================================================
RCS file: 
/var/covalent/.CVS/apache-cvs/jakarta-tomcat-connectors-cvs/jk/native/common/jk_connect.c,v
retrieving revision 1.35
diff -u -r1.35 jk_connect.c
--- jk/native/common/jk_connect.c       17 Dec 2004 14:58:37 -0000      1.35
+++ jk/native/common/jk_connect.c       23 Dec 2004 07:43:30 -0000
@@ -35,10 +35,6 @@
 #include "apr_general.h"
 #endif
 
-#if defined(WIN32)
-typedef u_long in_addr_t;
-#endif
-
 #if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__))
 #define JK_IS_SOCKET_ERROR(x) ((x) == SOCKET_ERROR)
 #define JK_GET_SOCKET_ERRNO() errno = WSAGetLastError() - WSABASEERR
@@ -53,15 +49,7 @@
 int jk_resolve(char *host, int port, struct sockaddr_in *rc)
 {
     int x;
-
-    /* TODO: Should be updated for IPV6 support. */
-    /* for now use the correct type, in_addr_t */
-    /* except on NetWare since the MetroWerks compiler is so strict */
-#if defined(NETWARE)
-    u_long laddr;
-#else
-    in_addr_t laddr;
-#endif
+    struct in_addr laddr;
 
     memset(rc, 0, sizeof(struct sockaddr_in));
 
@@ -119,13 +107,13 @@
             return JK_FALSE;
         }
 
-        laddr = ((struct in_addr *)hoste->h_addr_list[0])->s_addr;
+        laddr = *((struct in_addr *)hoste->h_addr_list[0]);
 
 #endif /* HAVE_APR */
     }
     else {
         /* If we found only digits we use inet_addr() */
-        laddr = inet_addr(host);
+        laddr.s_addr = inet_addr(host);
     }
     memcpy(&(rc->sin_addr), &laddr, sizeof(laddr));
 
Index: jk/native/common/jk_pool.h
===================================================================
RCS file: 
/var/covalent/.CVS/apache-cvs/jakarta-tomcat-connectors-cvs/jk/native/common/jk_pool.h,v
retrieving revision 1.9
diff -u -r1.9 jk_pool.h
--- jk/native/common/jk_pool.h  8 Nov 2004 13:32:56 -0000       1.9
+++ jk/native/common/jk_pool.h  23 Dec 2004 07:43:30 -0000
@@ -93,9 +93,8 @@
 #define BIG_POOL_SIZE   2*SMALL_POOL_SIZE       /* Bigger 1K atom pool. */
 #define HUGE_POOL_SIZE  2*BIG_POOL_SIZE /* Huge 2K atom pool. */
 
-    typedef struct jk_pool_t jk_pool_t;
 /** jk pool structure */
-struct jk_pool_t
+struct jk_pool
 {
     size_t size;
     size_t pos;
@@ -104,6 +103,8 @@
     size_t dyn_pos;
     void **dynamic;
 };
+
+typedef struct jk_pool jk_pool_t;
 
 void jk_open_pool(jk_pool_t *p, jk_pool_atom_t *buf, size_t size);
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to