This is a better patch, it also covers the deprecated code that still exists in the HAVE_APR path.
At 01:46 AM 12/23/2004, William A. Rowe, Jr. wrote: >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 > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED]
? .flavour_complete ? foo ? patch ? jk/native/apache-2.0/Debug ? jk/native/apache-2.0/Release ? jk/native/apache-2.0/mod_jk.dsw ? jk/native/apache-2.0/mod_jk.ncb ? jk/native/apache-2.0/mod_jk.opt ? jk/native/apache-2.0/mod_jk.plg ? jk/native/nt_service/Release ? jk/native/nt_service/nt_service.plg 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:50:22 -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)); @@ -105,7 +93,7 @@ return JK_FALSE; apr_sockaddr_ip_get(&remote_ipaddr, remote_sa); - laddr = inet_addr(remote_ipaddr); + laddr.s_addr = inet_addr(remote_ipaddr); /* May be we could avoid to delete it each time ? */ apr_pool_destroy(context); @@ -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:50:22 -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]