fix recording present on the proxy when proxying DATA-PRESENT
authorJoey Hess <joeyh@joeyh.name>
Wed, 30 Oct 2024 17:09:50 +0000 (13:09 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 30 Oct 2024 17:17:31 +0000 (13:17 -0400)
Apparently the protoerrhandler parameter never runs. Also the const
typo prevented the type checker from complaining that relayPUTRecord was
being called with 1 less parameter than needed.

So move the relayPUTRecord out of it.

P2P/Proxy.hs

index 3519fa64ed549454c0e6b63d993e520ff458c614..e6449c39c67611093a45afcfce20c71e5ec177e2 100644 (file)
@@ -688,8 +688,9 @@ proxyRequest proxydone proxyparams requestcomplete requestmessage protoerrhandle
        handlePutMulti_DATA_PRESENT _ _ _ = protoerr
 
        handlePut_DATA_PRESENT remoteside k DATA_PRESENT =
-               getresponse (runRemoteSide remoteside) DATA_PRESENT $ \resp ->
-                       protoerrhandler (const (relayPUTRecord k remoteside) >> requestcomplete) $
+               getresponse (runRemoteSide remoteside) DATA_PRESENT $ \resp -> do
+                       void $ relayPUTRecord k remoteside resp
+                       protoerrhandler requestcomplete $
                                client $ net $ sendMessage resp
        handlePut_DATA_PRESENT _ _ _ = protoerr