Merge pull request #4180 from eclipse/jetty-9.4.x-4179-SendCallback-gc
Issue #4179 SendCallback GC
This commit is contained in:
commit
ec56739d3c
|
@ -848,19 +848,22 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void releaseHeader()
|
private Callback release()
|
||||||
{
|
{
|
||||||
ByteBuffer h = _header;
|
Callback complete = _callback;
|
||||||
|
_callback = null;
|
||||||
|
_info = null;
|
||||||
|
_content = null;
|
||||||
|
if (_header != null)
|
||||||
|
_bufferPool.release(_header);
|
||||||
_header = null;
|
_header = null;
|
||||||
if (h != null)
|
return complete;
|
||||||
_bufferPool.release(h);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCompleteSuccess()
|
protected void onCompleteSuccess()
|
||||||
{
|
{
|
||||||
releaseHeader();
|
release().succeeded();
|
||||||
_callback.succeeded();
|
|
||||||
if (_shutdownOut)
|
if (_shutdownOut)
|
||||||
getEndPoint().shutdownOutput();
|
getEndPoint().shutdownOutput();
|
||||||
}
|
}
|
||||||
|
@ -868,8 +871,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
|
||||||
@Override
|
@Override
|
||||||
public void onCompleteFailure(final Throwable x)
|
public void onCompleteFailure(final Throwable x)
|
||||||
{
|
{
|
||||||
releaseHeader();
|
failedCallback(release(), x);
|
||||||
failedCallback(_callback, x);
|
|
||||||
if (_shutdownOut)
|
if (_shutdownOut)
|
||||||
getEndPoint().shutdownOutput();
|
getEndPoint().shutdownOutput();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue