Skip to content

Commit

Permalink
throwaway ContentSender if reset fails
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <[email protected]>
  • Loading branch information
lorban committed Aug 27, 2024
1 parent 457bd7a commit b0ccac3
Showing 1 changed file with 3 additions and 2 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 final ContentSender contentSender = new ContentSender();
private 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,7 +310,8 @@ private void terminateRequest(HttpExchange exchange, Throwable failure, Result r

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

protected void dispose()
Expand Down

0 comments on commit b0ccac3

Please sign in to comment.