Commit Graph

122 Commits

Author SHA1 Message Date
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
d49ad2d0cc queue STREAM_BLOCKED frames from the stream, when popping a STREAM frame 2017-12-20 10:23:01 +07:00
Marten Seemann
e926b0805a split the stream into a receive and a send stream 2017-12-20 10:05:02 +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
93e99e239c Merge pull request #1030 from lucas-clemente/fix-1029
when the stream write deadline expires, return the data length written
2017-12-14 23:13:44 +07:00
Marten Seemann
34ad9f9e63 when the stream write deadline expires, return the data length written 2017-12-14 19:25:36 +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
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
73ab97aa95 simplify the stream by directly popping STREAM frames from it 2017-12-12 18:48:08 +07:00
Marten Seemann
cd5e7ae177 remove unneeded function from the crypto stream interface 2017-12-12 18:30: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
25a6dc9654 implement stateless handling of Initial packets for the TLS server 2017-12-08 08:45:54 +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
268c3859fc remove the flow control manager 2017-10-20 21:34:09 +07:00
Marten Seemann
95a971f322 make the flow control package internal 2017-08-30 00:27:44 +07: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
Marten Seemann
8ef69143ba implement a context for the stream
The context is cancelled when the write-side of the stream is closed.
2017-08-02 11:28:17 +07:00
Marten Seemann
77d4573d9b return an error when Write is called on a closed stream 2017-07-29 00:19:39 +07:00
Marten Seemann
6546e13e26 implement net.Error interface for stream deadline expiration errors 2017-07-24 21:45:07 +07:00
Marten Seemann
e09993403d add stream deadlines to the Stream interface 2017-07-15 23:46:15 +07:00
Marten Seemann
1acdc5f18e implement write deadlines 2017-07-15 23:46:15 +07:00
Marten Seemann
5720e8af7d implement read deadlines 2017-07-15 23:46:15 +07:00
Marten Seemann
a70ae86f5a replace the sync.Cond for stream.Write() by a channel 2017-07-15 23:46:15 +07:00
Marten Seemann
5fbd52158f replace the sync.Cond for stream.Read() by a channel 2017-07-15 23:46:15 +07:00
Marten Seemann
c63be8c544 return the length of data written when the stream errors 2017-06-14 12:08:26 +02:00
Marten Seemann
987905149b run gofmt to fix ordering of imports 2017-06-13 18:07:22 +02:00
Marten Seemann
c0b09c8646 make utils an internal package 2017-06-09 22:28:40 +02:00
Lucas Clemente
1311629830 Remove unnecessary error return value in newStream 2017-06-08 11:09:11 +02:00
Lucas Clemente
a7c60e3229 Fix a data race in stream.Read 2017-04-30 15:30:31 +02:00
Marten Seemann
980d0e398f don’t add bytes read after receiving a RST_STREAM to flow controller 2017-01-09 10:15:12 +07:00
Marten Seemann
d6a0a145a4 correclty detected the closed state of a stream
fixes #380
2017-01-09 09:49:45 +07:00
Marten Seemann
7a91794292 send RST_STREAM frames
ref #380
2017-01-09 09:49:44 +07:00
Marten Seemann
c705a19f11 fix race condition in stream 2017-01-09 09:49:44 +07:00
Marten Seemann
57e6749955 stream code cleanup 2017-01-09 09:49:44 +07:00
Marten Seemann
a86f31d789 implement a stream.Reset() method
ref #380
2017-01-09 09:49:44 +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
9e09198df6 don’t return data for writing from a stream if it was closed with an error 2017-01-03 16:07:18 +07:00
Marten Seemann
74edf9caad improve errors returned for flow control violations 2017-01-03 12:01:27 +07:00