Handle flushingFailed() for Servlet containers
Closes gh-26434
This commit is contained in:
parent
d7e05aa48f
commit
5e5d8e4a23
|
|
@ -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.
|
||||
|
|
@ -186,12 +186,13 @@ public abstract class AbstractListenerWriteFlushProcessor<T> implements Processo
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -283,12 +283,6 @@ class UndertowServerHttpResponse extends AbstractListenerServerHttpResponse impl
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void flushingFailed(Throwable t) {
|
||||
cancel();
|
||||
onError(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isWritePossible() {
|
||||
StreamSinkChannel channel = UndertowServerHttpResponse.this.responseChannel;
|
||||
|
|
|
|||
Loading…
Reference in New Issue