Changeset 561 for trunk/src/network/kernel/qnetworkproxy.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/network/kernel/qnetworkproxy.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtNetwork module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 49 49 50 50 \reentrant 51 \ingroup io51 \ingroup 52 52 \inmodule QtNetwork 53 53 … … 55 55 proxy support to the Qt network classes. The currently supported 56 56 classes are QAbstractSocket, QTcpSocket, QUdpSocket, QTcpServer, 57 Q Http and QFtp. The proxy support is designed to be as transparent58 as possible. This means that existing network-enabled applications59 that you have written should automatically support network proxy60 using the following code.57 Q 58 59 60 using the following code. 61 61 62 62 \snippet doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp 0 … … 87 87 The supported authentication methods are no authentication and 88 88 username/password authentication. Both IPv4 and IPv6 are 89 supported, but domain name resolution via the SOCKS server is not 90 supported; i.e. all domain names are resolved locally. There are 91 several things to remember when using SOCKS5 with QUdpSocket and 92 QTcpServer: 89 supported. Domain names are resolved through the SOCKS5 server if 90 the QNetworkProxy::HostNameLookupCapability is enabled, otherwise 91 they are resolved locally and the IP address is sent to the 92 server. There are several things to remember when using SOCKS5 93 with QUdpSocket and QTcpServer: 93 94 94 95 With QUdpSocket, a call to \l {QUdpSocket::bind()}{bind()} may fail … … 160 161 \o Caching-only HTTP 161 162 \o Implemented using normal HTTP commands, it is useful only 162 in the context of HTTP requests (see QHttp, 163 QNetworkAccessManager) 163 in the context of HTTP requests (see QNetworkAccessManager) 164 164 \o CachingCapability, HostNameLookupCapability 165 165 … … 221 221 #ifndef QT_NO_NETWORKPROXY 222 222 223 223 224 #include "private/qsocks5socketengine_p.h" 224 225 #include "private/qhttpsocketengine_p.h" … … 324 325 } 325 326 326 Q_GLOBAL_STATIC(QGlobalNetworkProxy, globalNetworkProxy) ;327 Q_GLOBAL_STATIC(QGlobalNetworkProxy, globalNetworkProxy) 327 328 328 329 namespace { … … 366 367 }; 367 368 368 Q_ASSERT(int(type) >= 0 && int(type) <= int(QNetworkProxy::FtpCachingProxy)); 369 if (int(type) < 0 || int(type) > int(QNetworkProxy::FtpCachingProxy)) 370 type = QNetworkProxy::DefaultProxy; 369 371 return QNetworkProxy::Capabilities(defaults[int(type)]); 370 372 } … … 379 381 quint16 port; 380 382 QNetworkProxy::ProxyType type; 383 381 384 382 385 inline QNetworkProxyPrivate(QNetworkProxy::ProxyType t = QNetworkProxy::DefaultProxy, … … 388 391 capabilities(defaultCapabilitiesForType(t)), 389 392 port(p), 390 type(t) 393 type(t), 394 capabilitiesSet(false) 391 395 { } 392 396 … … 491 495 492 496 Note that changing the type of a proxy does not change 493 the set of capabilities this QNetworkProxy object holds. 497 the set of capabilities this QNetworkProxy object holds if any 498 capabilities have been set with setCapabilities(). 494 499 495 500 \sa type(), setCapabilities() … … 498 503 { 499 504 d->type = type; 505 506 500 507 } 501 508 … … 520 527 { 521 528 d->capabilities = capabilities; 529 522 530 } 523 531 … … 1112 1120 \since 4.5 1113 1121 1114 \ingroup io1122 \ingroup 1115 1123 \inmodule QtNetwork 1116 1124 … … 1148 1156 QNetworkProxyFactory::~QNetworkProxyFactory() 1149 1157 { 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1150 1181 } 1151 1182 … … 1251 1282 } 1252 1283 1284 1285 1253 1286 #endif // QT_NO_NETWORKPROXY 1254 1255 QT_END_NAMESPACE
Note:
See TracChangeset
for help on using the changeset viewer.