Module: SPDY::Protocol::Control::Helpers
Instance Method Summary collapse
Instance Method Details
#build(opts = {}) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/spdy/protocol.rb', line 30 def build(opts = {}) self.header.type = opts[:type] self.header.len = opts[:len] self.header.flags = opts[:flags] || 0 self.header.stream_id = opts[:stream_id] nv = SPDY::Protocol::NV.new nv.create(opts[:headers]) nv = @zlib_session.deflate(nv.to_binary_s) self.header.len = self.header.len.to_i + nv.size self.data = nv self end |
#initialize_instance ⇒ Object
16 17 18 19 |
# File 'lib/spdy/protocol.rb', line 16 def initialize_instance super @zlib_session = @params[:zlib_session] end |