Skip to content

Commit b0503d2

Browse files
geoandjponge
andcommitted
Don't read the stream when closing InputStream on REST Client
Fixes: quarkusio#50889 Co-authored-by: Julien Ponge <[email protected]>
1 parent 5577aef commit b0503d2

File tree

1 file changed

+6
-9
lines changed
  • independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers

1 file changed

+6
-9
lines changed

independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/VertxClientInputStream.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,9 @@ public void close() throws IOException {
9393
}
9494
closed = true;
9595
try {
96-
while (!finished) {
97-
readIntoBuffer();
98-
if (pooled != null) {
99-
pooled.release();
100-
pooled = null;
101-
}
96+
if (!finished) {
97+
exchange.discard();
10298
}
103-
} catch (IOException | RuntimeException e) {
104-
//our exchange is all broken, just end it
105-
throw e;
10699
} finally {
107100
if (pooled != null) {
108101
pooled.release();
@@ -246,6 +239,10 @@ public int readBytesAvailable() {
246239
return Integer.MAX_VALUE;
247240
}
248241
}
242+
243+
public void discard() {
244+
request.pause().handler(null).exceptionHandler(null).endHandler(null).resume();
245+
}
249246
}
250247

251248
}

0 commit comments

Comments
 (0)