Skip to content

Commit

Permalink
Fixing memory leak on initial request when HttpObjectAggregator is en…
Browse files Browse the repository at this point in the history
…abled
  • Loading branch information
jekh committed Feb 26, 2017
1 parent 43ee962 commit 08a36bc
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,13 @@ void connectionSucceeded(boolean shouldForwardInitialRequest) {
} else {
LOG.debug("Dropping initial request: {}", initialRequest);
}

// we're now done with the initialRequest: it's either been forwarded to the upstream server (HTTP requests), or
// completely dropped (HTTPS CONNECTs). if the initialRequest is reference counted (typically because the HttpObjectAggregator is in
// the pipeline to generate FullHttpRequests), we need to manually release it to avoid a memory leak.
if (initialRequest instanceof ReferenceCounted) {
((ReferenceCounted)initialRequest).release();
}
}

/**
Expand Down

0 comments on commit 08a36bc

Please sign in to comment.