mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-17 10:59:39 +00:00
Fix problems with CPPHTTPLIB_NO_EXCEPTIONS
This commit is contained in:
1 parent
094bf112bb
commit
71bb17fb0e
2 files changed
+97
-40
No files matched your search
+4
-10
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user