use the HTTP request context when opening the request stream

This commit is contained in:
Marten Seemann
2020-01-26 11:33:22 +07:00
parent fe026a3ac1
commit d2209ba553
2 changed files with 3 additions and 4 deletions

View File

@@ -2,7 +2,6 @@ package http3
import (
"bytes"
"context"
"crypto/tls"
"errors"
"fmt"
@@ -150,7 +149,7 @@ func (c *client) RoundTrip(req *http.Request) (*http.Response, error) {
return nil, c.handshakeErr
}
str, err := c.session.OpenStreamSync(context.Background())
str, err := c.session.OpenStreamSync(req.Context())
if err != nil {
return nil, err
}