From 418a493337a8837172032e62a53587e478f21c86 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 18 Sep 2014 11:50:18 +0200 Subject: [PATCH] More simplifications for the send() implementation. --- .../eclipse/jetty/http2/server/HttpTransportOverHTTP2.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java index 373524c00d0..dda7850f72d 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpTransportOverHTTP2.java @@ -78,13 +78,12 @@ public class HttpTransportOverHTTP2 implements HttpTransport // info == null | content == 0 | last = false => noop boolean hasContent = BufferUtil.hasContent(content) && !isHeadRequest; - boolean sendContent = hasContent || (info == null && lastContent); if (info != null) { if (commit.compareAndSet(false, true)) { - if (sendContent) + if (hasContent) { commit(info, false, commitCallback); send(content, lastContent, callback); @@ -101,7 +100,7 @@ public class HttpTransportOverHTTP2 implements HttpTransport } else { - if (sendContent) + if (hasContent || lastContent) { send(content, lastContent, callback); }