Skip to content

Commit

Permalink
Fix for looping requests when response wrapped in completable future.
Browse files Browse the repository at this point in the history
  • Loading branch information
noboomu committed Sep 14, 2020
1 parent 5497942 commit f91ff64
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Proteus Changelog.
## Unreleased
### No issue

**Cleanup shutdown and expose worker in request.**


[54979422dab4bff](https://github.com/noboomu/proteus/commit/54979422dab4bff) Joshua Bauer *2020-09-02 18:34:03*

**Set config log level to trace.**


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,6 @@ public void send(final HttpHandler handler, final HttpServerExchange exchange) t
return;
}



exchange.setStatusCode(this.status);


Expand Down Expand Up @@ -641,6 +639,9 @@ public void send(final HttpHandler handler, final HttpServerExchange exchange) t
exchange.getResponseSender().send(this.body, this.ioCallback);
}
} else if (hasEntity) {



try {
if (this.processXml) {
exchange.getResponseSender().send(ByteBuffer.wrap(XML_MAPPER.writeValueAsBytes(this.entity)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ protected void addClassMethodHandlers(TypeSpec.Builder typeBuilder, Class<?> cla
methodBuilder.beginControlFlow("", "");

methodBuilder.addCode(
"$L.thenAccept( r -> r.send(this,$L) )\n\t.exceptionally( ex -> ",
"$L.thenAccept( r -> r.send(null,$L) )\n\t.exceptionally( ex -> ",
"response", "exchange");
methodBuilder.beginControlFlow("", "");
methodBuilder.addCode("\t\tthrow new java.util.concurrent.CompletionException(ex);\n\t");
Expand Down

0 comments on commit f91ff64

Please sign in to comment.