We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75a5256 commit 44bcfd6Copy full SHA for 44bcfd6
src/HttpParser.h
@@ -41,7 +41,13 @@ namespace uWS {
41
static const unsigned int MINIMUM_HTTP_POST_PADDING = 32;
42
static void *FULLPTR = (void *)~(uintptr_t)0;
43
44
-static const size_t MAX_FALLBACK_SIZE = std::max<size_t>((size_t) atoi(getenv("UWS_HTTP_MAX_HEADERS_SIZE")), 1024 * 4);
+/* STL needs one of these */
45
+template<typename T>
46
+std::optional<T> maybeify(T *ptr) {
47
+ return ptr ? ptr : std::nullopt;
48
+}
49
+
50
+static const size_t MAX_FALLBACK_SIZE = atoi(maybeify(getenv("UWS_HTTP_MAX_HEADERS_SIZE")).value_or("4096"));
51
52
struct HttpRequest {
53
0 commit comments