Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bump unixrack to version 1.0.4.1

  • Loading branch information...
commit 56df595d61adfd26725f7248a71da3321b29f630 1 parent 1f8485f
Aaron Stone sodabrew authored
2  vendor/environment.rb
View
@@ -13,5 +13,5 @@ def rqrq_rqenv_add_path_if_needed(path)
rqrq_rqenv_add_path_if_needed(File.expand_path("#{dir}/gems/tilt-1.4.1/lib"))
rqrq_rqenv_add_path_if_needed(File.expand_path("#{dir}/gems/rack-protection-1.5.1/lib"))
rqrq_rqenv_add_path_if_needed(File.expand_path("#{dir}/gems/sinatra-1.4.4/lib"))
-rqrq_rqenv_add_path_if_needed(File.expand_path("#{dir}/gems/unixrack-1.0.1/lib"))
+rqrq_rqenv_add_path_if_needed(File.expand_path("#{dir}/gems/unixrack-1.0.4.1/lib"))
rqrq_rqenv_add_path_if_needed(File.expand_path("#{dir}/gems/daemons-1.1.9/lib"))
3  vendor/gems/unixrack-1.0.1/lib/unixrack/version.rb
View
@@ -1,3 +0,0 @@
-module Unixrack
- VERSION = "1.0.1"
-end
0  vendor/gems/unixrack-1.0.1/.gitignore → vendor/gems/unixrack-1.0.4.1/.gitignore
View
File renamed without changes
0  vendor/gems/unixrack-1.0.1/Gemfile → vendor/gems/unixrack-1.0.4.1/Gemfile
View
File renamed without changes
0  vendor/gems/unixrack-1.0.1/LICENSE.txt → vendor/gems/unixrack-1.0.4.1/LICENSE.txt
View
File renamed without changes
22 vendor/gems/unixrack-1.0.1/README.md → vendor/gems/unixrack-1.0.4.1/README.md
View
@@ -24,28 +24,6 @@ Or install it yourself as:
$ gem install unixrack
-## Sample sinatra bring up
-
-put instructions here
-
- $ gem install sinatra
- $ gem build unixrack.gemspec
- $ gem install unirack*gem
-
- #!/usr/bin/ruby
-
- require 'rubygems'
- require 'sinatra/base'
- require 'unixrack'
-
- class MyApp < Sinatra::Base
- get '/' do
- "Hello"
- end
- end
-
- Rack::Handler::UnixRack.run(MyApp.new)
-
## Usage
Here is an example command to run the standard Rack lobster web app.
0  vendor/gems/unixrack-1.0.1/Rakefile → vendor/gems/unixrack-1.0.4.1/Rakefile
View
File renamed without changes
21 vendor/gems/unixrack-1.0.1/lib/unixrack.rb → vendor/gems/unixrack-1.0.4.1/lib/unixrack.rb
View
@@ -52,16 +52,16 @@ def peeraddr
end
def self.write_buff(io, buff)
- len = buff.length
nwritten = 0
out_buff = buff
+ # buff could be UTF-8
while true
nw = io.syswrite(out_buff)
nwritten = nwritten + nw
- break if nw == out_buff.length
- out_buff = out_buff.slice(nw..-1)
+ break if nw == out_buff.bytesize
+ out_buff = out_buff.byteslice(nw..-1)
end
nwritten
end
@@ -92,7 +92,7 @@ def self.read_sock_num_bytes(sock, num, log = lambda { |x| x })
rescue EOFError
retval = [false, "EOF", buff]
break
- rescue EOFError, Errno::ECONNRESET, Errno::EPIPE, Errno::EINVAL, Errno::EBADF
+ rescue Errno::ECONNRESET, Errno::EPIPE, Errno::EINVAL, Errno::EBADF
retval = [false, "Exception occurred on socket read"]
#log("Got an #{$!} from socket read")
break
@@ -111,7 +111,7 @@ def do_read
puts "#{$$}: Got an EOF from socket read"
$stdout.flush
return nil
- rescue EOFError, Errno::ECONNRESET, Errno::EPIPE, Errno::EINVAL, Errno::EBADF
+ rescue Errno::ECONNRESET, Errno::EPIPE, Errno::EINVAL, Errno::EBADF
puts "#{$$}: Got an #{$!} from socket read"
$stdout.flush
exit! 0
@@ -327,7 +327,7 @@ def self.run(app, options={})
end
trap(:TERM) { log(0, "Listener received TERM. Exiting."); exit! 0 }
- trap("SIGINT") { log(0, "Listener received INT. Exiting."); exit! 0 }
+ trap(:INT) { log(0, "Listener received INT. Exiting."); exit! 0 }
if not @@chdir.empty?
Dir.chdir @@chdir
@@ -358,7 +358,7 @@ def self.run(app, options={})
server.close
@@start_time = Time.now
- trap("ALRM") { log(0, "Child received ALARM during read_headers. Exiting."); exit! 2 }
+ trap(:ALRM) { log(0, "Child received ALARM during read_headers. Exiting."); exit! 2 }
trap(:TERM) { log(0, "Child received TERM. Exiting."); exit! 0 }
::UnixRack::Alarm.alarm(5) # if no command received in 5 secs
@@ -367,10 +367,10 @@ def self.run(app, options={})
@@client_ip = sock.peeraddr.last
if not sock.read_headers()
- send_error_response!(sock, 400, "Bad Request")
+ send_error_response!(sock, 400, "Bad Request", "-", "-")
end
- trap("ALRM") { log(0, "Child received ALARM during response. Exiting."); exit! 2 }
+ trap(:ALRM) { log(0, "Child received ALARM during response. Exiting."); exit! 2 }
::UnixRack::Alarm.alarm(120) # if command not handled in 120 seconds
if not allowed_ips.empty?
@@ -457,6 +457,9 @@ def self.run(app, options={})
if sock.headers['X-Forwarded-For']
env["HTTP_X_FORWARDED_FOR"] = sock.headers['X-Forwarded-For']
end
+ if sock.headers['X-Forwarded-Proto']
+ env["HTTP_X_FORWARDED_PROTO"] = sock.headers['X-Forwarded-Proto']
+ end
if sock.headers['Host']
env["HTTP_HOST"] = sock.headers['Host']
end
3  vendor/gems/unixrack-1.0.4.1/lib/unixrack/version.rb
View
@@ -0,0 +1,3 @@
+module Unixrack
+ VERSION = "1.0.4.1"
+end
0  vendor/gems/unixrack-1.0.1/sample/lobster.ru → vendor/gems/unixrack-1.0.4.1/sample/lobster.ru
View
File renamed without changes
0  vendor/gems/unixrack-1.0.1/unixrack.gemspec → vendor/gems/unixrack-1.0.4.1/unixrack.gemspec
View
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.