Skip to content

Commit

Permalink
Fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB authored Dec 15, 2023
1 parent 75a5256 commit 44bcfd6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/HttpParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ namespace uWS {
static const unsigned int MINIMUM_HTTP_POST_PADDING = 32;
static void *FULLPTR = (void *)~(uintptr_t)0;

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 */
template<typename T>
std::optional<T> maybeify(T *ptr) {
return ptr ? ptr : std::nullopt;
}

static const size_t MAX_FALLBACK_SIZE = atoi(maybeify(getenv("UWS_HTTP_MAX_HEADERS_SIZE")).value_or("4096"));

struct HttpRequest {

Expand Down

0 comments on commit 44bcfd6

Please sign in to comment.