Author: hgomez
Date: Mon Apr 23 02:24:21 2007
New Revision: 531393
URL: http://svn.apache.org/viewvc?view=rev&rev=531393
Log:
Convert datas to EBCDIC before calling inet_addr on i5/OS V5R4
Modified:
tomcat/connectors/trunk/jk/native/common/jk_connect.c
Modified: tomcat/connectors/trunk/jk/native/common/jk_connect.c
URL:
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_connect.c?view=diff&rev=531393&r1=531392&r2=531393
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_connect.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_connect.c Mon Apr 23 02:24:21
2007
@@ -270,6 +270,11 @@
return JK_FALSE;
apr_sockaddr_ip_get(&remote_ipaddr, remote_sa);
+
+ /* i5/OS V5R4 need EBCDIC for its runtime calls but APR/APACHE
works in UTF */
+#if defined(AS400) && !defined(AS400_UTF8)
+ jk_ascii2ebcdic(remote_ipaddr);
+#endif
laddr.s_addr = inet_addr(remote_ipaddr);
#else /* HAVE_APR */
@@ -290,6 +295,10 @@
#endif /* HAVE_APR */
}
else {
+ /* i5/OS V5R4 need EBCDIC for its runtime calls but APR/APACHE
works in UTF */
+#if defined(AS400) && !defined(AS400_UTF8)
+ jk_ascii2ebcdic(remote_ipaddr);
+#endif
/* If we found only digits we use inet_addr() */
laddr.s_addr = inet_addr(host);
}
@@ -635,12 +644,12 @@
/* Wait one microsecond */
tv.tv_sec = 0;
tv.tv_usec = 1;
-
+
do {
rc = select((int)sock + 1, &fd, NULL, NULL, &tv);
#if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__))
errno = WSAGetLastError() - WSABASEERR;
-#endif
+#endif
} while (rc == -1 && errno == EINTR);
if (rc == 0) {
@@ -663,7 +672,7 @@
if (ioctl(sock, FIONREAD, (void*)&nr) == 0) {
return nr == 0 ? 0 : 1;
}
-#endif
+#endif
}
return 0;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]