HTTP/2 - do not set END_HEADERS if we have CONTINUATIONs

Setting END_HEADERS flag on a HEADERS frame means we do not have
CONTINUATION frame(s). So do NOT set it too early, only if we
fit into a single frame.

Change-Id: I891a2db227cee59e4eacfe7c2f18b431cd85fe47
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Timur Pocheptsov 2016-08-17 12:27:31 +02:00
parent 02a03e52f7
commit 3c5b9977cd
2 changed files with 2 additions and 1 deletions

View File

@ -478,6 +478,7 @@ bool FrameWriter::writeHEADERS(QAbstractSocket &socket, quint32 sizeLimit)
sizeLimit = quint32(maxPayloadSize);
if (quint32(frameBuffer.size() - frameHeaderSize) <= sizeLimit) {
addFlag(FrameFlag::END_HEADERS);
updatePayloadSize();
return write(socket);
}

View File

@ -328,7 +328,7 @@ bool QHttp2ProtocolHandler::sendHEADERS(Stream &stream)
{
using namespace HPack;
outboundFrame.start(FrameType::HEADERS, FrameFlag::PRIORITY | FrameFlag::END_HEADERS,
outboundFrame.start(FrameType::HEADERS, FrameFlag::PRIORITY,
stream.streamID);
if (!stream.data()) {