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:
Narasimha-sc
2026-05-30 06:33:10 +00:00
committed by GitHub
parent 68abd805d4
commit 5aace8401c
3 changed files with 24 additions and 2 deletions
+2 -1
View File
@@ -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