Skip to content

Commit

Permalink
[CONJ-673] Abording a connection while fetching a query won't read th…
Browse files Browse the repository at this point in the history
…e whole result-set

(cherry picked from commit d7f3bda)
  • Loading branch information
rusher committed Feb 5, 2019
1 parent d4a7bd8 commit 6c36108
Show file tree
Hide file tree
Showing 2 changed files with 1,051 additions and 974 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,12 @@ private static void closeSocket(PacketInputStream packetInputStream,
PacketOutputStream packetOutputStream, Socket socket) {
try {
try {
long maxCurrentMillis = System.currentTimeMillis() + 10;
socket.shutdownOutput();
socket.setSoTimeout(3);
InputStream is = socket.getInputStream();
//noinspection StatementWithEmptyBody
while (is.read() != -1) {
while (is.read() != -1 && System.currentTimeMillis() < maxCurrentMillis) {
//read byte
}
} catch (Throwable t) {
Expand Down
Loading

0 comments on commit 6c36108

Please sign in to comment.