mirror of
https://github.com/LibreOffice/online.git
synced 2025-08-16 17:42:05 +00:00
9a761ffe68b24e180dd74c0737e20cabe9dc9e1b

There was an interesting race when we cleared the inBuffer after the WS upgrade. Since during the upgrade we also transfer the socket to the DocBroker, which has its own poll thread, the DocBroker poll could trigger a POLLIN event if data comes while the handler (that is handling the WS upgrad and transfer to DocBroker) hasn't got to the point where it clears the inBuffer of the data we just read (i.e. the HTTP GET request). Even if not the case, after transfering a socket to another poll thread the socket buffers should not be touched. Here we move the inBuffer clearing to be as soon as we have successfully parsed the request and are ready to process it. Also, we don't clear the full buffer, in case we had read into the buffer both the requst and the first message, if the thread was switched out right after getting the POLLIN but before reading from the socket, giving enough time to receive more data and reading it together with first read (which is the request). Change-Id: I9888d4c2b70d2e433824818bbe7f69f13742486c Reviewed-on: https://gerrit.libreoffice.org/36326 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
…
…
…
…
…
…
…
LibreOffice Online. This project has several components: wsd/ The Web Services Daemon - which accepts external connections. kit/ The client which lives in its own chroot and renders documents. common/ Shared code between these processes. loleaflet/ The client side JavaScript component. It is recommended to read these files: wsd/README loleaflet/README Enjoy.
Description
Languages
JavaScript
48%
C++
32.6%
HTML
6.7%
CSS
5.8%
Java
2.3%
Other
4.5%