]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check that grow_headerspace added enough space or re-call it
authorMark Andrews <marka@isc.org>
Tue, 16 Nov 2010 00:51:41 +0000 (00:51 +0000)
committerMark Andrews <marka@isc.org>
Tue, 16 Nov 2010 00:51:41 +0000 (00:51 +0000)
lib/isc/httpd.c

index b10ef3802eb0037a58c8f790e85d865c20fec513..8c71b5541ce5986c7ebae384ad6cce10b29c103d 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: httpd.c,v 1.18 2010/02/04 23:49:13 tbox Exp $ */
+/* $Id: httpd.c,v 1.19 2010/11/16 00:51:41 marka Exp $ */
 
 /*! \file */
 
@@ -821,7 +821,7 @@ isc_httpd_response(isc_httpd_t *httpd)
        needlen += 3 + 1;  /* room for response code, always 3 bytes */
        needlen += strlen(httpd->retmsg) + 2;  /* return msg + CRLF */
 
-       if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
+       while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
                result = grow_headerspace(httpd);
                if (result != ISC_R_SUCCESS)
                        return (result);
@@ -846,7 +846,7 @@ isc_httpd_addheader(isc_httpd_t *httpd, const char *name,
                needlen += 2 + strlen(val); /* :<space> and val */
        needlen += 2; /* CRLF */
 
-       if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
+       while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
                result = grow_headerspace(httpd);
                if (result != ISC_R_SUCCESS)
                        return (result);
@@ -869,7 +869,7 @@ isc_httpd_endheaders(isc_httpd_t *httpd)
 {
        isc_result_t result;
 
-       if (isc_buffer_availablelength(&httpd->headerbuffer) < 2) {
+       while (isc_buffer_availablelength(&httpd->headerbuffer) < 2) {
                result = grow_headerspace(httpd);
                if (result != ISC_R_SUCCESS)
                        return (result);
@@ -893,7 +893,7 @@ isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val) {
        needlen += 2 + strlen(buf); /* :<space> and val */
        needlen += 2; /* CRLF */
 
-       if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
+       while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
                result = grow_headerspace(httpd);
                if (result != ISC_R_SUCCESS)
                        return (result);