Commit Graph

50 Commits

Author SHA1 Message Date
Marten Seemann
d330fda94c also use the onHasStreamData callback for the crypto stream 2018-01-09 17:17:16 +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
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
d49ad2d0cc queue STREAM_BLOCKED frames from the stream, when popping a STREAM frame 2017-12-20 10:23:01 +07:00
Marten Seemann
00edfb7461 set the offset in BLOCKED and STREAM_BLOCKED frames 2017-12-14 19:04:17 +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
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
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
11f746a183 implement parsing and writing of the new STREAM frames 2017-12-08 09:20:47 +07:00
Marten Seemann
9f1eb62860 implement the IETF draft BLOCKED and STREAM_BLOCKED frames 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
5ee7b205c6 handle the crypto stream separately 2017-10-25 09:13:48 +07:00
Marten Seemann
268c3859fc remove the flow control manager 2017-10-20 21:34:09 +07:00
Marten Seemann
f3e9bf4332 remove the params negotiator 2017-10-20 18:08:21 +07:00
Marten Seemann
709eec55b5 improve garbage collection of stream
This removes the Iterate method of the streamsMap, and moves the garbage
collection of closed streams from the session to the streamsMap.
2017-10-03 04:04:21 +08:00
Marten Seemann
8bcabe0ba9 correctly pack packets with sealers with different overheads 2017-09-08 12:04:45 +03:00
Marten Seemann
f1ada87dcf make the protocol package internal 2017-08-30 00:19:44 +07:00
Marten Seemann
ed522ebbce make wire an internal package 2017-08-29 23:51:56 +07:00
Marten Seemann
88afad8722 rename package frames to wire 2017-08-29 23:27:15 +07:00
Lucas Clemente
c02f904479 Mock CPM everywhere using gomock 2017-06-09 12:38:07 +02:00
Lucas Clemente
8b6a662223 Move flow control mocks to a separate package
This allows the other mocks to be used in the FC tests.
2017-06-09 12:08:26 +02:00
Lucas Clemente
eeb2d8d821 Mock FlowControlManager using gomock 2017-06-08 16:06:31 +02:00
Marten Seemann
16da08a440 add client functionality to the streamsMap 2017-01-14 18:54:15 +07:00
Marten Seemann
4e0ef58bab allow stream.Read for streams that a RST was received for
and a lot of code improvements

fixes #385
2017-01-09 09:49:43 +07:00
Marten Seemann
c12508c3c9 use a mock ConnectionParametersManager in quic tests 2016-12-08 21:50:10 +07:00
Marten Seemann
5af50c8fd0 correctly read MIDS and MSPC parameter
fixes #367
2016-12-08 16:15:31 +07:00
Marten Seemann
a8f45d7959 don't send BlockedFrames after sending the FinBit for a stream
fixes #333
2016-10-27 17:56:02 +07:00
Lucas Clemente
d837cd96b2 disable FIN-packing optimization, increasing transfer rate by 5% 2016-09-05 00:51:05 +02:00
Marten Seemann
1d7cf74e48 always send a StopWaiting with a packet containing a retransmission
fixes #259
2016-08-18 15:02:18 +07:00
Lucas Clemente
73c8967302 bundle FINs into stream frames (sometimes)
fixes #279
2016-08-17 23:12:37 +02:00
Lucas Clemente
f14f291032 add a test for sending FIN-only frames when flow control blocked
fixes #206
2016-08-17 18:40:41 +02:00
Marten Seemann
f1da2239ca don't split off empty StreamFrames in streamFramer
fixes #284
2016-08-17 18:04:33 +07:00
Lucas Clemente
02c28c3a59 remove unneeded streamsMap.{Put,Get}Stream 2016-08-08 20:51:57 +02:00
Lucas Clemente
65663c3314 implement GetOrOpenStream in streamsMap 2016-08-08 20:51:57 +02:00
Marten Seemann
71dcad29b5 use round-robin scheduling in StreamFramer
fixes #207
2016-08-06 17:01:28 +07:00
Marten Seemann
a796877b94 use StreamsMap in Session and StreamFramer
fixes #208
2016-08-05 19:30:28 +07:00
Lucas Clemente
f6b6566c65 add a test that the framer does not emit empty frames
fixes #202
2016-07-28 17:02:06 +02:00
Lucas Clemente
5f774c8e03 change fcm.SendWindowSize to include conn window to simplify framer 2016-07-26 17:06:54 +02:00
Lucas Clemente
804287bd5c remove streamFramer.EstimatedDataLen
ref #217
2016-07-26 13:44:09 +02:00
Lucas Clemente
d9a3980efc remove streamFramer.HasData()
ref #217
2016-07-26 13:43:18 +02:00
Lucas Clemente
7adf760fa4 change streamFramer to pop as many stream frames as possible at once
ref #217
2016-07-26 13:42:30 +02:00
Lucas Clemente
bdbf8d3ebe add BLOCKED frame management to streamFramer
ref #211
2016-07-09 14:29:56 +02:00
Lucas Clemente
f43c4c7f1a respect flow control in streamFramer estimated length and HasData()
ref #83
2016-07-08 18:21:45 +02:00
Lucas Clemente
f8130288a3 fix early garbage collection of streams
ref #83
2016-07-08 18:21:45 +02:00
Lucas Clemente
3cbf16b66f add flow control to streamFramer
ref #83
2016-07-08 18:21:45 +02:00
Lucas Clemente
d1e3b541d3 replace streamFrameQueue with just-in-time framing of written data
This commits replaces the stream frame queue with a framer which
requests data from the streams just when a frame is needed by the
packet packer. This simplifies a lot of things and allows some other
refactorings, see issue #83.

There are a few pending tests which will be fixed soon.
2016-07-08 18:21:44 +02:00