unicorn 2.0.0pre2 → 2.0.0pre2.1.ge991

Sign up to get free protection for your applications and to get access to all the features.
@@ -496,7 +496,6 @@ static VALUE HttpParser_reset(VALUE self)
496
496
 
497
497
  http_parser_init(hp);
498
498
  rb_funcall(hp->env, id_clear, 0);
499
- rb_str_set_len(hp->buf, 0);
500
499
 
501
500
  return Qnil;
502
501
  }
@@ -473,4 +473,29 @@ class HttpParserNgTest < Test::Unit::TestCase
473
473
  assert_equal expect, req
474
474
  end
475
475
 
476
+ def test_pipelined_requests
477
+ expect = {
478
+ "HTTP_HOST" => "example.com",
479
+ "SERVER_NAME" => "example.com",
480
+ "REQUEST_PATH" => "/",
481
+ "rack.url_scheme" => "http",
482
+ "SERVER_PROTOCOL" => "HTTP/1.1",
483
+ "PATH_INFO" => "/",
484
+ "HTTP_VERSION" => "HTTP/1.1",
485
+ "REQUEST_URI" => "/",
486
+ "SERVER_PORT" => "80",
487
+ "REQUEST_METHOD" => "GET",
488
+ "QUERY_STRING" => ""
489
+ }
490
+ str = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"
491
+ @parser.buf << (str * 2)
492
+ env1 = @parser.parse.dup
493
+ assert_equal expect, env1
494
+ assert_equal str, @parser.buf
495
+ assert @parser.keepalive?
496
+ @parser.reset
497
+ env2 = @parser.parse.dup
498
+ assert_equal expect, env2
499
+ assert_equal "", @parser.buf
500
+ end
476
501
  end
metadata CHANGED
@@ -1,13 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicorn
3
3
  version: !ruby/object:Gem::Version
4
- hash: -766259858
4
+ hash: 12487189
5
5
  prerelease: true
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
9
  - 0pre2
10
- version: 2.0.0pre2
10
+ - 1
11
+ - ge991
12
+ version: 2.0.0pre2.1.ge991
11
13
  platform: ruby
12
14
  authors:
13
15
  - Unicorn hackers