diff options
author | Jeff Trawick <trawick@apache.org> | 2000-10-26 12:48:28 +0200 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2000-10-26 12:48:28 +0200 |
commit | 6217bc8f88fe0a734478a70b872fa5bb062dd559 (patch) | |
tree | 3df3d2866a7d6406244389ce4a36dacd99a7bcb4 /server | |
parent | Get rid of the xlate version of ap_md5_digest() (diff) | |
download | apache2-6217bc8f88fe0a734478a70b872fa5bb062dd559.tar.xz apache2-6217bc8f88fe0a734478a70b872fa5bb062dd559.zip |
Introduce ap_xlate_proto_{to|from}_ascii() to clean up some of
the EBCDIC support. They are noops on ASCII machines, so this
type of translation doesn't have to be surrounded by #ifdef
CHARSET_EBCDIC.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86751 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/rfc1413.c | 17 | ||||
-rw-r--r-- | server/util_ebcdic.c | 18 |
2 files changed, 21 insertions, 14 deletions
diff --git a/server/rfc1413.c b/server/rfc1413.c index 7a8cc102f6..500553334c 100644 --- a/server/rfc1413.c +++ b/server/rfc1413.c @@ -119,9 +119,6 @@ static int get_rfc1413(apr_socket_t *sock, const char *local_ip, char *cp; char buffer[RFC1413_MAXDATA + 1]; int buflen; -#ifdef CHARSET_EBCDIC - apr_size_t inbytes_left, outbytes_left; -#endif /* * Bind the local and remote ends of the query socket to the same @@ -156,11 +153,7 @@ static int get_rfc1413(apr_socket_t *sock, const char *local_ip, /* send the data */ buflen = apr_snprintf(buffer, sizeof(buffer), "%u,%u\r\n", sav_rmt_port, sav_our_port); -#ifdef CHARSET_EBCDIC - inbytes_left = outbytes_left = buflen; - apr_xlate_conv_buffer(ap_hdrs_to_ascii, buffer, &inbytes_left, - buffer, &outbytes_left); -#endif + ap_xlate_proto_to_ascii(buffer, buflen); /* send query to server. Handle short write. */ i = 0; @@ -180,7 +173,7 @@ static int get_rfc1413(apr_socket_t *sock, const char *local_ip, /* * Read response from server. - the response should be newline - * terminated according to rfc - make sure it doesn't stomp it's + * terminated according to rfc - make sure it doesn't stomp its * way out of the buffer. */ @@ -209,11 +202,7 @@ static int get_rfc1413(apr_socket_t *sock, const char *local_ip, } /* RFC1413_USERLEN = 512 */ -#ifdef CHARSET_EBCDIC - inbytes_left = outbytes_left = i; - apr_xlate_conv_buffer(ap_hdrs_from_ascii, buffer, &inbytes_left, - buffer, &outbytes_left); -#endif + ap_xlate_proto_from_ascii(buffer, i); if (sscanf(buffer, "%u , %u : USERID :%*[^:]:%512s", &rmt_port, &our_port, user) != 3 || sav_rmt_port != rmt_port || sav_our_port != our_port) diff --git a/server/util_ebcdic.c b/server/util_ebcdic.c index 525ea170ba..51830d77c2 100644 --- a/server/util_ebcdic.c +++ b/server/util_ebcdic.c @@ -123,4 +123,22 @@ apr_status_t ap_init_ebcdic(apr_pool_t *pool) return APR_SUCCESS; } +void ap_xlate_proto_to_ascii(char *buffer, apr_size_t len) +{ + apr_size_t inbytes_left, outbytes_left; + + inbytes_left = outbytes_left = len; + apr_xlate_conv_buffer(ap_hdrs_to_ascii, buffer, &inbytes_left, + buffer, &outbytes_left); +} + +void ap_xlate_proto_from_ascii(char *buffer, apr_size_t len) +{ + apr_size_t inbytes_left, outbytes_left; + + inbytes_left = outbytes_left = len; + apr_xlate_conv_buffer(ap_hdrs_from_ascii, buffer, &inbytes_left, + buffer, &outbytes_left); +} + #endif /* CHARSET_EBCDIC */ |