Marten Seemann
69998c19cb
add the offset field to the BLOCKED and STREAM_BLOCKED frames
...
The value is not yet set, but parsing and writing works.
2017-12-14 19:00:06 +07:00
Marten Seemann
03977c1a25
pass RST_STREAM frames directly to the stream
2017-12-14 17:00:41 +07:00
Marten Seemann
2d31440510
pass MAX_STREAM_DATA frames directly to the stream
2017-12-14 16:50:47 +07:00
Marten Seemann
823098d6e2
rename stream.AddStreamFrame to stream.HandleStreamFrame
2017-12-14 16:50:47 +07:00
Marten Seemann
a6e44f3bfc
implement parsing and writing of the STOP_SENDING frame
2017-12-13 17:58:50 +07:00
Marten Seemann
73ab97aa95
simplify the stream by directly popping STREAM frames from it
2017-12-12 18:48:08 +07:00
Marten Seemann
7fd0157e1f
Merge pull request #1006 from lucas-clemente/more-window-updates
...
decrease the threshold to send MAX_{STREAM}_DATA frames
2017-12-12 18:30:55 +07:00
Marten Seemann
eb3e253be2
send MAX_{STREAM}_DATA frames more frequently
...
WINDOW_UPDATEs are relatively small, and it doesn't cost much to grant
the peer more flow control credit earlier.
2017-12-12 18:06:49 +07:00
Marten Seemann
4aca4d64b7
don't add more STREAM frames to a packet if remaining size is too small
2017-12-12 18:00:05 +07:00
Marten Seemann
4b4e487486
remove the error return value from wire.Frame.MinLength
...
No functional change expected.
The error was only non-nil if some required values for the STOP_WAITING
frame were not set. It should be sufficient to throw an error when
attempting to write an invalid STOP_WAITING frame.
2017-12-12 17:33:04 +07:00
Marten Seemann
632040bd2b
Merge pull request #1001 from lucas-clemente/min-packet-size
...
implement the minimum packet size requirements
2017-12-12 16:37:53 +07:00
Marten Seemann
489ea7fa1a
Merge pull request #997 from lucas-clemente/stream-refactoring
...
refactor sending of stream data
2017-12-08 22:55:42 +07:00
Marten Seemann
7e627d38ea
Merge pull request #999 from lucas-clemente/reject-version-0
...
reject packets with version 0 sent by the client
2017-12-08 22:54:08 +07:00
Marten Seemann
8e8892b064
remove the SentFin method from the stream
...
When a FIN is dequeued from the stream by the streamFramer, it is
guaranteed to be sent out. There's no need to explicitely signal that to
the stream.
2017-12-08 14:05:16 +07:00
Marten Seemann
71af5758e2
remove the ShouldSendFin method from the stream
...
GetDataForWriting now has two return parameters: the data and if a FIN
should be sent.
2017-12-08 14:05:14 +07:00
Marten Seemann
085624be20
replace stream.LenOfDataForWriting by HasDataForWriting
...
The return value (the length of data for writing) was only used to
determine if the stream has data for writing. Therefore it's easier to
just return a bool.
No functional change expected.
2017-12-08 14:04:00 +07:00
Marten Seemann
23ce5a8554
drop packets for new gQUIC connections that are too small
2017-12-08 12:34:59 +07:00
Marten Seemann
6019634286
pad Initial packets to the required minimum size (1200 bytes)
2017-12-08 11:50:43 +07:00
Marten Seemann
f8cbb0ae03
remove unused utils.GetByteOrder
...
This function was needed when we supported both Q039 (using big endian
encoding) and ealier versions (using little endian encoding).
2017-12-08 11:33:40 +07:00
Marten Seemann
d7ceebd644
implement parsing and writing of the new ACK frame
2017-12-08 09:35:55 +07:00
Marten Seemann
11f746a183
implement parsing and writing of the new STREAM frames
2017-12-08 09:20:47 +07:00
Marten Seemann
1a515d1371
implement the new variable integer length frame types
2017-12-08 09:18:54 +07:00
Marten Seemann
759b0d87b1
refactor packet unpacking
...
This replaces version.UsesMaxDataFrame by versoin.UsesIETFFrameFormat.
That way, we can have two separate code paths in the unpacker to unpack
either gQUIC frames or IETF frames.
2017-12-08 09:18:54 +07:00
Marten Seemann
0ac728f96e
implement the new variable integer length encoding
2017-12-08 09:18:54 +07:00
Marten Seemann
62b0d99dcd
reject packets with version 0 sent by the client
...
Version 0 is an invalid version. For packets sent by the server, it is
used to identify the Version Negotiation Packet.
2017-12-08 09:14:41 +07:00
Marten Seemann
25a6dc9654
implement stateless handling of Initial packets for the TLS server
2017-12-08 08:45:54 +07:00
Marten Seemann
a79e9ee35e
parse and write STOP_WAITING frames for packet number 0
2017-12-07 21:33:34 +07:00
Marten Seemann
6ce3336be5
parse and write ACKs that for packet number 0
2017-12-07 21:33:34 +07:00
Marten Seemann
196efa873d
Merge pull request #990 from lucas-clemente/fix-989
...
don't send a window update after the final offset was received
2017-12-07 18:55:19 +07:00
Marten Seemann
f51cfe9fe3
don't send a window update after the final offset was received
...
Receiving a final offset means the peer is done sending on that stream,
and there's no need to grant additional flow control credit.
2017-12-07 18:22:39 +07:00
Marten Seemann
7ba613c3b9
use the mint default cookie protector to encrypt and decrypt cookies
2017-12-07 18:20:22 +07:00
Marten Seemann
80a827f133
fix the crypto setup so that it works with the recent mint changes
...
mint now supports stateless retries, and requires that the cookie
protector is set in the mint.Config and returns a new alert when a
retry is performed.
2017-12-07 13:49:45 +07:00
Marten Seemann
8c2404edf5
send a reserved version number in the SHLO
2017-12-06 10:20:22 +07:00
Marten Seemann
1a3852aec6
send a reserved version number in the EncryptedExtensions message
2017-12-06 10:20:22 +07:00
Marten Seemann
be29963637
send a reserved version number in version negotiation packets
2017-12-06 10:20:22 +07:00
Marten Seemann
1f5cd31569
implement a function to get version slices containing reserved versions
2017-12-06 10:20:16 +07:00
Marten Seemann
45e43ada40
implement the recent changes to the version negotiation packet
2017-12-06 08:40:43 +07:00
Marten Seemann
7487dc22bf
Merge pull request #977 from lucas-clemente/fix-971
...
update validation of version negotiation
2017-12-06 07:02:49 +07:00
Marten Seemann
b070fcbd43
Merge pull request #976 from lucas-clemente/fix-973
...
make initial_max_stream_id optional and parse initial_max_stream_id_uni
2017-12-06 06:58:15 +07:00
Marten Seemann
ce70ba497d
Merge pull request #968 from lucas-clemente/remove-ack-every-20-packets
...
remove old code to send an ACK every 20 packets
2017-12-06 06:57:23 +07:00
Marten Seemann
7c8715616e
update validation of version negotiation
...
The negotiated_version parameter was recently moved from the
client_hello TLS handshake message to the encrypted_extensions.
2017-12-05 10:35:04 +07:00
Marten Seemann
c30064bb51
parse TLS extensions containing the initial_max_stream_id_uni parameter
...
We're not sending the initial_max_stream_id_uni parameter, which
implicitely sets this value to 0, i.e. the peer is not allowed to open
unidirectional streams.
2017-12-05 09:17:43 +07:00
Marten Seemann
a72efca38d
don't require the initial_max_stream_id in the transport parameters
...
The draft was recently changed to make this value optional.
2017-12-05 08:56:49 +07:00
Marten Seemann
184f81d8c4
remove old code to send an ACK every 20 packets
...
This was needed before QUIC 39, and should have been removed when we
dropped support for QUIC 38.
2017-12-01 12:14:54 +07:00
Marten Seemann
f440a65ef1
move the version field in front of the packet number in the long header
...
This was recently changed in the IETF draft.
2017-11-30 11:34:34 +07:00
Marten Seemann
4076ab587e
add a string representation for the Long Header packet types
2017-11-22 15:57:22 -08:00
Jan Rüth
281fec1b2d
Make error chan not block for a single write, allowing ParseHandshakeMessage goroutine to gracefully exit
2017-11-22 09:54:03 +01:00
Marten Seemann
683f244054
rename the Cleartext Long Header type to Handshake
...
This was recently changed in the draft.
2017-11-13 10:55:33 +08:00
Marten Seemann
7c3d6abb4b
fix parsing of the Header type byte
...
In order to determine if a packet is a Version Negotiation Packet, it is
not sufficient to just look at bit 0x1. Other packet types also have
that bit set, e.g. the Retry packet (packet type 0x3). Instead, we have
to look at the last 3 bits. This fix will work as long as IETF QUIC
doesn't define more than 8 long header types.
2017-11-13 10:23:17 +08:00
Marten Seemann
234d5aab36
echo the offered version in IETF Version Negotiation Packets
2017-11-12 14:37:43 +08:00