fix reversion in GET from proxy over http
authorJoey Hess <joeyh@joeyh.name>
Mon, 29 Jul 2024 15:03:18 +0000 (11:03 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 29 Jul 2024 15:07:09 +0000 (11:07 -0400)
commit7402ae61d9cb0fc5b09ea05a9cad8ed7a886490b
tree8f44278c186767eaf1cbd0d637162141b2b89da0
parent6af44b9de6168cf50128dfaf2c8400df961d2b70
fix reversion in GET from proxy over http

4f3ae966662c38080fcafb9d5bbee4dedce566b8 caused a hang in GET,
which git-annex testremote could reliably cause.

The problem is that closing both P2P handles before waiting on the
asyncworker prevents all the DATA from getting sent.

The solution is to only close the P2P handles early when the
P2PConnection is being closed. When it's being released, let the
asyncworker finish. closeP2PConnection is called in GET when it was
unable to send all data, and in PUT when it did not receive all the
data, and in both cases closing the P2P handles early is ok.
P2P/Http/State.hs