Issue #4382 - Support HTTP/1 upgrade to HTTP/2 in HttpClient.
Added comments and fixed logging. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
9cbd9ab44e
commit
1326700772
|
@ -35,12 +35,12 @@ import org.eclipse.jetty.io.EndPoint;
|
||||||
import org.eclipse.jetty.util.BufferUtil;
|
import org.eclipse.jetty.util.BufferUtil;
|
||||||
import org.eclipse.jetty.util.Callback;
|
import org.eclipse.jetty.util.Callback;
|
||||||
import org.eclipse.jetty.util.IteratingCallback;
|
import org.eclipse.jetty.util.IteratingCallback;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.slf4j.Logger;
|
||||||
import org.eclipse.jetty.util.log.Logger;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class HttpSenderOverHTTP extends HttpSender
|
public class HttpSenderOverHTTP extends HttpSender
|
||||||
{
|
{
|
||||||
private static final Logger LOG = Log.getLogger(HttpSenderOverHTTP.class);
|
private static final Logger LOG = LoggerFactory.getLogger(HttpSenderOverHTTP.class);
|
||||||
|
|
||||||
private final HttpGenerator generator = new HttpGenerator();
|
private final HttpGenerator generator = new HttpGenerator();
|
||||||
private boolean shutdown;
|
private boolean shutdown;
|
||||||
|
|
|
@ -35,8 +35,8 @@ import org.eclipse.jetty.http.HttpHeader;
|
||||||
import org.eclipse.jetty.io.EndPoint;
|
import org.eclipse.jetty.io.EndPoint;
|
||||||
import org.eclipse.jetty.util.Callback;
|
import org.eclipse.jetty.util.Callback;
|
||||||
import org.eclipse.jetty.util.Promise;
|
import org.eclipse.jetty.util.Promise;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.slf4j.Logger;
|
||||||
import org.eclipse.jetty.util.log.Logger;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>A HttpUpgrader that upgrades to a given protocol.</p>
|
* <p>A HttpUpgrader that upgrades to a given protocol.</p>
|
||||||
|
@ -47,7 +47,7 @@ import org.eclipse.jetty.util.log.Logger;
|
||||||
*/
|
*/
|
||||||
public class ProtocolHttpUpgrader implements HttpUpgrader
|
public class ProtocolHttpUpgrader implements HttpUpgrader
|
||||||
{
|
{
|
||||||
private static final Logger LOG = Log.getLogger(ProtocolHttpUpgrader.class);
|
private static final Logger LOG = LoggerFactory.getLogger(ProtocolHttpUpgrader.class);
|
||||||
|
|
||||||
private final HttpDestination destination;
|
private final HttpDestination destination;
|
||||||
private final String protocol;
|
private final String protocol;
|
||||||
|
|
|
@ -87,6 +87,9 @@ public class ClientConnectionFactoryOverHTTP2 extends ContainerLifeCycle impleme
|
||||||
// handle the HTTP/2 response to the upgrade request.
|
// handle the HTTP/2 response to the upgrade request.
|
||||||
promise.succeeded(connection);
|
promise.succeeded(connection);
|
||||||
connection.upgrade(context);
|
connection.upgrade(context);
|
||||||
|
// The connection can be used only after the upgrade that
|
||||||
|
// creates stream #1 corresponding to the HTTP/1.1 upgrade
|
||||||
|
// request, otherwise other requests can steal id #1.
|
||||||
destination.accept(connection);
|
destination.accept(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,12 +37,12 @@ import org.eclipse.jetty.http2.frames.DataFrame;
|
||||||
import org.eclipse.jetty.http2.frames.HeadersFrame;
|
import org.eclipse.jetty.http2.frames.HeadersFrame;
|
||||||
import org.eclipse.jetty.util.Callback;
|
import org.eclipse.jetty.util.Callback;
|
||||||
import org.eclipse.jetty.util.Promise;
|
import org.eclipse.jetty.util.Promise;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.slf4j.Logger;
|
||||||
import org.eclipse.jetty.util.log.Logger;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class HttpSenderOverHTTP2 extends HttpSender
|
public class HttpSenderOverHTTP2 extends HttpSender
|
||||||
{
|
{
|
||||||
private static final Logger LOG = Log.getLogger(HttpSenderOverHTTP2.class);
|
private static final Logger LOG = LoggerFactory.getLogger(HttpSenderOverHTTP2.class);
|
||||||
|
|
||||||
public HttpSenderOverHTTP2(HttpChannelOverHTTP2 channel)
|
public HttpSenderOverHTTP2(HttpChannelOverHTTP2 channel)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue