Hello,
The SPDY spec says:
###
There is a single zlib stream (context) for all name value pairs in
one direction on a connection. SPDY uses a SYNC_FLUSH between frame
which uses compression.
###
I wanted to confirm that the z_stream context is directional per SPDY
*connection* (and not per SPDY stream)?
This means that concurrent SPDY streams (on the same SPDY connection)
will have to decompress under lock because they operate on the same
z_stream. That is non-ideal but acceptable.
More critically, does this necessitate that all blocks must be
decompressed in the same order in which they were received from the
TCP connection? For example, if SYN_STREAM-1 arrived first and
SYN_STREAM-2 arrived a few microseconds later, does this require that
SYN_STREAM-1 must run through the decompressor first? This becomes
problematic if the stream processing is packaged and queued for later
execution because the system scheduler is free to execute them in
arbitrary order.
Skimming the zlib manual, it appears a deflate(SYNC_FLUSH) is to
completely write the current block output so that inflate(Z_BLOCK) can
stop at the end of the name-value block. But I don't see whether the
inflate order can be changed. It appears Z_FULL_FLUSH might do the
trick.
Thanks,
--Osama.