diff --git a/ext/http11/http11.c b/ext/http11/http11.c index 898efa20..fea54687 100644 --- a/ext/http11/http11.c +++ b/ext/http11/http11.c @@ -24,7 +24,6 @@ static VALUE eHttpParserError; -#define id_handler_map rb_intern("@handler_map") #define id_http_body rb_intern("@http_body") #define HTTP_PREFIX "HTTP_" #define HTTP_PREFIX_LEN (sizeof(HTTP_PREFIX) - 1) @@ -36,8 +35,6 @@ static VALUE global_query_string; static VALUE global_http_version; static VALUE global_request_path; -#define TRIE_INCREASE 30 - /** Defines common length and error messages for input length validation. */ #define DEF_MAX_LENGTH(N,length) const size_t MAX_##N##_LENGTH = length; const char *MAX_##N##_LENGTH_ERR = "HTTP element " # N " is longer than the " # length " allowed length." diff --git a/lib/mongrel.rb b/lib/mongrel.rb index b86442db..dc4fbff3 100644 --- a/lib/mongrel.rb +++ b/lib/mongrel.rb @@ -95,8 +95,6 @@ module Mongrel # socket.accept calls in order to give the server a cheap throttle time. It defaults to 0 and # actually if it is 0 then the sleep is not done at all. def initialize(host, port, num_processors=950, throttle=0, timeout=60) - - tries = 0 @socket = TCPServer.new(host, port) @classifier = URIClassifier.new @@ -152,15 +150,16 @@ module Mongrel params[SERVER_SOFTWARE] = MONGREL_VERSION params[GATEWAY_INTERFACE] = CGI_VER - if not params[REQUEST_PATH] + unless params[REQUEST_PATH] # it might be a dumbass full host request header uri = URI.parse(params[REQUEST_URI]) params[REQUEST_PATH] = uri.path + + raise "No REQUEST PATH" unless params[REQUEST_PATH] end - raise "No REQUEST PATH" if not params[REQUEST_PATH] - - script_name, path_info, handlers = @classifier.resolve(params[REQUEST_PATH]) + script_name, path_info, handlers = + @classifier.resolve(params[REQUEST_PATH]) if handlers params[PATH_INFO] = path_info