Fix problems with CPPHTTPLIB_NO_EXCEPTIONS

This commit is contained in:
yhirose committed 2026-02-01 08:43:13 -05:00
1 parent 094bf112bb
commit 71bb17fb0e
2 files changed
+97 -40

No files matched your search

+4 -10
View File
@@ -13565,18 +13565,12 @@ protected:
msg.id = value;
} else if (field == "retry") {
// Parse retry interval in milliseconds
#ifdef CPPHTTPLIB_NO_EXCEPTIONS
{
std::istringstream iss(value);
iss >> retry_ms;
int v = 0;
auto res =
detail::from_chars(value.data(), value.data() + value.size(), v);
if (res.ec == std::errc{}) { retry_ms = v; }
}
#else
try {
retry_ms = std::stoi(value);
} catch (...) {
// Invalid retry value, ignore
}
#endif
}
// Unknown fields are ignored per SSE spec