From: Jeff Trawick Date: Mon, 5 Jun 2000 02:26:52 +0000 (+0000) Subject: EBCDIC fixes: X-Git-Tag: APACHE_2_0_ALPHA_4~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f2851fe62b044f9d53fc6542ff22d71a174cbba8;p=thirdparty%2Fapache%2Fhttpd.git EBCDIC fixes: getline(): pick up a couple of Martin's changes which were missed when the 1.3.x EBCDIC fixes to this funciton were merged into 2.0 ap_setup_client_block(): fix the logic that, based on the mime type, can decide not to translate the request body git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85406 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 4eaa06f6c6b..04328179e96 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -759,8 +759,10 @@ static int getline(char *s, int n, BUFF *in, int fold) retval = ap_bgets(pos, n, in); /* retval == -1 if error, 0 if EOF */ - if (retval <= 0) - return ((retval < 0) && (total == 0)) ? -1 : total; + if (retval <= 0) { + total = ((retval < 0) && (total == 0)) ? -1 : total; + break; + } /* retval is the number of characters read, not including NUL */ @@ -785,7 +787,7 @@ static int getline(char *s, int n, BUFF *in, int fold) ++n; } else - return total; /* if not, input line exceeded buffer size */ + break; /* if not, input line exceeded buffer size */ /* Continue appending if line folding is desired and * the last line was not empty and we have room in the buffer and @@ -1873,7 +1875,12 @@ API_EXPORT(int) ap_setup_client_block(request_rec *r, int read_policy) strncasecmp(typep, "multipart/", 10) == 0 || strcasecmp (typep, "application/x-www-form-urlencoded") == 0 ); - ap_bsetopt(r->connection->client, BO_RXLATE, ap_locale_from_ascii); + /* By default, we translate content on input. Turn off translation + * if it isn't text. + */ + if (!convert_in) { + ap_set_content_xlate(r, 0, NULL); + } } #endif /*CHARSET_EBCDIC*/