[vlc-devel] [PATCH 1/2] httpd: Fix answer sending from custom handlers

Hugo Beauzée-Luyssen hugo at beauzee.fr
Wed Jun 17 10:12:16 CEST 2020


Ah indeed that is correct.
So... should we just remove the len == 0 handling altogether? I'm not sure what you meant by "I think that's a misunderstanding and a bug"

Regards,

On Fri, Jun 12, 2020, at 4:50 PM, Rémi Denis-Courmont wrote:
> Hi,
> 
> No, that's wrong. Skips the existing error handling and breaks EAGAIN case.
> 
> Le 12 juin 2020 11:22:32 GMT+03:00, "Hugo Beauzée-Luyssen" 
> <hugo at beauzee.fr> a écrit : On Thu, Jun 11, 2020, at 5:31 PM, Rémi 
> Denis-Courmont wrote:
> >> Le torstaina 11. kesäkuuta 2020, 13.59.29 EEST Hugo Beauzée-Luyssen a écrit :
> >>> In case of custom handlers, the entire response is crafted by pf_fill.
> >>> This will in turn cause 0 bytes of headers to be sent, which is expected
> >>> since those headers are contained in the answer, however we will treat
> >>> such a case as a dead connection,
> >> I think that's a misunderstanding and a bug. Writing can return 0 on a full 
> >> file system. But I don't think you can get a 0 write return other than writing 
> >> 0 bytes on a TCP socket.
> >> 
> > 
> > Hi,
> > 
> > If I understand correctly, you're saying that the correct fix would rather be something like
> > 
> > diff --git a/src/network/httpd.c b/src/network/httpd.c
> > index d4b188bad3..6170cc997d 100644
> > --- a/src/network/httpd.c
> > +++ b/src/network/httpd.c
> > @@ -1610,7 +1610,7 @@ static int httpd_ClientSend(httpd_client_t *cl)
> >      i_len = httpd_NetSend(cl, &cl->p_buffer[cl->i_buffer],
> >                             cl->i_buffer_size - cl->i_buffer);
> >  
> > -    if (i_len == 0) {
> > +    if (i_len < 0) {
> >          cl->i_state = HTTPD_CLIENT_DEAD; /* connection closed */
> >          return 0;
> >      }
> > 
> > ?
> 
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser 
> ma brièveté. 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list