Changeset 561 for trunk/src/network/socket/qsocks5socketengine.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/socket/qsocks5socketengine.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 ** … … 60 60 QT_BEGIN_NAMESPACE 61 61 62 63 64 62 65 static const int MaxWriteBufferSize = 128*1024; 66 63 67 64 68 //#define QSOCKS5SOCKETLAYER_DEBUG … … 154 158 static bool qt_socks5_set_host_address_and_port(const QHostAddress &address, quint16 port, QByteArray *pBuf) 155 159 { 156 QSOCKS5_DEBUG << "setting [" << address << ":" << port << "]";160 QSOCKS5_DEBUG << "setting [" << address << ; 157 161 158 162 union { … … 187 191 static bool qt_socks5_set_host_name_and_port(const QString &hostname, quint16 port, QByteArray *pBuf) 188 192 { 189 QSOCKS5_DEBUG << "setting [" << hostname << ":" << port << "]";193 QSOCKS5_DEBUG << "setting [" << hostname << ; 190 194 191 195 QByteArray encodedHostName = QUrl::toAce(hostname); … … 266 270 267 271 if (ret) { 268 QSOCKS5_DEBUG << "got [" << address << ":" << port << "]";272 QSOCKS5_DEBUG << "got [" << address << ; 269 273 *pAddress = address; 270 274 *pPort = port; … … 1125 1129 { 1126 1130 Q_D(QSocks5SocketEngine); 1127 QSOCKS5_DEBUG << "connectToHost" << address << ":"<< port;1131 QSOCKS5_DEBUG << "connectToHost" << address << << port; 1128 1132 1129 1133 setPeerAddress(address); … … 1232 1236 connectData->readBuffer.clear(); 1233 1237 emitReadNotification(); 1238 1239 1240 1234 1241 } else if (socks5State == Uninitialized 1235 1242 || socks5State == AuthenticationMethodsSent … … 1242 1249 q_func()->setError(data->controlSocket->error(), data->controlSocket->errorString()); 1243 1250 emitReadNotification(); 1251 1244 1252 } 1245 1253 } … … 1380 1388 return false; 1381 1389 } 1382 QSOCKS5_DEBUG << "udp actual address and port" << d->localAddress << ":"<< d->localPort;1390 QSOCKS5_DEBUG << "udp actual address and port" << d->localAddress << << d->localPort; 1383 1391 return true; 1384 1392 #endif // QT_NO_UDPSOCKET … … 1479 1487 { 1480 1488 Q_D(QSocks5SocketEngine); 1481 QSOCKS5_Q_DEBUG << "read( , maxlen = " << maxlen << ")";1489 QSOCKS5_Q_DEBUG << "read( , maxlen = " << maxlen << ; 1482 1490 if (d->mode == QSocks5SocketEnginePrivate::ConnectMode) { 1483 1491 if (d->connectData->readBuffer.size() == 0) { … … 1620 1628 #endif // QT_NO_UDPSOCKET 1621 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1622 1640 int QSocks5SocketEngine::option(SocketOption option) const 1623 1641 { 1624 Q_UNUSED(option); 1642 Q_D(const QSocks5SocketEngine); 1643 if (d->data && d->data->controlSocket) { 1644 // convert the enum and call the real socket 1645 if (option == QAbstractSocketEngine::LowDelayOption) 1646 return d->data->controlSocket->socketOption(QAbstractSocket::LowDelayOption).toInt(); 1647 if (option == QAbstractSocketEngine::KeepAliveOption) 1648 return d->data->controlSocket->socketOption(QAbstractSocket::KeepAliveOption).toInt(); 1649 } 1625 1650 return -1; 1626 1651 } … … 1628 1653 bool QSocks5SocketEngine::setOption(SocketOption option, int value) 1629 1654 { 1630 Q_UNUSED(option); 1631 Q_UNUSED(value); 1655 Q_D(QSocks5SocketEngine); 1656 if (d->data && d->data->controlSocket) { 1657 // convert the enum and call the real socket 1658 if (option == QAbstractSocketEngine::LowDelayOption) 1659 d->data->controlSocket->setSocketOption(QAbstractSocket::LowDelayOption, value); 1660 if (option == QAbstractSocketEngine::KeepAliveOption) 1661 d->data->controlSocket->setSocketOption(QAbstractSocket::KeepAliveOption, value); 1662 return true; 1663 } 1632 1664 return false; 1633 1665 } … … 1767 1799 Q_D(QSocks5SocketEngine); 1768 1800 1769 QSOCKS5_Q_DEBUG << "setReadNotificationEnabled(" << enable << ")";1801 QSOCKS5_Q_DEBUG << "setReadNotificationEnabled(" << enable << ; 1770 1802 1771 1803 bool emitSignal = false; … … 1831 1863 return 0; 1832 1864 } 1833 QS ocks5SocketEngine *engine = new QSocks5SocketEngine(parent);1865 QS); 1834 1866 engine->setProxy(proxy); 1835 return engine ;1867 return engine; 1836 1868 } 1837 1869
Note:
See TracChangeset
for help on using the changeset viewer.