-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Regexp.from_bson for data from SSL connections #44
Conversation
Hi @Nielsomat |
Hi @Nielsomat Let me know if you're able to write a test for this and rebase against master so I can merge it. Thanks! Emily |
4237a6c
to
23526fa
Compare
This is also fixed on my branch: https://github.com/mongodb/bson-ruby/pull/43/files#diff-d0d0c547552be777373e58660aabaa99R153 |
@estolfo, this commit simply brings the #readbyte handling within Regexp in line with existing code such as https://github.com/mongodb/bson-ruby/blob/master/lib/bson/array.rb#L97 or https://github.com/mongodb/bson-ruby/blob/master/lib/bson/hash.rb#L77. As it is not explicitly tested there, I didn't include tests of my own. I have adapted the commit message accordingly. It sounds like @durran's branch is the way to go in the long-term. For the short-term, I would suggest including this fix ASAP. The symptom of the bug isn't "just" invalid or incomplete data but rather the entire process hanging. Right now, I am also working on a PR against mongodb/mongo-ruby-driver to address the underlying issue of the raw TCP and SSL socket behaving differently. I will reference this PR here once completed. |
by returning an Integer byte rather than a String and raising EOFError if EOF was reached. This unifies #readbyte across SSL and non-SSL connections. [also see mongodb/bson-ruby#44]
The root cause for this is now fixed in mongodb/mongo-ruby-driver#700. |
Fix Regexp.from_bson for data from SSL connections
3.2.6 also has been released with this change. :) |
😍 Excellent! Thanks, @durran! |
by returning an Integer byte rather than a String and raising EOFError if EOF was reached. This unifies #readbyte across SSL and non-SSL connections. [also see mongodb/bson-ruby#44]
This PR unifies parsing of regular expressions across SSL and non-SSL connections thus fixing RUBY-1048. From the issue description: