[pve-devel] [PATCH http-server 2/2] Fix #1684 WebSocket proxy behind a buffered proxy.

René Jochum r.jochum at proxmox.com
Fri May 25 17:45:37 CEST 2018


Hi Thomas,

Thanks for having a look into it.

On 05/25/2018 05:20 PM, Thomas Lamprecht wrote:
> So, AFAIU, we read more than our calculated payload length and
> dropped the remaining data, thus potentially corrupting the next
> read.
> Further we may get two or more websocket frames in one callback,
> but we did only process at max one at any callback, thus if multiple
> got buffered together (i.e. NGINX) and after that nothing got send
> (thus the callback not called again) we would never process these.
>
> Could you confirm these thesis? And please add this to the commit message,
> i.e., what was wrong, why the bug occurred else it's really hard to follow
> why/what you do in the changes.
>
> That all said: The changes itself look actually good!

In the end its very simple, NGINX buffers requests coming from the
Browser, even with "proxy_buffering off;" and sends them in one frame to
the pvedaemon.

Before this patch (without the "while" loop and another very little
change) we handled only the first message of these and now with it we
process all messages until the frame is empty.

Will extend the commit Message.

Kind regards,

René





More information about the pve-devel mailing list