summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-04-22 10:13:31 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-04-25 07:39:58 +0000
commit7ba9863e32615549f883db98371d520b5488c9a1 (patch)
tree70238bb83f966c086564209a7a34636e7bbcd4c3 /src/network
parentdb27f3d5a7b5ea3e415b3985877c8951f8eabfbb (diff)
Simplify code in QSpdyProtocolHandler::parseHttpHeaders()
Instead of checking for the presence of a NUL, then splitting the QByteArray at NUL separators just to join the parts with different binders, simply use replace('\0', ...). Change-Id: I0e0453b80f63cffce4a0ff152120ece754211166 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qspdyprotocolhandler.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/network/access/qspdyprotocolhandler.cpp b/src/network/access/qspdyprotocolhandler.cpp
index 1a6dd04ecb..e4e058b772 100644
--- a/src/network/access/qspdyprotocolhandler.cpp
+++ b/src/network/access/qspdyprotocolhandler.cpp
@@ -935,19 +935,7 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD
} else if (name == "content-length") {
httpReply->setContentLength(value.toLongLong());
} else {
- if (value.contains('\0')) {
- QList<QByteArray> values = value.split('\0');
- QByteArray binder(", ");
- if (name == "set-cookie")
- binder = "\n";
- value.clear();
- Q_FOREACH (const QByteArray& ivalue, values) {
- if (value.isEmpty())
- value = ivalue;
- else
- value += binder + ivalue;
- }
- }
+ value.replace('\0', name == "set-cookie" ? "\n" : ", ");
httpReply->setHeaderField(name, value);
}
}