[vlc-devel] [PATCH 4/5] httpd: set timeout duration per host rather than client

Rémi Denis-Courmont remi at remlab.net
Mon Nov 23 09:00:38 CET 2020


Le maanantaina 23. marraskuuta 2020, 9.49.01 EET Steve Lhomme a écrit :
> On 2020-11-22 17:53, remi at remlab.net wrote:
> > From: Rémi Denis-Courmont <remi at remlab.net>
> > 
> > ---
> > 
> >   src/network/httpd.c | 31 +++++++++++++++----------------
> >   1 file changed, 15 insertions(+), 16 deletions(-)
> > 
> > diff --git a/src/network/httpd.c b/src/network/httpd.c
> > index 5a8aea918d..9a0a352566 100644
> > --- a/src/network/httpd.c
> > +++ b/src/network/httpd.c
> > @@ -96,6 +96,7 @@ struct httpd_host_t
> > 
> >       size_t client_count;
> >       struct vlc_list clients;
> > 
> > +    unsigned timeout_sec;
> 
> Why use an unsigned when we have a type to represent time/duration ?

Because negative timeouts have zero practical use and sub-second precision and 
decade-long timeouts are totally unused and unnecessary in this context, 
obviously.

> It was the type used so far. And it makes hardcoded constants like 10 or 0
> easier to understand.

Given that the RTSP protocol uses seconds to express time-outs, I'll have to 
disagree.

-- 
レミ・デニ-クールモン
http://www.remlab.net/





More information about the vlc-devel mailing list