libreoffice-online/net
Ashod Nakashian 6458e00bc4 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>
2022-04-30 20:41:26 +01:00
..
Buffer.hpp Buffer: remove _size member and calculate it from _offset as needed. 2021-11-30 09:32:45 +00:00
clientnb.cpp
DelaySocket.cpp
DelaySocket.hpp
FakeSocket.cpp
FakeSocket.hpp
HttpHelper.cpp
HttpHelper.hpp
HttpRequest.cpp
HttpRequest.hpp wsd: use STATE_ENUM for http 2022-04-06 18:33:45 -04:00
NetUtil.cpp
NetUtil.hpp
ServerSocket.hpp wsd: reduce noisy logs 2022-02-04 10:26:49 -05:00
Socket.cpp wsd: log macro cleanup 2022-04-26 11:13:44 +03:00
Socket.hpp wsd: return status from writeOutgoingData 2022-04-30 20:41:26 +01:00
Ssl.cpp wsd: use the default DH parameters in SSL 2022-04-22 09:47:19 +02:00
Ssl.hpp
SslSocket.hpp wsd: return status from writeOutgoingData 2022-04-30 20:41:26 +01:00
WebSocketHandler.hpp wsd: remove argument default-value 2022-04-20 08:34:59 -04:00
WebSocketSession.hpp