lib/ernicorn/server.rb
def process_ernicorn_client(client)
      Stats.decr_workers_idle
      Stats.incr_connections_total

      @client = client
      # bail out if client only sent EOF
      return if @client.kgio_trypeek(1).nil?

      iruby, oruby = Ernicorn.process(self, self)
    rescue EOFError
      logger.error("EOF from #{@client.kgio_addr rescue nil}")
    rescue Object => e
      logger.error(e)

      begin
        error = t[:error, t[:server, 0, e.class.to_s, e.message, e.backtrace]]
        Ernicorn.write_berp(self, error)
      rescue Object => ex
        logger.error(ex)
      end
    ensure
      @client.close rescue nil
      @client = nil

      Stats.incr_connections_completed
      Stats.incr_workers_idle
    end
# Private HttpServer methods we're overriding to
# implement BertRPC instead of HTTP.
Private HttpServer methods we're overriding to
implement BertRPC instead of HTTP.
Private HttpServer methods we ' re overriding to implement BertRPC instead of HTTP .
def process_ernicorn_client(client)
      Stats.decr_workers_idle
      Stats.incr_connections_total
      @client = client
      return if @client.kgio_trypeek(1).nil?
      iruby, oruby = Ernicorn.process(self, self)
    rescue EOFError
      logger.error("EOF from #{@client.kgio_addr rescue nil}")
    rescue Object => e
      logger.error(e)
      begin
        error = t[:error, t[:server, 0, e.class.to_s, e.message, e.backtrace]]
        Ernicorn.write_berp(self, error)
      rescue Object => ex
        logger.error(ex)
      end
    ensure
      @client.close rescue nil
      @client = nil
      Stats.incr_connections_completed
      Stats.incr_workers_idle
    end
def process_ernicorn_client ( client ) Stats . decr_workers_idle Stats . incr_connections_total @client = client return if @client . kgio_trypeek ( 1 ) . nil? iruby , oruby = Ernicorn . process ( self , self ) rescue EOFError logger . error ( "EOF from #{@client.kgio_addr rescue nil}" ) rescue Object => e logger . error ( e ) begin error = t [ :error , t [ :server , 0 , e . class . to_s , e . message , e . backtrace ] ] Ernicorn . write_berp ( self , error ) rescue Object => ex logger . error ( ex ) end ensure @client . close rescue nil @client = nil Stats . incr_connections_completed Stats . incr_workers_idle end
Private HttpServer methods we're overriding to
implement BertRPC instead of HTTP.
Private HttpServer methods we ' re overriding to implement BertRPC instead of HTTP .
# bail out if client only sent EOF
client