Issue #6728 - QUIC and HTTP/3

Updates after merge of #7100.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2021-12-01 10:13:30 +01:00
parent 3329604585
commit 3d6578deee
5 changed files with 12 additions and 68 deletions

View File

@ -134,11 +134,6 @@ public class ClientConnector extends ContainerLifeCycle
return executor; return executor;
} }
public boolean isIntrinsicallySecure()
{
return false;
}
public void setExecutor(Executor executor) public void setExecutor(Executor executor)
{ {
if (isStarted()) if (isStarted())

View File

@ -377,7 +377,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable
_selectorManager.endPointClosed(endPoint); _selectorManager.endPointClosed(endPoint);
} }
public void createEndPoint(SelectableChannel channel, SelectionKey selectionKey) throws IOException void createEndPoint(SelectableChannel channel, SelectionKey selectionKey) throws IOException
{ {
EndPoint endPoint = _selectorManager.newEndPoint(channel, this, selectionKey); EndPoint endPoint = _selectorManager.newEndPoint(channel, this, selectionKey);
Object context = selectionKey.attachment(); Object context = selectionKey.attachment();
@ -402,7 +402,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable
LOG.debug("Created {}", endPoint); LOG.debug("Created {}", endPoint);
} }
public void destroyEndPoint(EndPoint endPoint, Throwable cause) void destroyEndPoint(EndPoint endPoint, Throwable cause)
{ {
// Waking up the selector is necessary to clean the // Waking up the selector is necessary to clean the
// cancelled-key set and tell the TCP stack that the // cancelled-key set and tell the TCP stack that the
@ -419,7 +419,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable
} }
} }
public static int safeReadyOps(SelectionKey selectionKey) static int safeReadyOps(SelectionKey selectionKey)
{ {
try try
{ {
@ -432,7 +432,7 @@ public class ManagedSelector extends ContainerLifeCycle implements Dumpable
} }
} }
public static int safeInterestOps(SelectionKey selectionKey) static int safeInterestOps(SelectionKey selectionKey)
{ {
try try
{ {

View File

@ -69,11 +69,19 @@ public abstract class QuicConnection extends AbstractConnection
protected QuicConnection(Executor executor, Scheduler scheduler, ByteBufferPool byteBufferPool, EndPoint endPoint) protected QuicConnection(Executor executor, Scheduler scheduler, ByteBufferPool byteBufferPool, EndPoint endPoint)
{ {
super(endPoint, executor); super(endPoint, executor);
if (!(endPoint instanceof DatagramChannelEndPoint))
throw new IllegalArgumentException("EndPoint must be a " + DatagramChannelEndPoint.class.getSimpleName());
this.scheduler = scheduler; this.scheduler = scheduler;
this.byteBufferPool = byteBufferPool; this.byteBufferPool = byteBufferPool;
this.strategy = new AdaptiveExecutionStrategy(new QuicProducer(), getExecutor()); this.strategy = new AdaptiveExecutionStrategy(new QuicProducer(), getExecutor());
} }
@Override
public DatagramChannelEndPoint getEndPoint()
{
return (DatagramChannelEndPoint)super.getEndPoint();
}
public Scheduler getScheduler() public Scheduler getScheduler()
{ {
return scheduler; return scheduler;

View File

@ -57,24 +57,6 @@ public interface Callback extends Invocable
}); });
} }
/**
* <p>Completes this callback with the given {@link CompletableFuture}.</p>
* <p>When the CompletableFuture completes normally, this callback is succeeded;
* when the CompletableFuture completes exceptionally, this callback is failed.</p>
*
* @param completable the CompletableFuture that completes this callback
*/
default void completeWith(CompletableFuture<?> completable)
{
completable.whenComplete((o, x) ->
{
if (x == null)
succeeded();
else
failed(x);
});
}
/** /**
* <p>Callback invoked when the operation completes.</p> * <p>Callback invoked when the operation completes.</p>
* *
@ -204,18 +186,6 @@ public interface Callback extends Invocable
}; };
} }
static Callback from(InvocationType invocationType, Runnable completed)
{
return new Completing(invocationType)
{
@Override
public void completed()
{
completed.run();
}
};
}
/** /**
* <p>Creates a Callback with the given {@code invocationType}, * <p>Creates a Callback with the given {@code invocationType},
* that runs the given {@code Runnable} when it succeeds or fails.</p> * that runs the given {@code Runnable} when it succeeds or fails.</p>

View File

@ -125,35 +125,6 @@ public interface Invocable
return new ReadyTask(type, task); return new ReadyTask(type, task);
} }
public static Runnable from(InvocationType type, Runnable task)
{
class RunnableInvocable implements Runnable, Invocable
{
private final InvocationType type;
private final Runnable task;
RunnableInvocable(InvocationType type, Runnable task)
{
this.type = type;
this.task = task;
}
@Override
public void run()
{
task.run();
}
@Override
public InvocationType getInvocationType()
{
return type;
}
}
return new RunnableInvocable(type, task);
}
/** /**
* Test if the current thread has been tagged as non blocking * Test if the current thread has been tagged as non blocking
* *