mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-22 22:33:34 -07:00
Avoid redundant copy
This commit is contained in:
parent
e2db0bc866
commit
fe157665cd
1 changed files with 5 additions and 6 deletions
|
@ -164,7 +164,7 @@ bool RequestParser::parseStartLines(const QStringView data)
|
||||||
if (line.at(0).isSpace() && !requestLines.isEmpty())
|
if (line.at(0).isSpace() && !requestLines.isEmpty())
|
||||||
{
|
{
|
||||||
// continuation of previous line
|
// continuation of previous line
|
||||||
requestLines.last() += line.toString();
|
requestLines.last() += line;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -225,9 +225,7 @@ bool RequestParser::parseRequestLine(const QString &line)
|
||||||
const QByteArrayView valueComponent = param.mid(eqCharPos + 1);
|
const QByteArrayView valueComponent = param.mid(eqCharPos + 1);
|
||||||
const QString paramName = QString::fromUtf8(
|
const QString paramName = QString::fromUtf8(
|
||||||
QByteArray::fromPercentEncoding(asQByteArray(nameComponent)).replace('+', ' '));
|
QByteArray::fromPercentEncoding(asQByteArray(nameComponent)).replace('+', ' '));
|
||||||
const QByteArray paramValue = valueComponent.isNull()
|
const QByteArray paramValue = QByteArray::fromPercentEncoding(asQByteArray(valueComponent)).replace('+', ' ');
|
||||||
? QByteArray("")
|
|
||||||
: QByteArray::fromPercentEncoding(asQByteArray(valueComponent)).replace('+', ' ');
|
|
||||||
|
|
||||||
m_request.query[paramName] = paramValue;
|
m_request.query[paramName] = paramValue;
|
||||||
}
|
}
|
||||||
|
@ -337,7 +335,7 @@ bool RequestParser::parseFormData(const QByteArrayView data)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!parseHeaderLine(line.toString(), headersMap))
|
if (!parseHeaderLine(line, headersMap))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -348,7 +346,8 @@ bool RequestParser::parseFormData(const QByteArrayView data)
|
||||||
|
|
||||||
if (headersMap.contains(filename))
|
if (headersMap.contains(filename))
|
||||||
{
|
{
|
||||||
m_request.files.append({headersMap[filename], headersMap[HEADER_CONTENT_TYPE], payload.toByteArray()});
|
m_request.files.append({.filename = headersMap[filename], .type = headersMap[HEADER_CONTENT_TYPE]
|
||||||
|
, .data = payload.toByteArray()});
|
||||||
}
|
}
|
||||||
else if (headersMap.contains(name))
|
else if (headersMap.contains(name))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue