Sha256: 1335dd3615a608c0f55a79fc37a8ec6a860f42b51a7e40882d85a94ef0a86af4
Contents?: true
Size: 904 Bytes
Versions: 3
Compression:
Stored size: 904 Bytes
Contents
require 'erb' module Rex module Proto module Http ### # # This class is used to wrapper the calling of a procedure when a request # arrives. # ### class Handler::Proc < Handler # # Initializes the proc handler with the supplied procedure # def initialize(server, procedure, virt_dir = false) super(server) self.procedure = procedure self.virt_dir = virt_dir || false end # # Returns true if the procedure is representing a virtual directory. # def relative_resource_required? virt_dir end # # Called when a request arrives. # def on_request(cli, req) begin procedure.call(cli, req) rescue Errno::EPIPE elog("Proc::on_request: Client closed connection prematurely", LogSource) rescue elog("Proc::on_request: #{$!}\n\n#{$@.join("\n")}", LogSource) end end protected attr_accessor :procedure # :nodoc: attr_accessor :virt_dir # :nodoc: end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
librex-0.0.4 | lib/rex/proto/http/handler/proc.rb |
librex-0.0.3 | lib/rex/proto/http/handler/proc.rb |
librex-0.0.1 | lib/rex/proto/http/handler/proc.rb |