> but then it sounds like you're concatenating all of the messages together,

I should have mentioned that I reset the websockets buffer after reading
from the deflater.

A small self-contained example with this code would be tricky with all of
the websocket handling stuff in the way.

Regardless, with permessage-deflate, the sliding window must be maintained
across messages unless no_context_takeover is being used. Creating a new
deflater for each message doesn't work.

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?

On Wed, Jul 13, 2016 at 11:00 PM, Nigel Tao <nigel...@golang.org> wrote:

> On Thu, Jul 14, 2016 at 12:35 AM, A Keeton <ajkee...@gmail.com> wrote:
> > I'm trying to decompress messages arriving over websockets that are using
> > permessage-deflate.
>
> You say that you're using "per message" deflate...
>
>
> > Each new websockets message is written into buf and then I call Read on
>
> ...but then it sounds like you're concatenating all of the messages
> together, writing them all to the one buffer, so you're treating it as
> "per stream" deflate instead of "per message".
>
>
> > flater. It works for 1 or more messages (sometimes several right up
> until I
> > fill the 32k window). Eventually the Read fails and flate says there is a
> > corrupt byte before some offset. Even after more data has been written to
> > buf, successive reads fail. I presume there's some need to reset the
> flater
> > to a previous state, but Reset hasn't gotten me anywhere.
>
> Calling Reset is probably the way to go, but it's hard to give more
> specific advice without seeing your code, preferably a self-contained
> example and one that's as small and as simple as possible.
>

-- 
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