On Tue, 2011-05-24 at 10:45 +0200, [email protected] wrote: > Hi all, > > > > I have a scenario where I test error handling when streaming data to a > http server that is not reachable (e.g. the server process is down). > > > > With the following settings > > client.getParams().setParameter(HttpConnectionParams.STALE_CONNECTION_CH > ECK, true); > > > > InputStreamEntity entity = new InputStreamEntity(in, -1); > > entity.setChunked(true); > > putMethod = new HttpPut(effectiveUri); > > putMethod.setEntity(entity); > > putMethod.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINU > E, true); > > putMethod.getParams().setParameter(CoreProtocolPNames.WAIT_FOR_CONTINUE, > 5000); > > > > I get a "org.apache.http.conn.HttpHostConnectException: Connection to > serverXXX refused" before writing anything to the InputStream. This is > just as expected. > > > > > > If I disable the stale connection check I don't get this exception. > Instead it seems that either the HttpClient waits for a 100-continue > response (and does not consider the set timeout of 5000 ms because the > execute request blocks) or because of a bug http client thinks expect > 100-continue was successful and waits for data to be written >
Post a complete wire / context log of the session http://hc.apache.org/httpcomponents-client-ga/logging.html Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
