Marten Seemann
948eef3e42
create a logger interface and use it everywhere
2018-04-04 13:03:28 +07:00
Lorenzo Saino
10acc677aa
Make RoundTripper.RoundTrip(...) return if client timeout expires
...
Currently, the implementation of h2quic.RoundTripper.RoundTrip(req
*http.Request) ignores the context of req. As a result, if the
RoundTripper is used as transport of an http.Client with a timeout value
set, that is ignored.
For example, in the following snippet, client.Do(req) does not promptly
return if the task takes more than client.Timeout to complete.
client := http.Client{
Timeout: 50 * time.Millisecond,
Transport = &h2quic.RoundTripper{}
}
req, err := http.NewRequest("GET", "https://www.example.com ", nil)
response, err := client.Do(req)
This commit updates h2quic.client.RoundTrip(req *http.Request) to return
an error if the request is cancelled.
2018-02-25 20:58:37 +00:00
Marten Seemann
7c9b18ea67
make the h2quic client test less racy
2018-02-01 22:35:53 +08:00
Marten Seemann
ef56cae9dc
implement a Dial function for the h2quic.RoundTripper
...
If Dial is set, it will be used for dialing new QUIC connections. If it
is nil, quic.DialAddr will be used.
2018-01-21 13:47:06 +11:00
Marten Seemann
fc4adb4775
improve error handling in the h2quic client for header stream handling
...
When the underlying QUIC stream is closed, the close error should be
returned. This always happens when receiving a CONNECTION_CLOSE from the
server.
Furthermore, this adds a missing break statement in the case when
receiving an invalid HTTP request.
2018-01-03 09:07:18 +07:00
Julien Schmidt
06c87af606
remove unused encryptionLevel from client
2017-12-06 10:51:28 +01:00
Marten Seemann
f662822486
use stream 0 for the crypto stream when using TLS
2017-11-04 15:22:07 +07:00
Lucas Clemente
ea4de9a08f
Merge pull request #698 from twdkeule/implement-closeNotifier
...
implement the context for the server http.Request
2017-09-26 14:09:54 +02:00
Marten Seemann
f1ada87dcf
make the protocol package internal
2017-08-30 00:19:44 +07:00
Thomas De Keulenaer
4f6eef8b08
Add test for request context
2017-08-27 20:05:13 +02:00
Marten Seemann
ee6ca8dfb4
expose the quic.Config in the h2quic.RoundTripper
2017-07-10 22:00:03 +07:00
Marten Seemann
abb9594af8
change order of function parameters for the h2quic.client constructor
2017-07-10 22:00:03 +07:00
Marten Seemann
cb81a95ceb
make the dependency-injected dialAddr in h2quic.client a global variable
...
It's only used for testing, so there's no need to have in each
h2quic.client instance.
2017-07-10 21:59:58 +07:00
Marten Seemann
a851aaacda
remove the tls.Config from the quic.Config
...
The tls.Config now is a separate parameter to all Listen and Dial
functions in the quic package.
2017-07-03 22:12:09 +02:00
Marten Seemann
05d7bc91ef
fix race condition when handling the header stream fails in h2quic client
2017-06-06 17:08:00 +02:00
Marten Seemann
c122428cb6
simply the dialing in the h2quic client
...
Fixes #620 .
Dialing is now done lazily, when a request is executed.
2017-06-04 09:41:51 +02:00
Marten Seemann
c2a89e6b78
improve error message in the h2quic client
2017-06-03 17:41:17 +02:00
Marten Seemann
9054e5205f
don't pass the roundtripper to the h2quic client
2017-06-02 23:08:14 +02:00
Marten Seemann
4c3d4960bb
privatize the h2quic client
2017-06-01 20:14:07 +02:00
Marten Seemann
6623abf3d1
return handshake errors in h2quic Client.Do
2017-05-16 00:56:10 +08:00
Marten Seemann
33a9b5aae4
add more tests for Dial in the h2quic client
2017-05-16 00:56:09 +08:00
Marten Seemann
fb77a79b2b
close the response chan on header stream erros in h2quic client
2017-05-16 00:56:08 +08:00
Marten Seemann
612323985b
remove the ConnStateCallback from the client
...
Dial and DialAddr return once the connection is forward secure. There is
currently no option to get the session earlier, this will be added later.
2017-05-16 00:56:02 +08:00
Marten Seemann
dc782e78eb
fix race condition when saving the encryption level in h2quic.Client
...
fixes #551
2017-04-18 14:30:25 +07:00
Marten Seemann
6d0ac39cf7
Merge pull request #482 from lucas-clemente/fix-479
...
send a HeadersStreamDataDecompressFailure error when H2 frame parsing fails
2017-03-15 17:15:21 +07:00
Marten Seemann
7f416a06c4
send a HeadersStreamDataDecompressFailure error when H2 frame parsing fails
...
fixes #479
2017-03-15 11:11:38 +07:00
Marten Seemann
4f16503ab9
save the TLS config in the h2quic client
...
fixes #476
2017-03-15 09:18:06 +07:00
Marten Seemann
f5bbe316e8
use OpenStreamSync to open the data stream in the h2quic client
2017-03-06 14:55:46 +07:00
Marten Seemann
a972c7a21e
return the encryption level of a packet when decrypting it
2017-02-25 08:27:08 +07:00
Marten Seemann
6f27b7f70d
handle stream opening errors in h2quic client
2017-02-22 23:03:10 +07:00
Marten Seemann
96edca5219
privatize the client, only expose Dial functions
2017-02-22 23:03:09 +07:00
Marten Seemann
cd465ae0b5
move utils.Stream to quic.Stream
2017-02-22 23:03:09 +07:00
Marten Seemann
f47142eaac
remove stream ID from OpenStream() method
2017-02-22 23:03:05 +07:00
Marten Seemann
8cd1e4484c
fix flaky h2quic client tests
...
fixes #435
2017-02-22 22:55:51 +07:00
Marten Seemann
268841f0cc
add a TLSClientConfig to the QUIC RoundTripper
...
fixes #407
2017-02-04 10:28:00 +07:00
Marten Seemann
7284a74332
fix another flaky h2quic client test
2017-01-16 16:23:34 +07:00
Marten Seemann
f08e00630d
fix flaky h2quic client test
2017-01-16 12:22:03 +07:00
Marten Seemann
e3b34f2120
implement sending of the request body
2017-01-14 19:00:22 +07:00
Marten Seemann
6dd297379b
set EndStream header in HeadersFrame
2017-01-14 18:58:47 +07:00
Marten Seemann
128bad04e5
add option to disable compresson to QuicRoundTripper
2017-01-14 18:58:45 +07:00
Marten Seemann
d028624f77
implement compressed requests and responses
2017-01-14 18:58:45 +07:00
Marten Seemann
edb34b1765
close the quic client on protocol errors in h2quic client
2017-01-14 18:58:45 +07:00
Marten Seemann
14135798c0
compose a http.Response in h2quic client
2017-01-14 18:58:44 +07:00
Marten Seemann
0401b12f8a
handle the header stream in the h2quic client
2017-01-14 18:58:43 +07:00
Marten Seemann
08c267431b
implement closing the quic client with an error
2017-01-14 18:58:43 +07:00
Marten Seemann
c42262c2b3
implement a h2quic client that can send H2 requests
2017-01-14 18:58:43 +07:00