From: Dmitry Stogov Date: Fri, 20 Feb 2004 15:38:39 +0000 (+0000) Subject: BUGFIX: bug in HTTP chunked encoding was fixed X-Git-Tag: RELEASE_0_2_0~246 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8fc285275c7cf23fb69900a7cce5a09856bd46e9;p=php BUGFIX: bug in HTTP chunked encoding was fixed --- diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 70a96fdd6c..137e50f715 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -662,11 +662,11 @@ static int get_http_body(php_stream *stream, char *headers, char **response, in while (!done) { int buf_size = 0; - php_stream_gets(stream, chunk_size, sizeof(chunk_size)); + php_stream_gets(stream, chunk_size, sizeof(chunk_size)); if (sscanf(chunk_size, "%x", &buf_size) > 0 ) { if (buf_size > 0) { int len_size = 0; - + http_buf = erealloc(http_buf, http_buf_size + buf_size + 1); while (len_size < buf_size) { @@ -677,14 +677,14 @@ static int get_http_body(php_stream *stream, char *headers, char **response, in break; } len_size += len_read; - http_buf_size += len_size; + http_buf_size += len_read; } } - + /* Eat up '\r' '\n' */ php_stream_getc(stream); php_stream_getc(stream); - } else { + } else { /* Somthing wrong in chunked encoding */ efree(http_buf); return FALSE;