fix hang at end of PUT to proxied p2p http remote
authorJoey Hess <joeyh@joeyh.name>
Fri, 26 Jul 2024 23:50:15 +0000 (19:50 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 26 Jul 2024 23:50:15 +0000 (19:50 -0400)
commita3dab58be215beac74d569f8216dfdf9c021b2bf
treec323ca7ad11677b8b6ccf6ff74d7a857074863cc
parentb431201e1f834868e80f0dab145155a385e72625
fix hang at end of PUT to proxied p2p http remote

sendExactly will now be sure to evaluate the whole lazy ByteString.

In this case, the lazy ByteString was exactly the right lenth.
But, it seems that L.take caused it to not actually be fully evaluated.

In servePut, this manifested as gather never being fully evaluated,
which caused the hang.

Very, very subtle, and horrible bug. Clearly the use of lazy ByteString
(or really just laziness) is at fault, and it would be very worth moving
to conduit or whatever to avoid this.
P2P/IO.hs
doc/design/p2p_protocol.mdwn
doc/todo/git-annex_proxies.mdwn