Remove dead code for WebSocketHandler

This commit is contained in:
Serdar Dogruyol 2017-10-05 19:29:35 +03:00
parent ff37027afe
commit 677dc62832

View file

@ -8,7 +8,6 @@ module Kemal
INSTANCE = Config.new INSTANCE = Config.new
HANDLERS = [] of HTTP::Handler HANDLERS = [] of HTTP::Handler
CUSTOM_HANDLERS = [] of Tuple(Nil | Int32, HTTP::Handler) CUSTOM_HANDLERS = [] of Tuple(Nil | Int32, HTTP::Handler)
WEBSOCKET_HANDLERS = [] of HTTP::WebSocketHandler
FILTER_HANDLERS = [] of HTTP::Handler FILTER_HANDLERS = [] of HTTP::Handler
ERROR_HANDLERS = {} of Int32 => HTTP::Server::Context, Exception -> String ERROR_HANDLERS = {} of Int32 => HTTP::Server::Context, Exception -> String
@ -59,7 +58,6 @@ module Kemal
@default_handlers_setup = false @default_handlers_setup = false
HANDLERS.clear HANDLERS.clear
CUSTOM_HANDLERS.clear CUSTOM_HANDLERS.clear
WEBSOCKET_HANDLERS.clear
FILTER_HANDLERS.clear FILTER_HANDLERS.clear
ERROR_HANDLERS.clear ERROR_HANDLERS.clear
end end
@ -81,10 +79,6 @@ module Kemal
CUSTOM_HANDLERS << {position, handler} CUSTOM_HANDLERS << {position, handler}
end end
def add_handler(handler : HTTP::WebSocketHandler)
WEBSOCKET_HANDLERS << handler
end
def add_filter_handler(handler : HTTP::Handler) def add_filter_handler(handler : HTTP::Handler)
FILTER_HANDLERS << handler FILTER_HANDLERS << handler
end end
@ -145,7 +139,6 @@ module Kemal
end end
end end
# Handle WebSocketHandler
private def setup_custom_handlers private def setup_custom_handlers
CUSTOM_HANDLERS.each do |ch| CUSTOM_HANDLERS.each do |ch|
position = ch[0] position = ch[0]
@ -159,12 +152,6 @@ module Kemal
end end
end end
private def setup_websocket_handlers
WEBSOCKET_HANDLERS.each do |h|
HANDLERS.insert(@handler_position, h)
end
end
private def setup_filter_handlers private def setup_filter_handlers
FILTER_HANDLERS.each do |h| FILTER_HANDLERS.each do |h|
HANDLERS.insert(@handler_position, h) HANDLERS.insert(@handler_position, h)