desktop automatic memory cleanup

This commit is contained in:
wanghongenpin
2024-10-23 11:06:39 +08:00
parent 2f37309879
commit 29e1227d76
15 changed files with 283 additions and 73 deletions

View File

@@ -57,10 +57,12 @@ class HttpParse {
return false;
}
if (data.length > defaultMaxLength) {
throw Exception("header too long");
}
int startIndex = data.readerIndex;
for (int i = data.readerIndex; i < data.length; i++) {
if ((i - startIndex) > defaultMaxLength) {
throw Exception("header too long");
}
if (_isLineEnd(data, i)) {
Uint8List line = data.readBytes(i - data.readerIndex);
data.skipBytes(2);