fix setting protocol version for v0 server

Before it was leaving the protocol version at the default, when it
was actually v0.

v0 has only ever been used over tor, which is probably why this bug was
never noticed.
This commit is contained in:
Joey Hess 2024-07-26 13:24:56 -04:00
parent 576ec6ed71
commit de7730f51f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -377,7 +377,7 @@ negotiateProtocolVersion preferredversion = do
case r of case r of
Just (VERSION v) -> net $ setProtocolVersion v Just (VERSION v) -> net $ setProtocolVersion v
-- Old server doesn't know about the VERSION command. -- Old server doesn't know about the VERSION command.
Just (ERROR _) -> return () Just (ERROR _) -> net $ setProtocolVersion 0
_ -> net $ sendMessage (ERROR "expected VERSION") _ -> net $ sendMessage (ERROR "expected VERSION")
sendBypass :: Bypass -> Proto () sendBypass :: Bypass -> Proto ()