More simplifications for the send() implementation.
This commit is contained in:
parent
0acee9851f
commit
418a493337
|
@ -78,13 +78,12 @@ public class HttpTransportOverHTTP2 implements HttpTransport
|
||||||
// info == null | content == 0 | last = false => noop
|
// info == null | content == 0 | last = false => noop
|
||||||
|
|
||||||
boolean hasContent = BufferUtil.hasContent(content) && !isHeadRequest;
|
boolean hasContent = BufferUtil.hasContent(content) && !isHeadRequest;
|
||||||
boolean sendContent = hasContent || (info == null && lastContent);
|
|
||||||
|
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
if (commit.compareAndSet(false, true))
|
if (commit.compareAndSet(false, true))
|
||||||
{
|
{
|
||||||
if (sendContent)
|
if (hasContent)
|
||||||
{
|
{
|
||||||
commit(info, false, commitCallback);
|
commit(info, false, commitCallback);
|
||||||
send(content, lastContent, callback);
|
send(content, lastContent, callback);
|
||||||
|
@ -101,7 +100,7 @@ public class HttpTransportOverHTTP2 implements HttpTransport
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (sendContent)
|
if (hasContent || lastContent)
|
||||||
{
|
{
|
||||||
send(content, lastContent, callback);
|
send(content, lastContent, callback);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue