@ -692,8 +692,8 @@ static int http_server(void)
second to handle timeouts */
second to handle timeouts */
do {
do {
ret = poll ( poll_table , poll_entry - poll_table , delay ) ;
ret = poll ( poll_table , poll_entry - poll_table , delay ) ;
if ( ret < 0 & & ff_neterrno ( ) ! = FF_NET ERROR( EAGAIN ) & &
if ( ret < 0 & & ff_neterrno ( ) ! = AV ERROR( EAGAIN ) & &
ff_neterrno ( ) ! = FF_NET ERROR( EINTR ) )
ff_neterrno ( ) ! = AV ERROR( EINTR ) )
return - 1 ;
return - 1 ;
} while ( ret < 0 ) ;
} while ( ret < 0 ) ;
@ -916,8 +916,8 @@ static int handle_connection(HTTPContext *c)
read_loop :
read_loop :
len = recv ( c - > fd , c - > buffer_ptr , 1 , 0 ) ;
len = recv ( c - > fd , c - > buffer_ptr , 1 , 0 ) ;
if ( len < 0 ) {
if ( len < 0 ) {
if ( ff_neterrno ( ) ! = FF_NET ERROR( EAGAIN ) & &
if ( ff_neterrno ( ) ! = AV ERROR( EAGAIN ) & &
ff_neterrno ( ) ! = FF_NET ERROR( EINTR ) )
ff_neterrno ( ) ! = AV ERROR( EINTR ) )
return - 1 ;
return - 1 ;
} else if ( len = = 0 ) {
} else if ( len = = 0 ) {
return - 1 ;
return - 1 ;
@ -952,8 +952,8 @@ static int handle_connection(HTTPContext *c)
return 0 ;
return 0 ;
len = send ( c - > fd , c - > buffer_ptr , c - > buffer_end - c - > buffer_ptr , 0 ) ;
len = send ( c - > fd , c - > buffer_ptr , c - > buffer_end - c - > buffer_ptr , 0 ) ;
if ( len < 0 ) {
if ( len < 0 ) {
if ( ff_neterrno ( ) ! = FF_NET ERROR( EAGAIN ) & &
if ( ff_neterrno ( ) ! = AV ERROR( EAGAIN ) & &
ff_neterrno ( ) ! = FF_NET ERROR( EINTR ) ) {
ff_neterrno ( ) ! = AV ERROR( EINTR ) ) {
/* error : close connection */
/* error : close connection */
av_freep ( & c - > pb_buffer ) ;
av_freep ( & c - > pb_buffer ) ;
return - 1 ;
return - 1 ;
@ -1022,8 +1022,8 @@ static int handle_connection(HTTPContext *c)
return 0 ;
return 0 ;
len = send ( c - > fd , c - > buffer_ptr , c - > buffer_end - c - > buffer_ptr , 0 ) ;
len = send ( c - > fd , c - > buffer_ptr , c - > buffer_end - c - > buffer_ptr , 0 ) ;
if ( len < 0 ) {
if ( len < 0 ) {
if ( ff_neterrno ( ) ! = FF_NET ERROR( EAGAIN ) & &
if ( ff_neterrno ( ) ! = AV ERROR( EAGAIN ) & &
ff_neterrno ( ) ! = FF_NET ERROR( EINTR ) ) {
ff_neterrno ( ) ! = AV ERROR( EINTR ) ) {
/* error : close connection */
/* error : close connection */
av_freep ( & c - > pb_buffer ) ;
av_freep ( & c - > pb_buffer ) ;
return - 1 ;
return - 1 ;
@ -1049,8 +1049,8 @@ static int handle_connection(HTTPContext *c)
len = send ( c - > fd , c - > packet_buffer_ptr ,
len = send ( c - > fd , c - > packet_buffer_ptr ,
c - > packet_buffer_end - c - > packet_buffer_ptr , 0 ) ;
c - > packet_buffer_end - c - > packet_buffer_ptr , 0 ) ;
if ( len < 0 ) {
if ( len < 0 ) {
if ( ff_neterrno ( ) ! = FF_NET ERROR( EAGAIN ) & &
if ( ff_neterrno ( ) ! = AV ERROR( EAGAIN ) & &
ff_neterrno ( ) ! = FF_NET ERROR( EINTR ) ) {
ff_neterrno ( ) ! = AV ERROR( EINTR ) ) {
/* error : close connection */
/* error : close connection */
av_freep ( & c - > packet_buffer ) ;
av_freep ( & c - > packet_buffer ) ;
return - 1 ;
return - 1 ;
@ -2550,8 +2550,8 @@ static int http_send_data(HTTPContext *c)
/* TCP data output */
/* TCP data output */
len = send ( c - > fd , c - > buffer_ptr , c - > buffer_end - c - > buffer_ptr , 0 ) ;
len = send ( c - > fd , c - > buffer_ptr , c - > buffer_end - c - > buffer_ptr , 0 ) ;
if ( len < 0 ) {
if ( len < 0 ) {
if ( ff_neterrno ( ) ! = FF_NET ERROR( EAGAIN ) & &
if ( ff_neterrno ( ) ! = AV ERROR( EAGAIN ) & &
ff_neterrno ( ) ! = FF_NET ERROR( EINTR ) )
ff_neterrno ( ) ! = AV ERROR( EINTR ) )
/* error : close connection */
/* error : close connection */
return - 1 ;
return - 1 ;
else
else
@ -2624,8 +2624,8 @@ static int http_receive_data(HTTPContext *c)
len = recv ( c - > fd , c - > buffer_ptr , 1 , 0 ) ;
len = recv ( c - > fd , c - > buffer_ptr , 1 , 0 ) ;
if ( len < 0 ) {
if ( len < 0 ) {
if ( ff_neterrno ( ) ! = FF_NET ERROR( EAGAIN ) & &
if ( ff_neterrno ( ) ! = AV ERROR( EAGAIN ) & &
ff_neterrno ( ) ! = FF_NET ERROR( EINTR ) )
ff_neterrno ( ) ! = AV ERROR( EINTR ) )
/* error : close connection */
/* error : close connection */
goto fail ;
goto fail ;
return 0 ;
return 0 ;
@ -2651,8 +2651,8 @@ static int http_receive_data(HTTPContext *c)
len = recv ( c - > fd , c - > buffer_ptr ,
len = recv ( c - > fd , c - > buffer_ptr ,
FFMIN ( c - > chunk_size , c - > buffer_end - c - > buffer_ptr ) , 0 ) ;
FFMIN ( c - > chunk_size , c - > buffer_end - c - > buffer_ptr ) , 0 ) ;
if ( len < 0 ) {
if ( len < 0 ) {
if ( ff_neterrno ( ) ! = FF_NET ERROR( EAGAIN ) & &
if ( ff_neterrno ( ) ! = AV ERROR( EAGAIN ) & &
ff_neterrno ( ) ! = FF_NET ERROR( EINTR ) )
ff_neterrno ( ) ! = AV ERROR( EINTR ) )
/* error : close connection */
/* error : close connection */
goto fail ;
goto fail ;
} else if ( len = = 0 )
} else if ( len = = 0 )