EventMachine::HttpDecoders::GZip

Oneshot decompressor, due to lack of a streaming Gzip reader implementation. We may steal code from Zliby to improve this.

For now, do not put `gzip’ or `compressed’ in your accept-encoding header if you expect much data through the :on_response interface.

Public Class Methods

encoding_names() click to toggle source
     # File lib/em-http/decoders.rb, line 101
101:     def self.encoding_names
102:       %(gzip compressed)
103:     end

Public Instance Methods

decompress(compressed) click to toggle source
     # File lib/em-http/decoders.rb, line 105
105:     def decompress(compressed)
106:       @buf ||= ''
107:       @buf += compressed
108:       nil
109:     end
finalize() click to toggle source
     # File lib/em-http/decoders.rb, line 111
111:     def finalize
112:       begin
113:         Zlib::GzipReader.new(StringIO.new(@buf.to_s)).read
114:       rescue Zlib::Error
115:         raise DecoderError
116:       end
117:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.