diff options
| author | Marc Mutz <[email protected]> | 2016-04-22 10:13:31 +0200 | 
|---|---|---|
| committer | Marc Mutz <[email protected]> | 2016-04-25 07:39:58 +0000 | 
| commit | 7ba9863e32615549f883db98371d520b5488c9a1 (patch) | |
| tree | 70238bb83f966c086564209a7a34636e7bbcd4c3 | |
| parent | db27f3d5a7b5ea3e415b3985877c8951f8eabfbb (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 <[email protected]>
| -rw-r--r-- | src/network/access/qspdyprotocolhandler.cpp | 14 | 
1 files changed, 1 insertions, 13 deletions
diff --git a/src/network/access/qspdyprotocolhandler.cpp b/src/network/access/qspdyprotocolhandler.cpp index 1a6dd04ecb8..e4e058b7727 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);          }      }  | 
