Skip to content

Commit f7322ca

Browse files
committed
more
1 parent 0c7e305 commit f7322ca

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

packages/bun-uws/src/ChunkedEncoding.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,15 @@ namespace uWS {
6666
state |= bits;
6767
data.remove_prefix(1);
6868
}
69-
auto len = data.length();
70-
if(len >= 2) {
69+
if(data.length() >= 2) {
7170
/* Consume \r\n */
7271
if((data[0] != '\r' || data[1] != '\n')) {
7372
state = STATE_IS_ERROR;
7473
return;
7574
}
75+
state += 2; // include the two last /r/n
76+
state |= STATE_HAS_SIZE | STATE_IS_CHUNKED;
7677
data.remove_prefix(2);
77-
/* Now we stand on \n so consume it and enable size */
78-
if (data.length()) {
79-
state += 2; // include the two last /r/n
80-
state |= STATE_HAS_SIZE | STATE_IS_CHUNKED;
81-
data.remove_prefix(1);
82-
}
8378
}
8479
// short read
8580
}

0 commit comments

Comments
 (0)