You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the debugging of TLS support for a MySQL driver, I've encountered a SSL error which made the stream resource close and thus emit an error when we checked whether there's an EOF.
Error on feof was supplied resource is not a valid stream resource due to stream_socket_enable_crypto already failing with the error An existing connection was forcibly closed by the remote host.
This PR therefore only checks EOF if the resource is still valid.
@clue I've been thinking about this aswell, but I'm not sure how this can be reliably tested. Quickly testing whether closing the socket from the server is enough was negative.
My other idea would be starting a new process for the server and then killing the server process after getting a successful connect while trying to setup TLS, to get a TCP reset. However I've yet to get to test this and see if that works.
If you have an idea how this can be tested, I'd like to add that as test.
@CharlotteDunois Perhaps take a look at #169 which originally introduced this feof() check. It's my understanding that if the resource is closed already, the stream_socket_crypto_enable() call should also report a warning, so perhaps just switching the statements as in your original version would be preferred? In the test suite, we can just call the internal toggleCrypto() method with some invalid arguments, this should already trigger the faulty behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During the debugging of TLS support for a MySQL driver, I've encountered a SSL error which made the stream resource close and thus emit an error when we checked whether there's an EOF.
Error on
feofwassupplied resource is not a valid stream resourcedue tostream_socket_enable_cryptoalready failing with the errorAn existing connection was forcibly closed by the remote host.This PR therefore only checks EOF if the resource is still valid.