Skip to content

Commit

Permalink
fixed transferRWI.html 'Read timed out'
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5092 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
danielr committed Aug 28, 2008
1 parent e503158 commit d6d9b0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions source/de/anomic/http/httpd.java
Expand Up @@ -56,6 +56,7 @@
import org.apache.commons.fileupload.RequestContext;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.httpclient.ChunkedInputStream;
import org.apache.commons.httpclient.ContentLengthInputStream;

import de.anomic.data.htmlTools;
import de.anomic.data.userDB;
Expand Down Expand Up @@ -877,14 +878,17 @@ public static String decodeHtmlEntities(String s) {
* hier muss ARGC gesetzt werden!
* @param args
* @param in
* @param length
* @return
* @throws IOException
*/
@SuppressWarnings("unchecked")
public static HashMap<String, byte[]> parseMultipart(final httpRequestHeader header, final serverObjects args, final InputStream in, final int length)
public static HashMap<String, byte[]> parseMultipart(final httpRequestHeader header, final serverObjects args, final InputStream in)
throws IOException {
RequestContext request = new yacyContextRequest(header, in);

final long clength = header.getContentLength();
final InputStream body = (clength > 0) ? new ContentLengthInputStream(in, clength) : in;

RequestContext request = new yacyContextRequest(header, body);

// check information
if (!FileUploadBase.isMultipartContent(request)) {
Expand All @@ -898,6 +902,7 @@ public static HashMap<String, byte[]> parseMultipart(final httpRequestHeader hea
try {
items = upload.parseRequest(request);
} catch (FileUploadException e) {
e.printStackTrace();
throw new IOException("FileUploadException " + e.getMessage());
}

Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/http/httpdFileHandler.java
Expand Up @@ -341,7 +341,7 @@ public static void doResponse(final Properties conProp, final httpRequestHeader
if ((requestHeader.containsKey(httpHeader.CONTENT_TYPE)) &&
(requestHeader.get(httpHeader.CONTENT_TYPE).toLowerCase().startsWith("multipart"))) {
// parse multipart
final HashMap<String, byte[]> files = httpd.parseMultipart(requestHeader, args, body, length);
final HashMap<String, byte[]> files = httpd.parseMultipart(requestHeader, args, body);
// integrate these files into the args
if (files != null) {
final Iterator<Map.Entry<String, byte[]>> fit = files.entrySet().iterator();
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/server/serverCore.java
Expand Up @@ -616,7 +616,7 @@ public void run() {

// listen for commands
listen();
} catch (final Exception e) {
} catch (final IOException e) {
System.err.println("ERROR: (internal) " + e);
} finally {
try {
Expand Down

0 comments on commit d6d9b0f

Please sign in to comment.