Revert "proxy local timestamps in single proxy case as well as cluster case"
Turns out not to be necessary. I think.
This reverts commit 81e11efda1
.
This commit is contained in:
parent
81e11efda1
commit
e9cba0a580
1 changed files with 13 additions and 3 deletions
16
P2P/Proxy.hs
16
P2P/Proxy.hs
|
@ -349,8 +349,18 @@ proxy proxydone proxymethods proxystate servermode (ClientSide clientrunst clien
|
|||
_ <- client $ net $ sendMessage (ERROR "protocol error X")
|
||||
giveup "protocol error M"
|
||||
|
||||
-- Reply with our local timestamp, and do timestamp translation
|
||||
-- when sending REMOVE-BEFORE.
|
||||
-- When there is a single remote, reply with its timestamp,
|
||||
-- to avoid needing timestamp translation.
|
||||
handleGETTIMESTAMP (remoteside:[]) = do
|
||||
liftIO $ atomically $ do
|
||||
writeTVar (proxyRemoteLatestTimestamps proxystate)
|
||||
mempty
|
||||
writeTVar (proxyRemoteLatestLocalTimestamp proxystate)
|
||||
Nothing
|
||||
proxyresponse remoteside GETTIMESTAMP
|
||||
(const proxynextclientmessage)
|
||||
-- When there are multiple remotes, reply with our local timestamp,
|
||||
-- and do timestamp translation when sending REMOVE-FROM.
|
||||
handleGETTIMESTAMP remotesides = do
|
||||
-- Order of getting timestamps matters.
|
||||
-- Getting the local time after the time of the remotes
|
||||
|
@ -375,11 +385,11 @@ proxy proxydone proxymethods proxystate servermode (ClientSide clientrunst clien
|
|||
Just (remoteSideId r, ts)
|
||||
_ -> Nothing
|
||||
|
||||
proxyTimestamp ts _ _ Nothing = ts -- not proxying timestamps
|
||||
proxyTimestamp ts r tsm (Just correspondinglocaltime) =
|
||||
case M.lookup (remoteSideId r) tsm of
|
||||
Just oldts -> oldts + (ts - correspondinglocaltime)
|
||||
Nothing -> ts -- not reached
|
||||
proxyTimestamp ts _ _ Nothing = ts -- not proxying timestamps
|
||||
|
||||
handleREMOVE [] _ _ =
|
||||
-- When no places are provided to remove from,
|
||||
|
|
Loading…
Reference in a new issue