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 0c7e305 commit f7322caCopy full SHA for f7322ca
packages/bun-uws/src/ChunkedEncoding.h
@@ -66,20 +66,15 @@ namespace uWS {
66
state |= bits;
67
data.remove_prefix(1);
68
}
69
- auto len = data.length();
70
- if(len >= 2) {
+ if(data.length() >= 2) {
71
/* Consume \r\n */
72
if((data[0] != '\r' || data[1] != '\n')) {
73
state = STATE_IS_ERROR;
74
return;
75
+ state += 2; // include the two last /r/n
76
+ state |= STATE_HAS_SIZE | STATE_IS_CHUNKED;
77
data.remove_prefix(2);
- /* 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
- }
83
84
// short read
85
0 commit comments