|
|
|
@ -588,7 +588,8 @@ static int http_server(void) |
|
|
|
|
second to handle timeouts */ |
|
|
|
|
do { |
|
|
|
|
ret = poll(poll_table, poll_entry - poll_table, delay); |
|
|
|
|
if (ret < 0 && errno != EAGAIN && errno != EINTR) |
|
|
|
|
if (ret < 0 && ff_neterrno() != FF_NETERROR(EAGAIN) && |
|
|
|
|
ff_neterrno() != FF_NETERROR(EINTR)) |
|
|
|
|
return -1; |
|
|
|
|
} while (ret < 0); |
|
|
|
|
|
|
|
|
@ -791,7 +792,8 @@ static int handle_connection(HTTPContext *c) |
|
|
|
|
read_loop: |
|
|
|
|
len = recv(c->fd, c->buffer_ptr, 1, 0); |
|
|
|
|
if (len < 0) { |
|
|
|
|
if (errno != EAGAIN && errno != EINTR) |
|
|
|
|
if (ff_neterrno() != FF_NETERROR(EAGAIN) && |
|
|
|
|
ff_neterrno() != FF_NETERROR(EINTR)) |
|
|
|
|
return -1; |
|
|
|
|
} else if (len == 0) { |
|
|
|
|
return -1; |
|
|
|
@ -826,7 +828,8 @@ static int handle_connection(HTTPContext *c) |
|
|
|
|
return 0; |
|
|
|
|
len = send(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr, 0); |
|
|
|
|
if (len < 0) { |
|
|
|
|
if (errno != EAGAIN && errno != EINTR) { |
|
|
|
|
if (ff_neterrno() != FF_NETERROR(EAGAIN) && |
|
|
|
|
ff_neterrno() != FF_NETERROR(EINTR)) { |
|
|
|
|
/* error : close connection */ |
|
|
|
|
av_freep(&c->pb_buffer); |
|
|
|
|
return -1; |
|
|
|
@ -896,7 +899,8 @@ static int handle_connection(HTTPContext *c) |
|
|
|
|
return 0; |
|
|
|
|
len = send(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr, 0); |
|
|
|
|
if (len < 0) { |
|
|
|
|
if (errno != EAGAIN && errno != EINTR) { |
|
|
|
|
if (ff_neterrno() != FF_NETERROR(EAGAIN) && |
|
|
|
|
ff_neterrno() != FF_NETERROR(EINTR)) { |
|
|
|
|
/* error : close connection */ |
|
|
|
|
av_freep(&c->pb_buffer); |
|
|
|
|
return -1; |
|
|
|
@ -922,7 +926,8 @@ static int handle_connection(HTTPContext *c) |
|
|
|
|
len = send(c->fd, c->packet_buffer_ptr, |
|
|
|
|
c->packet_buffer_end - c->packet_buffer_ptr, 0); |
|
|
|
|
if (len < 0) { |
|
|
|
|
if (errno != EAGAIN && errno != EINTR) { |
|
|
|
|
if (ff_neterrno() != FF_NETERROR(EAGAIN) && |
|
|
|
|
ff_neterrno() != FF_NETERROR(EINTR)) { |
|
|
|
|
/* error : close connection */ |
|
|
|
|
av_freep(&c->packet_buffer); |
|
|
|
|
return -1; |
|
|
|
@ -2333,7 +2338,8 @@ static int http_send_data(HTTPContext *c) |
|
|
|
|
/* TCP data output */ |
|
|
|
|
len = send(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr, 0); |
|
|
|
|
if (len < 0) { |
|
|
|
|
if (errno != EAGAIN && errno != EINTR) { |
|
|
|
|
if (ff_neterrno() != FF_NETERROR(EAGAIN) && |
|
|
|
|
ff_neterrno() != FF_NETERROR(EINTR)) { |
|
|
|
|
/* error : close connection */ |
|
|
|
|
return -1; |
|
|
|
|
} else { |
|
|
|
@ -2390,7 +2396,8 @@ static int http_receive_data(HTTPContext *c) |
|
|
|
|
|
|
|
|
|
len = recv(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr, 0); |
|
|
|
|
if (len < 0) { |
|
|
|
|
if (errno != EAGAIN && errno != EINTR) { |
|
|
|
|
if (ff_neterrno() != FF_NETERROR(EAGAIN) && |
|
|
|
|
ff_neterrno() != FF_NETERROR(EINTR)) { |
|
|
|
|
/* error : close connection */ |
|
|
|
|
goto fail; |
|
|
|
|
} |
|
|
|
|