Fixes #1671 - Asymmetric usage of trailers in MetaData.Request.
Reviewed with code cleanups.
This commit is contained in:
parent
82462eafb7
commit
1d9f21a9b1
|
@ -61,7 +61,6 @@ import org.eclipse.jetty.util.thread.Scheduler;
|
|||
* The HttpChannel signals the switch from passive mode to active mode by returning true to one of the
|
||||
* HttpParser.RequestHandler callbacks. The completion of the active phase is signalled by a call to
|
||||
* HttpTransport.completed().
|
||||
*
|
||||
*/
|
||||
public class HttpChannel implements Runnable, HttpOutput.Interceptor
|
||||
{
|
||||
|
@ -76,18 +75,11 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
|
|||
private final HttpChannelState _state;
|
||||
private final Request _request;
|
||||
private final Response _response;
|
||||
private final Supplier<HttpFields> _trailerSupplier = new Supplier<HttpFields>()
|
||||
{
|
||||
@Override
|
||||
public HttpFields get()
|
||||
{
|
||||
return _trailers;
|
||||
}
|
||||
};
|
||||
private HttpFields _trailers;
|
||||
private final Supplier<HttpFields> _trailerSupplier = () -> _trailers;
|
||||
private MetaData.Response _committedMetaData;
|
||||
private RequestLog _requestLog;
|
||||
private long _oldIdleTimeout;
|
||||
private HttpFields _trailers;
|
||||
|
||||
/** Bytes written after interception (eg after compression) */
|
||||
private long _written;
|
||||
|
@ -262,6 +254,8 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
|
|||
_committedMetaData=null;
|
||||
_requestLog=_connector==null?null:_connector.getServer().getRequestLog();
|
||||
_written=0;
|
||||
_trailers=null;
|
||||
_oldIdleTimeout=0;
|
||||
}
|
||||
|
||||
public void asyncReadFillInterested()
|
||||
|
|
|
@ -219,7 +219,7 @@ public class Request implements HttpServletRequest
|
|||
public HttpFields getTrailers()
|
||||
{
|
||||
MetaData.Request metadata=_metaData;
|
||||
Supplier<HttpFields> trailers = metadata==null?null:metadata.getTrailerSupplier();
|
||||
Supplier<HttpFields> trailers = metadata==null?null:metadata.getTrailerSupplier();
|
||||
return trailers==null?null:trailers.get();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue