unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] unicorn 4.6.3 - fix --no-default-middleware option
@ 2013-06-21  8:14  5% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2013-06-21  8:14 UTC (permalink / raw)
  To: mongrel-unicorn

Changes:

Thanks to Micah Chalmer for this fix.  There are also minor
documentation updates and internal cleanups.

Eric Wong (4):
      doc: update documentation for systemd + PrivateTmp users
      test_signals: increase delay between Process.kill
      HttpParser#next? becomes response_start_sent-aware
      unicorn 4.6.3 - fix --no-default-middleware option

Micah Chalmer (1):
      Make -N/--no-default-middleware option work

* http://unicorn.bogomips.org/
* mongrel-unicorn@rubyforge.org
* git://bogomips.org/unicorn.git
* http://unicorn.bogomips.org/NEWS.atom.xml

/me yawns
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

^ permalink raw reply	[relevance 5%]

* [PATCH] HttpParser#next? becomes response_start_sent-aware
@ 2013-05-08 23:01  7% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2013-05-08 23:01 UTC (permalink / raw)
  To: mongrel-unicorn

This could allow servers with persistent connection support[1]
to support our check_client_connection in the future.

[1] - Rainbows!/zbatery, possibly others
---
 ext/unicorn_http/unicorn_http.rl |  6 ++----
 test/unit/test_http_parser_ng.rb | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl
index 1a8003f..3529740 100644
--- a/ext/unicorn_http/unicorn_http.rl
+++ b/ext/unicorn_http/unicorn_http.rl
@@ -732,10 +732,8 @@ static VALUE HttpParser_parse(VALUE self)
   struct http_parser *hp = data_get(self);
   VALUE data = hp->buf;
 
-  if (HP_FL_TEST(hp, TO_CLEAR)) {
-    http_parser_init(hp);
-    rb_funcall(hp->env, id_clear, 0);
-  }
+  if (HP_FL_TEST(hp, TO_CLEAR))
+    HttpParser_clear(self);
 
   http_parser_execute(hp, RSTRING_PTR(data), RSTRING_LEN(data));
   if (hp->offset > MAX_HEADER_LEN)
diff --git a/test/unit/test_http_parser_ng.rb b/test/unit/test_http_parser_ng.rb
index 93c44bb..ab335ac 100644
--- a/test/unit/test_http_parser_ng.rb
+++ b/test/unit/test_http_parser_ng.rb
@@ -12,6 +12,23 @@ def setup
     @parser = HttpParser.new
   end
 
+  def test_next_clear
+    r = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"
+    @parser.buf << r
+    @parser.parse
+    @parser.response_start_sent = true
+    assert @parser.keepalive?
+    assert @parser.next?
+    assert @parser.response_start_sent
+
+    # persistent client makes another request:
+    @parser.buf << r
+    @parser.parse
+    assert @parser.keepalive?
+    assert @parser.next?
+    assert_equal false, @parser.response_start_sent
+  end
+
   def test_keepalive_requests_default_constant
     assert_kind_of Integer, HttpParser::KEEPALIVE_REQUESTS_DEFAULT
     assert HttpParser::KEEPALIVE_REQUESTS_DEFAULT >= 0
-- 
Eric Wong
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

^ permalink raw reply related	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2013-05-08 23:01  7% [PATCH] HttpParser#next? becomes response_start_sent-aware Eric Wong
2013-06-21  8:14  5% [ANN] unicorn 4.6.3 - fix --no-default-middleware option Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).