Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 20774 invoked from network); 18 Jul 2000 02:11:53 -0000 Received: from unknown (HELO mail.stt.com.hk) (202.70.130.9) by locus.apache.org with SMTP; 18 Jul 2000 02:11:53 -0000 Received: from stt.com.hk (ipvpn009174.netvigator.com [203.198.51.174]) by mail.stt.com.hk (Sun Internet Mail Server sims.4.0.1999.06.13.00.20) with SMTP id <0FXV002B6FERMY@mail.stt.com.hk> for tomcat-dev@jakarta.apache.org; Tue, 18 Jul 2000 10:11:15 +0800 (HKT) Date: Tue, 18 Jul 2000 10:13:02 +0800 From: Arion Yu Subject: Re: [BUG] Network connection reset while uploading large file To: tomcat-dev@jakarta.apache.org Message-id: <3973BD2E.6AC991B4@stt.com.hk> MIME-version: 1.0 X-Mailer: Mozilla 4.73 [en] (Win98; U) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-Accept-Language: en References: X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hi! I think you may try opening the input stream of the request object, dump out everything till the end, and then give out response. Arion Steve Fyfe wrote: > I have discovered that when I attempt to upload a file larger than 40KB, Tomcat will just reset the network connection. As a result, IE shows an error screen with the message "Server or DNS not available", and Netscape gives an error message box saying "A network error has occurred while sending data (Connection reset by peer)." > > Whenever I send a file that is smaller than 40KB, the response produced by the test servlet is correctly shown in the browser's window. But if I upload a file larger than 40KB using the exact same configuration and servlet, the code in the servlet is executed but the web page produced by the servlet never appears - the browser's error message appears instead. > > This problem occurs both when I run Tomcat locally (Win 98) and when I run it on NT 4 with IIS serving the static pages. I get the same problem using Tomcat 3.1 or 3.2b2 when running locally. I have only tried 3.1 with IIS. I don't believe the problem is in IIS, since this application works using a different servlet container on the same machine. > > I have put together a small test case that demonstrates the problem. As you can see from the code below, the servlet is only a few lines long, and it does not even look at the uploaded data. The only thing that is different with each test case is the size of the uploaded file - larger than 40KB fails, but less than 40KB succeeds. > > Here is my test servlet - this is the entire code for the whole thing: > > // start servlet > import java.io.*; > import javax.servlet.*; > import javax.servlet.http.*; > > public class TestUploadServlet extends HttpServlet { > > protected void doPost(HttpServletRequest req, > HttpServletResponse res) > throws ServletException, IOException { > > ////res.sendRedirect("Error.htm"); > > PrintWriter out = res.getWriter(); > out.println("It worked!"); > > out.flush(); > res.flushBuffer(); > } > } > // end servlet code > > If I substitute the "sendRedirect" line for all the lines below that, the same problem occurs. > > This is the web page that does the upload: > > > Test Upload Form > > > Test Upload Form
> >
action="../Servlets/testupload"> > > > > >
> > > > Tomcat is still very new to me, so if there is any configuration setting I can change that will resolve this problem, please let me know. I sure hope this can be fixed before 3.2 is final. In its current state I cannot use Tomcat since this web app must be able to accept uploaded files larger than 100 MB (large page full color images or postscript). > > If I can supply anything else that will help to nail this one, please let me know. > > Steve Fyfe > CNI Corporation > Milford New Hampshire > > SFyfe@cnicorp.com > (603) 673-6600 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org -- [This email and any files transmitted with it are confidential and may contain information that is legally privileged. They are intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not the intended recipient, please delete it and notify the sender by email immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person. Thank you.]