buffering.rb
sysread_nonblock
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/openssl/buffering.rb
in
sysread_nonblock
buf.clear
return buf
else
return ""
end
end
if @rbuffer.empty?
return sysread_nonblock(maxlen, buf)
end
ret = consume_rbuff(maxlen)
if buf
buf.replace(ret)
ret = buf
end
raise EOFError if ret.empty?
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/openssl/buffering.rb
in
read_nonblock
buf.clear
return buf
else
return ""
end
end
if @rbuffer.empty?
return sysread_nonblock(maxlen, buf)
end
ret = consume_rbuff(maxlen)
if buf
buf.replace(ret)
ret = buf
end
raise EOFError if ret.empty?
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/protocol.rb
in
rbuf_fill
private
BUFSIZE = 1024 * 16
def rbuf_fill
begin
@rbuf << @io.read_nonblock(BUFSIZE)
rescue IO::WaitReadable
if IO.select([@io], nil, nil, @read_timeout)
retry
else
raise Timeout::Error
end
rescue IO::WaitWritable
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/protocol.rb
in
readuntil
LOG "read #{read_bytes} bytes"
dest
end
def readuntil(terminator, ignore_eof = false)
begin
until idx = @rbuf.index(terminator)
rbuf_fill
end
return rbuf_consume(idx + terminator.size)
rescue EOFError
raise unless ignore_eof
return rbuf_consume(@rbuf.size)
end
end
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/protocol.rb
in
readline
rescue EOFError
raise unless ignore_eof
return rbuf_consume(@rbuf.size)
end
end
def readline
readuntil("\n").chop
end
private
BUFSIZE = 1024 * 16
def rbuf_fill
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb
in
read_status_line
end
res
end
private
def read_status_line(sock)
str = sock.readline
m = /\AHTTP(?:\/(\d+\.\d+))?\s+(\d\d\d)\s*(.*)\z/in.match(str) or
raise HTTPBadResponse, "wrong status line: #{str.dump}"
m.captures
end
def response_class(code)
CODE_TO_OBJ[code] or
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb
in
read_new
'503' => HTTPServiceUnavailable,
'504' => HTTPGatewayTimeOut,
'505' => HTTPVersionNotSupported
}
class << HTTPResponse
def read_new(sock) #:nodoc: internal use only
httpv, code, msg = read_status_line(sock)
res = response_class(code).new(httpv, code, msg)
each_response_header(sock) do |k,v|
res.add_field k, v
end
res
end
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb
in
transport_request
private
def transport_request(req)
begin_transport req
req.exec @socket, @curr_http_version, edit_path(req.path)
begin
res = HTTPResponse.read_new(@socket)
end while res.kind_of?(HTTPContinue)
res.reading_body(@socket, req.response_body_permitted?) {
yield res if block_given?
}
end_transport req, res
res
rescue => exception
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb
in
request
return request(req, body, &block)
}
end
if proxy_user()
req.proxy_basic_auth proxy_user(), proxy_pass() unless use_ssl?
end
req.set_body_internal body
res = transport_request(req, &block)
if sspi_auth?(res)
sspi_auth(req)
res = transport_request(req, &block)
end
res
end
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb
in
block in request
#
# This method never raises Net::* exceptions.
#
def request(req, body = nil, &block) # :yield: +response+
unless started?
start {
req['connection'] ||= 'close'
return request(req, body, &block)
}
end
if proxy_user()
req.proxy_basic_auth proxy_user(), proxy_pass() unless use_ssl?
end
req.set_body_internal body
res = transport_request(req, &block)
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb
in
start
# block; otherwise, returns self.
#
def start # :yield: http
raise IOError, 'HTTP session already opened' if @started
if block_given?
begin
do_start
return yield(self)
ensure
do_finish
end
end
do_start
self
end
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb
in
request
#
# Returns a HTTPResponse object.
#
# This method never raises Net::* exceptions.
#
def request(req, body = nil, &block) # :yield: +response+
unless started?
start {
req['connection'] ||= 'close'
return request(req, body, &block)
}
end
if proxy_user()
req.proxy_basic_auth proxy_user(), proxy_pass() unless use_ssl?
end
/home/rorapps/.rvm/rubies/ruby-1.9.2-p330/lib/ruby/1.9.1/net/http.rb
in
get
unless initheader.keys.any?{|k| k.downcase == "accept-encoding"}
initheader = initheader.merge({
"accept-encoding" => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
})
@compression = true
end
end
request(Get.new(path, initheader)) {|r|
if r.key?("content-encoding") and @compression
@compression = nil # Clear it till next set.
the_body = r.read_body dest, &block
case r["content-encoding"]
when "gzip"
r.body= Zlib::GzipReader.new(StringIO.new(the_body), encoding: "ASCII-8BIT").read
r.delete("content-encoding")
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/bundler/gems/rubycas-server-986b1d50bf49/lib/casserver/server.rb
in
render_userbar
uri = URI.parse('https://profiles.3dgames.com.ar/user_bar/false/basic?service_uri=http://foros.3dgames.com.ar')
end
$LOG.debug("Sending request for user_bar")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
data = http.get(uri.request_uri)
# req = Net::HTTP::Get.new(url.to_s)
# res = Net::HTTP.start(url.host, url.port) {|http|
# http.request(req)
# }
data.body.to_my_utf8
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/bundler/gems/rubycas-server-986b1d50bf49/lib/casserver/server.rb
in
block in <class:Server>
elsif !tgt
$LOG.debug("No ticket granting ticket detected.")
end
if tgt and !tgt_error
@user_bar = render_userbar(tgt.extra_attributes['user_hash'])
else
@user_bar = render_userbar(nil)
end
if params['redirection_loop_intercepted']
@message = {:type => 'mistake',
:message => _("The client and server are unable to negotiate authentication. Please try logging in again later.")}
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
call
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
pattern, keys = compile path
conditions, @conditions = @conditions, []
wrapper = block.arity != 0 ?
proc { |a,p| unbound_method.bind(a).call(*p) } :
proc { |a,p| unbound_method.bind(a).call }
wrapper.instance_variable_set(:@route_name, method_name)
[ pattern, keys, conditions, wrapper ]
end
def compile(path)
if path.respond_to? :to_str
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in compile!
method_name = "#{verb} #{path}"
unbound_method = generate_method(method_name, &block)
pattern, keys = compile path
conditions, @conditions = @conditions, []
wrapper = block.arity != 0 ?
proc { |a,p| unbound_method.bind(a).call(*p) } :
proc { |a,p| unbound_method.bind(a).call }
wrapper.instance_variable_set(:@route_name, method_name)
[ pattern, keys, conditions, wrapper ]
end
def compile(path)
if path.respond_to? :to_str
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
[]
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, keys, conditions, block|
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block (3 levels) in route!
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, keys, conditions, block|
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
route_eval
route_eval(&pass_block) if pass_block
route_missing
end
# Run a route block and throw :halt with the result.
def route_eval
throw :halt, yield
end
# If the current request matches pattern and conditions, fill params
# with keys and call the given block.
# Revert params afterwards.
#
# Returns pass block.
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block (2 levels) in route!
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, keys, conditions, block|
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in process_route
if values.any?
original, @params = params, params.merge('splat' => [], 'captures' => values)
keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
ensure
@params = original if original
end
# No matching route was found or all routes passed. The default
# implementation is to forward the request downstream when running
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
catch
values += match.captures.map! { |v| force_encoding URI_INSTANCE.unescape(v) if v }
if values.any?
original, @params = params, params.merge('splat' => [], 'captures' => values)
keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
ensure
@params = original if original
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
process_route
values += match.captures.map! { |v| force_encoding URI_INSTANCE.unescape(v) if v }
if values.any?
original, @params = params, params.merge('splat' => [], 'captures' => values)
keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
ensure
@params = original if original
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in route!
base.filters[type].each { |args| process_route(*args) }
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, keys, conditions, block|
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
each
filter! type, base.superclass if base.superclass.respond_to?(:filters)
base.filters[type].each { |args| process_route(*args) }
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, keys, conditions, block|
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
route!
filter! type, base.superclass if base.superclass.respond_to?(:filters)
base.filters[type].each { |args| process_route(*args) }
end
# Run routes defined on the class and all superclasses.
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, keys, conditions, block|
returned_pass_block = process_route(pattern, keys, conditions) do |*args|
env['sinatra.route'] = block.instance_variable_get(:@route_name)
route_eval { block[*args] }
end
# don't wipe out pass_block in superclass
pass_block = returned_pass_block if returned_pass_block
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in dispatch!
end
# Dispatch a request with error handling.
def dispatch!
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before
route!
end
rescue ::Exception => boom
invoke { handle_exception!(boom) }
ensure
begin
filter! :after unless env['sinatra.static_file']
rescue ::Exception => boom
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in invoke
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
catch
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
invoke
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
dispatch!
body res
end
nil # avoid double setting the same response tuple twice
end
# Dispatch a request with error handling.
def dispatch!
invoke do
static! if settings.static? && (request.get? || request.head?)
filter! :before
route!
end
rescue ::Exception => boom
invoke { handle_exception!(boom) }
ensure
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in call!
@request = Request.new(env)
@response = Response.new
@params = indifferent_params(@request.params)
template_cache.clear if settings.reload_templates
force_encoding(@params)
@response['Content-Type'] = nil
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
unless @response['Content-Type']
if Array === body and body[0].respond_to? :content_type
content_type body[0].content_type
else
content_type :html
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
block in invoke
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
catch
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
invoke
# Creates a Hash with indifferent access.
def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end
# Run the block with 'throw :halt' support and apply result to the response.
def invoke
res = catch(:halt) { yield }
res = [res] if Integer === res or String === res
if Array === res and Integer === res.first
res = res.dup
status(res.shift)
body(res.pop)
headers(*res)
elsif res.respond_to? :each
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
call!
@request = Request.new(env)
@response = Response.new
@params = indifferent_params(@request.params)
template_cache.clear if settings.reload_templates
force_encoding(@params)
@response['Content-Type'] = nil
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
unless @response['Content-Type']
if Array === body and body[0].respond_to? :content_type
content_type body[0].content_type
else
content_type :html
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
call
@app = app
@template_cache = Tilt::Cache.new
yield self if block_given?
end
# Rack call interface.
def call(env)
dup.call!(env)
end
def call!(env) # :nodoc:
@env = env
@request = Request.new(env)
@response = Response.new
@params = indifferent_params(@request.params)
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-protection-1.5.5/lib/rack/protection/xss_header.rb
in
call
#
# Options:
# xss_mode:: How the browser should prevent the attack (default: :block)
class XSSHeader < Base
default_options :xss_mode => :block, :nosniff => true
def call(env)
status, headers, body = @app.call(env)
headers['X-XSS-Protection'] ||= "1; mode=#{options[:xss_mode]}" if html? headers
headers['X-Content-Type-Options'] ||= 'nosniff' if options[:nosniff]
[status, headers, body]
end
end
end
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-protection-1.5.5/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if Array === result and result.size == 3
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-protection-1.5.5/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if Array === result and result.size == 3
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-protection-1.5.5/lib/rack/protection/path_traversal.rb
in
call
#
# Unescapes '/' and '.', expands +path_info+.
# Thus <tt>GET /foo/%2e%2e%2fbar</tt> becomes <tt>GET /bar</tt>.
class PathTraversal < Base
def call(env)
path_was = env["PATH_INFO"]
env["PATH_INFO"] = cleanup path_was if path_was && !path_was.empty?
app.call env
ensure
env["PATH_INFO"] = path_was
end
def cleanup(path)
if path.respond_to?(:encoding)
# Ruby 1.9+ M17N
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-protection-1.5.5/lib/rack/protection/json_csrf.rb
in
call
# Array prototype has been patched to track data. Checks the referrer
# even on GET requests if the content type is JSON.
class JsonCsrf < Base
alias react deny
def call(env)
request = Request.new(env)
status, headers, body = app.call(env)
if has_vector? request, headers
warn env, "attack prevented by #{self.class}"
react(env) or [status, headers, body]
else
[status, headers, body]
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-protection-1.5.5/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if Array === result and result.size == 3
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-protection-1.5.5/lib/rack/protection/base.rb
in
call
end
def call(env)
unless accepts? env
instrument env
result = react env
end
result or app.call(env)
end
def react(env)
result = send(options[:reaction], env)
result if Array === result and result.size == 3
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-protection-1.5.5/lib/rack/protection/frame_options.rb
in
call
frame_options = options[:frame_options]
frame_options = options[:frame_options].to_s.upcase unless frame_options.respond_to? :to_str
frame_options.to_str
end
end
def call(env)
status, headers, body = @app.call(env)
headers['X-Frame-Options'] ||= frame_options if html? headers
[status, headers, body]
end
end
end
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/session/abstract/id.rb
in
context
def call(env)
context(env)
end
def context(env, app=@app)
prepare_session(env)
status, headers, body = app.call(env)
commit_session(env, status, headers, body)
end
private
def initialize_sid
@sidbits = @default_options[:sidbits]
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/session/abstract/id.rb
in
call
@default_options = self.class::DEFAULT_OPTIONS.merge(options)
@key = @default_options.delete(:key)
@cookie_only = @default_options.delete(:cookie_only)
initialize_sid
end
def call(env)
context(env)
end
def context(env, app=@app)
prepare_session(env)
status, headers, body = app.call(env)
commit_session(env, status, headers, body)
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/nulllogger.rb
in
call
class NullLogger
def initialize(app)
@app = app
end
def call(env)
env['rack.logger'] = self
@app.call(env)
end
def info(progname = nil, &block); end
def debug(progname = nil, &block); end
def warn(progname = nil, &block); end
def error(progname = nil, &block); end
def fatal(progname = nil, &block); end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/head.rb
in
call
# Rack::Head returns an empty body for all HEAD requests. It leaves
# all other requests unchanged.
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
if env[REQUEST_METHOD] == HEAD
[
status, headers, Rack::BodyProxy.new([]) do
body.close if body.respond_to? :close
end
]
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/show_exceptions.rb
in
call
def initialize(app)
@app = app
@template = ERB.new(TEMPLATE)
end
def call(env)
@app.call(env)
rescue Exception => e
errors, env["rack.errors"] = env["rack.errors"], @@eats_errors
if prefers_plain_text?(env)
content_type = "text/plain"
exception = dump_exception(e)
else
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
call
# Some Rack handlers (Thin, Rainbows!) implement an extended body object protocol, however,
# some middleware (namely Rack::Lint) will break it by not mirroring the methods in question.
# This middleware will detect an extended body object and will make sure it reaches the
# handler directly. We do this here, so our middleware and middleware set up by the app will
# still be able to run.
class ExtendedRack < Struct.new(:app)
def call(env)
result, callback = app.call(env), env['async.callback']
return result unless callback and async?(*result)
after_response { callback.call result }
setup_close(env, *result)
throw :async
end
private
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
call
end
def helpers
@instance
end
def call(env)
@stack.call(env)
end
def inspect
"#<#{@instance.class} app_file=#{settings.app_file.inspect}>"
end
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/commonlogger.rb
in
call
def initialize(app, logger=nil)
@app = app
@logger = logger
end
def call(env)
began_at = Time.now
status, header, body = @app.call(env)
header = Utils::HeaderHash.new(header)
body = BodyProxy.new(body) { log(env, status, header, began_at) }
[status, header, body]
end
private
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
call
env['sinatra.commonlogger'] ? @app.call(env) : super
end
superclass.class_eval do
alias call_without_check call unless method_defined? :call_without_check
def call(env)
env['sinatra.commonlogger'] = true
call_without_check(env)
end
end
end
class NotFound < NameError #:nodoc:
def http_status; 404 end
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/runtime.rb
in
call
@header_name = "X-Runtime"
@header_name << "-#{name}" if name
end
FORMAT_STRING = "%0.6f"
def call(env)
start_time = clock_time
status, headers, body = @app.call(env)
request_time = clock_time - start_time
if !headers.has_key?(@header_name)
headers[@header_name] = FORMAT_STRING % request_time
end
[status, headers, body]
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/showexceptions.rb
in
call
def initialize(app)
@app = app
@template = ERB.new(TEMPLATE)
end
def call(env)
@app.call(env)
rescue StandardError, LoadError, SyntaxError => e
exception_string = dump_exception(e)
env["rack.errors"].puts(exception_string)
env["rack.errors"].flush
if accepts_html?(env)
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/tempfile_reaper.rb
in
call
class TempfileReaper
def initialize(app)
@app = app
end
def call(env)
env['rack.tempfiles'] ||= []
status, headers, body = @app.call(env)
body_proxy = BodyProxy.new(body) do
env['rack.tempfiles'].each { |f| f.close! } unless env['rack.tempfiles'].nil?
end
[status, headers, body_proxy]
end
end
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/lint.rb
in
_call
assert("No env given") { env }
check_env env
env['rack.input'] = InputWrapper.new(env['rack.input'])
env['rack.errors'] = ErrorWrapper.new(env['rack.errors'])
## and returns an Array of exactly three values:
status, headers, @body = @app.call(env)
## The *status*,
check_status status
## the *headers*,
check_headers headers
check_hijack_response headers, env
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/lint.rb
in
call
## after to catch all mistakes.
## = Rack applications
## A Rack application is a Ruby object (not a class) that
## responds to +call+.
def call(env=nil)
dup._call(env)
end
def _call(env)
## It takes exactly one argument, the *environment*
assert("No env given") { env }
check_env env
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/showexceptions.rb
in
call
def initialize(app)
@app = app
@template = ERB.new(TEMPLATE)
end
def call(env)
@app.call(env)
rescue StandardError, LoadError, SyntaxError => e
exception_string = dump_exception(e)
env["rack.errors"].puts(exception_string)
env["rack.errors"].flush
if accepts_html?(env)
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/commonlogger.rb
in
call
def initialize(app, logger=nil)
@app = app
@logger = logger
end
def call(env)
began_at = Time.now
status, header, body = @app.call(env)
header = Utils::HeaderHash.new(header)
body = BodyProxy.new(body) { log(env, status, header, began_at) }
[status, header, body]
end
private
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/sinatra-1.4.8/lib/sinatra/base.rb
in
call
env['sinatra.commonlogger'] ? @app.call(env) : super
end
superclass.class_eval do
alias call_without_check call unless method_defined? :call_without_check
def call(env)
env['sinatra.commonlogger'] = true
call_without_check(env)
end
end
end
class NotFound < NameError #:nodoc:
def http_status; 404 end
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/chunked.rb
in
call
false
else
true
end
end
def call(env)
status, headers, body = @app.call(env)
headers = HeaderHash.new(headers)
if ! chunkable_version?(env['HTTP_VERSION']) ||
STATUS_WITH_NO_ENTITY_BODY.include?(status) ||
headers[CONTENT_LENGTH] ||
headers['Transfer-Encoding']
[status, headers, body]
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/content_length.rb
in
call
include Rack::Utils
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
headers = HeaderHash.new(headers)
if !STATUS_WITH_NO_ENTITY_BODY.include?(status.to_i) &&
!headers[CONTENT_LENGTH] &&
!headers['Transfer-Encoding'] &&
body.respond_to?(:to_ary)
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/unicorn-5.5.1/lib/unicorn/http_server.rb
in
process_client
"HTTP/1.1 100 Continue\r\n\r\n".freeze)
env.delete('HTTP_EXPECT'.freeze)
end
# once a client is accepted, it is processed in its entirety here
# in 3 easy steps: read request, call app, write app response
def process_client(client)
status, headers, body = @app.call(env = @request.read(client))
begin
return if @request.hijacked?
if 100 == status.to_i
e100_response_write(client, env)
status, headers, body = @app.call(env)
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/unicorn-5.5.1/lib/unicorn/http_server.rb
in
worker_loop
nr = 0
worker.tick = time_now.to_i
tmp = ready.dup
while sock = tmp.shift
# Unicorn::Worker#kgio_tryaccept is not like accept(2) at all,
# but that will return false
if client = sock.kgio_tryaccept
process_client(client)
nr += 1
worker.tick = time_now.to_i
end
break if nr < 0
end
# make the following bet: if we accepted clients this round,
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/unicorn-5.5.1/lib/unicorn/http_server.rb
in
spawn_missing_workers
worker = Unicorn::Worker.new(worker_nr)
before_fork.call(self, worker)
pid = @worker_exec ? worker_spawn(worker) : fork
unless pid
after_fork_internal
worker_loop(worker)
exit
end
@workers[pid] = worker
worker.atfork_parent
end
rescue => e
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/unicorn-5.5.1/lib/unicorn/http_server.rb
in
maintain_worker_count
rescue => e
@logger.error(e) rescue nil
exit!
end
def maintain_worker_count
(off = @workers.size - worker_processes) == 0 and return
off < 0 and return spawn_missing_workers
@workers.each_value { |w| w.nr >= worker_processes and w.soft_kill(:QUIT) }
end
# if we get any error, try to write something back to the client
# assuming we haven't closed the socket, but don't get hung up
# if the socket is already closed or broken. We'll always ensure
# the socket is closed at the end of this function
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/unicorn-5.5.1/lib/unicorn/http_server.rb
in
join
# machine) comes out of suspend/hibernation
if (last_check + @timeout) >= (last_check = time_now)
sleep_time = murder_lazy_workers
else
sleep_time = @timeout/2.0 + 1
@logger.debug("waiting #{sleep_time}s after suspend/hibernation")
end
maintain_worker_count if respawn
master_sleep(sleep_time)
when :QUIT # graceful shutdown
break
when :TERM, :INT # immediate shutdown
stop(false)
break
when :USR1 # rotate logs
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/unicorn-5.5.1/bin/unicorn
in
<top (required)>
:unicorn_options => options,
:app => app,
:daemonize => rackup_opts[:daemonize],
})
end
Unicorn::Launcher.daemonize!(options) if rackup_opts[:daemonize]
Unicorn::HttpServer.new(app, options).start.join
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/bin/unicorn
in
load
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('unicorn', 'unicorn', version)
else
gem "unicorn", version
load Gem.bin_path("unicorn", "unicorn", version)
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/bin/unicorn
in
<main>
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end
if Gem.respond_to?(:activate_bin_path)
load Gem.activate_bin_path('unicorn', 'unicorn', version)
else
gem "unicorn", version
load Gem.bin_path("unicorn", "unicorn", version)
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/bin/ruby_executable_hooks
in
eval
if
(index = content.index("\n#!ruby\n")) && index > 0
then
skipped_content = content.slice!(0..index)
start_line = skipped_content.count("\n") + 1
eval content, binding, $0, start_line
else
eval content, binding, $0
end
/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/bin/ruby_executable_hooks
in
<main>
if
(index = content.index("\n#!ruby\n")) && index > 0
then
skipped_content = content.slice!(0..index)
start_line = skipped_content.count("\n") + 1
eval content, binding, $0, start_line
else
eval content, binding, $0
end
Variable | Value |
---|---|
service | "http://foros.3dgames.com.ar/noticias-dia.395/797358.mauricio-presidente.8.html" |
No POST data.
Variable | Value |
---|---|
HTTP_ACCEPT | */* |
HTTP_CONNECTION | close |
HTTP_HOST | login.3dgames.com.ar |
HTTP_USER_AGENT | claudebot |
HTTP_VERSION | HTTP/1.0 |
HTTP_X_FORWARDED_FOR | 3.234.143.63 |
HTTP_X_FORWARDED_PROTO | https |
PATH_INFO | /login |
QUERY_STRING | service=http%3A%2F%2Fforos.3dgames.com.ar%2Fnoticias-dia.395%2F797358.mauricio-presidente.8.html |
REMOTE_ADDR | 127.0.0.1 |
REQUEST_METHOD | GET |
REQUEST_PATH | /login |
REQUEST_URI | /login?service=http%3A%2F%2Fforos.3dgames.com.ar%2Fnoticias-dia.395%2F797358.mauricio-presidente.8.html |
SCRIPT_NAME | |
SERVER_NAME | login.3dgames.com.ar |
SERVER_PORT | 443 |
SERVER_PROTOCOL | HTTP/1.0 |
SERVER_SOFTWARE | Unicorn 5.5.1 |
rack.errors | #<Object:0x00565286b7def8> |
rack.hijack | #<Proc:0x00565287f36a58@/home/rorapps/.rvm/gems/ruby-1.9.2-p330@casserver/gems/rack-1.6.11/lib/rack/lint.rb:525> |
rack.hijack? | true |
rack.input | #<Rack::Lint::InputWrapper:0x00565287f2cd50 @input=#<StringIO:0x00565286601c18>> |
rack.logger | #<Rack::NullLogger:0x00565287abdb98 @app=#<Rack::Session::Cookie:0x00565287abdc88 @secrets=["48dc272f23d2e876fbf6f867f6b17406458318c16b941d3e098a20810100ac7a0036343edd42583718b6a19fbd1c93be3caca639decd718aaa22d00e79eda742"], @coder=#<Rack::Session::Cookie::Base64::Marshal:0x00565287abdc10>, @app=#<Rack::Protection::FrameOptions:0x00565287abdd28 @app=#<Rack::Protection::HttpOrigin:0x00565287abde40 @app=#<Rack::Protection::IPSpoofing:0x00565287abdf30 @app=#<Rack::Protection::JsonCsrf:0x00565287abdfa8 @app=#<Rack::Protection::PathTraversal:0x00565287abe020 @app=#<Rack::Protection::RemoteToken:0x00565287abe110 @app=#<Rack::Protection::SessionHijacking:0x00565287abe1d8 @app=#<Rack::Protection::XSSHeader:0x00565287abe278 @app=#<CASServer::Server:0x00565286bec4c0 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Tilt::Cache:0x00565286bec448 @cache={}>>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :xss_mode=>:block, :nosniff=>true, :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :tracking_key=>:tracking, :encrypt_tracking=>true, :track=>["HTTP_USER_AGENT", "HTTP_ACCEPT_LANGUAGE"], :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :authenticity_param=>"authenticity_token", :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :frame_options=>:sameorigin, :except=>[]}, @frame_options="SAMEORIGIN">, @default_options={:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :sidbits=>128, :secure_random=>SecureRandom, :secret=>"48dc272f23d2e876fbf6f867f6b17406458318c16b941d3e098a20810100ac7a0036343edd42583718b6a19fbd1c93be3caca639decd718aaa22d00e79eda742", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0x00565287abdc10>}, @key="rack.session", @cookie_only=true, @sidbits=128, @sid_secure=SecureRandom, @sid_length=32>> |
rack.multiprocess | true |
rack.multithread | false |
rack.request.cookie_hash | {} |
rack.request.query_hash | {"service"=>"http://foros.3dgames.com.ar/noticias-dia.395/797358.mauricio-presidente.8.html"} |
rack.request.query_string | service=http%3A%2F%2Fforos.3dgames.com.ar%2Fnoticias-dia.395%2F797358.mauricio-presidente.8.html |
rack.run_once | false |
rack.session | {"session_id"=>"fe54ef277d7a41d7b1ae782b55bed06ee93163755c66ac372f3411fd20abc2bc", "csrf"=>"82a1ab1c0f363d40f6588568c7cf89cf", "tracking"=>{"HTTP_USER_AGENT"=>"ec0660ee20674482e3fbf9df2da732a482688d77", "HTTP_ACCEPT_LANGUAGE"=>"da39a3ee5e6b4b0d3255bfef95601890afd80709"}} |
rack.session.options | {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :sidbits=>128, :secure_random=>SecureRandom, :secret=>"48dc272f23d2e876fbf6f867f6b17406458318c16b941d3e098a20810100ac7a0036343edd42583718b6a19fbd1c93be3caca639decd718aaa22d00e79eda742", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0x00565287abdc10>} |
rack.session.unpacked_cookie_data | {"session_id"=>"fe54ef277d7a41d7b1ae782b55bed06ee93163755c66ac372f3411fd20abc2bc"} |
rack.tempfiles | [] |
rack.url_scheme | https |
rack.version | [1, 2] |
sinatra.accept | [*/*] |
sinatra.commonlogger | true |
sinatra.error | #<OpenSSL::SSL::SSLError: SSL_read:: shutdown while in init> |
sinatra.route | GET /login |
unicorn.socket | #<Kgio::Socket:fd 7> |
You're seeing this error because you have
enabled the show_exceptions
setting.