On Fri, Jul 15, 2016 at 9:14 AM, Adam Keeton <ajkee...@gmail.com> wrote:
> A small self-contained example with this code would be tricky with all of
> the websocket handling stuff in the way.

You could possibly capture the bytes of each compressed message, and
then construct a new websocket-free program that starts with those
bytes and knows what each decompressed message should be.


> I'm not entirely clear with how to work with Reset, specifically the use of
> dictionaries. Passing 'nil' as a dictionary hasn't gotten me anywhere. I'm
> guessing that might be the key detail for maintaining the sliding window?

You might need new API on a flate decompressor to e.g. ack and clear
an explicit mypkg.EndOfMessage error that you repeatedly thread
through the underlying reader. The compress/flate package, like all
io.Reader implementations, expects to read and deliver streams of
bytes, not delimited messages, but websocket (IIUC) isn't really a
stream (two messages "abc" and "def" isn't semantically equivalent to
a single message "abcdef"), and the two models don't quite fit well.

That new API would need to be like the flate.Resetter dance, due to
backwards compat on flate.NewReader returning an io.ReadCloser.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to