mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
Merge pull request #2371 from lorenzosaino/fix-http3-client-close
Make http3.client.Close() succeed if session was not started
This commit is contained in:
commit
3b1e6118da
2 changed files with 9 additions and 0 deletions
|
@ -127,6 +127,9 @@ func (c *client) setupSession() error {
|
|||
}
|
||||
|
||||
func (c *client) Close() error {
|
||||
if c.session == nil {
|
||||
return nil
|
||||
}
|
||||
return c.session.CloseWithError(quic.ErrorCode(errorNoError), "")
|
||||
}
|
||||
|
||||
|
|
|
@ -146,6 +146,12 @@ var _ = Describe("Client", func() {
|
|||
Expect(err).To(MatchError(testErr))
|
||||
})
|
||||
|
||||
It("closes correctly if session was not created", func() {
|
||||
client = newClient("localhost:1337", nil, &roundTripperOpts{}, nil, nil)
|
||||
err := client.Close()
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
|
||||
Context("Doing requests", func() {
|
||||
var (
|
||||
request *http.Request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue