ffserver: unify exit path in http_server()

Signed-off-by: 's avatarReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
parent 9a168e93
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment