[vlc-devel] [PATCH 1/2] httpd: warn when an accept() failed even though it was signaled

Rémi Denis-Courmont remi at remlab.net
Mon Nov 30 17:46:05 CET 2015


On Monday 30 November 2015 17:35:58 Steve Lhomme wrote:
> ---
>  src/network/httpd.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/network/httpd.c b/src/network/httpd.c
> index 7c924a8..cfaac4b 100644
> --- a/src/network/httpd.c
> +++ b/src/network/httpd.c
> @@ -2038,7 +2038,10 @@ static void httpdLoop(httpd_host_t *host)
>          /* */
>          fd = vlc_accept (fd, NULL, NULL, true);
>          if (fd == -1)
> +        {
> +            msg_Warn(host, "accept failed: %s", vlc_strerror_c(net_errno));
> continue;
> +        }
>          setsockopt (fd, SOL_SOCKET, SO_REUSEADDR,
>                  &(int){ 1 }, sizeof(int));

accept() failing is perfectly normal, if rare. TCP connections can be aborted.

Not sure we want to flood the logs if/when that happens.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list