Commit graph

133 commits

Author SHA1 Message Date
Marten Seemann
17f4ebad64 handle Retry packets in the session 2019-02-04 15:38:47 +08:00
Marten Seemann
bb185a3ad2 add a function to close the packet handler map
Close will close the underlying connection and wait until listen has
returned. While not strictly necessary in production use, this will fix
a few race conditions in our tests.
2019-01-24 18:09:46 +07:00
Marten Seemann
178ac0dacb keep increasing the packet number after version negotiation and retry 2018-12-22 22:15:35 +06:30
Marten Seemann
f9218444a9 use a separate function to close the session after VN and retry 2018-12-21 23:47:10 +06:30
Marten Seemann
7fecf8e478 handle Version Negotiation packets in a separate Go routine 2018-11-27 17:19:21 +07:00
Marten Seemann
a8db148dbf don't lock the client mutex when handling regular packets 2018-11-27 17:19:21 +07:00
Marten Seemann
38548c137c remove unneeded check for destination connection ID in the client
The packetHandlerMap routes packets to the client based on the
destination connection ID, so we can be sure that packets that are
handled in the client have the right connection ID.
2018-11-27 17:19:21 +07:00
Marten Seemann
c5ca6fd7e5 parse the extended header in the session 2018-11-26 15:57:54 +07:00
Marten Seemann
70ce6a5814 parse the whole Long Header, if the version is known 2018-11-26 15:57:54 +07:00
Marten Seemann
b740d57c61 embed the Header in the ExtendedHeader 2018-11-26 15:57:54 +07:00
Marten Seemann
9bcedd988d move parsing of version negotiation packets to the wire.Header 2018-11-26 15:57:54 +07:00
Marten Seemann
bf96707f48 rename the wire.Header to ExtendedHeader
It's not encrypted yet.
2018-11-26 15:57:54 +07:00
Marten Seemann
6150c19dcb remove unused perspective from header writing 2018-11-26 13:43:27 +07:00
Marten Seemann
a3831b2134 rename removing of connection IDs to retiring 2018-11-16 21:22:32 +07:00
Marten Seemann
190d1dcc59
Merge pull request #1595 from lucas-clemente/fix-1529
authenticate retries
2018-11-12 18:00:22 +07:00
Marten Seemann
c37b698f68
Merge pull request #1596 from lucas-clemente/internalize-errors
internalize the qerr package
2018-11-12 15:54:39 +07:00
Marten Seemann
3ffea5d8c4 internalize the qerr package 2018-11-11 12:44:16 +07:00
Marten Seemann
70cb67bd2a check that the server sends the correct original_connection_id 2018-11-11 11:00:40 +07:00
Marten Seemann
a56b85a49a disable flaky client unit test on AppVeyor 2018-11-10 10:06:20 +07:00
Marten Seemann
ce257f3f23 replace quic.clemente.io by localhost in the client unit tests 2018-11-03 09:31:45 +07:00
Marten Seemann
16848038be remove unnecessary initial packet number parameter 2018-11-02 17:14:31 +07:00
Marten Seemann
3266e36811 drop support for gQUIC 2018-10-30 10:20:39 +07:00
Marten Seemann
82508f1562 use tls-tris instead of mint 2018-10-26 16:18:49 +07:00
Marten Seemann
a7f94d89b6 only allow a single retry 2018-10-24 23:48:33 +07:00
Marten Seemann
c1f55ba910 use tls.Config.ServerName for the passing the hostname around 2018-10-02 14:47:18 -07:00
Marten Seemann
c0d4f00b20 implement gQUIC 44 2018-08-28 08:49:29 +07:00
Marten Seemann
9608e8563f only accept 3 retries
While the server is allowed to perform multiple Retries, the client
should impose a limit in order to avoid being caught in an endless loop.
2018-08-14 18:35:25 +07:00
Marten Seemann
872e1747f4 always use connection IDs longer than 8 bytes when sending a Retry
A server is allowed to perform multiple Retries. There's little to gain
from doing so, but it's something our API allows. If a server performs
multiple Retries, it must use a connection ID that's at least 8 bytes
long. Only if it doesn't perform any further Retries it is allowed to
use shorter IDs. Therefore, we're on the safe side by always using a
long connection ID.
This shouldn't have a performance impact, since the server changes the
connection ID to a short value with the first Handshake packet it sends.
2018-08-14 17:34:21 +07:00
Marten Seemann
f88b7bb175 implement the new Retry mechanism 2018-08-13 08:47:29 +07:00
Marten Seemann
c8d20e86d7 move listening from the multiplexer to the packet handler map 2018-08-08 10:03:20 +07:00
Marten Seemann
7e2adfe19d rename the clientMultiplexer to connMultiplexer 2018-08-08 09:49:49 +07:00
Marten Seemann
a654e7600a move cutting of packets at the payload length to the multiplexer 2018-08-08 09:49:12 +07:00
Marten Seemann
cfa55f91bc close connections created by DialAddr when the session is closed 2018-08-08 08:45:47 +07:00
Marten Seemann
8b2992a243 split the Session.Close(error) in Close() and CloseWithError(error) 2018-07-06 15:51:35 +07:00
Marten Seemann
f806f9146b also use the multiplexer when dialing an address 2018-07-04 10:38:40 +07:00
Marten Seemann
f02dc92a32 make the connection ID length configurable 2018-07-03 18:34:31 +07:00
Marten Seemann
73f7636537 use a random length destination connection ID on the Initial packet
The destination connection ID on the Initial packet must be at least 8
bytes long. By using all valid values, we make sure that the everything
works correctly. The server chooses a new connection ID with the Retry
or Handshake packet it sends, so the overhead of this is negligible.
2018-07-03 18:01:41 +07:00
Marten Seemann
0bd7e744ff implement parsing of headers with different connection ID lengths 2018-07-03 18:01:41 +07:00
Marten Seemann
b682af20cf add some more tests for the client multiplexer 2018-07-03 17:30:51 +07:00
Marten Seemann
0928e91e4d remove closed clients from the multiplexer 2018-07-03 17:30:49 +07:00
Marten Seemann
4109c85c8a refactor header parsing in a version independent and dependent part 2018-07-01 09:01:30 +07:00
Marten Seemann
7b96d158d2 remove the OmitConnectionID field from the Header struct
Instead, just look at the length of the destination connection ID.
2018-06-24 17:21:41 +07:00
Marten Seemann
fc57bf6c35 only set the destination connection ID for the Public Header 2018-06-24 16:47:59 +07:00
Marten Seemann
97e734e973 refactor packet handling functions in the client 2018-06-23 08:20:27 +07:00
Marten Seemann
b3fd768a61 use a smaller packetHandler interface
The packetHandler interface just needs two methods: one for handling
packets, and one for closing.
2018-06-23 08:16:51 +07:00
Marten Seemann
b28615125d only accept authenticated Retry packets 2018-06-19 22:06:38 +07:00
Marten Seemann
3601f06aed only accept a single Retry packet for a connection 2018-06-19 21:49:59 +07:00
Marten Seemann
f26a68d45c implement dial functions that use a context 2018-06-14 16:15:32 +07:00
Marten Seemann
3e03055a7d use varint packet numbers in IETF QUIC headers 2018-06-06 16:07:47 +02:00
Marten Seemann
15da47cf98 use a GoMock mock session in the server and client tests 2018-05-30 21:10:44 +08:00