path: root/lib/webrick/server.rb
diff options
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-08 18:51:56 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-08 18:51:56 +0000
commit22474d8f9636e1555d61cd4bb3d93698dc1ab2af (patch)
tree3ff001c6d322f1a347af2d5c1ae1f6d24c1dbe40 /lib/webrick/server.rb
parent6d8f47fde1aa6b275d1bff0d7832944231b42353 (diff)
webrick: allow shutdown after StartCallback
We must to ensure the @status ivar is set to :Running before running StartCallback, otherwise Webrick::Server#stop will not change the @status to :Shutdown properly. Note: I have not been able to reproduce the original issue but understood at least part of the problem and fixed it with this commit. However, the original reporter (Peak Xu) was still able to reproduce the problem on 1.9.2 p180 on Windows, so I'm not sure what else might be going on. Ruby threading and synchronization primitives have changed a lot since 1.9.2, so maybe that was fixed elsewhere. * lib/webrick/server.rb: call StartCallback sooner [Bug #4841] git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/server.rb')
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb
index ca5e435..06b7f9f 100644
--- a/lib/webrick/server.rb
+++ b/lib/webrick/server.rb
@@ -157,12 +157,12 @@ module WEBrick
server_type.start{ \
"#{self.class}#start: pid=#{$$} port=#{@config[:Port]}"
+ @status = :Running
shutdown_pipe = @shutdown_pipe
thgroup =
- @status = :Running
while @status == :Running