Request decoding

2011-02-16 Thread CodingForever
Hi, there I handled http responses using; SessionInputBuffer inbuffer = new SessionInputBufferMockup(s, US-ASCII); HttpResponseParser parser = new HttpResponseParser( inbuffer, BasicLineParser.DEFAULT, new

Re: Request decoding

2011-02-16 Thread sebb
On 16 February 2011 09:44, CodingForever nighttmm...@gmail.com wrote: Hi, there I handled http responses using; SessionInputBuffer inbuffer = new SessionInputBufferMockup(s, US-ASCII); HttpResponseParser parser = new

Re: java.io.IOException: Request already aborted - Why ThreadSafeClientConnManager does not renew connection?

2011-02-16 Thread Maxim Veksler
On Tue, Feb 15, 2011 at 3:06 PM, Oleg Kalnichevski ol...@apache.org wrote: Well, I finally spotted an obvious problem with your code, which I should have found earlier: HttpRequest objects are NOT thread-safe. They may not be used by multiple threads. Oleg Hi Oleg, By HttpRequest you mean

Re: java.io.IOException: Request already aborted - Why ThreadSafeClientConnManager does not renew connection?

2011-02-16 Thread sebb
On 16 February 2011 10:41, Maxim Veksler ma...@vekslers.org wrote: On Tue, Feb 15, 2011 at 3:06 PM, Oleg Kalnichevski ol...@apache.org wrote: Well, I finally spotted an obvious problem with your code, which I should have found earlier: HttpRequest objects are NOT thread-safe. They may not be

Non-blocking file upload

2011-02-16 Thread Frazer Irving
Hi, I have a requirement to upload a file, and to have the transfer of data be interrupted in the event of the server responding with an error. My code looks like: MimetypesFileTypeMap mime = new MimetypesFileTypeMap(); request = new PostMethod(url);

Re: Non-blocking file upload

2011-02-16 Thread Oleg Kalnichevski
On Wed, 2011-02-16 at 11:05 +, Frazer Irving wrote: Hi, ... It seems that the call to executeMethod is blocking until the entire body of the RequestEntity has been written to the server before processing the response. Yes, this is indeed the case due to the limitations of the

Re: java.io.IOException: Request already aborted - Why ThreadSafeClientConnManager does not renew connection?

2011-02-16 Thread Maxim Veksler
On Wed, Feb 16, 2011 at 12:48 PM, sebb seb...@gmail.com wrote: On 16 February 2011 10:41, Maxim Veksler ma...@vekslers.org wrote: On Tue, Feb 15, 2011 at 3:06 PM, Oleg Kalnichevski ol...@apache.org wrote: Well, I finally spotted an obvious problem with your code, which I should have found

Re: java.io.IOException: Request already aborted - Why ThreadSafeClientConnManager does not renew connection?

2011-02-16 Thread Oleg Kalnichevski
On Wed, 2011-02-16 at 14:47 +0200, Maxim Veksler wrote: ... I've implemented the suggested changes. Please find them at the revision https://gist.github.com/829061/8a173df84ce47b288f6b34f675fc708fcf649535 This has improved the execution, now calling httpGet.abort(); does not affect the

Re: java.io.IOException: Request already aborted - Why ThreadSafeClientConnManager does not renew connection?

2011-02-16 Thread Maxim Veksler
On Wed, Feb 16, 2011 at 3:14 PM, Oleg Kalnichevski ol...@apache.org wrote: Once aborted a request cannot be executed again. Create a new HttpGet instance for each request execution. They are cheap. The problem is that HttpClient does not check whether or not a request has been aborted prior

Re: java.io.IOException: Request already aborted - Why ThreadSafeClientConnManager does not renew connection?

2011-02-16 Thread Oleg Kalnichevski
On Wed, 2011-02-16 at 16:31 +0200, Maxim Veksler wrote: On Wed, Feb 16, 2011 at 3:14 PM, Oleg Kalnichevski ol...@apache.org wrote: Once aborted a request cannot be executed again. Create a new HttpGet instance for each request execution. They are cheap. The problem is that HttpClient