Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix dangling view in addr/port parsing
With this in the config: [bind] listen=144.76.164.202:1666 I was getting a failure during config parsing: Dec 04 16:00:21 fenrir lokinet[2480391]: [2024-12-04 20:00:21] [+0.000s] [config:critical|/home/testnet/lokinet/llarp/config/config.cpp:1232] Parsing input: 144.76.164.202:1666 Dec 04 16:00:21 fenrir lokinet[2480391]: [2024-12-04 20:00:21] [+0.000s] [config:critical|/home/testnet/lokinet/llarp/config/config.cpp:1234] Parsed input = Dec 04 16:00:21 fenrir lokinet[2480391]: [1B blob data] Dec 04 16:00:21 fenrir lokinet[2480391]: :1666 which turned out to be that we had a string view viewing a temporary std::string. This fixes it. Also removes a counterproductive `static` from inlined header methods around addr parsing. (Having a `static` free function forces a distinct copy of the function to exist for every compilation unit that uses the function *without* linkage of those functions, while plain `inline` still compiles separate copies where used, but allows the linker to deduplicate them when linking the final binary).
- Loading branch information