Commit Graph

135 Commits

Author SHA1 Message Date
Marten Seemann
f88b7bb175 implement the new Retry mechanism 2018-08-13 08:47:29 +07:00
Marten Seemann
ad5a3e2fa0 also use the multiplexer for the server 2018-08-08 10:03:22 +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
e265abb8cb fix populating the client config when dialing an address 2018-08-06 16:15:09 +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
0928e91e4d remove closed clients from the multiplexer 2018-07-03 17:30:49 +07:00
Marten Seemann
6e299157d4 implement the disable_migration transport parameter and use it 2018-07-02 22:18:28 +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
2c05dbff07 multiplex multiple clients on one packet conn 2018-06-23 08:35:11 +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
54d0a0e7e9 remove stray debug statement when handling packets in the client 2018-06-18 13:29:19 +07:00
Marten Seemann
f26a68d45c implement dial functions that use a context 2018-06-14 16:15:32 +07:00
Marten Seemann
d7dee33bc7 change the source connection ID when creating a new IETF QUIC session 2018-05-30 21:37:05 +08:00
Marten Seemann
733e2e952b use callbacks for signaling the session status
Instead of exposing a session.handshakeStatus() <-chan error, it's
easier to pass a callback to the session which is called when the
handshake is done.
The removeConnectionID callback is in preparation for IETF QUIC, where a
connection can have multiple connection IDs over its lifetime.
2018-05-29 21:27:08 +08:00
Marten Seemann
c7119b2adf move logging of connection closing to the session 2018-05-29 21:24:24 +08:00
Marten Seemann
6b82e46e0c use the prefix logger for client, server and proxy 2018-05-29 20:52:54 +08:00
Marten Seemann
5142b73ac3 Merge pull request #1370 from lucas-clemente/client-header-parsing
parse headers sent by the server without knowing the version
2018-05-29 16:43:52 +08:00
Marten Seemann
372463db49 don't pass the client's version to the header parser 2018-05-21 11:27:15 +08:00
Marten Seemann
c98afd6625 simplify version negotiation in the client 2018-05-15 11:02:21 +09:00
Marten Seemann
8f2fed1b10 parse IETF headers independent of the sender's perspective
The IETF header format allows parsing of the header without knowing
which peer sent the packet.
2018-05-09 13:28:30 +09:00
Marten Seemann
683b5823e4 handle gQUIC and IETF QUIC packets separately in the client 2018-05-08 15:17:16 +09:00
Marten Seemann
cc536fb895 cut packets at the payload length when receiving 2018-04-23 17:47:17 +09:00
Marten Seemann
fae32101a0 use different source and destination connection IDs 2018-04-23 15:23:01 +09:00
Marten Seemann
dd5d376d94 improve packet handling in the client 2018-04-23 11:40:25 +09:00
Marten Seemann
d47124d14d add more methods to the protocol.ConnectionID
This will make it easier to change the underlying type of the connection
ID (potentially an array is faster than a byte slice).
2018-04-19 16:08:06 +09:00
Marten Seemann
52d31dd7ef implement the new header format
Currently, we're only sending and accepting packets with matching source
and destination connection IDs.
2018-04-19 13:46:54 +09:00
Marten Seemann
1a035a265c change the type of Connection ID to byte slice 2018-04-18 22:41:24 +09:00
Marten Seemann
af8971d8c9 move connection ID generation from the utils to the protocol package 2018-04-17 20:21:06 +09:00
Marten Seemann
948eef3e42 create a logger interface and use it everywhere 2018-04-04 13:03:28 +07:00
Marten Seemann
b40942d39e send stream counts, not stream IDs, in the transport parameters 2018-03-16 17:41:21 +00:00
Marten Seemann
624ac61412 reject unknown versions in the quic.Config 2018-02-26 11:07:06 +08:00
Marten Seemann
58b20c6009 make the number of incoming streams configurable, for IETF QUIC 2018-02-23 22:15:31 +08:00
Marten Seemann
07b8821ef7 use pointer to byte slices in the buffer pool
https://staticcheck.io/docs/staticcheck#SA6002 suggests to use pointers
to objects in the sync.Pool.
2018-02-23 18:57:12 +08:00
Marten Seemann
ce01e99ba1 log version negotiation packets 2018-02-21 14:55:33 +08:00
Marten Seemann
8e332c2e13 implement sending of MAX_STREAM_ID frames
We can now impose a limit on the number of stream for IETF QUIC, and
advertise that in the transport parameters during the handshake.
2018-02-06 08:32:16 +08:00
Marten Seemann
cd4bcda458 read and write the stream id limits sent in the TLS handshake 2018-02-06 08:30:57 +08:00
Marten Seemann
1cc209e4fb update mint, and adapt to the new use of the extension handler 2018-02-02 08:18:29 +08:00
Marten Seemann
99a2853e7d remove non forward-secure dialing
This was broken for a long time, and won't be available when using the
TLS 1.3 handshake.
2018-01-02 23:26:55 +07:00
Marten Seemann
2a0b71c66b fix race when dialing a new connection
When a connection error occurs, Dial can only return the error if the
session is closed with that error. Therefore, the session must be
created before client.listen() is called.
2017-12-21 13:25:49 +07:00