QtBase  v6.3.1
qnetworkrequest.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2022 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the QtNetwork module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 3 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 3 requirements
23 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24 **
25 ** GNU General Public License Usage
26 ** Alternatively, this file may be used under the terms of the GNU
27 ** General Public License version 2.0 or (at your option) the GNU General
28 ** Public license version 3 or any later version approved by the KDE Free
29 ** Qt Foundation. The licenses are as published by the Free Software
30 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31 ** included in the packaging of this file. Please review the following
32 ** information to ensure the GNU General Public License requirements will
33 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34 ** https://www.gnu.org/licenses/gpl-3.0.html.
35 **
36 ** $QT_END_LICENSE$
37 **
38 ****************************************************************************/
39 
40 #include "qnetworkrequest.h"
41 #include "qnetworkrequest_p.h"
42 #include "qplatformdefs.h"
43 #include "qnetworkcookie.h"
44 #include "qsslconfiguration.h"
45 #if QT_CONFIG(http) || defined(Q_CLANG_QDOC)
46 #include "qhttp2configuration.h"
47 #include "private/http2protocol_p.h"
48 #endif
49 #include "QtCore/qshareddata.h"
50 #include "QtCore/qlocale.h"
51 #include "QtCore/qdatetime.h"
52 
53 #include <ctype.h>
54 #if QT_CONFIG(datestring)
55 # include <stdio.h>
56 #endif
57 
58 #include <algorithm>
59 
61 
433 {
434 public:
435  static const int maxRedirectCount = 50;
437  : priority(QNetworkRequest::NormalPriority)
438 #ifndef QT_NO_SSL
440 #endif
442  , transferTimeout(0)
443  { qRegisterMetaType<QNetworkRequest>(); }
445  {
446 #ifndef QT_NO_SSL
447  delete sslConfiguration;
448 #endif
449  }
450 
451 
454  {
455  url = other.url;
456  priority = other.priority;
457  maxRedirectsAllowed = other.maxRedirectsAllowed;
458 #ifndef QT_NO_SSL
459  sslConfiguration = nullptr;
460  if (other.sslConfiguration)
461  sslConfiguration = new QSslConfiguration(*other.sslConfiguration);
462 #endif
463  peerVerifyName = other.peerVerifyName;
464 #if QT_CONFIG(http)
465  h2Configuration = other.h2Configuration;
466  decompressedSafetyCheckThreshold = other.decompressedSafetyCheckThreshold;
467 #endif
468  transferTimeout = other.transferTimeout;
469  }
470 
471  inline bool operator==(const QNetworkRequestPrivate &other) const
472  {
473  return url == other.url &&
474  priority == other.priority &&
475  rawHeaders == other.rawHeaders &&
476  attributes == other.attributes &&
477  maxRedirectsAllowed == other.maxRedirectsAllowed &&
478  peerVerifyName == other.peerVerifyName
479 #if QT_CONFIG(http)
480  && h2Configuration == other.h2Configuration
481  && decompressedSafetyCheckThreshold == other.decompressedSafetyCheckThreshold
482 #endif
483  && transferTimeout == other.transferTimeout
484  ;
485  // don't compare cookedHeaders
486  }
487 
490 #ifndef QT_NO_SSL
492 #endif
495 #if QT_CONFIG(http)
496  QHttp2Configuration h2Configuration;
497  qint64 decompressedSafetyCheckThreshold = 10ll * 1024ll * 1024ll;
498 #endif
500 };
501 
510 {
511 #if QT_CONFIG(http)
512  // Initial values proposed by RFC 7540 are quite draconian, but we
513  // know about servers configured with this value as maximum possible,
514  // rejecting our SETTINGS frame and sending us a GOAWAY frame with the
515  // flow control error set. Unless an application sets its own parameters,
516  // we don't send SETTINGS_INITIAL_WINDOW_SIZE, but increase
517  // (via WINDOW_UPDATE) the session window size. These are our 'defaults':
518  d->h2Configuration.setStreamReceiveWindowSize(Http2::defaultSessionWindowSize);
519  d->h2Configuration.setSessionReceiveWindowSize(Http2::maxSessionReceiveWindowSize);
520  d->h2Configuration.setServerPushEnabled(false);
521 #endif // QT_CONFIG(http)
522 }
523 
531  : QNetworkRequest()
532 {
533  d->url = url;
534 }
535 
540  : d(other.d)
541 {
542 }
543 
548 {
549  // QSharedDataPointer auto deletes
550  d = nullptr;
551 }
552 
560 {
561  return d == other.d || *d == *other.d;
562 }
563 
576 {
577  d = other.d;
578  return *this;
579 }
580 
595 {
596  return d->url;
597 }
598 
605 {
606  d->url = url;
607 }
608 
617 {
618  return d->cookedHeaders.value(header);
619 }
620 
629 {
631 }
632 
639 bool QNetworkRequest::hasRawHeader(const QByteArray &headerName) const
640 {
641  return d->findRawHeader(headerName) != d->rawHeaders.constEnd();
642 }
643 
655 {
657  d->findRawHeader(headerName);
658  if (it != d->rawHeaders.constEnd())
659  return it->second;
660  return QByteArray();
661 }
662 
670 {
671  return d->rawHeadersKeys();
672 }
673 
693 void QNetworkRequest::setRawHeader(const QByteArray &headerName, const QByteArray &headerValue)
694 {
695  d->setRawHeader(headerName, headerValue);
696 }
697 
708 {
709  return d->attributes.value(code, defaultValue);
710 }
711 
721 {
722  if (value.isValid())
724  else
725  d->attributes.remove(code);
726 }
727 
728 #ifndef QT_NO_SSL
736 {
737  if (!d->sslConfiguration)
739  return *d->sslConfiguration;
740 }
741 
751 {
752  if (!d->sslConfiguration)
754  else
755  *d->sslConfiguration = config;
756 }
757 #endif
758 
771 {
773 }
774 
785 {
786  return d->originatingObject.data();
787 }
788 
797 {
798  return d->priority;
799 }
800 
824 {
825  d->priority = priority;
826 }
827 
837 {
838  return d->maxRedirectsAllowed;
839 }
840 
849 void QNetworkRequest::setMaximumRedirectsAllowed(int maxRedirectsAllowed)
850 {
851  d->maxRedirectsAllowed = maxRedirectsAllowed;
852 }
853 
863 {
864  return d->peerVerifyName;
865 }
866 
876 {
877  d->peerVerifyName = peerName;
878 }
879 
880 #if QT_CONFIG(http) || defined(Q_CLANG_QDOC)
902 QHttp2Configuration QNetworkRequest::http2Configuration() const
903 {
904  return d->h2Configuration;
905 }
906 
920 void QNetworkRequest::setHttp2Configuration(const QHttp2Configuration &configuration)
921 {
922  d->h2Configuration = configuration;
923 }
924 
935 qint64 QNetworkRequest::decompressedSafetyCheckThreshold() const
936 {
937  return d->decompressedSafetyCheckThreshold;
938 }
939 
962 void QNetworkRequest::setDecompressedSafetyCheckThreshold(qint64 threshold)
963 {
964  d->decompressedSafetyCheckThreshold = threshold;
965 }
966 #endif // QT_CONFIG(http) || defined(Q_CLANG_QDOC)
967 
968 #if QT_CONFIG(http) || defined(Q_CLANG_QDOC) || defined (Q_OS_WASM)
979 int QNetworkRequest::transferTimeout() const
980 {
981  return d->transferTimeout;
982 }
983 
998 void QNetworkRequest::setTransferTimeout(int timeout)
999 {
1000  d->transferTimeout = timeout;
1001 }
1002 #endif // QT_CONFIG(http) || defined(Q_CLANG_QDOC) || defined (Q_OS_WASM)
1003 
1005 {
1006  switch (header) {
1008  return "Content-Type";
1009 
1011  return "Content-Length";
1012 
1014  return "Location";
1015 
1017  return "Last-Modified";
1018 
1020  return "If-Modified-Since";
1021 
1023  return "ETag";
1024 
1026  return "If-Match";
1027 
1029  return "If-None-Match";
1030 
1032  return "Cookie";
1033 
1035  return "Set-Cookie";
1036 
1038  return "Content-Disposition";
1039 
1041  return "User-Agent";
1042 
1044  return "Server";
1045 
1046  // no default:
1047  // if new values are added, this will generate a compiler warning
1048  }
1049 
1050  return QByteArray();
1051 }
1052 
1053 static QByteArray headerValue(QNetworkRequest::KnownHeaders header, const QVariant &value)
1054 {
1055  switch (header) {
1064  return value.toByteArray();
1065 
1067  switch (value.userType()) {
1068  case QMetaType::QUrl:
1069  return value.toUrl().toEncoded();
1070 
1071  default:
1072  return value.toByteArray();
1073  }
1074 
1077  switch (value.userType()) {
1078  // Generate RFC 1123/822 dates:
1079  case QMetaType::QDate:
1080  return QNetworkHeadersPrivate::toHttpDate(value.toDate().startOfDay(Qt::UTC));
1081  case QMetaType::QDateTime:
1082  return QNetworkHeadersPrivate::toHttpDate(value.toDateTime());
1083 
1084  default:
1085  return value.toByteArray();
1086  }
1087 
1089  QList<QNetworkCookie> cookies = qvariant_cast<QList<QNetworkCookie> >(value);
1090  if (cookies.isEmpty() && value.userType() == qMetaTypeId<QNetworkCookie>())
1091  cookies << qvariant_cast<QNetworkCookie>(value);
1092 
1094  bool first = true;
1095  for (const QNetworkCookie &cookie : qAsConst(cookies)) {
1096  if (!first)
1097  result += "; ";
1098  first = false;
1099  result += cookie.toRawForm(QNetworkCookie::NameAndValueOnly);
1100  }
1101  return result;
1102  }
1103 
1105  QList<QNetworkCookie> cookies = qvariant_cast<QList<QNetworkCookie> >(value);
1106  if (cookies.isEmpty() && value.userType() == qMetaTypeId<QNetworkCookie>())
1107  cookies << qvariant_cast<QNetworkCookie>(value);
1108 
1110  bool first = true;
1111  for (const QNetworkCookie &cookie : qAsConst(cookies)) {
1112  if (!first)
1113  result += ", ";
1114  first = false;
1115  result += cookie.toRawForm(QNetworkCookie::Full);
1116  }
1117  return result;
1118  }
1119  }
1120 
1121  return QByteArray();
1122 }
1123 
1124 static int parseHeaderName(const QByteArray &headerName)
1125 {
1126  if (headerName.isEmpty())
1127  return -1;
1128 
1129  switch (tolower(headerName.at(0))) {
1130  case 'c':
1131  if (headerName.compare("content-type", Qt::CaseInsensitive) == 0)
1133  else if (headerName.compare("content-length", Qt::CaseInsensitive) == 0)
1135  else if (headerName.compare("cookie", Qt::CaseInsensitive) == 0)
1137  else if (qstricmp(headerName.constData(), "content-disposition") == 0)
1139  break;
1140 
1141  case 'e':
1142  if (qstricmp(headerName.constData(), "etag") == 0)
1144  break;
1145 
1146  case 'i':
1147  if (qstricmp(headerName.constData(), "if-modified-since") == 0)
1149  if (qstricmp(headerName.constData(), "if-match") == 0)
1151  if (qstricmp(headerName.constData(), "if-none-match") == 0)
1153  break;
1154 
1155  case 'l':
1156  if (headerName.compare("location", Qt::CaseInsensitive) == 0)
1158  else if (headerName.compare("last-modified", Qt::CaseInsensitive) == 0)
1160  break;
1161 
1162  case 's':
1163  if (headerName.compare("set-cookie", Qt::CaseInsensitive) == 0)
1165  else if (headerName.compare("server", Qt::CaseInsensitive) == 0)
1167  break;
1168 
1169  case 'u':
1170  if (headerName.compare("user-agent", Qt::CaseInsensitive) == 0)
1172  break;
1173  }
1174 
1175  return -1; // nothing found
1176 }
1177 
1178 static QVariant parseHttpDate(const QByteArray &raw)
1179 {
1181  if (dt.isValid())
1182  return dt;
1183  return QVariant(); // transform an invalid QDateTime into a null QVariant
1184 }
1185 
1186 static QVariant parseCookieHeader(const QByteArray &raw)
1187 {
1189  const QList<QByteArray> cookieList = raw.split(';');
1190  for (const QByteArray &cookie : cookieList) {
1191  QList<QNetworkCookie> parsed = QNetworkCookie::parseCookies(cookie.trimmed());
1192  if (parsed.count() != 1)
1193  return QVariant(); // invalid Cookie: header
1194 
1195  result += parsed;
1196  }
1197 
1198  return QVariant::fromValue(result);
1199 }
1200 
1201 static QVariant parseETag(const QByteArray &raw)
1202 {
1203  const QByteArray trimmed = raw.trimmed();
1204  if (!trimmed.startsWith('"') && !trimmed.startsWith(R"(W/")"))
1205  return QVariant();
1206 
1207  if (!trimmed.endsWith('"'))
1208  return QVariant();
1209 
1210  return QString::fromLatin1(trimmed);
1211 }
1212 
1213 static QVariant parseIfMatch(const QByteArray &raw)
1214 {
1215  const QByteArray trimmedRaw = raw.trimmed();
1216  if (trimmedRaw == "*")
1217  return QStringList(QStringLiteral("*"));
1218 
1219  QStringList tags;
1220  const QList<QByteArray> split = trimmedRaw.split(',');
1221  for (const QByteArray &element : split) {
1222  const QByteArray trimmed = element.trimmed();
1223  if (!trimmed.startsWith('"'))
1224  continue;
1225 
1226  if (!trimmed.endsWith('"'))
1227  continue;
1228 
1229  tags += QString::fromLatin1(trimmed);
1230  }
1231  return tags;
1232 }
1233 
1234 static QVariant parseIfNoneMatch(const QByteArray &raw)
1235 {
1236  const QByteArray trimmedRaw = raw.trimmed();
1237  if (trimmedRaw == "*")
1238  return QStringList(QStringLiteral("*"));
1239 
1240  QStringList tags;
1241  const QList<QByteArray> split = trimmedRaw.split(',');
1242  for (const QByteArray &element : split) {
1243  const QByteArray trimmed = element.trimmed();
1244  if (!trimmed.startsWith('"') && !trimmed.startsWith(R"(W/")"))
1245  continue;
1246 
1247  if (!trimmed.endsWith('"'))
1248  continue;
1249 
1250  tags += QString::fromLatin1(trimmed);
1251  }
1252  return tags;
1253 }
1254 
1255 
1256 static QVariant parseHeaderValue(QNetworkRequest::KnownHeaders header, const QByteArray &value)
1257 {
1258  // header is always a valid value
1259  switch (header) {
1264  // copy exactly, convert to QString
1265  return QString::fromLatin1(value);
1266 
1268  bool ok;
1269  qint64 result = value.trimmed().toLongLong(&ok);
1270  if (ok)
1271  return result;
1272  return QVariant();
1273  }
1274 
1277  if (result.isValid() && !result.scheme().isEmpty())
1278  return result;
1279  return QVariant();
1280  }
1281 
1284  return parseHttpDate(value);
1285 
1287  return parseETag(value);
1288 
1290  return parseIfMatch(value);
1291 
1293  return parseIfNoneMatch(value);
1294 
1296  return parseCookieHeader(value);
1297 
1300 
1301  default:
1302  Q_ASSERT(0);
1303  }
1304  return QVariant();
1305 }
1306 
1309 {
1312  for ( ; it != end; ++it)
1313  if (it->first.compare(key, Qt::CaseInsensitive) == 0)
1314  return it;
1315 
1316  return end; // not found
1317 }
1318 
1320 {
1321  return rawHeaders;
1322 }
1323 
1325 {
1327  result.reserve(rawHeaders.size());
1329  end = rawHeaders.constEnd();
1330  for ( ; it != end; ++it)
1331  result << it->first;
1332 
1333  return result;
1334 }
1335 
1337 {
1338  if (key.isEmpty())
1339  // refuse to accept an empty raw header
1340  return;
1341 
1342  setRawHeaderInternal(key, value);
1343  parseAndSetHeader(key, value);
1344 }
1345 
1355 {
1356  cookedHeaders.clear();
1357  rawHeaders = list;
1358 
1361  for ( ; it != end; ++it)
1362  parseAndSetHeader(it->first, it->second);
1363 }
1364 
1366  const QVariant &value)
1367 {
1368  QByteArray name = headerName(header);
1369  if (name.isEmpty()) {
1370  // headerName verifies that \a header is a known value
1371  qWarning("QNetworkRequest::setHeader: invalid header value KnownHeader(%d) received", header);
1372  return;
1373  }
1374 
1375  if (value.isNull()) {
1376  setRawHeaderInternal(name, QByteArray());
1378  } else {
1379  QByteArray rawValue = headerValue(header, value);
1380  if (rawValue.isEmpty()) {
1381  qWarning("QNetworkRequest::setHeader: QVariant of type %s cannot be used with header %s",
1382  value.typeName(), name.constData());
1383  return;
1384  }
1385 
1386  setRawHeaderInternal(name, rawValue);
1388  }
1389 }
1390 
1391 void QNetworkHeadersPrivate::setRawHeaderInternal(const QByteArray &key, const QByteArray &value)
1392 {
1393  auto firstEqualsKey = [&key](const RawHeaderPair &header) {
1394  return header.first.compare(key, Qt::CaseInsensitive) == 0;
1395  };
1396  rawHeaders.removeIf(firstEqualsKey);
1397 
1398  if (value.isNull())
1399  return; // only wanted to erase key
1400 
1401  RawHeaderPair pair;
1402  pair.first = key;
1403  pair.second = value;
1404  rawHeaders.append(pair);
1405 }
1406 
1407 void QNetworkHeadersPrivate::parseAndSetHeader(const QByteArray &key, const QByteArray &value)
1408 {
1409  // is it a known header?
1410  const int parsedKeyAsInt = parseHeaderName(key);
1411  if (parsedKeyAsInt != -1) {
1412  const QNetworkRequest::KnownHeaders parsedKey
1413  = static_cast<QNetworkRequest::KnownHeaders>(parsedKeyAsInt);
1414  if (value.isNull()) {
1415  cookedHeaders.remove(parsedKey);
1416  } else if (parsedKey == QNetworkRequest::ContentLengthHeader
1418  // Only set the cooked header "Content-Length" once.
1419  // See bug QTBUG-15311
1420  } else {
1421  cookedHeaders.insert(parsedKey, parseHeaderValue(parsedKey, value));
1422  }
1423 
1424  }
1425 }
1426 
1427 // Fast month string to int conversion. This code
1428 // assumes that the Month name is correct and that
1429 // the string is at least three chars long.
1430 static int name_to_month(const char* month_str)
1431 {
1432  switch (month_str[0]) {
1433  case 'J':
1434  switch (month_str[1]) {
1435  case 'a':
1436  return 1;
1437  case 'u':
1438  switch (month_str[2] ) {
1439  case 'n':
1440  return 6;
1441  case 'l':
1442  return 7;
1443  }
1444  }
1445  break;
1446  case 'F':
1447  return 2;
1448  case 'M':
1449  switch (month_str[2] ) {
1450  case 'r':
1451  return 3;
1452  case 'y':
1453  return 5;
1454  }
1455  break;
1456  case 'A':
1457  switch (month_str[1]) {
1458  case 'p':
1459  return 4;
1460  case 'u':
1461  return 8;
1462  }
1463  break;
1464  case 'O':
1465  return 10;
1466  case 'S':
1467  return 9;
1468  case 'N':
1469  return 11;
1470  case 'D':
1471  return 12;
1472  }
1473 
1474  return 0;
1475 }
1476 
1478 {
1479  // HTTP dates have three possible formats:
1480  // RFC 1123/822 - ddd, dd MMM yyyy hh:mm:ss "GMT"
1481  // RFC 850 - dddd, dd-MMM-yy hh:mm:ss "GMT"
1482  // ANSI C's asctime - ddd MMM d hh:mm:ss yyyy
1483  // We only handle them exactly. If they deviate, we bail out.
1484 
1485  int pos = value.indexOf(',');
1486  QDateTime dt;
1487 #if QT_CONFIG(datestring)
1488  if (pos == -1) {
1489  // no comma -> asctime(3) format
1490  dt = QDateTime::fromString(QString::fromLatin1(value), Qt::TextDate);
1491  } else {
1492  // Use sscanf over QLocal/QDateTimeParser for speed reasons. See the
1493  // Qt WebKit performance benchmarks to get an idea.
1494  if (pos == 3) {
1495  char month_name[4];
1496  int day, year, hour, minute, second;
1497 #ifdef Q_CC_MSVC
1498  // Use secure version to avoid compiler warning
1499  if (sscanf_s(value.constData(), "%*3s, %d %3s %d %d:%d:%d 'GMT'", &day, month_name, 4, &year, &hour, &minute, &second) == 6)
1500 #else
1501  // The POSIX secure mode is %ms (which allocates memory), too bleeding edge for now
1502  // In any case this is already safe as field width is specified.
1503  if (sscanf(value.constData(), "%*3s, %d %3s %d %d:%d:%d 'GMT'", &day, month_name, &year, &hour, &minute, &second) == 6)
1504 #endif
1505  dt = QDateTime(QDate(year, name_to_month(month_name), day), QTime(hour, minute, second));
1506  } else {
1507  QLocale c = QLocale::c();
1508  // eat the weekday, the comma and the space following it
1509  QString sansWeekday = QString::fromLatin1(value.constData() + pos + 2);
1510  // must be RFC 850 date
1511  dt = c.toDateTime(sansWeekday, QLatin1String("dd-MMM-yy hh:mm:ss 'GMT'"));
1512  }
1513  }
1514 #endif // datestring
1515 
1516  if (dt.isValid())
1517  dt.setTimeSpec(Qt::UTC);
1518  return dt;
1519 }
1520 
1522 {
1523  return QLocale::c().toString(dt.toUTC(), u"ddd, dd MMM yyyy hh:mm:ss 'GMT'").toLatin1();
1524 }
1525 
small capitals from c petite p scientific f u
Definition: afcover.h:88
#define value
[5]
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:85
const char * constData() const noexcept
Definition: qbytearray.h:144
QList< QByteArray > split(char sep) const
int qstricmp(const char *str1, const char *str2)
Definition: qbytearray.cpp:260
char at(qsizetype i) const
Definition: qbytearray.h:505
bool isEmpty() const noexcept
Definition: qbytearray.h:129
int compare(QByteArrayView a, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
Definition: qbytearray.h:569
bool startsWith(QByteArrayView other) const noexcept
bool endsWith(QByteArrayView other) const noexcept
QByteArrayView trimmed() const noexcept
The QDate class provides date functions.
Definition: qdatetime.h:64
The QDateTime class provides date and time functions.
Definition: qdatetime.h:238
QDateTime toUTC() const
Definition: qdatetime.h:340
void setTimeSpec(Qt::TimeSpec spec)
Definition: qdatetime.cpp:3994
bool isValid() const
Definition: qdatetime.cpp:3741
bool remove(const Key &key)
Definition: qhash.h:911
bool contains(const Key &key) const noexcept
Definition: qhash.h:944
T value(const Key &key) const noexcept
Definition: qhash.h:997
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Definition: qhash.h:904
iterator insert(const Key &key, const T &value)
Definition: qhash.h:1228
The QHttp2Configuration class controls HTTP/2 parameters and settings.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
Definition: qstring.h:84
qsizetype size() const noexcept
Definition: qlist.h:414
bool isEmpty() const noexcept
Definition: qlist.h:418
const_iterator constBegin() const noexcept
Definition: qlist.h:630
qsizetype removeIf(Predicate pred)
Definition: qlist.h:602
qsizetype count() const noexcept
Definition: qlist.h:415
void append(parameter_type t)
Definition: qlist.h:469
const_iterator constEnd() const noexcept
Definition: qlist.h:631
const_iterator ConstIterator
Definition: qlist.h:280
static QLocale c()
Definition: qlocale.h:1134
QString toString(qlonglong i) const
Definition: qlocale.cpp:1981
RawHeadersList allRawHeaders() const
void setCookedHeader(QNetworkRequest::KnownHeaders header, const QVariant &value)
QPointer< QObject > originatingObject
QList< QByteArray > rawHeadersKeys() const
void setAllRawHeaders(const RawHeadersList &list)
void setRawHeader(const QByteArray &key, const QByteArray &value)
static QByteArray toHttpDate(const QDateTime &dt)
QPair< QByteArray, QByteArray > RawHeaderPair
RawHeadersList::ConstIterator findRawHeader(const QByteArray &key) const
CookedHeadersMap cookedHeaders
static QDateTime fromHttpDate(const QByteArray &value)
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
bool operator==(const QNetworkRequest &other) const
void setOriginatingObject(QObject *object)
void setSslConfiguration(const QSslConfiguration &configuration)
void setHeader(KnownHeaders header, const QVariant &value)
void setAttribute(Attribute code, const QVariant &value)
Priority priority() const
QVariant attribute(Attribute code, const QVariant &defaultValue=QVariant()) const
QVariant header(KnownHeaders header) const
void setRawHeader(const QByteArray &headerName, const QByteArray &value)
QObject * originatingObject() const
QNetworkRequest & operator=(QNetworkRequest &&other) noexcept
int maximumRedirectsAllowed() const
QList< QByteArray > rawHeaderList() const
void setPeerVerifyName(const QString &peerName)
bool hasRawHeader(const QByteArray &headerName) const
void setMaximumRedirectsAllowed(int maximumRedirectsAllowed)
void setUrl(const QUrl &url)
void setPriority(Priority priority)
QString peerVerifyName() const
QByteArray rawHeader(const QByteArray &headerName) const
QSslConfiguration sslConfiguration() const
QSslConfiguration * sslConfiguration
bool operator==(const QNetworkRequestPrivate &other) const
QNetworkRequest::Priority priority
static const int maxRedirectCount
QNetworkRequestPrivate(const QNetworkRequestPrivate &other)
The QObject class is the base class of all Qt objects.
Definition: qobject.h:125
T * data() const
Definition: qpointer.h:76
The QSharedData class is a base class for shared data objects. \reentrant.
Definition: qshareddata.h:55
The QSslConfiguration class holds the configuration and state of an SSL connection.
static QSslConfiguration defaultConfiguration()
The QString class provides a Unicode character string.
Definition: qstring.h:388
QByteArray toLatin1() const &
Definition: qstring.h:745
static QString fromLatin1(QByteArrayView ba)
Definition: qstring.cpp:5488
The QStringList class provides a list of strings.
The QTime class provides clock time functions.
Definition: qdatetime.h:166
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:130
@ StrictMode
Definition: qurl.h:134
static QUrl fromEncoded(const QByteArray &url, ParsingMode mode=TolerantMode)
Definition: qurl.cpp:3004
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:95
static auto fromValue(const T &value) -> std::enable_if_t< std::is_copy_constructible_v< T >, QVariant >
Definition: qvariant.h:391
struct config_s config
@ defaultSessionWindowSize
const qint32 maxSessionReceiveWindowSize((quint32(1)<< 31) - 1)
@ UTC
Definition: qnamespace.h:1261
@ TextDate
Definition: qnamespace.h:1253
@ CaseInsensitive
Definition: qnamespace.h:1283
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QByteArrayView trimmed(QByteArrayView s) noexcept
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld SRC pixld MASK if DST_R else pixld DST_R endif if
bool raw
Definition: property.cpp:47
QList< QString > QStringList
Definition: qcontainerfwd.h:64
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
long long qint64
Definition: qglobal.h:298
#define qWarning
Definition: qlogging.h:179
GLuint64 key
GLuint GLuint end
GLuint object
[3]
GLbitfield GLuint64 timeout
[4]
GLuint name
GLint first
const GLubyte * c
Definition: qopenglext.h:12701
GLuint64EXT * result
[6]
Definition: qopenglext.h:10932
#define Q_ASSERT(cond)
Definition: qrandom.cpp:84
#define QStringLiteral(str)
QUrl url("http://www.example.com/List of holidays.xml")
[0]
QObject::connect nullptr
QSharedPointer< T > other(t)
[5]
QHttpRequestHeader header("GET", QUrl::toPercentEncoding("/index.html"))
[1]
QStringList::Iterator it
QStringList list
[0]
Definition: inftrees.h:24