diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/yahns/rackup_handler.rb | 4 | ||||
-rw-r--r-- | lib/yahns/server.rb | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/yahns/rackup_handler.rb b/lib/yahns/rackup_handler.rb index 943d858..127db48 100644 --- a/lib/yahns/rackup_handler.rb +++ b/lib/yahns/rackup_handler.rb @@ -18,8 +18,8 @@ module Yahns::RackupHandler # :nodoc: app(:rack, app) do addr = o[:listen] || "#{o[:Host]||default_host}:#{o[:Port]||8080}" # allow listening to multiple addresses - if addr =~ /,/ - addr.split(/,/).each { |l| listen(l) } + if addr.include?(',') + addr.split(',').each { |l| listen(l) } else listen addr end diff --git a/lib/yahns/server.rb b/lib/yahns/server.rb index ae2ebd4..b28e741 100644 --- a/lib/yahns/server.rb +++ b/lib/yahns/server.rb @@ -1,4 +1,3 @@ -# -*- encoding: binary -*- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) require_relative 'queue_quitter' @@ -314,7 +313,7 @@ class Yahns::Server # :nodoc: # because that can completely break the non-blocking one. # Unfortunately, there is no one-off MSG_DONTWAIT-like flag for # accept4(2). - inherited = ENV['YAHNS_FD'].to_s.split(/,/).map do |fd| + inherited = ENV['YAHNS_FD'].to_s.split(',').map do |fd| io = Socket.for_fd(fd.to_i) set_server_sockopt(io, sock_opts(io)) @logger.info "inherited addr=#{sock_name(io)} fd=#{fd}" |