Repository navigation
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #10105.
RubyBasicSocket#doSendconverted the message withconvertToString(), but only theDatagramChannelsend to a destination address used the result. Without an address it passed the original object tosyswrite, which writes itsto_s, so a socket fromUNIXSocket.pair, a TCP socket or a connected UDP socket sent"#<Object:...>"for an object that definesto_str. It now passes the converted String in both cases, and converts the message first, asrsock_bsock_senddoes withStringValue(arg.mesg)(basicsocket.c#L576).This adds "sends the String returned by #to_str of an object" to
spec/ruby/library/socket/basicsocket/send_spec.rb, for a connected UDP socket without a destination address. It fails before this change and passes after it, and passes on CRuby 4.0.9 and 3.4.12. Tested withspec/ruby/library/socket/basicsocket,udpsocketandunixsocket(also with-Xjit.threshold=0and-X-C),test/mri/socket/test_basicsocket.rb,test_socket.rb,test_udp.rb,test_unix.rband the fast RubySpec suite. No new failures.The commit cherry-picks cleanly onto master, and the new spec passes there with the default parser and with
-Xparser.prism.