Re: how to close request input stream
Hello, Thanks for your help. I've tried it but the response (Internal Server Error) is displayed after the whole file is send... trying to flush doesn't help either: response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); response.flushBuffer(); response.getWriter().close(); Greetings and Thanks Peter From: Tim Funk <[EMAIL PROTECTED]> Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]> To: Tomcat Users List <[EMAIL PROTECTED]> Subject: Re: how to close request input stream Date: Tue, 23 Sep 2003 11:02:26 -0400 Try this and see what happens: protected void doPost(HttpServletRequest req, HttpServletResponse resp) { if(req.getContentLength()>TOO_MUCH) resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); ... } I am unsure of how much date is read before the servlet is called. (Which is probably the crux of the problem) -Tim Peter H. wrote: I tried a file upload field up to 100MB I tried textfield/textareas up to 600kb ( i must use a slow connection ) it looks like the complete request is send? dont know if tomcat or apache receives those bytes - or in other words - my program leaves its service method... to Tim Funk: What status can I set and respond with my previous form? I guess I've tried that but also I see incoming bytes in my network interface... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Sehen, wer online ist: Mit dem MSN Messenger! http://messenger.msn.de Jetzt kostenlos downloaden und mitmachen! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to close request input stream
Try this and see what happens: protected void doPost(HttpServletRequest req, HttpServletResponse resp) { if(req.getContentLength()>TOO_MUCH) resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); ... } I am unsure of how much date is read before the servlet is called. (Which is probably the crux of the problem) -Tim Peter H. wrote: I tried a file upload field up to 100MB I tried textfield/textareas up to 600kb ( i must use a slow connection ) it looks like the complete request is send? dont know if tomcat or apache receives those bytes - or in other words - my program leaves its service method... to Tim Funk: What status can I set and respond with my previous form? I guess I've tried that but also I see incoming bytes in my network interface... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to close request input stream
I tried a file upload field up to 100MB I tried textfield/textareas up to 600kb ( i must use a slow connection ) it looks like the complete request is send? dont know if tomcat or apache receives those bytes - or in other words - my program leaves its service method... to Tim Funk: What status can I set and respond with my previous form? I guess I've tried that but also I see incoming bytes in my network interface... Greetings and Thanks Peter From: "Christopher St. John" <[EMAIL PROTECTED]> Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]> To: Tomcat Users List <[EMAIL PROTECTED]> Subject: Re: how to close request input stream Date: Tue, 23 Sep 2003 09:34:58 -0500 Peter H. wrote: Calling request.getInputStream().close does not work... ...the browser still sends bytes how many? it won't be an instant stop because there can be many bytes "in flight" between the browser and your server (operating systems buffers, proxy servers, etc). if "still sends bytes" means 100's of kilobytes, then something else is going on, and you'd need to look at each "hop" your bytes are taking on the way to the server to see where they're ending up... -cks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Schluß mit Spam! http://www.msn.de/antispam Wir helfen Ihnen, unerwünschte E-Mails zu reduzieren. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to close request input stream
Peter H. wrote: Calling request.getInputStream().close does not work... ...the browser still sends bytes how many? it won't be an instant stop because there can be many bytes "in flight" between the browser and your server (operating systems buffers, proxy servers, etc). if "still sends bytes" means 100's of kilobytes, then something else is going on, and you'd need to look at each "hop" your bytes are taking on the way to the server to see where they're ending up... -cks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to close request input stream
The browser will send all the bytes it can (or is supposed to). Then it waits for a response. The only thing you can to is abort the request. (Send error status and return) -Tim Peter H. wrote: Hello, Calling request.getInputStream().close does not work... ...the browser still sends bytes any ideas? Greetings & Thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]