comparison libmpdemux/asf_streaming.c @ 10206:35e306346e59

Using recv/send instead read/write for proper MinGW support (it's a 4.2BSD standard). Patch by FloDt <flodt8@yahoo.de>
author alex
date Thu, 29 May 2003 19:36:58 +0000
parents 58e5880f4788
children 54bcbf28698a
comparison
equal deleted inserted replaced
10205:a8aad67823db 10206:35e306346e59
654 if( fd<0 ) return fd; 654 if( fd<0 ) return fd;
655 655
656 http_hdr = asf_http_request( stream->streaming_ctrl ); 656 http_hdr = asf_http_request( stream->streaming_ctrl );
657 mp_msg(MSGT_NETWORK,MSGL_DBG2,"Request [%s]\n", http_hdr->buffer ); 657 mp_msg(MSGT_NETWORK,MSGL_DBG2,"Request [%s]\n", http_hdr->buffer );
658 for(i=0; i < (int)http_hdr->buffer_size ; ) { 658 for(i=0; i < (int)http_hdr->buffer_size ; ) {
659 int r = write( fd, http_hdr->buffer+i, http_hdr->buffer_size-i ); 659 int r = send( fd, http_hdr->buffer+i, http_hdr->buffer_size-i, 0 );
660 if(r <0) { 660 if(r <0) {
661 mp_msg(MSGT_NETWORK,MSGL_ERR,"Socket write error : %s\n",strerror(errno)); 661 mp_msg(MSGT_NETWORK,MSGL_ERR,"Socket write error : %s\n",strerror(errno));
662 return -1; 662 return -1;
663 } 663 }
664 i += r; 664 i += r;
665 } 665 }
666 http_free( http_hdr ); 666 http_free( http_hdr );
667 http_hdr = http_new_header(); 667 http_hdr = http_new_header();
668 do { 668 do {
669 i = read( fd, buffer, BUFFER_SIZE ); 669 i = recv( fd, buffer, BUFFER_SIZE, 0 );
670 //printf("read: %d\n", i ); 670 //printf("read: %d\n", i );
671 if( i<=0 ) { 671 if( i<=0 ) {
672 perror("read"); 672 perror("read");
673 http_free( http_hdr ); 673 http_free( http_hdr );
674 return -1; 674 return -1;