You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Cohttp_eio.Client.call function takes a ~sw and returns a Body.t. calling Eio.Flow.read_all on the body after getting out of the Switch.run can cause a “use-after-close” exception from Eio:
Invalid-argument: readv: file descriptor used after calling close!
It gives the impression of defeating the purpose of eio-swtches, right?
PS: the documentation does say "Consume [response_body] in a timely fashion." which is a bit vague :)
The text was updated successfully, but these errors were encountered:
The purpose of the switch is to make sure that the connection gets freed, even if an error occurs. Ideally the type system would also make sure you don't use things after they're closed, but OCaml can't do that yet.
The
Cohttp_eio.Client.call
function takes a~sw
and returns aBody.t
. callingEio.Flow.read_all
on the body after getting out of theSwitch.run
can cause a “use-after-close” exception from Eio:It gives the impression of defeating the purpose of eio-swtches, right?
PS: the documentation does say "
Consume [response_body] in a timely fashion.
" which is a bit vague :)The text was updated successfully, but these errors were encountered: