Skip to content

Commit

Permalink
Merge pull request #33680 from cescoffier/fix-cancellation-on-json-st…
Browse files Browse the repository at this point in the history
…ream
  • Loading branch information
cescoffier authored May 30, 2023
2 parents 89db120 + 42edefe commit 7987b28
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ public void handle(Buffer buffer) {
});

// this captures the end of the response
// FIXME: won't this call complete twice()?
vertxClientResponse.endHandler(v -> {
multiRequest.emitter.complete();
});
Expand All @@ -265,17 +264,17 @@ public void handle(Buffer chunk) {
try {
R item = restClientRequestContext.readEntity(in, responseType, response.getMediaType(),
response.getMetadata());
multiRequest.emitter.emit(item);
multiRequest.emit(item);
} catch (IOException e) {
multiRequest.emitter.fail(e);
multiRequest.fail(e);
}
}
});
vertxClientResponse.exceptionHandler(t -> {
if (t == ConnectionBase.CLOSED_EXCEPTION) {
// we can ignore this one since we registered a closeHandler
} else {
multiRequest.emitter.fail(t);
multiRequest.fail(t);
}
});
vertxClientResponse.endHandler(new Handler<Void>() {
Expand Down

0 comments on commit 7987b28

Please sign in to comment.