summaryrefslogtreecommitdiffstats
path: root/src/httpserver/qhttpserverrequest.cpp
diff options
context:
space:
mode:
authorMikhail Svetkin <mikhail.svetkin@qt.io>2019-03-25 16:09:50 +0100
committerMikhail Svetkin <mikhail.svetkin@qt.io>2019-04-08 13:49:38 +0000
commit5147076e5ede09fafa96e147ab41dbb5744b8655 (patch)
tree2c8840d062c6e3069448d933bceaa6d6abf8dd1f /src/httpserver/qhttpserverrequest.cpp
parentbe06bd66b8c8613498df06026dd8f10164dbd4ff (diff)
Fix support for keep-alive connection
QAbstractHttpServer did not clear a request's internal properties (headers, url, body). If a request has a keep-alive header, QAbstractHttpServer should clear the request's internal properties. Change-Id: I2dfd0565369bd3291cd8d9900045c5a7f9d43ca3 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/httpserver/qhttpserverrequest.cpp')
-rw-r--r--src/httpserver/qhttpserverrequest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/httpserver/qhttpserverrequest.cpp b/src/httpserver/qhttpserverrequest.cpp
index f6c52dd..b92024a 100644
--- a/src/httpserver/qhttpserverrequest.cpp
+++ b/src/httpserver/qhttpserverrequest.cpp
@@ -116,6 +116,14 @@ uint QHttpServerRequestPrivate::headerHash(const QString &key) const
return qHash(key.toLower(), headersSeed);
}
+void QHttpServerRequestPrivate::clear()
+{
+ url.clear();
+ lastHeader.clear();
+ headers.clear();
+ body.clear();
+}
+
bool QHttpServerRequestPrivate::parseUrl(const char *at, size_t length, bool connect, QUrl *url)
{
static const std::map<std::size_t, std::function<void(const QString &, QUrl *)>> functions {