public void operationComplete(ChannelFuture cf) { closeSilently(raf); super.operationComplete(cf); } });
public void operationComplete(ChannelFuture cf) { if (!abortOnThrowable(cf.getCause(), cf.getChannel())) { future.touch(); /** * We need to make sure we aren't in the middle of an authorization process before publishing events as we will re-publish again the same event after the authorization, * causing unpredictable behavior. */ Realm realm = future.getRequest().getRealm() != null ? future.getRequest().getRealm() : config.getRealm(); boolean startPublishing = future.isInAuth() || realm == null || realm.getUsePreemptiveAuth(); if (startPublishing && asyncHandler instanceof ProgressAsyncHandler) { if (notifyHeaders) { ProgressAsyncHandler.class.cast(asyncHandler).onHeadersWritten(); } else { ProgressAsyncHandler.class.cast(asyncHandler).onContentWritten(); } } } }
public <T> void writeRequest(NettyResponseFuture<T> future, Channel channel) { NettyRequest nettyRequest = future.getNettyRequest(); HttpRequest httpRequest = nettyRequest.getHttpRequest(); AsyncHandler<T> handler = future.getAsyncHandler(); // if the channel is dead because it was pooled and the remote // server decided to close it, // we just let it go and the channelInactive do its work if (!Channels.isChannelValid(channel)) return; try { if (handler instanceof TransferCompletionHandler) configureTransferAdapter(handler, httpRequest); if (!future.isHeadersAlreadyWrittenOnContinue()) { if (future.getAsyncHandler() instanceof AsyncHandlerExtensions) AsyncHandlerExtensions.class.cast(future.getAsyncHandler()).onRequestSend(nettyRequest); channel.writeAndFlush(httpRequest, channel.newProgressivePromise()).addListener(new ProgressListener(config, future.getAsyncHandler(), future, true, 0L)); } if (!future.isDontWriteBodyBecauseExpectContinue() && httpRequest.getMethod() != HttpMethod.CONNECT && nettyRequest.getBody() != null) nettyRequest.getBody().write(channel, future); // don't bother scheduling timeouts if channel became invalid if (Channels.isChannelValid(channel)) scheduleTimeouts(future); } catch (Exception e) { LOGGER.error("Can't write request", e); abort(channel, future, e); } }
public void operationComplete(ChannelFuture cf) { if (!abortOnThrowable(cf.getCause(), cf.getChannel())) { future.touch(); /** * We need to make sure we aren't in the middle of an authorization process before publishing events as we will re-publish again the same event after the authorization, * causing unpredictable behavior. */ Realm realm = future.getRequest().getRealm() != null ? future.getRequest().getRealm() : config.getRealm(); boolean startPublishing = future.isInAuth() || realm == null || realm.getUsePreemptiveAuth(); if (startPublishing && asyncHandler instanceof ProgressAsyncHandler) { if (notifyHeaders) { ProgressAsyncHandler.class.cast(asyncHandler).onHeaderWriteCompleted(); } else { ProgressAsyncHandler.class.cast(asyncHandler).onContentWriteCompleted(); } } } }
public <T> void writeRequest(NettyResponseFuture<T> future, Channel channel) { NettyRequest nettyRequest = future.getNettyRequest(); HttpRequest httpRequest = nettyRequest.getHttpRequest(); AsyncHandler<T> handler = future.getAsyncHandler(); // if the channel is dead because it was pooled and the remote // server decided to close it, // we just let it go and the channelInactive do its work if (!Channels.isChannelValid(channel)) return; try { if (handler instanceof TransferCompletionHandler) configureTransferAdapter(handler, httpRequest); if (!future.isHeadersAlreadyWrittenOnContinue()) { if (future.getAsyncHandler() instanceof AsyncHandlerExtensions) AsyncHandlerExtensions.class.cast(future.getAsyncHandler()).onSendRequest(nettyRequest); channel.writeAndFlush(httpRequest, channel.newProgressivePromise()).addListener(new ProgressListener(config, future.getAsyncHandler(), future, true, 0L)); } if (!future.isDontWriteBodyBecauseExpectContinue() && httpRequest.getMethod() != HttpMethod.CONNECT && nettyRequest.getBody() != null) nettyRequest.getBody().write(channel, future); // don't bother scheduling timeouts if channel became invalid if (Channels.isChannelValid(channel)) scheduleTimeouts(future); } catch (Throwable t) { LOGGER.error("Can't write request", t); Channels.silentlyCloseChannel(channel); } }
public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(raf); super.operationComplete(cf); } });
@Override public void operationComplete(ChannelProgressiveFuture cf) { // The write operation failed. If the channel was cached, it means it got asynchronously closed. // Let's retry a second time. if (!abortOnThrowable(cf.cause(), cf.channel())) { future.touch(); /** * We need to make sure we aren't in the middle of an authorization * process before publishing events as we will re-publish again the * same event after the authorization, causing unpredictable * behavior. */ Realm realm = future.getRequest().getRealm() != null ? future.getRequest().getRealm() : config.getRealm(); boolean startPublishing = future.isInAuth() || realm == null || realm.getUsePreemptiveAuth(); if (startPublishing && asyncHandler instanceof ProgressAsyncHandler) { ProgressAsyncHandler<?> progressAsyncHandler = (ProgressAsyncHandler<?>) asyncHandler; if (notifyHeaders) { progressAsyncHandler.onHeaderWriteCompleted(); } else { progressAsyncHandler.onContentWriteCompleted(); } } } }
public <T> void writeRequest(NettyResponseFuture<T> future, Channel channel) { NettyRequest nettyRequest = future.getNettyRequest(); HttpRequest httpRequest = nettyRequest.getHttpRequest(); AsyncHandler<T> handler = future.getAsyncHandler(); // if the channel is dead because it was pooled and the remote // server decided to close it, // we just let it go and the channelInactive do its work if (!Channels.isChannelValid(channel)) return; try { if (handler instanceof TransferCompletionHandler) configureTransferAdapter(handler, httpRequest); if (!future.isHeadersAlreadyWrittenOnContinue()) { if (future.getAsyncHandler() instanceof AsyncHandlerExtensions) AsyncHandlerExtensions.class.cast(future.getAsyncHandler()).onSendRequest(nettyRequest); channel.write(httpRequest).addListener(new ProgressListener(config, future.getAsyncHandler(), future, true)); } if (!future.isDontWriteBodyBecauseExpectContinue() && httpRequest.getMethod() != HttpMethod.CONNECT && nettyRequest.getBody() != null) nettyRequest.getBody().write(channel, future); // don't bother scheduling timeouts if channel became invalid if (Channels.isChannelValid(channel)) scheduleTimeouts(future); } catch (Throwable t) { LOGGER.error("Can't write request", t); Channels.silentlyCloseChannel(channel); } }
public void operationComplete(ChannelFuture cf) { closeSilently(body); super.operationComplete(cf); } });
@Override public void operationComplete(ChannelProgressiveFuture cf) { // The write operation failed. If the channel was cached, it means it got asynchronously closed. // Let's retry a second time. if (!abortOnThrowable(cf.cause(), cf.channel())) { future.touch(); /** * We need to make sure we aren't in the middle of an authorization * process before publishing events as we will re-publish again the * same event after the authorization, causing unpredictable * behavior. */ Realm realm = future.getRequest().getRealm() != null ? future.getRequest().getRealm() : config.getRealm(); boolean startPublishing = future.isInAuth() || realm == null || realm.getUsePreemptiveAuth(); if (startPublishing && asyncHandler instanceof ProgressAsyncHandler) { ProgressAsyncHandler<?> progressAsyncHandler = (ProgressAsyncHandler<?>) asyncHandler; if (notifyHeaders) { progressAsyncHandler.onHeadersWritten(); } else { progressAsyncHandler.onContentWritten(); } } } }
public <T> void writeRequest(NettyResponseFuture<T> future, Channel channel) { NettyRequest nettyRequest = future.getNettyRequest(); HttpRequest httpRequest = nettyRequest.getHttpRequest(); AsyncHandler<T> handler = future.getAsyncHandler(); // if the channel is dead because it was pooled and the remote // server decided to close it, // we just let it go and the channelInactive do its work if (!Channels.isChannelValid(channel)) return; try { if (handler instanceof TransferCompletionHandler) configureTransferAdapter(handler, httpRequest); if (!future.isHeadersAlreadyWrittenOnContinue()) { if (future.getAsyncHandler() instanceof AsyncHandlerExtensions) AsyncHandlerExtensions.class.cast(future.getAsyncHandler()).onRequestSend(nettyRequest); channel.write(httpRequest).addListener(new ProgressListener(config, future.getAsyncHandler(), future, true)); } if (!future.isDontWriteBodyBecauseExpectContinue() && httpRequest.getMethod() != HttpMethod.CONNECT && nettyRequest.getBody() != null) nettyRequest.getBody().write(channel, future); // don't bother scheduling timeouts if channel became invalid if (Channels.isChannelValid(channel)) scheduleTimeouts(future); } catch (Exception e) { LOGGER.error("Can't write request", e); abort(channel, future, e); } }
public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(raf); super.operationComplete(cf); } });
public void operationComplete(ChannelFuture cf) { closeSilently(body); super.operationComplete(cf); } });
public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(body); super.operationComplete(cf); } });
public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(is); super.operationComplete(cf); } });
public void operationComplete(ChannelFuture cf) { closeSilently(raf); super.operationComplete(cf); } });
public void operationComplete(ChannelFuture cf) { closeSilently(body); super.operationComplete(cf); } });
public void operationComplete(ChannelFuture cf) { closeSilently(body); super.operationComplete(cf); } });
public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(body); super.operationComplete(cf); } });
public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(is); super.operationComplete(cf); } });