Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

since many POST-requests come as gzip they report a contentlength of -1 request memory of -1 * 3 look useless to me so I added some megs to it - even correct report of contentlength should not be harmed by this

sixcooler06408a9428ab
diff --git a/source/de/anomic/http/server/HTTPDemon.java b/source/de/anomic/http/server/HTTPDemon.java
index 764c11088..2bf70d509 100644
--- a/source/de/anomic/http/server/HTTPDemon.java
+++ b/source/de/anomic/http/server/HTTPDemon.java
@@ -816,15 +816,15 @@ public final class HTTPDemon implements serverHandler, Cloneable {
}
// check if we have enough memory
- if (!MemoryControl.request(request.getContentLength() * 3, false)) {
+ if (!MemoryControl.request(request.getContentLength() * 3 + 10*1024*1024, false)) {
throw new IOException("not enough memory available for request. request.getContentLength() = " + request.getContentLength() + ", MemoryControl.available() = " + MemoryControl.available());
}
// parse data in memory
- final FileUpload upload = new FileUpload(DISK_FILE_ITEM_FACTORY);
final List<FileItem> items;
try {
+ final FileUpload upload = new FileUpload(DISK_FILE_ITEM_FACTORY);
items = upload.parseRequest(request);
} catch (FileUploadException e) {
throw new IOException("FileUploadException " + e.getMessage());