Indentation

This commit is contained in:
Trustin Lee 2009-06-30 11:36:01 +00:00
parent 6805ea719b
commit 81cb42f37e

View File

@ -119,18 +119,22 @@ class HttpTunnelingClientSocketChannel extends AbstractChannel
}
public InetSocketAddress getLocalAddress() {
// FIXME: NPE - Cache to avoid
return channel.getLocalAddress();
}
public InetSocketAddress getRemoteAddress() {
// FIXME: NPE - Cache to avoid
return channel.getRemoteAddress();
}
public boolean isBound() {
// FIXME: Should not return false during reconnection.
return channel.isBound();
}
public boolean isConnected() {
// FIXME: Should not return false during reconnection.
return channel.isConnected();
}
@ -188,8 +192,8 @@ class HttpTunnelingClientSocketChannel extends AbstractChannel
future.addListener(ChannelFutureListener.CLOSE_ON_FAILURE);
SocketAddress connectAddress = new InetSocketAddress(url.getHost(), url.getPort());
channel.connect(connectAddress).addListener(
new ChannelFutureListener() {
// FIXME: bindAddress not respected.
channel.connect(connectAddress).addListener(new ChannelFutureListener() {
public void operationComplete(ChannelFuture f) {
if (f.isSuccess()) {
// Configure SSL
@ -256,7 +260,7 @@ class HttpTunnelingClientSocketChannel extends AbstractChannel
channel.write(req);
future.setSuccess();
if (!isBound()) {
// FIXME: channelBound is not fired.
// FIXME: channelBound is not fired - needs own state flag
fireChannelBound(HttpTunnelingClientSocketChannel.this, channel.getLocalAddress());
}
fireChannelConnected(HttpTunnelingClientSocketChannel.this, channel.getRemoteAddress());
@ -285,6 +289,7 @@ class HttpTunnelingClientSocketChannel extends AbstractChannel
}
void sendChunk(ChannelBuffer a, final ChannelFuture future) {
// XXX: Investigate race condition during reconnection
final int size = a.readableBytes();
channel.write(new DefaultHttpChunk(a)).addListener(new ChannelFutureListener() {
public void operationComplete(ChannelFuture f)
@ -303,6 +308,7 @@ class HttpTunnelingClientSocketChannel extends AbstractChannel
void closeSocket() {
if (setClosed()) {
// Send the end of chunk.
// XXX: Investigate race condition during reconnection
synchronized (writeLock) {
channel.write(HttpChunk.LAST_CHUNK).addListener(ChannelFutureListener.CLOSE);
}