1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test
nobu 1680a13a92 Fix Net::Protocol::BufferedIO#write when sending large multi-byte string
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-12-27 04:49:12 +00:00
..
-ext- Add test cases of rb_arithmetic_sequence_extract 2018-12-12 21:17:04 +00:00
base64
benchmark
bigdecimal Import bigdecimal-1.4.0.pre.20181220a 2018-12-20 23:29:49 +00:00
cgi
coverage ext/coverage/lib/coverage.rb (Coverage.line_stub): use only line events 2018-12-20 10:17:37 +00:00
csv remove trailing spaces [ci skip] 2018-12-23 11:11:35 +00:00
date test/date: removed unnecessaruy __send__ 2018-12-11 05:09:35 +00:00
dbm
digest
drb
dtrace test/dtrace: use TracePoint.__enable 2018-12-11 09:49:31 +00:00
erb erb.rb: print deprecation warning with warn level 1 2018-12-25 13:57:28 +00:00
etc
excludes test/excludes/_wercker: give up testing TestGemRemoteFetcher 2018-12-21 14:33:25 +00:00
fiddle test/fiddle/test_function.rb: loosen timeout 2018-12-23 01:40:33 +00:00
fileutils
gdbm
io Suppress uninitialized instance variable warnings 2018-12-14 01:29:23 +00:00
irb
json Fix JSON::Parser against bigdecimal updates 2018-12-02 05:21:57 +00:00
lib test/lib/test/unit.rb: do not propagate MAKEFLAGS to children 2018-12-15 04:40:14 +00:00
logger
matrix
minitest object.c (rb_obj_match): use rb_warn for deprecation warning 2018-12-26 09:04:12 +00:00
misc
mkmf
monitor
net Fix Net::Protocol::BufferedIO#write when sending large multi-byte string 2018-12-27 04:49:12 +00:00
nkf
objspace
open-uri
openssl
optparse
ostruct ostruct.rb: Accept block for to_h [#15451]. 2018-12-22 17:05:03 +00:00
pathname Pathname#relative_path_from uses is_a? 2018-12-18 03:09:54 +00:00
psych
rdoc test/rdoc: skip some tests when euid is root 2018-12-26 06:01:18 +00:00
readline
resolv
rexml Really ensure loading REXML in tests 2018-12-20 04:03:10 +00:00
rinda
ripper
rss
ruby string.c: remove the deprecation warnings of String#bytes with block 2018-12-26 14:43:25 +00:00
rubygems Restore SOURCE_DATE_EPOCH 2018-12-25 13:33:51 +00:00
scanf
sdbm
shell
socket disable non-blocking pipes and sockets by default 2018-11-29 20:00:00 +00:00
stringio
strscan
syslog
testunit test/testunit/test_parallel.rb: respect subprocess timeout scale 2018-11-30 03:56:34 +00:00
uri
webrick webrick: add the ability to override res, req creation 2018-12-19 11:08:05 +00:00
win32ole test_win32ole_event.rb: use better retry strategy 2018-12-24 03:50:39 +00:00
yaml
zlib zlib (gzfile_write_raw): do not resize string after .write call 2018-12-07 07:09:31 +00:00
colors
runner.rb
test_abbrev.rb
test_cmath.rb
test_delegate.rb
test_extlibs.rb
test_find.rb
test_forwardable.rb
test_ipaddr.rb Import ipaddr 1.2.2 2018-12-18 05:09:08 +00:00
test_mutex_m.rb
test_observer.rb
test_open3.rb use :chdir option to avoid fd 3 to work with Windows. 2018-12-13 08:53:15 +00:00
test_pp.rb test_pp.rb: show the node when failed 2018-12-03 00:57:06 +00:00
test_prettyprint.rb
test_prime.rb
test_pstore.rb
test_pty.rb
test_rbconfig.rb
test_securerandom.rb
test_set.rb
test_shellwords.rb
test_singleton.rb
test_sync.rb
test_syslog.rb
test_tempfile.rb
test_time.rb
test_timeout.rb
test_tmpdir.rb
test_tracer.rb
test_tsort.rb
test_unicode_normalize.rb
test_weakref.rb
test_win32api.rb