path: root/tests/auto/network/access/http2/http2srv.h
diff options
authorTimur Pocheptsov <>2018-04-05 15:51:36 +0200
committerTimur Pocheptsov <>2018-04-12 14:02:20 +0000
commit9917eb2ec69c2d5cc1db408660df43af34fe63fb (patch)
tree3285c2425ceaa6c4801a5da031221298ab030be2 /tests/auto/network/access/http2/http2srv.h
parent144ee494b774fdc0fcdfdda53ebd8d4807a270dc (diff)
HTTP/2 - reset uploadByteDevice if necessary
1. If a request was redirected or some error was encountered, we try to reset the uploading byte-device. 2. Disconnecting from the byte-device is not enough, since we have a queued connection, _q_uploadDataReadyRead() gets called even if byte-device was deleted and thus sender() can return null - we have to check this condition. 3. Update auto-test with a case where our server immediately replies with a redirect status code. Task-number: QTBUG-67469 Task-number: QTBUG-66913 Change-Id: I9b364cf3dee1717940ddbe50cba37c3398cc9c95 Reviewed-by: Edward Welbourne <>
Diffstat (limited to 'tests/auto/network/access/http2/http2srv.h')
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h
index 76c5a0ee36..14b41cc67d 100644
--- a/tests/auto/network/access/http2/http2srv.h
+++ b/tests/auto/network/access/http2/http2srv.h
@@ -74,6 +74,7 @@ public:
void enablePushPromise(bool enabled, const QByteArray &path = QByteArray());
void setResponseBody(const QByteArray &body);
void emulateGOAWAY(int timeout);
+ void redirectOpenStream(quint16 targetPort);
// Invokables, since we can call them from the main thread,
// but server (can) work on its own thread.
@@ -186,6 +187,10 @@ private:
// We need it for PUSH_PROMISE, with the correct port number appended,
// when replying to essentially 1.1 request.
QByteArray authority;
+ // Redirect, with status code 308, as soon as we've seen headers, while client
+ // may still be sending DATA frames. See tst_Http2::earlyResponse().
+ bool redirectWhileReading = false;
+ quint16 targetPort = 0;
protected slots:
void ignoreErrorSlot();