mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-06-04 12:31:46 +00:00
core: fix /start remote host parser when iface name contains a space (#7025)
* core: fix /start remote host parser when iface name contains a space The iface= field used jsonP (which calls takeByteString and strict-decodes the entire remaining input as JSON). When port= followed iface=, the strict decode failed on the trailing data and the text1P fallback stopped at the first space inside the JSON-quoted interface name (e.g. "Ethernet 2"), leaving unparseable junk and producing "Failed reading: empty". Replace jsonP with a bounded quotedP that consumes only up to the closing quote, leaving port=… for the next parser. * plan: document fix for /start remote host iface-with-space parser bug
This commit is contained in:
@@ -5526,7 +5526,8 @@ chatCommandP =
|
||||
addressAA = AddressSettings False <$> (Just . AutoAccept <$> (" incognito=" *> onOffP <|> pure False)) <*> autoReply
|
||||
businessAA = " business" *> (AddressSettings True (Just $ AutoAccept False) <$> autoReply)
|
||||
autoReply = optional (A.space *> msgContentP)
|
||||
rcCtrlAddressP = RCCtrlAddress <$> ("addr=" *> strP) <*> (" iface=" *> (jsonP <|> text1P))
|
||||
rcCtrlAddressP = RCCtrlAddress <$> ("addr=" *> strP) <*> (" iface=" *> (quotedP <|> text1P))
|
||||
quotedP = safeDecodeUtf8 <$> (A.char '"' *> A.takeTill (== '"') <* A.char '"')
|
||||
text1P = safeDecodeUtf8 <$> A.takeTill (== ' ')
|
||||
char_ = optional . A.char
|
||||
|
||||
|
||||
Reference in New Issue
Block a user