forked from FFmpeg/FFmpeg
ffserver: unify exit path in http_server()
Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
This commit is contained in:
parent
9a168e9371
commit
2580395e1c
1 changed files with 9 additions and 10 deletions
19
ffserver.c
19
ffserver.c
|
@ -566,25 +566,21 @@ static int http_server(void)
|
|||
|
||||
if (config.http_addr.sin_port) {
|
||||
server_fd = socket_open_listen(&config.http_addr);
|
||||
if (server_fd < 0) {
|
||||
av_free(poll_table);
|
||||
return -1;
|
||||
}
|
||||
if (server_fd < 0)
|
||||
goto quit;
|
||||
}
|
||||
|
||||
if (config.rtsp_addr.sin_port) {
|
||||
rtsp_server_fd = socket_open_listen(&config.rtsp_addr);
|
||||
if (rtsp_server_fd < 0) {
|
||||
av_free(poll_table);
|
||||
closesocket(server_fd);
|
||||
return -1;
|
||||
goto quit;
|
||||
}
|
||||
}
|
||||
|
||||
if (!rtsp_server_fd && !server_fd) {
|
||||
http_log("HTTP and RTSP disabled.\n");
|
||||
av_free(poll_table);
|
||||
return -1;
|
||||
goto quit;
|
||||
}
|
||||
|
||||
http_log("FFserver started.\n");
|
||||
|
@ -662,8 +658,7 @@ static int http_server(void)
|
|||
ret = poll(poll_table, poll_entry - poll_table, delay);
|
||||
if (ret < 0 && ff_neterrno() != AVERROR(EAGAIN) &&
|
||||
ff_neterrno() != AVERROR(EINTR)) {
|
||||
av_free(poll_table);
|
||||
return -1;
|
||||
goto quit;
|
||||
}
|
||||
} while (ret < 0);
|
||||
|
||||
|
@ -697,6 +692,10 @@ static int http_server(void)
|
|||
new_connection(rtsp_server_fd, 1);
|
||||
}
|
||||
}
|
||||
|
||||
quit:
|
||||
av_free(poll_table);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* start waiting for a new HTTP/RTSP request */
|
||||
|
|
Loading…
Add table
Reference in a new issue