Bug 8012 - Socket errors can unintentionally be ignored
Summary: Socket errors can unintentionally be ignored
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Misc (show other bugs)
Version: 4.14.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Frida Flodin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-21 14:18 CEST by Linn
Modified: 2022-11-08 12:34 CET (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Linn cendio 2022-10-21 14:18:02 CEST
When initiating class HTTPSRequestHandler, all ConnectionErrors encountered are assumed to be due to a client abandoning a session. 

This is correct for the case where the error belongs to the socket of this object, but it will also catch ConnectionErrors cast by other sockets. Errors from these other sockets are real, unexpected errors, and we should not just ignore these.
Comment 1 Frida Flodin cendio 2022-10-26 16:05:11 CEST
It's not trivial how to check if an exception belongs to a specific socket. 

I looked into if we could use sockopt to see if there is an error on our socket. I  found the option SO_ERROR. I tried it out, but I only got 0 even when I knew the socket had a broken pipe. Then I found in "unix network programming vol 1" that SO_ERROR is reset to 0 after errno has been set. So when we get the exception, it's to late, as I understand it.

Note You need to log in before you can comment on or make changes to this bug.