Let's do that *after* we've checked sochan for nullity.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5871 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1136,12 +1136,12 @@ public class ConnectionManager extends LoopingThread
|
|||||||
if (_partial != null) {
|
if (_partial != null) {
|
||||||
// if our outgoing channel is gone or closed, then bail immediately
|
// if our outgoing channel is gone or closed, then bail immediately
|
||||||
SocketChannel sochan = conn.getChannel();
|
SocketChannel sochan = conn.getChannel();
|
||||||
if (sochan.isConnectionPending()) {
|
|
||||||
return false; // not ready to write to this connection yet
|
|
||||||
}
|
|
||||||
if (sochan == null || (!sochan.isConnected() && !sochan.isConnectionPending())) {
|
if (sochan == null || (!sochan.isConnected() && !sochan.isConnectionPending())) {
|
||||||
throw new IOException("Connection unavailable for overflow write " + sochan);
|
throw new IOException("Connection unavailable for overflow write " + sochan);
|
||||||
}
|
}
|
||||||
|
if (sochan.isConnectionPending()) {
|
||||||
|
return false; // not ready to write to this connection yet
|
||||||
|
}
|
||||||
|
|
||||||
// write all we can of our partial buffer
|
// write all we can of our partial buffer
|
||||||
int wrote = sochan.write(_partial);
|
int wrote = sochan.write(_partial);
|
||||||
|
|||||||
Reference in New Issue
Block a user