diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2022-04-29 18:12:32 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-05-02 21:16:05 +0200 |
commit | 8e9b8f7e821851360c633698f00f267fa5b8661f (patch) | |
tree | 45c7c53afc826d1f979a6e59a643fdb1e53f7e1e /coolwsd.xml.in | |
parent | fix: isVisible is not a function error. (diff) | |
download | online-8e9b8f7e821851360c633698f00f267fa5b8661f.tar.gz online-8e9b8f7e821851360c633698f00f267fa5b8661f.zip |
wsd: return status from writeOutgoingData
Without knowing whether the write succeeded
or failed, we cannot trust errno has our
error or some earlier and unrelated error.
This was caught when there were two sockets,
one of which disconnected. The write to the
disconnected one returned -1 and set errno
to ECONNRESET. We subsequently wrote to the
second socket, which succeeded. However,
because errno wasn't reset, and since
writeOutgoingData didn't return anything
to indicate the success, errno's ECONNRESET
value meant the second socket was also
disconnected, which was incorrect.
writeOutgoingData now returns the last return
value from writeData so we can make informed
decision as to whether to check errno or not.
Also, to avoid incorrecly propagating errno,
we now capture errno only when readData and
writeData return -1. This has the nice
side-effect that we reset errno to 0 when
no errors occur during our call.
Change-Id: I911b31390f37cc71938bc4a6ae75393dbf24bb9d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit dec21487859873c416ecd7191501973f36dc9cf4)
Diffstat (limited to 'coolwsd.xml.in')
0 files changed, 0 insertions, 0 deletions