Commit Graph

4 Commits

Author SHA1 Message Date
Gary Burd 6c51b25bc8 Compression improvements
- Remove unnecessary error return from compressNoContextTakeover.
- Simplify use of sync.Pool.
- Fix formatting in compression documentation.
2016-12-27 17:05:16 -05:00
Cyrus Katrak 2db2f66488 pool flate readers 2016-12-19 07:28:05 -08:00
Cyrus Katrak 3ab3a8b883 pool flate writers 2016-12-16 15:41:18 -08:00
Gary Burd a87eae1d6f Add hooks to support RFC 7692 (per-message compression extension)
Add newCompressionWriter and newDecompressionReader fields to Conn. When
not nil, these functions are used to create a compression/decompression
wrapper around an underlying message writer/reader.

Add code to set and check for RSV1 frame header bit.

Add functions compressNoContextTakeover and decompressNoContextTakeover
for creating no context takeover wrappers around an underlying message
writer/reader.

Work remaining:

- Add fields to Dialer and Upgrader for specifying compression options.
- Add compression negotiation to Dialer and Upgrader.
- Add function to enable/disable write compression:

    // EnableWriteCompression enables and disables write compression of
    // subsequent text and binary messages. This function is a noop if
    // compression was not negotiated with the peer.
    func (c *Conn) EnableWriteCompression(enable bool) {
            c.enableWriteCompression = enable
    }
2016-06-29 17:03:55 -07:00