Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdaf314a

Browse files
committed
Remove usage of IO#nread
IO#wait, a method to obtain the number of bytes readable withoutblocking, has been removed from io/wait.ruby/io-wait@1decadcWhen WEBrick is combined with io.wait >= 0.4.0, the following erroroccurs on shutdown: ERROR NoMethodError: undefined method 'nread' for an instance of IO /(snip)/webrick-1.9.1/lib/webrick/server.rb:178:in 'block in WEBrick::GenericServer#start'WEBrick uses IO#nread to efficiently consume the entire input streamduring shutdown. This patch removes the call to IO#nread, and insteadrepeatedly take a fixed size of 8 bytes each iteration.
1 parent5584117 commitdaf314a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎lib/webrick/server.rb‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ def start(&block)
174174
ifsvrs[0].include?sp
175175
# swallow shutdown pipe
176176
buf=String.new
177-
nilwhileString ===
178-
sp.read_nonblock([sp.nread,8].max,buf,exception:false)
177+
nilwhileString ===sp.read_nonblock(8,buf,exception:false)
179178
break
180179
end
181180
svrs[0].each{|svr|

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp