On Thu, 2008-06-05 at 08:59 +0200, Martin Zdila wrote: > Thanks for reply, Oleg. > > > This is clearly a bug. I believe it has already been fixed in the SVN > > trunk. Please re-test application with the latest HttpClient snapshot > > and let me know if the problem still persists. > > I've upgraded to trunk/SNAPSHOT version of both httpcore and httpclient. The > problem is still there but behaves differently. > > When I am doing the POST, the httpclient gets sometimes locked. You can see > here the stacktrace of (dead)locked thread. > > SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int) line: > not available [native method] [local variables unavailable]
The thread is blocked in the socket read operation. This is perfectly normal. If you do not want the operation to block indefinitely you should set a timeout for it. > SocketInputStream.read(byte[], int, int) line: 129 > SocketInputBuffer(AbstractSessionInputBuffer).fillBuffer() line: 103 > SocketInputBuffer(AbstractSessionInputBuffer).readLine(CharArrayBuffer) line: > 191 > DefaultResponseParser.parseHead(SessionInputBuffer) line: 82 > DefaultResponseParser(AbstractMessageParser).parse() line: 174 > DefaultClientConnection(AbstractHttpClientConnection).receiveResponseHeader() > line: 179 > DefaultClientConnection.receiveResponseHeader() line: 235 > BasicPooledConnAdapter(AbstractClientConnAdapter).receiveResponseHeader() > line: 253 > HttpRequestExecutor.doReceiveResponse(HttpRequest, HttpClientConnection, > HttpContext) line: 279 > HttpRequestExecutor.execute(HttpRequest, HttpClientConnection, HttpContext) > line: 121 > DefaultClientRequestDirector.execute(HttpHost, HttpRequest, HttpContext) > line: 391 > DefaultHttpClient(AbstractHttpClient).execute(HttpHost, HttpRequest, > HttpContext) line: 538 > DefaultHttpClient(AbstractHttpClient).execute(HttpUriRequest, HttpContext) > line: 473 > DefaultHttpClient(AbstractHttpClient).execute(HttpUriRequest) line: 439 > ... > > I am using httpclient as part of my proxy. I am forwarding post requests like > that: > > // httpclient configuration is shown in my first email > HttpServletRequest request; > final HttpPost postMethod = new HttpPost(url); > postMethod.setEntity(new InputStreamEntity(request.getInputStream(), > request.getContentLength())); > final HttpResponse response = httpClient.execute(postMethod); > > Looks reasonable. > I am using http://www.zdila.sk/post.html for testing (via the proxy using > httpclient). > What is very interesting is that if open the page and click on submit within > few seconds, then it works correctly. > But if I wait for cca half minute, then the browser gets stuck. > Have you tried doing the same test without the proxy? It can well be a proxy side problem. Oleg > I can do more test fo you if you tell me what do you need (set to debug > level?)? > > BR --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
