From 9917eb2ec69c2d5cc1db408660df43af34fe63fb Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 5 Apr 2018 15:51:36 +0200 Subject: 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 --- tests/auto/network/access/http2/http2srv.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/auto/network/access/http2/http2srv.h') 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(); }; -- cgit v1.2.3