summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-23 07:31:45 +0000
committerbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-23 07:31:45 +0000
commit646c35a06e71beb4a4b60d312f5bf9d3db088226 (patch)
tree7dea2c2641447018a3f3431444e8eb63cbc8e70e /libmpdemux
parent64ae87b5e49f90321ccc3c17401d1695e9de9c1b (diff)
downloadmpv-646c35a06e71beb4a4b60d312f5bf9d3db088226.tar.bz2
mpv-646c35a06e71beb4a4b60d312f5bf9d3db088226.tar.xz
Fixed the http response parser when the http header only has the HTTP
answer and no field. Fixed some compiler warnings. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4817 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/http.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmpdemux/http.c b/libmpdemux/http.c
index bebdacd7cf..dab354cdf8 100644
--- a/libmpdemux/http.c
+++ b/libmpdemux/http.c
@@ -9,6 +9,7 @@
#include <string.h>
#include "http.h"
+#include "url.h"
HTTP_header_t *
http_new_header() {
@@ -146,6 +147,7 @@ http_response_parse( HTTP_header_t *http_hdr ) {
ptr = hdr_ptr;
while( *ptr!='\r' && *ptr!='\n' ) ptr++;
len = ptr-hdr_ptr;
+ if( len==0 ) break;
field = (char*)realloc(field, len+1);
if( field==NULL ) {
printf("Memory allocation failed\n");
@@ -256,7 +258,6 @@ http_get_field( HTTP_header_t *http_hdr, const char *field_name ) {
char *
http_get_next_field( HTTP_header_t *http_hdr ) {
char *ptr;
- int i;
HTTP_field_t *field;
if( http_hdr==NULL ) return NULL;