Skip to content

Commit

Permalink
Merge pull request #548 from SDCISA-13736-ApplyFindings-2024011001-1312
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenalpha authored Jan 10, 2024
2 parents acafdf6 + f4d685d commit 6978e34
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Promise;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.streams.WriteStream;

Expand Down Expand Up @@ -36,15 +37,17 @@ public WriteStream<Buffer> exceptionHandler(Handler<Throwable> handler) {

@Override
public Future<Void> write(Buffer data) {
Promise<Void> p = Promise.promise();
write(data, event -> {

if( event.failed() ) p.fail(event.cause());
else p.complete();
});
return Future.succeededFuture();
return p.future();
}

@Override
public void write(Buffer data, Handler<AsyncResult<Void>> handler) {
wrappedWriteStream.write(data);
wrappedWriteStream.write(data, handler);
if (isRequest) {
loggingHandler.appendRequestPayload(data);
} else {
Expand Down

0 comments on commit 6978e34

Please sign in to comment.