On Fri, 2009-03-06 at 16:33 +0530, Santosh Gangadhar wrote: > Hi All, > After doing a few tests, the problem seems not be in http client. After the > service (doGet or doPost) method returns, at the back Tomcat does some > cleanup. As a part of this cleanup, it tries to read out all data coming in. > It does not *close* the stream after the service method and therefore the > http client keeps sending. >
What Tomcat does makes perfect sense. Tomcat attempts to read to end of the request entity in order to ensure the connection can be re-used for subsequent requests. If the clients keeps on sending data, Tomcat will keep on reading it. > How can this be tackled? Is this a problem with Tomcat? Is this related to > Expect: 100 continue? > > Please help. > Whatever you are trying to do it looks pretty bizarre to me. You should probably seriously reconsider your approach. Oleg > > Thanks, > Santosh. > > On Thu, Mar 5, 2009 at 6:55 PM, Santosh Gangadhar <[email protected]>wrote: > > > Hi All, > > In the following code, pushServlet is a servlet that consumes data sent to > > it with an upper limit specified by the "mb" parameter. > > RandomDataInputStream is an InputStream generates some random data with an > > upper limit. If acceptMB < sendMB, then httpclient stops sending data, > > servlet stop receiving and sends response code 200 to http client. If > > acceptMB > sendMB, then although the servlet stops accepting data and its > > thread exits cleanly, the http client does not stop. It remains stuck at > > executeMethod(). Further, it seems to retry sending data to pushServlet > > again but no data is actually received there. > > > > Http client code: - > > http://rafb.net/p/GVNMxd61.html > > > > Push servelet code: - > > http://rafb.net/p/RrXrOx81.html > > > > RandomDataInputSteram code: - > > http://rafb.net/p/wNA9HN92.html > > > > > > There is no retry handler specified here. Specifying a retry handler that > > disallows a retry does not work either. Is this a bug? If the receving end > > has stopped accepting data and sent the repsonse code, http cleint should > > return from the executeMethod() method. > > > > Thanks, > > Santosh. > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
