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

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7880 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
sixcooler 13 years ago
parent 411ed159f8
commit 06408a9428

@ -816,15 +816,15 @@ public final class HTTPDemon implements serverHandler, Cloneable {
} }
// check if we have enough memory // 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()); throw new IOException("not enough memory available for request. request.getContentLength() = " + request.getContentLength() + ", MemoryControl.available() = " + MemoryControl.available());
} }
// parse data in memory // parse data in memory
final FileUpload upload = new FileUpload(DISK_FILE_ITEM_FACTORY);
final List<FileItem> items; final List<FileItem> items;
try { try {
final FileUpload upload = new FileUpload(DISK_FILE_ITEM_FACTORY);
items = upload.parseRequest(request); items = upload.parseRequest(request);
} catch (FileUploadException e) { } catch (FileUploadException e) {
throw new IOException("FileUploadException " + e.getMessage()); throw new IOException("FileUploadException " + e.getMessage());

Loading…
Cancel
Save