Marten Seemann
66fd3b5195
expose the ConnectionState in the Session
...
The ConnectionState contains basic details about the QUIC connection.
2018-01-11 16:27:42 +07:00
Marten Seemann
a20e94ee16
use separate streamsMaps for gQUIC and IETF QUIC
...
This is a lot of duplicate code for now, but it will make moving towards
the new stream ID mapping in IETF QUIC (and unidirectional streams) much
easier.
2018-01-10 08:56:15 +07:00
Marten Seemann
69437a0e78
introduce a streamManager interface for the streamsMap
2018-01-10 08:56:15 +07:00
Marten Seemann
e802491a8f
create internal interfaces for send and receive streams
...
And use those for handling frames.
2018-01-10 08:56:13 +07:00
Marten Seemann
b0ab718c7a
delete non-forward-secure retransmissions when the handshake completes
2018-01-09 17:16:27 +07:00
Marten Seemann
3e2faa45a6
refactor sending such that session.sendPacket only sends one packet
2018-01-09 16:42:44 +07:00
Marten Seemann
46384c4845
refactor sending of ACK-only packets in a separate function
...
No functional change expected.
2018-01-09 16:42:44 +07:00
Marten Seemann
b687dd774f
remove the Range method in the streamsMap
...
streamsMap.Range was only used to pass the stream flow control window to
all open streams after receiving the peer's transport parameters. It's
easier to pass the transport parameters to the streamsMap directly.
2018-01-03 16:18:53 +07:00
Marten Seemann
8a3f807a12
immediately delete a stream when it is completed
...
By introducing a callback to the stream, which the stream calls as soon
as it is completed, we can get rid of checking every single open stream
if it is completed.
2018-01-03 10:30:20 +07:00
Marten Seemann
091b6b2602
Merge pull request #1087 from lucas-clemente/remove-non-forward-secure-dialing
...
remove non forward-secure dialing
2018-01-02 23:48:00 +07: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
d9c107b034
introduce a queue of active streams in the streamFramer
...
The queue holds all streams that have data to send. When stream.Write or
stream.Close are called, a stream is added to this queue. It is removed
from the queue when all available (at that moment) data was sent.
This way, we don't need the round robin scheduling (which, for every
packet sent, asked every single open stream if it had data) any more.
2018-01-02 23:24:44 +07:00
Marten Seemann
a5d3eaea61
rename the scheduleSending callback to onHasStreamData in the stream
...
This callback also takes the stream ID, which will later be used to
create a queue of streams that have data for writing available.
2018-01-02 23:24:44 +07:00
Marten Seemann
d195085f65
don't queue the complete window update, but only the stream ID
2017-12-21 19:03:52 +07:00
Marten Seemann
c270de3538
queue stream window updates directly from stream.Read
...
By queueing receive window updates directly from stream.Read, it is no
longer necessary to ask every stream for window updates when sending a
packet.
2017-12-20 13:03:36 +07:00
Marten Seemann
fc8fafd15e
pass a callback containing the callbacks to the stream
2017-12-20 11:49:05 +07:00
Marten Seemann
d2e31c04ab
generate the streamI mock in the quic package
...
By doing so, we can mock private methods of the stream, so they cannot
be type-asserted by users of quic-go.
2017-12-20 10:42:07 +07:00
Marten Seemann
092908d3e0
simplify sending of (connection-level) BLOCKED frames
2017-12-20 10:23:17 +07:00
Marten Seemann
a0c4e28485
send and handle STOP_SENDING frames (for IETF QUIC)
2017-12-16 09:30:07 +07:00
Marten Seemann
2c83c9e3f0
don't send STOP_WAITING frames (for IETF QUIC)
2017-12-14 23:14:05 +07:00
Marten Seemann
bb093d82f1
Merge pull request #1025 from lucas-clemente/fix-964
...
ignore STOP_WAITINGs, derive lower bound for packets to include in ACK
2017-12-14 19:38:28 +07:00
Marten Seemann
8e0060c51b
ignore STOP_WAITINGs, derive lower bound for packets to include in ACK
2017-12-14 19:23:06 +07:00
Marten Seemann
8c5741ae79
rename stream.Cancel to stream.CloseForShutdown
2017-12-14 17:30:44 +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
bd77f3081c
directly queue RST_STREAM frames on stream.Reset
2017-12-13 17:40:46 +07:00
Marten Seemann
8e1f62f749
when forcing a retransmittable packet, bundle the PING with other frames
...
We're sending a retransmittable packet every 20 packets (if there are no
other frames to send). To make a packet retransmittable, we add a PING
frame. We should bundle this PING with an ACK.
2017-12-12 23:10:43 +07:00
Marten Seemann
b75e1df4f0
Merge pull request #1011 from lucas-clemente/crypto-stream-is-special
...
remove unneeded function from the crypto stream interface
2017-12-12 18:40:12 +07:00
Marten Seemann
cd5e7ae177
remove unneeded function from the crypto stream interface
2017-12-12 18:30:08 +07:00
Marten Seemann
16d610417b
don't send every MAX_{STREAM}_DATA twice
2017-12-12 18:06:55 +07:00
Marten Seemann
dfa2181657
reject RST_STREAM frames for the crypto stream
2017-12-12 17:37:15 +07:00
Marten Seemann
81e13e52fd
reject STREAM frames that would close the crypto stream
2017-12-12 17:37:15 +07:00
Marten Seemann
5a36a287de
handle MAX_STREAM_DATA frames for the crypto stream
2017-12-12 17:36:59 +07:00
Marten Seemann
51c5cc46d8
remove the internal error for RST_STREAM frames for closed streams
2017-12-10 23:34:09 +07:00
Marten Seemann
ba4e980876
remove the internal error for MAX_STREAM_DATA frames for closed streams
2017-12-10 23:29:01 +07:00
Marten Seemann
11f746a183
implement parsing and writing of the new STREAM frames
2017-12-08 09:20:47 +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
57c6f3ceb5
don't return the handshakeChan from the session constructor
2017-12-08 07:34:57 +07:00
Marten Seemann
f90029ef64
change ReceivedPacketHandler such that it can generate ACKs for packet number 0
2017-12-07 21:33:34 +07:00
Marten Seemann
ad22ed9d16
disable connection migration
...
Connection migration is complicated: We need to verify the new path, and
reset the congestion controller. In the IETF draft, connection migration
is still work in progress.
2017-12-06 08:42:13 +07:00
Marten Seemann
dc8b547793
reject ACKs that ack packets with a higher encryption level
2017-11-12 15:05:14 +08:00
Marten Seemann
9f1eb62860
implement the IETF draft BLOCKED and STREAM_BLOCKED frames
2017-11-04 15:22:14 +07:00
Marten Seemann
0f1f1c8d41
implement the MAX_DATA and MAX_STREAM_DATA frames
...
For gQUIC WINDOW_UPDATEs are converted to MAX_DATA and MAX_STREAM_DATA,
respectively.
2017-11-04 15:22:14 +07:00
Marten Seemann
1f644debd4
set if a stream contributes to connection flow control
...
This depends on the version. In gQUIC, stream 1 and 3 don't contribute,
in IETF QUIC only stream 0 doesn't contribute.
2017-11-04 15:22:14 +07:00
Marten Seemann
f662822486
use stream 0 for the crypto stream when using TLS
2017-11-04 15:22:07 +07:00
Marten Seemann
a1a4f35096
send initial version in the CHLO, not the current version
...
This commit fixes two bugs:
1. In the CHLO, we need to send the initial QUIC version. It will differ
from the current version if version negotiation was performed.
2. The session setup was using the wrong version (current version, and
not the initial version), such that we would have sent the wrong version
in the TLS handshake as well.
2017-11-02 21:51:51 +07:00
Marten Seemann
df13a0a970
implement the TLS Cookie extension
2017-11-02 16:45:43 +07:00
Marten Seemann
a65929f6cf
add logging for the packet header
2017-10-27 22:56:41 +07:00
Marten Seemann
4f86995e48
encrypt unprotected packets with a connection-dependent key
2017-10-27 17:35:08 +07:00