"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/main/java/org/apache/http/impl/execchain/MinimalClientExec.java" between
httpcomponents-client-4.5.6-src.tar.gz and httpcomponents-client-4.5.7-src.tar.gz

About: HttpComponents is an Apache project responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols. Java sources.

MinimalClientExec.java  (httpcomponents-client-4.5.6-src):MinimalClientExec.java  (httpcomponents-client-4.5.7-src)
skipping to change at line 149 skipping to change at line 149
Args.notNull(request, "HTTP request"); Args.notNull(request, "HTTP request");
Args.notNull(context, "HTTP context"); Args.notNull(context, "HTTP context");
rewriteRequestURI(request, route); rewriteRequestURI(request, route);
final ConnectionRequest connRequest = connManager.requestConnection(rout e, null); final ConnectionRequest connRequest = connManager.requestConnection(rout e, null);
if (execAware != null) { if (execAware != null) {
if (execAware.isAborted()) { if (execAware.isAborted()) {
connRequest.cancel(); connRequest.cancel();
throw new RequestAbortedException("Request aborted"); throw new RequestAbortedException("Request aborted");
} else {
execAware.setCancellable(connRequest);
} }
execAware.setCancellable(connRequest);
} }
final RequestConfig config = context.getRequestConfig(); final RequestConfig config = context.getRequestConfig();
final HttpClientConnection managedConn; final HttpClientConnection managedConn;
try { try {
final int timeout = config.getConnectionRequestTimeout(); final int timeout = config.getConnectionRequestTimeout();
managedConn = connRequest.get(timeout > 0 ? timeout : 0, TimeUnit.MI LLISECONDS); managedConn = connRequest.get(timeout > 0 ? timeout : 0, TimeUnit.MI LLISECONDS);
} catch(final InterruptedException interrupted) { } catch(final InterruptedException interrupted) {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
skipping to change at line 177 skipping to change at line 176
} }
throw new RequestAbortedException("Request execution failed", cause) ; throw new RequestAbortedException("Request execution failed", cause) ;
} }
final ConnectionHolder releaseTrigger = new ConnectionHolder(log, connMa nager, managedConn); final ConnectionHolder releaseTrigger = new ConnectionHolder(log, connMa nager, managedConn);
try { try {
if (execAware != null) { if (execAware != null) {
if (execAware.isAborted()) { if (execAware.isAborted()) {
releaseTrigger.close(); releaseTrigger.close();
throw new RequestAbortedException("Request aborted"); throw new RequestAbortedException("Request aborted");
} else {
execAware.setCancellable(releaseTrigger);
} }
execAware.setCancellable(releaseTrigger);
} }
if (!managedConn.isOpen()) { if (!managedConn.isOpen()) {
final int timeout = config.getConnectTimeout(); final int timeout = config.getConnectTimeout();
this.connManager.connect( this.connManager.connect(
managedConn, managedConn,
route, route,
timeout > 0 ? timeout : 0, timeout > 0 ? timeout : 0,
context); context);
this.connManager.routeComplete(managedConn, route, context); this.connManager.routeComplete(managedConn, route, context);
skipping to change at line 233 skipping to change at line 231
} else { } else {
releaseTrigger.markNonReusable(); releaseTrigger.markNonReusable();
} }
// check for entity, release connection if possible // check for entity, release connection if possible
final HttpEntity entity = response.getEntity(); final HttpEntity entity = response.getEntity();
if (entity == null || !entity.isStreaming()) { if (entity == null || !entity.isStreaming()) {
// connection not needed and (assumed to be) in re-usable state // connection not needed and (assumed to be) in re-usable state
releaseTrigger.releaseConnection(); releaseTrigger.releaseConnection();
return new HttpResponseProxy(response, null); return new HttpResponseProxy(response, null);
} else {
return new HttpResponseProxy(response, releaseTrigger);
} }
return new HttpResponseProxy(response, releaseTrigger);
} catch (final ConnectionShutdownException ex) { } catch (final ConnectionShutdownException ex) {
final InterruptedIOException ioex = new InterruptedIOException( final InterruptedIOException ioex = new InterruptedIOException(
"Connection has been shut down"); "Connection has been shut down");
ioex.initCause(ex); ioex.initCause(ex);
throw ioex; throw ioex;
} catch (final HttpException ex) { } catch (final HttpException ex) {
releaseTrigger.abortConnection(); releaseTrigger.abortConnection();
throw ex; throw ex;
} catch (final IOException ex) { } catch (final IOException ex) {
releaseTrigger.abortConnection(); releaseTrigger.abortConnection();
 End of changes. 6 change blocks. 
6 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)