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

Rémi Denis-Courmont remi at remlab.net
Fri Jun 12 16:50:27 CEST 2020


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;
>     }
>
>?
>
>-- 
>  Hugo Beauzée-Luyssen
>  hugo at beauzee.fr
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20200612/88b605a9/attachment.html>


More information about the vlc-devel mailing list