|
58 | 58 | import com.ning.http.util.UTF8UrlEncoder;
|
59 | 59 | import com.ning.org.jboss.netty.handler.codec.http.CookieDecoder;
|
60 | 60 | import com.ning.org.jboss.netty.handler.codec.http.CookieEncoder;
|
| 61 | + |
61 | 62 | import org.jboss.netty.bootstrap.ClientBootstrap;
|
62 | 63 | import org.jboss.netty.buffer.ChannelBuffer;
|
63 | 64 | import org.jboss.netty.buffer.ChannelBufferOutputStream;
|
|
106 | 107 | import org.slf4j.LoggerFactory;
|
107 | 108 |
|
108 | 109 | import javax.net.ssl.SSLEngine;
|
| 110 | + |
109 | 111 | import java.io.File;
|
110 | 112 | import java.io.FileInputStream;
|
111 | 113 | import java.io.IOException;
|
|
153 | 155 | import static org.jboss.netty.channel.Channels.pipeline;
|
154 | 156 |
|
155 | 157 | public class NettyAsyncHttpProvider extends SimpleChannelUpstreamHandler implements AsyncHttpProvider {
|
| 158 | + public static final IOException REMOTELY_CLOSED_EXCEPTION = new IOException("Remotely Closed"); |
| 159 | + static { |
| 160 | + REMOTELY_CLOSED_EXCEPTION.setStackTrace(new StackTraceElement[0]); |
| 161 | + } |
156 | 162 | private final static String HTTP_HANDLER = "httpHandler";
|
157 | 163 | protected final static String SSL_HANDLER = "sslHandler";
|
158 | 164 | private final static String HTTPS = "https";
|
@@ -1379,7 +1385,7 @@ public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws
|
1379 | 1385 |
|
1380 | 1386 | if (future != null && !future.isDone() && !future.isCancelled()) {
|
1381 | 1387 | if (remotelyClosed(ctx.getChannel(), future)) {
|
1382 |
| - abort(future, new IOException("Remotely Closed")); |
| 1388 | + abort(future, REMOTELY_CLOSED_EXCEPTION); |
1383 | 1389 | }
|
1384 | 1390 | } else {
|
1385 | 1391 | closeChannel(ctx);
|
|
0 commit comments