http: add "HttpParser#keepalive?" method
commitb1adc4738b5fd9a42a5d686d67efae300d1c55ea
authorEric Wong <normalperson@yhbt.net>
Tue, 11 Aug 2009 06:55:21 +0000 (10 23:55 -0700)
committerEric Wong <normalperson@yhbt.net>
Tue, 11 Aug 2009 07:51:10 +0000 (11 00:51 -0700)
tree8027e31e9ebb0d0fe64cbaf85a704136c56f212d
parent4d1121dbe7244537fc76757552345ea0e8f87a03
http: add "HttpParser#keepalive?" method

This should be used to detect if a request can really handle
keepalives and pipelining.  Currently, the rules are:

  1. MUST be a GET or HEAD request
  2. MUST be HTTP/1.1
  3. MUST NOT have "Connection: close" set

This also reduces the amount of garbage we create by
globalizing constants and using them whenever possible.
ext/unicorn_http/global_variables.h
ext/unicorn_http/unicorn_http.rl
test/unit/test_http_parser.rb
test/unit/test_http_parser_ng.rb