# HG changeset patch # User bertrand # Date 1014449505 0 # Node ID f1dea39a50bbd8b51808582c39e27c620e9957e3 # Parent 178b524e521385c44ac8597fb2dba445a350f247 Fixed the http response parser when the http header only has the HTTP answer and no field. Fixed some compiler warnings. diff -r 178b524e5213 -r f1dea39a50bb libmpdemux/http.c --- a/libmpdemux/http.c Sat Feb 23 01:38:06 2002 +0000 +++ b/libmpdemux/http.c Sat Feb 23 07:31:45 2002 +0000 @@ -9,6 +9,7 @@ #include #include "http.h" +#include "url.h" HTTP_header_t * http_new_header() { @@ -146,6 +147,7 @@ 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 @@ char * http_get_next_field( HTTP_header_t *http_hdr ) { char *ptr; - int i; HTTP_field_t *field; if( http_hdr==NULL ) return NULL;