diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-08-14 22:39:11 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-08-15 02:38:48 -0700 |
commit | 8c2e83f98ec8ba9dd2e02f9579b6b2cdefc1b8af (patch) | |
tree | 5310d6e90496b4a978a4e71ec815e93dcae11ef6 /ext | |
parent | 216308704cfc7a4ff50750822126584b54853bc1 (diff) | |
download | unicorn-8c2e83f98ec8ba9dd2e02f9579b6b2cdefc1b8af.tar.gz |
ab still sends this with HTTP/1.0 requests, which is unfortunate, but synthetic benchmarks are good for marketing purposes!
Diffstat (limited to 'ext')
-rw-r--r-- | ext/unicorn_http/unicorn_http.rl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl index 220069b..88fb163 100644 --- a/ext/unicorn_http/unicorn_http.rl +++ b/ext/unicorn_http/unicorn_http.rl @@ -100,8 +100,12 @@ static void write_value(VALUE req, struct http_parser *hp, VALIDATE_MAX_LENGTH(hp->s.field_len, FIELD_NAME); f = uncommon_field(PTR_TO(start.field), hp->s.field_len); } else if (f == g_http_connection) { - if (STR_CSTR_CASE_EQ(v, "close")) - hp->flags &= ~UH_FL_KEEPALIVE; + if (hp->flags & UH_FL_KAMETHOD) { + if (STR_CSTR_CASE_EQ(v, "keep-alive")) + hp->flags |= UH_FL_KAVERSION; + else if (STR_CSTR_CASE_EQ(v, "close")) + hp->flags &= ~UH_FL_KEEPALIVE; + } } else if (f == g_content_length) { hp->len.content = parse_length(RSTRING_PTR(v), RSTRING_LEN(v)); if (hp->len.content < 0) |