Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Dec 18, 2023
1 parent 3821fe5 commit 98b5c79
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/HttpParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ std::optional<T *> optional_ptr(T *ptr) {
}

static const size_t MAX_FALLBACK_SIZE = (size_t) atoi(optional_ptr(getenv("UWS_HTTP_MAX_HEADERS_SIZE")).value_or((char *) "4096"));
#ifdef UWS_HTTP_MAX_HEADERS_COUNT
const static int MAX_HEADERS = UWS_HTTP_MAX_HEADERS_COUNT;
#else
const static int MAX_HEADERS = 100;
#ifndef UWS_HTTP_MAX_HEADERS_COUNT
#define UWS_HTTP_MAX_HEADERS_COUNT 100
#endif

struct HttpRequest {
Expand Down Expand Up @@ -331,7 +329,7 @@ struct HttpParser {
}
headers++;

for (unsigned int i = 1; i < HttpRequest::MAX_HEADERS - 1; i++) {
for (unsigned int i = 1; i < UWS_HTTP_MAX_HEADERS_COUNT - 1; i++) {
/* Lower case and consume the field name */
preliminaryKey = postPaddedBuffer;
postPaddedBuffer = (char *) consumeFieldName(postPaddedBuffer);
Expand Down

0 comments on commit 98b5c79

Please sign in to comment.