Subject: [hybi] Fragment and extensions

From: Greg Wilkins <[email-masked]>
Date: Wed, 20 Apr 2011 17:36:51 +1000

Currently the spec says in 4.4:

   o  An intermediary MAY change the fragmentation of a message if the
      message uses only opcode and reserved bit values known to the
      intermediary.

I'm not sure if that is strong enough.    Imagine an extension that
sends digital signatures of the payload as extension data, so a  frame
might look like:

   DATA_OP  length  signature message.

An intermediary will see neither an opcode nor a resource bit that it
does not understand, so it is free to fragment that frame, which will
break that extension.

I propose that  the spec should say:

   o  An intermediary MUST NOT change the fragmentation of a message unless
      all extension that apply to the message are known to the intermediary.

Furthermore,  since an intermediary that does not know all the
extensions that apply to a connection, must neither fragment nor
aggregate frames, then I propose that we allow an extension to
interleave the fragments of a message.

   o  Extensions MAY interleave fragments one one message between
        fragments of a separate message. As such, an end point that accepts
        connections with such extensions must be capable of handling the
        interleaving when aggregating the frames of the messages.  In
the absence
        of any interleaving extension, an end point MUST NOT
interleave the fragments
        of different messages.

I believe that such a change will allow simpler MUX implementations,
and the specification says that MUX is one of the two identified
reasons for fragmentation, yet currently fragmentation cannot be used
for MUX because you cannot interleave messages.

regards

---

From: Greg Wilkins <[email-masked]>
Date: Thu, 28 Apr 2011 09:41:00 +1000

Note that is is a bit crazy that at the moment we allow an extension
like deflate-stream to entirely change the bytes on the wire, yet the
spec prevents us having a MUX extensions that interleaves otherwise
valid WS frames.