Skip to content

Commit

Permalink
Handle flushingFailed() for Servlet containers
Browse files Browse the repository at this point in the history
Closes gh-26434
  • Loading branch information
rstoyanchev committed Jan 28, 2021
1 parent d7e05aa commit 5e5d8e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -186,12 +186,13 @@ public final void subscribe(Subscriber<? super Void> subscriber) {
protected abstract boolean isFlushPending();

/**
* Invoked when an error happens while flushing. Sub-classes may choose
* to ignore this if they know the underlying API will provide an error
* notification in a container thread.
* <p>Defaults to no-op.
* Invoked when an error happens while flushing.
* <p>The default implementation cancels the upstream write publisher and
* sends an onError downstream as the result of request handling.
*/
protected void flushingFailed(Throwable t) {
cancel();
onError(t);
}


Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -283,12 +283,6 @@ protected void flush() throws IOException {
}
}

@Override
protected void flushingFailed(Throwable t) {
cancel();
onError(t);
}

@Override
protected boolean isWritePossible() {
StreamSinkChannel channel = UndertowServerHttpResponse.this.responseChannel;
Expand Down

0 comments on commit 5e5d8e4

Please sign in to comment.