* [ANN] yahns 1.12.5 -_- sleepy app server for Ruby
@ 2016-06-05 23:12 4% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-06-05 23:12 UTC (permalink / raw)
To: ruby-talk, yahns-public
A Free Software, multi-threaded, non-blocking network
application server designed for low _idle_ power consumption.
It is primarily optimized for applications with occasional users
which see little or no traffic. yahns currently hosts Rack/HTTP
applications, but may eventually support other application
types. Unlike some existing servers, yahns is extremely
sensitive to fatal bugs in the applications it hosts.
* git clone git://yhbt.net/yahns
* https://yahns.yhbt.net/README
* https://yahns.yhbt.net/NEWS.atom.xml
* we only accept plain-text email yahns-public@yhbt.net
* and archive all the mail we receive: https://yhbt.net/yahns-public/
* nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns
Changes:
yahns 1.12.5 - proxy_pass + rack.hijack fixes
Hopefully the last of the 1.12.x series, this release
fixes a few minor bugs mainly needed for testing.
No upgrade should be necessary for non-proxy_pass users.
4 changes since v1.12.4 from the "maint" branch at
git://yhbt.net/yahns.git
http_client: set state to :ignore before hijack callback
test/test_client_expire: fix for high RLIMIT_NOFILE
proxy_pass: do not chunk HTTP/1.0 with keep-alive
proxy_pass: X-Forwarded-For appends to existing list
lib/yahns/http_client.rb | 6 +++---
lib/yahns/proxy_http_response.rb | 8 ++++++--
lib/yahns/proxy_pass.rb | 5 ++++-
test/test_client_expire.rb | 13 +++++++++++--
test/test_proxy_pass.rb | 10 ++++++++++
5 files changed, 34 insertions(+), 8 deletions(-)
Note: the current "master" branch (at commit 5e211ea003d2)
includes refactorings and new features not included in this
release.
Please note the disclaimer:
yahns is extremely sensitive to fatal bugs in the apps it hosts. There
is no (and never will be) any built-in "watchdog"-type feature to kill
stuck processes/threads. Each yahns process may be handling thousands
of clients; unexpectedly killing the process will abort _all_ of those
connections. Lives may be lost!
yahns hackers are not responsible for your application/library bugs.
Use an application server which is tolerant of buggy applications
if you cannot be bothered to fix all your fatal bugs.
^ permalink raw reply [relevance 4%]
* [PATCH] proxy_pass: do not chunk HTTP/1.0 with keep-alive
@ 2016-05-16 1:12 7% Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-05-16 1:12 UTC (permalink / raw)
To: yahns-public
Instead, we must drop non-terminated responses since
HTTP/1.0 clients do not understand chunked encoding.
This is necessary for "ab -k" which still uses HTTP/1.0.
---
lib/yahns/proxy_http_response.rb | 8 ++++++--
test/test_proxy_pass.rb | 10 ++++++++++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/lib/yahns/proxy_http_response.rb b/lib/yahns/proxy_http_response.rb
index c5e7be5..bd274fe 100644
--- a/lib/yahns/proxy_http_response.rb
+++ b/lib/yahns/proxy_http_response.rb
@@ -105,8 +105,12 @@ def proxy_response_start(res, tip, kcar, req_res)
# chunk the response ourselves if the client supports it,
# but the backend does not terminate properly
- if alive && ! term && (env['HTTP_VERSION'] == 'HTTP/1.1'.freeze)
- res << "Transfer-Encoding: chunked\r\n".freeze
+ if alive && ! term
+ if env['HTTP_VERSION'] == 'HTTP/1.1'.freeze
+ res << "Transfer-Encoding: chunked\r\n".freeze
+ else # we can't persist HTTP/1.0 and HTTP/0.9 w/o Content-Length
+ alive = false
+ end
end
res << (alive ? "Connection: keep-alive\r\n\r\n".freeze
: "Connection: close\r\n\r\n".freeze)
diff --git a/test/test_proxy_pass.rb b/test/test_proxy_pass.rb
index c938976..5dd8058 100644
--- a/test/test_proxy_pass.rb
+++ b/test/test_proxy_pass.rb
@@ -572,6 +572,16 @@ def check_response_trailer(host, port)
end
def check_eof_body(host, port)
+ Timeout.timeout(30) do
+ s = TCPSocket.new(host, port)
+ s.write("GET /eof-body-fast HTTP/1.0\r\nConnection:keep-alive\r\n\r\n")
+ res = s.read
+ assert_match %r{\AHTTP/1\.[01] 200 OK\r\n}, res
+ assert_match %r{\r\nConnection: close\r\n}, res
+ assert_match %r{\r\n\r\neof-body-fast\z}, res
+ s.close
+ end
+
Timeout.timeout(60) do
s = TCPSocket.new(host, port)
s.write("GET /eof-body-fast HTTP/1.0\r\n\r\n")
^ 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 --
2016-04-08 20:01 [ANN] yahns 1.12.3 -_- sleepy app server for Ruby Eric Wong
2016-05-02 19:47 ` [ANN] yahns 1.12.4 " Eric Wong
2016-06-05 23:12 4% ` [ANN] yahns 1.12.5 " Eric Wong
2016-05-16 1:12 7% [PATCH] proxy_pass: do not chunk HTTP/1.0 with keep-alive Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/yahns.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).