From e6485b618cc8126d361e41c8a2c7862f604498cc Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 6 May 2009 15:23:59 +0300 Subject: Added some debug information for nativeSelect in Symbian OS --- src/network/socket/qnativesocketengine_unix.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index 0e0980c..e000e11 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -913,8 +913,8 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool selectForRead) co #ifdef Q_OS_SYMBIAN bool selectForExec = FD_ISSET(socketDescriptor, &fdexec); if(selectForExec) { - qWarning("nativeSelect (selectForRead %d, retVal %d) Unexpected expectfds ready in fd %d", - selectForRead, retval, socketDescriptor); + qWarning("nativeSelect (selectForRead %d, retVal %d, errno %d) Unexpected expectfds ready in fd %d", + selectForRead, retval, errno, socketDescriptor); } #endif @@ -973,12 +973,16 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool c ret = qt_socket_select(socketDescriptor + 1, &fdread, &fdwrite, &fdexec, timeout < 0 ? 0 : &tv); bool selectForExec = FD_ISSET(socketDescriptor, &fdexec); if(selectForExec) { - qWarning("nativeSelect (checkRead %d, checkWrite %d, ret %d): Unexpected expectfds ready in fd %d", - checkRead, checkWrite, ret, socketDescriptor); - if(checkRead) + qWarning("nativeSelect (checkRead %d, checkWrite %d, ret %d, errno %d): Unexpected expectfds ready in fd %d", + checkRead, checkWrite, ret, errno, socketDescriptor); + if (checkRead) FD_SET(socketDescriptor, &fdread); - if(checkWrite) + if (checkWrite) FD_SET(socketDescriptor, &fdwrite); + + if ((ret == -1) && ( errno == ECONNREFUSED || errno == EPIPE )) + ret = 1; + } #endif if (ret != -1 || errno != EINTR) { -- cgit v0.12