Skip to content

Commit

Permalink
revert reset changes
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
  • Loading branch information
lorban committed Aug 27, 2024
1 parent b0ccac3 commit 60ac0ce
Showing 1 changed file with 13 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public abstract class HttpSender
{
private static final Logger LOG = LoggerFactory.getLogger(HttpSender.class);

private ContentSender contentSender = new ContentSender();
private final ContentSender contentSender = new ContentSender();
private final AtomicReference<RequestState> requestState = new AtomicReference<>(RequestState.QUEUED);
private final AtomicReference<Throwable> failure = new AtomicReference<>();
private final HttpChannel channel;
Expand Down Expand Up @@ -310,8 +310,7 @@ private void terminateRequest(HttpExchange exchange, Throwable failure, Result r

protected void reset()
{
if (!contentSender.reset())
contentSender = new ContentSender();
contentSender.reset();
}

protected void dispose()
Expand Down Expand Up @@ -482,21 +481,17 @@ private class ContentSender extends IteratingCallback
@Override
public boolean reset()
{
if (super.reset())
{
exchange = null;
proceedAction = null;
expect100 = false;
chunk = null;
contentBuffer = null;
committed = false;
success = false;
complete = false;
abort = null;
demanded = false;
return true;
}
return false;
exchange = null;
proceedAction = null;
expect100 = false;
chunk = null;
contentBuffer = null;
committed = false;
success = false;
complete = false;
abort = null;
demanded = false;
return super.reset();
}

@Override
Expand Down

0 comments on commit 60ac0ce

Please sign in to comment.