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
19
ffserver.c
19
ffserver.c
@ -566,25 +566,21 @@ static int http_server(void)
|
|||||||
|
|
||||||
if (config.http_addr.sin_port) {
|
if (config.http_addr.sin_port) {
|
||||||
server_fd = socket_open_listen(&config.http_addr);
|
server_fd = socket_open_listen(&config.http_addr);
|
||||||
if (server_fd < 0) {
|
if (server_fd < 0)
|
||||||
av_free(poll_table);
|
goto quit;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.rtsp_addr.sin_port) {
|
if (config.rtsp_addr.sin_port) {
|
||||||
rtsp_server_fd = socket_open_listen(&config.rtsp_addr);
|
rtsp_server_fd = socket_open_listen(&config.rtsp_addr);
|
||||||
if (rtsp_server_fd < 0) {
|
if (rtsp_server_fd < 0) {
|
||||||
av_free(poll_table);
|
|
||||||
closesocket(server_fd);
|
closesocket(server_fd);
|
||||||
return -1;
|
goto quit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rtsp_server_fd && !server_fd) {
|
if (!rtsp_server_fd && !server_fd) {
|
||||||
http_log("HTTP and RTSP disabled.\n");
|
http_log("HTTP and RTSP disabled.\n");
|
||||||
av_free(poll_table);
|
goto quit;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
http_log("FFserver started.\n");
|
http_log("FFserver started.\n");
|
||||||
@ -662,8 +658,7 @@ static int http_server(void)
|
|||||||
ret = poll(poll_table, poll_entry - poll_table, delay);
|
ret = poll(poll_table, poll_entry - poll_table, delay);
|
||||||
if (ret < 0 && ff_neterrno() != AVERROR(EAGAIN) &&
|
if (ret < 0 && ff_neterrno() != AVERROR(EAGAIN) &&
|
||||||
ff_neterrno() != AVERROR(EINTR)) {
|
ff_neterrno() != AVERROR(EINTR)) {
|
||||||
av_free(poll_table);
|
goto quit;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
} while (ret < 0);
|
} while (ret < 0);
|
||||||
|
|
||||||
@ -697,6 +692,10 @@ static int http_server(void)
|
|||||||
new_connection(rtsp_server_fd, 1);
|
new_connection(rtsp_server_fd, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
quit:
|
||||||
|
av_free(poll_table);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* start waiting for a new HTTP/RTSP request */
|
/* start waiting for a new HTTP/RTSP request */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user