once the http fetch is done, close the flow (#5)
This commit is contained in:
parent
023fb4283d
commit
99dcf500c1
1 changed files with 15 additions and 13 deletions
|
@ -271,7 +271,7 @@ let single_request ~ctx ~alpn_protocol ?config cfg ~meth ~headers ?body uri =
|
||||||
| Error _ -> Mimic.add tls_config cfg ctx )
|
| Error _ -> Mimic.add tls_config cfg ctx )
|
||||||
| Error _ -> ctx in
|
| Error _ -> ctx in
|
||||||
Mimic.resolve ctx >>? fun flow ->
|
Mimic.resolve ctx >>? fun flow ->
|
||||||
match Option.bind (alpn_protocol flow) alpn_protocol_of_string, config with
|
(match Option.bind (alpn_protocol flow) alpn_protocol_of_string, config with
|
||||||
| (Some `HTTP_1_1 | None), Some (`HTTP_1_1 config) ->
|
| (Some `HTTP_1_1 | None), Some (`HTTP_1_1 config) ->
|
||||||
single_http_1_1_request ~sleep ~config flow user_pass host meth path headers body
|
single_http_1_1_request ~sleep ~config flow user_pass host meth path headers body
|
||||||
| (Some `HTTP_1_1 | None), None ->
|
| (Some `HTTP_1_1 | None), None ->
|
||||||
|
@ -283,7 +283,9 @@ let single_request ~ctx ~alpn_protocol ?config cfg ~meth ~headers ?body uri =
|
||||||
| Some `H2, (Some (`HTTP_1_1 _)) ->
|
| Some `H2, (Some (`HTTP_1_1 _)) ->
|
||||||
single_h2_request ~sleep ~scheme flow user_pass host meth path headers body
|
single_h2_request ~sleep ~scheme flow user_pass host meth path headers body
|
||||||
| Some `HTTP_1_1, Some (`H2 _) ->
|
| Some `HTTP_1_1, Some (`H2 _) ->
|
||||||
single_http_1_1_request ~sleep flow user_pass host meth path headers body
|
single_http_1_1_request ~sleep flow user_pass host meth path headers body) >>= fun r ->
|
||||||
|
Mimic.close flow >|= fun () ->
|
||||||
|
r
|
||||||
|
|
||||||
let tls_config ?tls_config ?config authenticator =
|
let tls_config ?tls_config ?config authenticator =
|
||||||
lazy ( match tls_config with
|
lazy ( match tls_config with
|
||||||
|
|
Loading…
Reference in a new issue