Merge branch '5.3.x'

This commit is contained in:
Arjen Poutsma 2022-10-28 11:33:57 +02:00
commit 2ccfc7068e
1 changed files with 13 additions and 0 deletions

View File

@ -209,6 +209,7 @@ final class PartGenerator extends BaseSubscriber<MultipartParser.Token> {
void requestToken() {
if (upstream() != null &&
this.state.get().canRequest() &&
this.requestOutstanding.compareAndSet(false, true)) {
request(1);
}
@ -252,6 +253,13 @@ final class PartGenerator extends BaseSubscriber<MultipartParser.Token> {
default void error(Throwable throwable) {
}
/**
* Indicates whether the current state is ready to accept a new token.
*/
default boolean canRequest() {
return true;
}
/**
* Cleans up any state.
*/
@ -755,6 +763,11 @@ final class PartGenerator extends BaseSubscriber<MultipartParser.Token> {
}
}
@Override
public boolean canRequest() {
return false;
}
@Override
public void dispose() {
this.disposed = true;