Skip to content

Commit

Permalink
handle review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
  • Loading branch information
lorban committed Feb 22, 2024
1 parent c783fcb commit 2bd8896
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class ServerFCGIConnection extends AbstractMetaDataConnection implements
private final HttpChannel.Factory httpChannelFactory = new HttpChannel.DefaultFactory();
private final Attributes attributes = new Lazy();
private final Connector connector;
private final ByteBufferPool networkByteBufferPool;
private final ByteBufferPool bufferPool;
private final boolean sendStatus200;
private final Flusher flusher;
private final ServerParser parser;
Expand All @@ -59,7 +59,7 @@ public ServerFCGIConnection(Connector connector, EndPoint endPoint, HttpConfigur
{
super(connector, configuration, endPoint);
this.connector = connector;
this.networkByteBufferPool = connector.getByteBufferPool();
this.bufferPool = connector.getByteBufferPool();
this.flusher = new Flusher(endPoint);
this.sendStatus200 = sendStatus200;
this.parser = new ServerParser(new ServerListener());
Expand Down Expand Up @@ -178,10 +178,10 @@ public void onFillable()
LOG.debug("Read {} bytes from {} {}", read, getEndPoint(), this);
if (read > 0)
{
// The networkBuffer cannot be released immediately after parse()
// The inputBuffer cannot be released immediately after parse()
// even if the buffer has been fully consumed because releaseInputBuffer()
// must be called as the last release for it to be able to null out the
// networkBuffer field exactly when the latter isn't used anymore.
// inputBuffer field exactly when the latter isn't used anymore.
if (parse(inputBuffer.getByteBuffer()))
return;
}
Expand Down Expand Up @@ -228,10 +228,10 @@ void parseAndFill()
// See also HttpConnection.parseAndFillForContent().
while (stream != null)
{
// The networkBuffer cannot be released immediately after parse()
// The inputBuffer cannot be released immediately after parse()
// even if the buffer has been fully consumed because releaseInputBuffer()
// must be called as the last release for it to be able to null out the
// networkBuffer field exactly when the latter isn't used anymore.
// inputBuffer field exactly when the latter isn't used anymore.
if (parse(inputBuffer.getByteBuffer()))
return;

Expand All @@ -249,7 +249,7 @@ void parseAndFill()
private void acquireInputBuffer()
{
if (inputBuffer == null)
inputBuffer = networkByteBufferPool.acquire(getInputBufferSize(), isUseInputDirectByteBuffers());
inputBuffer = bufferPool.acquire(getInputBufferSize(), isUseInputDirectByteBuffers());
}

private void releaseInputBuffer()
Expand Down Expand Up @@ -369,7 +369,7 @@ public boolean onContent(int request, FCGI.StreamType streamType, ByteBuffer buf
LOG.debug("Request {} {} content {} on {}", request, streamType, buffer, stream);
if (stream != null)
{
// No need to call networkBuffer.retain() here.
// No need to call inputBuffer.retain() here.
// The receiver of the chunk decides whether to consume/retain it.
Content.Chunk chunk = Content.Chunk.asChunk(buffer, false, inputBuffer);
stream.onContent(chunk);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ private void processData(DataFrame frame, Runnable delegate)
}
else
{
// No need to call networkBuffer.retain() here, since we know
// that the action will be run before releasing the networkBuffer.
// No need to call inputBuffer.retain() here, since we know
// that the action will be run before releasing the inputBuffer.
data = new StreamData(frame, inputBuffer);
}

Expand Down

0 comments on commit 2bd8896

Please sign in to comment.