summaryrefslogtreecommitdiff
path: root/test/net/protocol
AgeCommit message (Collapse)Author
2022-12-09Merge net-protocol-0.2.1Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-12-08[ruby/net-protocol] Failing test case for #19Jean Boussier
Unfortunately we have to use a mock, but this test demonstrate the mutation bug fixed in #19. It fails on 0.2.0 but passes on 0.1.3 or 0.2.1. https://github.com/ruby/net-protocol/commit/40a1ab687c
2019-06-29Add max option to TestProtocol#create_mockioNobuyoshi Nakada
* test/net/protocol/test_protocol.rb (TestProtocol#create_mockio): max option to limit maximum writable size at once, and unify mock method in test_write0_multibyte.
2018-12-27Fix Net::Protocol::BufferedIO#write when sending large multi-byte stringnobu
This commit should fix Net::Protocol::BufferedIO#write when sending large multi-byte string like following example. ``` $ ruby -rnet/http -rjson -v -e "Net::HTTP.post(URI('http://httpbin.org/post'), { text: 'あ'*100_000 }.to_json, 'Content-Type' => 'application/json')" ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] Traceback (most recent call last): 19: from -e:1:in `<main>' 18: from lib/ruby/2.6.0/net/http.rb:500:in `post' 17: from lib/ruby/2.6.0/net/http.rb:605:in `start' 16: from lib/ruby/2.6.0/net/http.rb:920:in `start' 15: from lib/ruby/2.6.0/net/http.rb:502:in `block in post' 14: from lib/ruby/2.6.0/net/http.rb:1281:in `post' 13: from lib/ruby/2.6.0/net/http.rb:1493:in `send_entity' 12: from lib/ruby/2.6.0/net/http.rb:1479:in `request' 11: from lib/ruby/2.6.0/net/http.rb:1506:in `transport_request' 10: from lib/ruby/2.6.0/net/http.rb:1506:in `catch' 9: from lib/ruby/2.6.0/net/http.rb:1507:in `block in transport_request' 8: from lib/ruby/2.6.0/net/http/generic_request.rb:123:in `exec' 7: from lib/ruby/2.6.0/net/http/generic_request.rb:189:in `send_request_with_body' 6: from lib/ruby/2.6.0/net/protocol.rb:247:in `write' 5: from lib/ruby/2.6.0/net/protocol.rb:265:in `writing' 4: from lib/ruby/2.6.0/net/protocol.rb:248:in `block in write' 3: from lib/ruby/2.6.0/net/protocol.rb:275:in `write0' 2: from lib/ruby/2.6.0/net/protocol.rb:275:in `each_with_index' 1: from lib/ruby/2.6.0/net/protocol.rb:275:in `each' lib/ruby/2.6.0/net/protocol.rb:280:in `block in write0': undefined method `bytesize' for nil:NilClass (NoMethodError) ``` [Fix GH-2058] From: Eito Katagiri <eitoball@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-06Introduce write_timeout to Net::HTTP [Feature #13396]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-14revert r57323nobu
StringIO.new makes the buffer IO.default_external, while StringIO.new("".dup) makes source encoding which is defaulted to UTF-8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-14StringIO.new makes a RW buffernobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-11lib/net/protocol.rb: Specify frozen_string_literal: true.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-23net/protocol.rb: fix SMTP dot stuffingnobu
* net/protocol.rb (using_each_crlf_line): fix SMTP dot-stuffing for messages not ending with a new-line. [ruby-core:61441] [Bug #9627] [fix GH-616] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-08* lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line):naruse
treat \r as newline as mame pointed. [ruby-dev:46425] [Bug #7278] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line):naruse
don't use /n in universal regexp. [ruby-dev:46394] [Bug #7278] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e