hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Jack" <aj...@TrySybase.com>
Subject RE: [PATCH] Re: java.net.SocketException
Date Wed, 18 Dec 2002 23:00:01 GMT
Odi

I'm no patch expert (and couldn't get my MKS patch.exe to process your file)
so I manually did this (see below).

The patch works. In fact I'd already changed my code to retry on
java.net.SocketException as I do on an HttpRecoverableException, so there
was really little difference. That said, it seems somewhat disappointing for
the user code to have to participate in this recovery. I know I am broken
recrod that HttpClient is too low level but wouldn't it be saving disk space
accross the world to put a configurable set of retries in for this and save
this code going into all clients? Just my tuppence.

Thanks for your input, and your previous posting repost (interesting).

regards

Adam

P.S. I use a VPN over a modem, nothing fast about my link, so I am not sure
our scenarios can be the same, if yours was affected by a log entry.

-----------------------------------------------------------------

 protected void readResponse(HttpState state, HttpConnection conn)
 throws HttpException {
             try{
     log.trace(
         "enter HttpMethodBase.readResponse(HttpState, HttpConnection)");
     readStatusLine(state, conn);
     processStatusLine(state, conn);
     readResponseHeaders(state, conn);
     processResponseHeaders(state, conn);
     readResponseBody(state, conn);
     processResponseBody(state, conn);
     } catch(IOException e) {
         throw new HttpRecoverableException(e.toString());
     }
 }

-----Original Message-----
From: Ortwin Gluck [mailto:ortwin.glueck@nose.ch]
Sent: Wednesday, December 18, 2002 1:45 PM
To: Commons HttpClient Project
Subject: [PATCH] Re: java.net.SocketException


Maybe we should change readResponse to catch IOException and rethrow it
as a HttpRecoverableException? --> See patch

Please try if this fixes your problem.

Odi

Ps. Would like a test case for this one though.

Adam Jack wrote:
  > java.net.SocketException
> [java.net.SocketException: Connection reset by peer: JVM_recv in socket
> input stream read] (java.net.SocketException)java.net.SocketException:
> Connection reset by peer: JVM_recv in socket input stream read at
> java.net.SocketInputStream.socketRead0(Native Method) at
> java.net.SocketInputStream.read(SocketInputStream.java:116) at
> java.net.SocketInputStream.read(SocketInputStream.java:144) at
>
org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:76
> 4) at
>
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.j
> ava:1843) at
>
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.jav
> a:1608) at
>
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.j
> ava:2266) at
>
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:862
> ) at
>
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:550)
> at org.apache.commons.httpclient.HttpClient.executeMethod


Mime
View raw message