Issue #6728 - QUIC and HTTP/3

Made QuicConnection's fillable callback of type EITHER.
This is necessary when there are no threads available,
because we still want to read from the network and feed
Quiche so that it can progress with respect to packet
acknowledgments and flow control updates.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2021-12-08 16:47:34 +01:00
parent 94c3e9a775
commit e81c3ead7a
1 changed files with 28 additions and 0 deletions

View File

@ -62,6 +62,7 @@ public abstract class QuicConnection extends AbstractConnection
private final ByteBufferPool byteBufferPool;
private final AdaptiveExecutionStrategy strategy;
private final Flusher flusher = new Flusher();
private final Callback fillableCallback = new FillableCallback();
private int outputBufferSize = 2048;
private boolean useInputDirectByteBuffers = true;
private boolean useOutputDirectByteBuffers = true;
@ -163,6 +164,12 @@ public abstract class QuicConnection extends AbstractConnection
strategy.produce();
}
@Override
public void fillInterested()
{
getEndPoint().fillInterested(fillableCallback);
}
@Override
public abstract boolean onIdleExpired();
@ -409,4 +416,25 @@ public abstract class QuicConnection extends AbstractConnection
}
}
}
private class FillableCallback implements Callback
{
@Override
public void succeeded()
{
onFillable();
}
@Override
public void failed(Throwable x)
{
onFillInterestedFailed(x);
}
@Override
public InvocationType getInvocationType()
{
return InvocationType.EITHER;
}
}
}