summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-04-17 10:53:44 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-04-17 10:53:44 (GMT)
commit160252d5d1facf2a53af1314836f22fb00784625 (patch)
treee1a6a0be850671e32af0306ffd8b0c4a780da720 /src/network
parentfd73185195633fd97228a0c832c247b761967598 (diff)
parentcfa04d53ff58d45d7811637c8be76099740d25c5 (diff)
downloadQt-160252d5d1facf2a53af1314836f22fb00784625.zip
Qt-160252d5d1facf2a53af1314836f22fb00784625.tar.gz
Qt-160252d5d1facf2a53af1314836f22fb00784625.tar.bz2
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts: tests/auto/qpainterpath/tst_qpainterpath.cpp
Diffstat (limited to 'src/network')
-rw-r--r--src/network/socket/qabstractsocket.cpp2
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp19
2 files changed, 3 insertions, 18 deletions
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index f8cf4ca..f9750f2 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -1263,7 +1263,7 @@ void QAbstractSocket::connectToHostImplementation(const QString &hostName, quint
(int) openMode);
#endif
- if (d->state == ConnectedState || d->state == ConnectingState) {
+ if (d->state == ConnectedState || d->state == ConnectingState || d->state == ClosingState) {
qWarning("QAbstractSocket::connectToHost() called when already connecting/connected to \"%s\"", qPrintable(hostName));
return;
}
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index 73f6f84..cc372a6 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -506,26 +506,11 @@ int QNativeSocketEnginePrivate::nativeAccept()
qint64 QNativeSocketEnginePrivate::nativeBytesAvailable() const
{
- /*
- Apparently, there is not consistency among different operating
- systems on how to use FIONREAD.
-
- FreeBSD, Linux and Solaris all expect the 3rd argument to
- ioctl() to be an int, which is normally 32-bit even on 64-bit
- machines.
-
- IRIX, on the other hand, expects a size_t, which is 64-bit on
- 64-bit machines.
-
- So, the solution is to use size_t initialized to zero to make
- sure all bits are set to zero, preventing underflow with the
- FreeBSD/Linux/Solaris ioctls.
- */
- size_t nbytes = 0;
+ int nbytes = 0;
// gives shorter than true amounts on Unix domain sockets.
qint64 available = 0;
if (::ioctl(socketDescriptor, FIONREAD, (char *) &nbytes) >= 0)
- available = (qint64) *((int *) &nbytes);
+ available = (qint64) nbytes;
#if defined (QNATIVESOCKETENGINE_DEBUG)
qDebug("QNativeSocketEnginePrivate::nativeBytesAvailable() == %lli", available);