Commit Graph

7 Commits

Author SHA1 Message Date
Gary Burd 2257eda00b Fix compile error on Go < 1.6 2017-01-19 11:27:08 -08:00
Gary Burd 522f286a67 Fix to compile on Go < 1.6 2017-01-19 11:23:28 -08:00
Gary Burd b0dc45572b Change default and add API for compression level
Change the default compression level to 1. This level is faster and uses
less memory.

Add Conn.SetCompressionLevel API to allow applications to tune
compression on a per message basis.
2017-01-19 11:00:23 -08:00
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