- use a static DiskFileItemFactory (one instantiation is enough)

- use more memory for the DiskFileItemFactory to avoid IO when POST commands come

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6485 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 267108470f
commit 94b2a664f3

@ -71,7 +71,6 @@ import java.io.UnsupportedEncodingException;
import java.lang.ref.SoftReference;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.InetAddress;
import java.net.URLDecoder;
import java.util.Date;
import java.util.HashMap;

@ -99,6 +99,8 @@ public final class HTTPDemon implements serverHandler, Cloneable {
public static final int ERRORCASE_MESSAGE = 4;
public static final int ERRORCASE_FILE = 5;
private static File TMPDIR = new File(System.getProperty("java.io.tmpdir"));
private static FileItemFactory diskFileItemFactory = new DiskFileItemFactory(5 * 1024 * 1024, TMPDIR);
private static AlternativeDomainNames alternativeResolver = null;
/**
@ -901,8 +903,7 @@ public final class HTTPDemon implements serverHandler, Cloneable {
}
// parse data in memory
FileItemFactory factory = new DiskFileItemFactory(1024 * 1024, TMPDIR);
FileUpload upload = new FileUpload(factory);
FileUpload upload = new FileUpload(diskFileItemFactory);
List<FileItem> items;
try {
items = upload.parseRequest(request);

Loading…
Cancel
Save