]> granicus.if.org Git - apache/commitdiff
Back out a patch that wasn't ready for inclusion. Thanks to OtherBill
authorRyan Bloom <rbb@apache.org>
Tue, 7 Aug 2001 16:40:25 +0000 (16:40 +0000)
committerRyan Bloom <rbb@apache.org>
Tue, 7 Aug 2001 16:40:25 +0000 (16:40 +0000)
for pointing out that this was committed when it shouldn't have been.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89990 13f79535-47bb-0310-9956-ffa450edef68

server/protocol.c

index 305ca53e6769c8b72171540bf5d7e2991e69ceac..edb9a9786f0f6642c7a3f702cbb71ab3ca83acbd 100644 (file)
@@ -1135,30 +1135,14 @@ AP_DECLARE(int) ap_rwrite(const void *buf, int nbyte, request_rec *r)
 
 AP_DECLARE(int) ap_vrprintf(request_rec *r, const char *fmt, va_list va)
 {
-    char *buf;
-    int   buf_size = 4096; /* start with a 4k buffer */
+    char buf[4096];
     apr_size_t written;
 
     if (r->connection->aborted)
         return -1;
 
-    buf = apr_palloc(r->pool, buf_size);
-    while (1) {
-       written = apr_vsnprintf(buf, buf_size, fmt, va);
-
-       /*
-        * Per the apr_vsnprintf comments, in no event does apr_snprintf return a negative number.
-        * Therefore, it's not possible to distinguish between an output which was truncated,
-        * and an output which exactly filled the buffer.
-        */
-       if (written == buf_size) {
-           buf_size *= 2;
-           buf = apr_palloc(r->pool, buf_size); /* want realloc */
-       }
-       else {
-           break;
-       }
-    }
+    /* ### fix this mechanism to allow more than 4K of output */
+    written = apr_vsnprintf(buf, sizeof(buf), fmt, va);
 
     if (buffer_output(r, buf, written) != APR_SUCCESS)
         return -1;