Skip to content

Commit 3383a77

Browse files
committed
cleanuop
1 parent 42704b3 commit 3383a77

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

packages/bun-uws/src/HttpParser.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ namespace uWS
4545

4646
/* We require at least this much post padding */
4747
static const unsigned int MINIMUM_HTTP_POST_PADDING = 32;
48-
static void *FULLPTR = (void *)~(uintptr_t)0;
4948

5049
enum HttpParserError: uint8_t {
5150
HTTP_PARSER_ERROR_NONE = 0,
@@ -699,10 +698,7 @@ namespace uWS
699698
return 0;
700699
}
701700

702-
/* This is the only caller of getHeaders and is thus the deepest part of the parser.
703-
* From here we return either [consumed, user] for "keep going",
704-
* or [consumed, nullptr] for "break; I am closed or upgraded to websocket"
705-
* or [whatever, fullptr] for "break and close me, I am a parser error!" */
701+
/* This is the only caller of getHeaders and is thus the deepest part of the parser. */
706702
template <bool ConsumeMinimally>
707703
HttpParserResult fenceAndConsumePostPadded(bool requireHostHeader, char *data, unsigned int length, void *user, void *reserved, HttpRequest *req, MoveOnlyFunction<void *(void *, HttpRequest *)> &requestHandler, MoveOnlyFunction<void *(void *, std::string_view, bool)> &dataHandler) {
708704

@@ -751,7 +747,6 @@ namespace uWS
751747
auto transferEncodingStringLen = transferEncodingString.length();
752748
auto contentLengthStringLen = contentLengthString.length();
753749
if (transferEncodingStringLen && contentLengthStringLen) {
754-
/* Returning fullptr is the same as calling the errorHandler */
755750
/* We could be smart and set an error in the context along with this, to indicate what
756751
* http error response we might want to return */
757752
return HttpParserResult::error(HTTP_ERROR_400_BAD_REQUEST, HTTP_PARSER_ERROR_INVALID_TRANSFER_ENCODING);
@@ -839,7 +834,6 @@ namespace uWS
839834
break;
840835
}
841836
}
842-
/* Whenever we return FULLPTR, the interpretation of "consumed" should be the HttpError enum. */
843837
if (err) {
844838
return HttpParserResult::error(err, parserError);
845839
}

0 commit comments

Comments
 (0)