summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-23 08:46:22 +0000
committerbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-23 08:46:22 +0000
commitfcc41f6043584f7d44c5a0e77f3ec3136a3efc33 (patch)
tree40dff88106ac38860becbf3f58d9a595262b8595
parentcb5dbade4c8230d43d2cd5a1881039dce4e4c9c5 (diff)
downloadmpv-fcc41f6043584f7d44c5a0e77f3ec3136a3efc33.tar.bz2
mpv-fcc41f6043584f7d44c5a0e77f3ec3136a3efc33.tar.xz
Modified the output of the http_debug function.
Fixed a bug in the reading of the "reason answer" git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4312 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libmpdemux/http.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libmpdemux/http.c b/libmpdemux/http.c
index bcec792b52..bebdacd7cf 100644
--- a/libmpdemux/http.c
+++ b/libmpdemux/http.c
@@ -124,6 +124,9 @@ http_response_parse( HTTP_header_t *http_hdr ) {
return -1;
}
strncpy( http_hdr->reason_phrase, hdr_ptr, len );
+ if( http_hdr->reason_phrase[len-1]=='\r' ) {
+ len--;
+ }
http_hdr->reason_phrase[len]='\0';
// Set the position of the header separator: \r\n\r\n
@@ -329,12 +332,14 @@ http_debug_hdr( HTTP_header_t *http_hdr ) {
int i = 0;
if( http_hdr==NULL ) return;
- printf("protocol: %s\n", http_hdr->protocol );
- printf("http minor version: %d\n", http_hdr->http_minor_version );
- printf("uri: %s\n", http_hdr->uri );
- printf("method: %s\n", http_hdr->method );
- printf("status code: %d\n", http_hdr->status_code );
- printf("reason phrase: %s\n", http_hdr->reason_phrase );
+ printf("--- HTTP DEBUG HEADER --- START ---\n");
+ printf("protocol: [%s]\n", http_hdr->protocol );
+ printf("http minor version: [%d]\n", http_hdr->http_minor_version );
+ printf("uri: [%s]\n", http_hdr->uri );
+ printf("method: [%s]\n", http_hdr->method );
+ printf("status code: [%d]\n", http_hdr->status_code );
+ printf("reason phrase: [%s]\n", http_hdr->reason_phrase );
+ printf("body size: [%d]\n", http_hdr->body_size );
printf("Fields:\n");
field = http_hdr->first_field;
@@ -342,4 +347,5 @@ http_debug_hdr( HTTP_header_t *http_hdr ) {
printf(" %d - %s\n", i++, field->field_name );
field = field->next;
}
+ printf("--- HTTP DEBUG HEADER --- END ---\n");
}