diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-04-11 10:48:44 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-04-11 10:48:44 (GMT) |
commit | 1062da14facb7dd10f0928a4c242549d3626f9ba (patch) | |
tree | 4462fcaa82b45c47eddcdcb1d89e1cc03de45a85 /src/network/socket | |
parent | 847df81a5680fe4d71196d0afe5e68e41ae49700 (diff) | |
parent | dd60cf7ba8afdf5c84f5793c1e1d08ab18303a74 (diff) | |
download | Qt-1062da14facb7dd10f0928a4c242549d3626f9ba.zip Qt-1062da14facb7dd10f0928a4c242549d3626f9ba.tar.gz Qt-1062da14facb7dd10f0928a4c242549d3626f9ba.tar.bz2 |
Merge branch 'master' of scm.dev.troll.no:qt/qt-earth-team into symbian-socket-engine
Conflicts:
src/s60installs/bwins/QtCoreu.def
src/s60installs/bwins/QtGuiu.def
src/s60installs/bwins/QtNetworku.def
src/s60installs/eabi/QtCoreu.def
src/s60installs/eabi/QtGuiu.def
src/s60installs/eabi/QtNetworku.def
src/s60installs/eabi/QtOpenVGu.def
tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
Diffstat (limited to 'src/network/socket')
-rw-r--r-- | src/network/socket/qabstractsocketengine_p.h | 6 | ||||
-rw-r--r-- | src/network/socket/qhttpsocketengine.cpp | 2 | ||||
-rw-r--r-- | src/network/socket/qhttpsocketengine_p.h | 2 | ||||
-rw-r--r-- | src/network/socket/qlocalsocket_win.cpp | 10 | ||||
-rw-r--r-- | src/network/socket/qnativesocketengine.cpp | 5 | ||||
-rw-r--r-- | src/network/socket/qnativesocketengine_p.h | 6 | ||||
-rw-r--r-- | src/network/socket/qnativesocketengine_unix.cpp | 3 | ||||
-rw-r--r-- | src/network/socket/qsocks5socketengine.cpp | 2 | ||||
-rw-r--r-- | src/network/socket/qsocks5socketengine_p.h | 2 | ||||
-rw-r--r-- | src/network/socket/qudpsocket.cpp | 4 | ||||
-rw-r--r-- | src/network/socket/qudpsocket.h | 2 |
11 files changed, 42 insertions, 2 deletions
diff --git a/src/network/socket/qabstractsocketengine_p.h b/src/network/socket/qabstractsocketengine_p.h index c00b6d7..ee6dad6 100644 --- a/src/network/socket/qabstractsocketengine_p.h +++ b/src/network/socket/qabstractsocketengine_p.h @@ -61,7 +61,9 @@ QT_BEGIN_NAMESPACE class QAuthenticator; class QAbstractSocketEnginePrivate; +#ifndef QT_NO_NETWORKINTERFACE class QNetworkInterface; +#endif class QNetworkProxy; class QAbstractSocketEngineReceiver { @@ -121,12 +123,14 @@ public: virtual qint64 write(const char *data, qint64 len) = 0; #ifndef QT_NO_UDPSOCKET +#ifndef QT_NO_NETWORKINTERFACE virtual bool joinMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface) = 0; virtual bool leaveMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface) = 0; virtual QNetworkInterface multicastInterface() const = 0; virtual bool setMulticastInterface(const QNetworkInterface &iface) = 0; +#endif // QT_NO_NETWORKINTERFACE virtual qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *addr = 0, quint16 *port = 0) = 0; @@ -134,7 +138,7 @@ public: quint16 port) = 0; virtual bool hasPendingDatagrams() const = 0; virtual qint64 pendingDatagramSize() const = 0; -#endif +#endif // QT_NO_UDPSOCKET virtual qint64 bytesToWrite() const = 0; diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index c580b03..7846056 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -243,6 +243,7 @@ qint64 QHttpSocketEngine::write(const char *data, qint64 len) } #ifndef QT_NO_UDPSOCKET +#ifndef QT_NO_NETWORKINTERFACE bool QHttpSocketEngine::joinMulticastGroup(const QHostAddress &, const QNetworkInterface &) { @@ -270,6 +271,7 @@ bool QHttpSocketEngine::setMulticastInterface(const QNetworkInterface &) QLatin1String("Operation on socket is not supported")); return false; } +#endif // QT_NO_NETWORKINTERFACE qint64 QHttpSocketEngine::readDatagram(char *, qint64, QHostAddress *, quint16 *) diff --git a/src/network/socket/qhttpsocketengine_p.h b/src/network/socket/qhttpsocketengine_p.h index 2ecd708..361ef5c 100644 --- a/src/network/socket/qhttpsocketengine_p.h +++ b/src/network/socket/qhttpsocketengine_p.h @@ -102,12 +102,14 @@ public: qint64 write(const char *data, qint64 len); #ifndef QT_NO_UDPSOCKET +#ifndef QT_NO_NETWORKINTERFACE bool joinMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &interface); bool leaveMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &interface); QNetworkInterface multicastInterface() const; bool setMulticastInterface(const QNetworkInterface &iface); +#endif // QT_NO_NETWORKINTERFACE qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *addr = 0, quint16 *port = 0); diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index 7bbe275..14f5af8 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -79,6 +79,11 @@ void QLocalSocketPrivate::setErrorString(const QString &function) errorString = QLocalSocket::tr("%1: Invalid name").arg(function); state = QLocalSocket::UnconnectedState; break; + case ERROR_ACCESS_DENIED: + error = QLocalSocket::SocketAccessError; + errorString = QLocalSocket::tr("%1: Access denied").arg(function); + state = QLocalSocket::UnconnectedState; + break; default: error = QLocalSocket::UnknownSocketError; errorString = QLocalSocket::tr("%1: Unknown error %2").arg(function).arg(windowsError); @@ -348,6 +353,11 @@ qint64 QLocalSocket::writeData(const char *data, qint64 maxSize) void QLocalSocket::abort() { + Q_D(QLocalSocket); + if (d->pipeWriter) { + delete d->pipeWriter; + d->pipeWriter = 0; + } close(); } diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index efa4f6f..f5a88e2 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -646,6 +646,8 @@ int QNativeSocketEngine::accept() return d->nativeAccept(); } +#ifndef QT_NO_NETWORKINTERFACE + /*! \since 4.8 */ @@ -681,7 +683,6 @@ QNetworkInterface QNativeSocketEngine::multicastInterface() const return d->nativeMulticastInterface(); } - /*! \since 4.8 */ bool QNativeSocketEngine::setMulticastInterface(const QNetworkInterface &iface) { @@ -691,6 +692,8 @@ bool QNativeSocketEngine::setMulticastInterface(const QNetworkInterface &iface) return d->nativeSetMulticastInterface(iface); } +#endif // QT_NO_NETWORKINTERFACE + /*! Returns the number of bytes that are currently available for reading. On error, -1 is returned. diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h index a186911..35054fb 100644 --- a/src/network/socket/qnativesocketengine_p.h +++ b/src/network/socket/qnativesocketengine_p.h @@ -96,7 +96,9 @@ union qt_sockaddr { }; class QNativeSocketEnginePrivate; +#ifndef QT_NO_NETWORKINTERFACE class QNetworkInterface; +#endif class Q_AUTOTEST_EXPORT QNativeSocketEngine : public QAbstractSocketEngine { @@ -119,12 +121,14 @@ public: int accept(); void close(); +#ifndef QT_NO_NETWORKINTERFACE bool joinMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface); bool leaveMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface); QNetworkInterface multicastInterface() const; bool setMulticastInterface(const QNetworkInterface &iface); +#endif qint64 bytesAvailable() const; @@ -240,12 +244,14 @@ public: bool nativeBind(const QHostAddress &address, quint16 port); bool nativeListen(int backlog); int nativeAccept(); +#ifndef QT_NO_NETWORKINTERFACE bool nativeJoinMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface); bool nativeLeaveMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface); QNetworkInterface nativeMulticastInterface() const; bool nativeSetMulticastInterface(const QNetworkInterface &iface); +#endif qint64 nativeBytesAvailable() const; bool nativeHasPendingDatagrams() const; diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index 3d850a1..4318427 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -591,6 +591,7 @@ int QNativeSocketEnginePrivate::nativeAccept() return acceptedDescriptor; } +#ifndef QT_NO_NETWORKINTERFACE static bool multicastMembershipHelper(QNativeSocketEnginePrivate *d, int how6, @@ -756,6 +757,8 @@ bool QNativeSocketEnginePrivate::nativeSetMulticastInterface(const QNetworkInter return (::setsockopt(socketDescriptor, IPPROTO_IP, IP_MULTICAST_IF, &v, sizeof(v)) != -1); } +#endif // QT_NO_NETWORKINTERFACE + qint64 QNativeSocketEnginePrivate::nativeBytesAvailable() const { int nbytes = 0; diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp index 16c0faa..c365635 100644 --- a/src/network/socket/qsocks5socketengine.cpp +++ b/src/network/socket/qsocks5socketengine.cpp @@ -1554,6 +1554,7 @@ qint64 QSocks5SocketEngine::write(const char *data, qint64 len) } #ifndef QT_NO_UDPSOCKET +#ifndef QT_NO_NETWORKINTERFACE bool QSocks5SocketEngine::joinMulticastGroup(const QHostAddress &, const QNetworkInterface &) { @@ -1582,6 +1583,7 @@ bool QSocks5SocketEngine::setMulticastInterface(const QNetworkInterface &) QLatin1String("Operation on socket is not supported")); return false; } +#endif // QT_NO_NETWORKINTERFACE qint64 QSocks5SocketEngine::readDatagram(char *data, qint64 maxlen, QHostAddress *addr, quint16 *port) diff --git a/src/network/socket/qsocks5socketengine_p.h b/src/network/socket/qsocks5socketengine_p.h index b85fd62..9492d45 100644 --- a/src/network/socket/qsocks5socketengine_p.h +++ b/src/network/socket/qsocks5socketengine_p.h @@ -92,12 +92,14 @@ public: qint64 write(const char *data, qint64 len); #ifndef QT_NO_UDPSOCKET +#ifndef QT_NO_NETWORKINTERFACE bool joinMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &interface); bool leaveMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &interface); QNetworkInterface multicastInterface() const; bool setMulticastInterface(const QNetworkInterface &iface); +#endif // QT_NO_NETWORKINTERFACE qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *addr = 0, quint16 *port = 0); diff --git a/src/network/socket/qudpsocket.cpp b/src/network/socket/qudpsocket.cpp index dc473c6..f8bcd1b 100644 --- a/src/network/socket/qudpsocket.cpp +++ b/src/network/socket/qudpsocket.cpp @@ -338,6 +338,8 @@ bool QUdpSocket::bind(quint16 port, BindMode mode) return bind(QHostAddress::Any, port, mode); } +#ifndef QT_NO_NETWORKINTERFACE + /*! \since 4.8 @@ -444,6 +446,8 @@ void QUdpSocket::setMulticastInterface(const QNetworkInterface &iface) d->socketEngine->setMulticastInterface(iface); } +#endif // QT_NO_NETWORKINTERFACE + /*! Returns true if at least one datagram is waiting to be read; otherwise returns false. diff --git a/src/network/socket/qudpsocket.h b/src/network/socket/qudpsocket.h index 82266cb..7502349 100644 --- a/src/network/socket/qudpsocket.h +++ b/src/network/socket/qudpsocket.h @@ -77,6 +77,7 @@ public: bool bind(quint16 port, BindMode mode); // ### Qt 5: Merge the bind functions +#ifndef QT_NO_NETWORKINTERFACE bool joinMulticastGroup(const QHostAddress &groupAddress); bool joinMulticastGroup(const QHostAddress &groupAddress, const QNetworkInterface &iface); @@ -86,6 +87,7 @@ public: QNetworkInterface multicastInterface() const; void setMulticastInterface(const QNetworkInterface &iface); +#endif bool hasPendingDatagrams() const; qint64 pendingDatagramSize() const; |