Sha256: ce9bb858dad63797a3c561bccb855014a5aaf1c2a619b5b7099da064f46209c5

Contents?: true

Size: 907 Bytes

Versions: 12

Compression:

Stored size: 907 Bytes

Contents

class Goliath::Connection
  attr_accessor :socket_stream
  alias :goliath_receive_data :receive_data
  
  def receive_data(data)
    if @serving == :websocket
      socket_stream.receive(data) if socket_stream
    else
      goliath_receive_data(data)
      socket_stream.receive(@parser.upgrade_data) if socket_stream
      @serving = :websocket if @api.websocket?
    end
  end
  
  def unbind
    super
  ensure
    socket_stream.fail if socket_stream
  end
end

class Goliath::API
  include Faye::WebSocket::Adapter
end

class Goliath::Request
  alias :goliath_process :process
  
  def process
    env['em.connection'] = conn
    goliath_process
  end
end

class Goliath::Response
  alias :goliath_head :head
  alias :goliath_headers_output :headers_output
  
  def head
    (status == 101) ? '' : goliath_head
  end
  
  def headers_output
    (status == 101) ? '' : goliath_headers_output
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
faye-websocket-0.4.6-java lib/faye/adapters/goliath.rb
faye-websocket-0.4.6 lib/faye/adapters/goliath.rb
faye-websocket-0.4.5-java lib/faye/adapters/goliath.rb
faye-websocket-0.4.5 lib/faye/adapters/goliath.rb
_bushido-faye-websocket-0.4.4 lib/faye/adapters/goliath.rb
faye-websocket-0.4.4-java lib/faye/adapters/goliath.rb
faye-websocket-0.4.4 lib/faye/adapters/goliath.rb
faye-websocket-0.4.3 lib/faye/adapters/goliath.rb
faye-websocket-0.4.2 lib/faye/adapters/goliath.rb
faye-websocket-0.4.1 lib/faye/adapters/goliath.rb
faye-websocket-0.4.0 lib/faye/adapters/goliath.rb
faye-websocket-0.3.0 lib/faye/adapters/goliath.rb