Commit Graph

177 Commits

Author SHA1 Message Date
Marten Seemann
f7526b9883 rewrite flow control auto-tuning 2017-12-21 18:02:14 +07:00
Marten Seemann
ac05343b00 rename window increment to window size in the flow controller
No functional change expected.
2017-12-21 17:58:03 +07:00
Marten Seemann
d4f904b55b regenerate all gomocks after gomock output format was changed
No functional change expected.
2017-12-21 17:30:51 +07:00
Marten Seemann
f2a6c25124 remove unneeded mockgen command 2017-12-21 13:38:13 +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
a0c4e28485 send and handle STOP_SENDING frames (for IETF QUIC) 2017-12-16 09:30:07 +07:00
Marten Seemann
d0b22e3439 refactor stream to support canceling Read and Write 2017-12-16 09:10:24 +07:00
Marten Seemann
15af2c6e41 Merge pull request #1037 from lucas-clemente/flow-control-mutexes
remove flow control mutexes for the sending data
2017-12-16 08:57:59 +07:00
Marten Seemann
4b7af49164 Merge pull request #1038 from lucas-clemente/flow-control-no-defer
don't defer unlocking the mutex when getting window updates
2017-12-16 00:25:26 +07:00
Marten Seemann
bfdeeae70c remove flow control mutexes for the sending data
Receiving MAX_{STREAM}_DATA frames and sending data is all done
sequentially, so we don't need a mutex there.
2017-12-16 00:23:48 +07:00
Marten Seemann
357a2f6213 don't defer unlocking the mutex when getting window updates 2017-12-15 19:49:41 +07:00
Marten Seemann
40650d93f0 add an application-defined error type, for RST_STREAM and STOP_SENDING 2017-12-15 16:21:09 +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
448928fc63 Merge pull request #1028 from lucas-clemente/fix-986
add the offset to the BLOCKED and STREAM_BLOCKED frames
2017-12-14 19:21:05 +07:00
Marten Seemann
00edfb7461 set the offset in BLOCKED and STREAM_BLOCKED frames 2017-12-14 19:04:17 +07:00
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
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
8833e4f4af use a gomock ReceivedPacketHandler in the session tests 2017-12-14 12:28:40 +07:00
Marten Seemann
5c7fb54445 use a gomock SentPacketHandler in the session tests 2017-12-14 12:28:40 +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