mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* lib/webrick/server.rb (WEBrick::GenericServer#start):
partially revert r35315. * test/webrick/test_server.rb (test_start_exception): received signal is delivered to the main thread, so it is needed to emulate it. patched by Eric Hodel. [ruby-core:44348] [Feature #6236] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									e95f7ea80d
								
							
						
					
					
						commit
						c26ea74ad6
					
				
					 3 changed files with 15 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,12 @@
 | 
			
		|||
Sat Apr 14 10:45:18 2012  NARUSE, Yui  <naruse@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* lib/webrick/server.rb (WEBrick::GenericServer#start):
 | 
			
		||||
	  partially revert r35315.
 | 
			
		||||
 | 
			
		||||
	* test/webrick/test_server.rb (test_start_exception):
 | 
			
		||||
	  received signal is delivered to the main thread, so it is needed to
 | 
			
		||||
	  emulate it. patched by Eric Hodel. [ruby-core:44348] [Feature #6236]
 | 
			
		||||
 | 
			
		||||
Sat Apr 14 09:35:45 2012  Eric Hodel  <drbrain@segment7.net>
 | 
			
		||||
 | 
			
		||||
	* variable.c (trace_ev):  Removed "not reached" comment as this line is
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -133,12 +133,12 @@ module WEBrick
 | 
			
		|||
            rescue Errno::EBADF, IOError => ex
 | 
			
		||||
              # if the listening socket was closed in GenericServer#shutdown,
 | 
			
		||||
              # IO::select raise it.
 | 
			
		||||
            rescue Interrupt => ex # ^C
 | 
			
		||||
              @logger.fatal ex
 | 
			
		||||
              raise
 | 
			
		||||
            rescue Exception => ex
 | 
			
		||||
            rescue StandardError => ex
 | 
			
		||||
              msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
 | 
			
		||||
              @logger.error msg
 | 
			
		||||
            rescue Exception => ex
 | 
			
		||||
              @logger.fatal ex
 | 
			
		||||
              raise
 | 
			
		||||
            end
 | 
			
		||||
          end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,12 +29,12 @@ class TestWEBrickServer < Test::Unit::TestCase
 | 
			
		|||
      :StopCallback => Proc.new{ stopped += 1 },
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    e = assert_raises(Interrupt) do
 | 
			
		||||
    e = assert_raises(SignalException) do
 | 
			
		||||
      TestWEBrick.start_server(Echo, config) { |server, addr, port, log|
 | 
			
		||||
        listener = server.listeners.first
 | 
			
		||||
 | 
			
		||||
        def listener.accept
 | 
			
		||||
          Process.kill(:INT, $$) # simulate ^C
 | 
			
		||||
          raise SignalException, 'SIGTERM' # simulate signal in main thread
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        Thread.pass while server.status != :Running
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue