mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Make HTTP::Server uninitialized instead of HTTP::Server?
This commit is contained in:
		
							parent
							
								
									8dfe815dc0
								
							
						
					
					
						commit
						64d3271fb2
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		|  | @ -11,8 +11,8 @@ module Kemal | |||
|     config.setup | ||||
|     config.add_handler Kemal::RouteHandler::INSTANCE | ||||
| 
 | ||||
|     config.server = HTTP::Server.new(config.host_binding.not_nil!, config.port, config.handlers) | ||||
|     config.server.not_nil!.tls = config.ssl | ||||
|     config.server = HTTP::Server.new(config.host_binding, config.port, config.handlers) | ||||
|     config.server.tls = config.ssl | ||||
| 
 | ||||
|     Kemal::Sessions.run_reaper! | ||||
| 
 | ||||
|  | @ -26,7 +26,7 @@ module Kemal | |||
|     unless config.env == "test" | ||||
|       Signal::INT.trap { | ||||
|         config.logger.write "Kemal is going to take a rest!\n" | ||||
|         config.server.not_nil!.close | ||||
|         config.server.close | ||||
|         exit | ||||
|       } | ||||
| 
 | ||||
|  | @ -40,7 +40,7 @@ module Kemal | |||
|       end | ||||
| 
 | ||||
|       config.logger.write "[#{config.env}] Kemal is ready to lead at #{config.scheme}://#{config.host_binding}:#{config.port}\n" | ||||
|       config.server.not_nil!.listen | ||||
|       config.server.listen | ||||
|     end | ||||
|   end | ||||
| end | ||||
|  |  | |||
|  | @ -9,7 +9,6 @@ module Kemal | |||
|     HANDLERS       = [] of HTTP::Handler | ||||
|     ERROR_HANDLERS = {} of Int32 => HTTP::Server::Context -> String | ||||
|     @ssl : OpenSSL::SSL::Context::Server? | ||||
|     @server : HTTP::Server? | ||||
| 
 | ||||
|     property host_binding, ssl, port, env, public_folder, logging, | ||||
|       always_rescue, serve_static, server, extra_options | ||||
|  | @ -24,6 +23,7 @@ module Kemal | |||
|       @logger = nil | ||||
|       @error_handler = nil | ||||
|       @always_rescue = true | ||||
|       @server = uninitialized HTTP::Server | ||||
|     end | ||||
| 
 | ||||
|     def logger | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue