summaryrefslogtreecommitdiffstats
path: root/libmpdemux/asf_streaming.c
diff options
context:
space:
mode:
authorbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-14 20:45:30 +0000
committerbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-14 20:45:30 +0000
commit3ea29912ef6367871359b6d2d66f23a1fc4e9c5c (patch)
tree01f4d0f63b788c4d59115c86736c23b15c0831b9 /libmpdemux/asf_streaming.c
parent5b38c5c2515efe76b35259b817bcbb9deebf09bf (diff)
downloadmpv-3ea29912ef6367871359b6d2d66f23a1fc4e9c5c.tar.bz2
mpv-3ea29912ef6367871359b6d2d66f23a1fc4e9c5c.tar.xz
Applied the patch from Alban Bedel <albeu@free.fr>.
He added some errors checking on network code. Added a check on the port number parsing in the url. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3495 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/asf_streaming.c')
-rw-r--r--libmpdemux/asf_streaming.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libmpdemux/asf_streaming.c b/libmpdemux/asf_streaming.c
index 37ca079b16..47d8e2d337 100644
--- a/libmpdemux/asf_streaming.c
+++ b/libmpdemux/asf_streaming.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <errno.h>
#include "config.h"
@@ -468,13 +469,16 @@ asf_http_streaming_start( stream_t *stream ) {
//http_hdr = asf_http_request( url );
http_hdr = asf_http_request( stream->streaming_ctrl );
printf("Request [%s]\n", http_hdr->buffer );
- write( fd, http_hdr->buffer, http_hdr->buffer_size );
-printf("1\n");
+ for(i=0; i < http_hdr->buffer_size ; ) {
+ int r = write( fd, http_hdr->buffer+i, http_hdr->buffer_size-i );
+ if(r <0) {
+ printf("Socket write error : %s\n",strerror(errno));
+ return -1;
+ }
+ i += r;
+ }
// http_free( http_hdr );
-printf("2\n");
-
http_hdr = http_new_header();
-printf("3\n");
do {
i = read( fd, buffer, BUFFER_SIZE );
printf("read: %d\n", i );