[vlc-devel] [PATCH 1/2] httpd: add httpd_ClientSetTimeout

Rémi Denis-Courmont remi at remlab.net
Tue Oct 27 18:04:42 CET 2020


Le tiistaina 27. lokakuuta 2020, 18.27.59 EET Thomas Guillem a écrit :
> ---
>  include/vlc_httpd.h | 2 ++
>  src/libvlccore.sym  | 1 +
>  src/network/httpd.c | 4 ++++
>  3 files changed, 7 insertions(+)
> 
> diff --git a/include/vlc_httpd.h b/include/vlc_httpd.h
> index 0b8f8c26bd9..e106d73f894 100644
> --- a/include/vlc_httpd.h
> +++ b/include/vlc_httpd.h
> @@ -69,6 +69,8 @@ VLC_API httpd_host_t *vlc_https_HostNew( vlc_object_t * )
> VLC_USED; VLC_API httpd_host_t *vlc_rtsp_HostNew( vlc_object_t * )
> VLC_USED; /* delete a host */
>  VLC_API void httpd_HostDelete( httpd_host_t * );
> +/* Can only be called from httpd callbacks */
> +VLC_API void httpd_ClientSetTimeout(httpd_client_t *cl, vlc_tick_t
> timeout);
> 
>  typedef struct
>  {
> diff --git a/src/libvlccore.sym b/src/libvlccore.sym
> index c4d5273dbd5..1bdb11c6d98 100644
> --- a/src/libvlccore.sym
> +++ b/src/libvlccore.sym
> @@ -164,6 +164,7 @@ httpd_StreamSetHTTPHeaders
>  httpd_UrlCatch
>  httpd_UrlDelete
>  httpd_UrlNew
> +httpd_ClientSetTimeout
>  image_Ext2Fourcc
>  image_HandlerCreate
>  image_HandlerDelete
> diff --git a/src/network/httpd.c b/src/network/httpd.c
> index 52c8e5bdf3e..ec079847c9d 100644
> --- a/src/network/httpd.c
> +++ b/src/network/httpd.c
> @@ -166,6 +166,10 @@ struct httpd_client_t
>      httpd_message_t answer; /* httpd -> client */
>  };
> 
> +void httpd_ClientSetTimeout(httpd_client_t *cl, vlc_tick_t timeout)
> +{
> +    cl->i_activity_timeout = timeout;
> +}

I don't really see the point. The only place outside of HTTPd that sees HTTPd 
client objects are the URL callbacks, which access the client read-only.

-- 
Реми Дёни-Курмон
http://www.remlab.net/





More information about the vlc-devel mailing list