* [ANN] unicorn 5.4.0 - Rack HTTP server for fast clients and Unix
@ 2017-12-23 23:42 4% Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2017-12-23 23:42 UTC (permalink / raw)
To: ruby-talk, unicorn-public; +Cc: James P Robinson Jr, Sam Saffron
unicorn is an HTTP server for Rack applications designed to only serve
fast clients on low-latency, high-bandwidth connections and take
advantage of features in Unix/Unix-like kernels. Slow clients should
only be served by placing a reverse proxy capable of fully buffering
both the the request and response in between unicorn and slow clients.
* https://bogomips.org/unicorn/
* public list: unicorn-public@bogomips.org
* mail archives: https://bogomips.org/unicorn-public/
* git clone git://bogomips.org/unicorn.git
* https://bogomips.org/unicorn/NEWS.atom.xml
* nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn
Changes:
Rack hijack support improves as the app code can capture and use
the Rack `env' privately without copying it (to avoid clobbering
by another client). Thanks to Sam Saffron for reporting and
testing this new feature:
https://bogomips.org/unicorn-public/CAAtdryPG3nLuyo0jxfYW1YHu1Q+ZpkLkd4KdWC8vA46B5haZxw@mail.gmail.com/T/
We also now support $DEBUG being set by the Rack app (instead of
relying on the "-d" CLI switch). Thanks to James P Robinson Jr
for reporting this bug:
https://bogomips.org/unicorn-public/D6324CB4.7BC3E%25james.robinson3@cigna.com/T/
(Coincidentally, this fix will be irrelevant for Ruby 2.5
which requires 'pp' by default)
There's a few minor test cleanups and documentation updates, too.
All commits since v5.3.1 (2017-10-03):
reduce method calls with String#start_with?
require 'pp' if $DEBUG is set by Rack app
avoid reusing env on hijack
tests: cleanup some unused variable warnings
ISSUES: add a note about Debian BTS interopability
Roughly all mailing discussions since the last release:
https://bogomips.org/unicorn-public/?q=d:20171004..20171223
^ permalink raw reply [relevance 4%]
* [PATCH] reduce method calls with String#start_with?
@ 2017-06-28 0:19 7% Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2017-06-28 0:19 UTC (permalink / raw)
To: unicorn-public
These three cold call sites instruction sequence size by a few
hundred bytes combined since we no longer support Ruby 1.8.6.
The "?/" shorthand is esoteric and no longer avoids allocation
in Ruby 1.9+ (not that this is hot code).
---
lib/unicorn/configurator.rb | 2 +-
lib/unicorn/http_server.rb | 2 +-
lib/unicorn/socket_helper.rb | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb
index 7fb9030f..f34d38b8 100644
--- a/lib/unicorn/configurator.rb
+++ b/lib/unicorn/configurator.rb
@@ -587,7 +587,7 @@ def working_directory(path)
# just let chdir raise errors
path = File.expand_path(path)
if config_file &&
- config_file[0] != ?/ &&
+ ! config_file.start_with?('/') &&
! File.readable?("#{path}/#{config_file}")
raise ArgumentError,
"config_file=#{config_file} would not be accessible in" \
diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 3827f2e9..f33aa252 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
@@ -148,7 +148,7 @@ def start
def listeners=(listeners)
cur_names, dead_names = [], []
listener_names.each do |name|
- if ?/ == name[0]
+ if name.start_with?('/')
# mark unlinked sockets as dead so we can rebind them
(File.socket?(name) ? cur_names : dead_names) << name
else
diff --git a/lib/unicorn/socket_helper.rb b/lib/unicorn/socket_helper.rb
index f52dde2d..9e672d97 100644
--- a/lib/unicorn/socket_helper.rb
+++ b/lib/unicorn/socket_helper.rb
@@ -116,7 +116,7 @@ def log_buffer_sizes(sock, pfx = '')
def bind_listen(address = '0.0.0.0:8080', opt = {})
return address unless String === address
- sock = if address[0] == ?/
+ sock = if address.start_with?('/')
if File.exist?(address)
if File.socket?(address)
begin
--
EW
^ 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 --
2017-06-28 0:19 7% [PATCH] reduce method calls with String#start_with? Eric Wong
2017-12-23 23:42 4% [ANN] unicorn 5.4.0 - Rack HTTP server for fast clients and Unix 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).