fix: escape the source title in markup; capture peer comes from the source config

This commit is contained in:
Martino Ferrari committed 2026-10-31 20:27:47 +01:00
1 parent 4d859d6a37
commit dd4aed8dec
2 files changed
+13 -7

No files matched your search

+10 -4
View File
@@ -97,11 +97,17 @@ void Acquisition::set_capture_want(bool want, std::uint32_t slots) {
g_mkdir_with_parents(dir.c_str(), 0700);
capture_path_ = dir + "/capture.bin";
std::uint32_t addr = 0;
struct ::in_addr a;
if (cfg_.source_kind == "udps" && ::inet_pton(AF_INET, cfg_.server.c_str(), &a) == 1) {
addr = a.s_addr; // already network order, which is what the header wants
std::uint16_t peer_port = 0;
if (cfg_.source_kind == "udps") {
// The source config, not cfg_.server/port: --source-opt overrides only the former.
const SourceConfig sc = cfg_.source_config();
struct ::in_addr a;
if (::inet_pton(AF_INET, sc.get("server", "127.0.0.1").c_str(), &a) == 1) {
addr = a.s_addr; // already network order, which is what the header wants
}
peer_port = static_cast<std::uint16_t>(sc.get_int("port", 8000));
}
capture_.set_peer(addr, cfg_.source_kind == "udps" ? cfg_.port : 0);
capture_.set_peer(addr, peer_port);
}
}
capture_want_.store(want, std::memory_order_release);