Skip to content

Commit

Permalink
Just directly close the channel if read returns -1
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Jan 19, 2015
1 parent 6edbc72 commit ac99afc
Showing 1 changed file with 0 additions and 14 deletions.
Expand Up @@ -220,20 +220,6 @@ private void handleFailedRead(ConduitStreamSourceChannel channel, int res) {
channel.setReadListener(this);
channel.resumeReads();
} else if (res == -1) {
handleConnectionClose(channel);
}
}

private void handleConnectionClose(StreamSourceChannel channel) {
try {
channel.suspendReads();
channel.shutdownReads();
final StreamSinkChannel responseChannel = this.connection.getChannel().getSinkChannel();
responseChannel.shutdownWrites();
IoUtils.safeClose(connection);
} catch (IOException e) {
UndertowLogger.REQUEST_IO_LOGGER.debug("Error reading request", e);
// fuck it, it's all ruined
IoUtils.safeClose(connection);
}
}
Expand Down

0 comments on commit ac99afc

Please sign in to comment.