Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.11.0
-
Ubuntu Linux 16.04 with Thrift 0.11.0 and libssl-dev 1.0.2g
-
Patch Available
-
Patch
Description
Tested on both 0.11.0 and master.
C++ Server, Python Client. SSL sockets. SSL works correctly and communication is successful, however when the client disconnects the server always prints the following message:
Thrift: Tue Apr 17 15:43:36 2018 TConnectedClient died: SSL_read: error code: 0 (SSL_error_code = 5)
Deeper diving shows that SSL_error_code 5 is SSL_ERROR_SYSCALL. Documentation says to check both errno and the SLL error stack, however upon inspection both return 0 (no error). I believe this message is printed incorrectly.
Upon inspecting the code for handing SSL_read, it appears that reading is done in a while-loop, which if no error is found is broken out of. At some point a switch-case was added, but the single level of break statements remained, leaving non-errors to break out of the switch instead of the while.
A potential fix can be seen here: https://github.com/apache/thrift/pull/1549