1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Some cleanup

This commit is contained in:
Evan Phoenix 2011-09-15 16:04:45 -07:00
parent f748edfade
commit 2710357ca4
2 changed files with 5 additions and 9 deletions

View file

@ -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."

View file

@ -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