kazu-yamamoto / http2

HTTP/2.0 library including HPACK
BSD 3-Clause "New" or "Revised" License
86 stars 22 forks source link

Bug in `sendRequest`? #73

Closed edsko closed 1 year ago

edsko commented 1 year ago

It's entirely possible I just misunderstand, but I think there is a bug in sendRequest:

let setup = addMyId mgr
let teardown _ = deleteMyId mgr
E.bracket setup teardown $ \_ -> void $ forkIO $ do
  ..

(this was introduced in #47). The call to forkIO will return immediately, so that call to teardown will happen immediately.

kazu-yamamoto commented 1 year ago

I guess that setup and teardown should move into the inside of forkIO. If you agree, would you send a PR?

edsko commented 1 year ago

Yes, I think at least the teardown should move inside. Will send a PR.

kazu-yamamoto commented 1 year ago

forkFinally would be nice.

edsko commented 1 year ago

Yes, I actually introduced forkManaged :: Manager -> IO () -> IO () in my WIP branch. Just figuring out one detail at the moment, will submit a PR soon.

edsko commented 1 year ago

PR at #74.