]> granicus.if.org Git - apache/commitdiff
EBCDIC fixes:
authorJeff Trawick <trawick@apache.org>
Mon, 5 Jun 2000 02:26:52 +0000 (02:26 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 5 Jun 2000 02:26:52 +0000 (02:26 +0000)
  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

modules/http/http_protocol.c

index 4eaa06f6c6b3953ff0c6d9b5442ec8beaa817b81..04328179e960915ee4cf4a7b52544f33016f5706 100644 (file)
@@ -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*/