This commit splits up handling of the crypto stream and the other streams in the framer, crypto setup, and the packer.
- Crypto stream data is handled separately and should never be sent unencrypted or FW-secure. Fixes#544.
- Non-crypto stream data is only sent with FW encryption on the server and only with non-FW or FW encryption on the client. Fixes#611.
The crypto stream is current excluded from flow control (#657), but that shouldn't be an issue in practice for now.
We used to reject duplicate and packets with packet numbers lower than
the LeastUnacked we received in a STOP_WAITING frame, because we didn't
accept overlapping stream data. For all other frames, duplicates never
were an issue. Now that we accept overlapping stream data, there's no
need to reject those packets, in fact, processing a delayed packet will
be beneficial for performance.
Pass the diversification nonce via a channel instead of setting it
directly. That way there is no need to protect the diversificationNonce
member by a mutex. Also prevents a possible deadlock that occurred when
SetDiversificationNonce was called before maybeUpgradeCrypto returned.
fixes#598
The mockReceivedPacketHandler returned the same ACK frame over and over
again, so that the loop in session.sendPacket() would send packets
containing this packet indefinitely.
The closeCallback was run when a session was closed, i.e. after the run
loop of the session stopped. Instead of explicitely calling this callback
from the session, the caller of session.run() can just execute the code
after session.run() returns.
fixes#517
Also fixes an off-by-one error, such that the queue now holds exactly
protocol.MaxUndecrytablePackets packets when enough undecryptable
packets are received.
We were relying on the number of goroutines in those tests. This commit
replaces that logic with grepping through the current callstack.
The 'doesn't return after version negotiation is established if no
ConnState is defined' test is disabled, since I can't figure out a way
to make it work without leaking sessions. I filed #506 to track that
work.
Fixes#484.
Fixes#411.
Chrome sends the FHL2 when it wants to perform a head-of-line blocking
experiment, introduced in QUIC version 36 (see
https://codereview.chromium.org/2115033002). We don’t support this
experiment. By sending a Public Reset when receiving this tag we force
Chrome to use the TCP fallback.