path: root/tests/auto/network/access/http2/http2srv.h
diff options
authorTimur Pocheptsov <>2016-10-10 15:29:26 +0200
committerTimur Pocheptsov <>2016-10-21 14:27:06 +0000
commit512934f7e70592ed06a790fcb46dde1e435b488e (patch)
treef5fa91f8ce36289976e389ded3c155c45ac2ebb1 /tests/auto/network/access/http2/http2srv.h
parent016b5bc949b6dfb2f76db2e8b40a40e7eaee6828 (diff)
HTTP/2 - fix the handling of PUSH_PROMISE
HTTP/2 allows a server to pre-emptively send (or "push") responses (along with corresponding "promised" requests) to a client in association with a previous client-initiated request. This can be useful when the server knows the client will need to have those responses available in order to fully process the response to the original request. Server push is semantically equivalent to a server responding to a request; however, in this case, that request is also sent by the server, as a PUSH_PROMISE frame. The PUSH_PROMISE frame includes a header block that contains a complete set of request header fields that the server attributes to the request. After sending the PUSH_PROMISE frame, the server can begin delivering the pushed response as a response on a server-initiated stream that uses the promised stream identifier. This patch: - fixes the HPACK decompression of PUSH_PROMISE frames; - allows a user to enable PUSH_PROMISE; - processes and caches pushed data for promised streams; - updates auto-test - emulates a simple PUSH_PROMISE scenario. Change-Id: Ic4850863a5e3895320baac3871a723fc091b4aca Reviewed-by: Edward Welbourne <>
Diffstat (limited to 'tests/auto/network/access/http2/http2srv.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h
index 73b1d80f8e..15a4f212c9 100644
--- a/tests/auto/network/access/http2/http2srv.h
+++ b/tests/auto/network/access/http2/http2srv.h
@@ -68,6 +68,7 @@ public:
// To be called before server started:
+ void enablePushPromise(bool enabled, const QByteArray &path = QByteArray());
void setResponseBody(const QByteArray &body);
// Invokables, since we can call them from the main thread,
@@ -157,6 +158,9 @@ private:
QByteArray responseBody;
bool clearTextHTTP2 = false;
+ bool pushPromiseEnabled = false;
+ quint32 lastPromisedStream = 0;
+ QByteArray pushPath;
protected slots:
void ignoreErrorSlot();