summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-13 15:24:09 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-13 15:24:09 (GMT)
commitdf28c1203e12c572f795b8d114254a8e5a6619e8 (patch)
treecc8604b7c5b58d82124a38b6512ec5e084711ee6
parentee3ad7e774a959454eb3c367b40a8a4bdfab45bc (diff)
parent6d682ce861c72618022188fac61c9a5ebb1770b7 (diff)
downloadQt-df28c1203e12c572f795b8d114254a8e5a6619e8.zip
Qt-df28c1203e12c572f795b8d114254a8e5a6619e8.tar.gz
Qt-df28c1203e12c572f795b8d114254a8e5a6619e8.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Revert "Making network reconnect happen after teardown." Revert "Adding some error checking for setdefaultif" Fixed a possible hanging bug in the Symbian networking. Fixed a network hanging bug on Symbian.
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index c3e0808..2a52044 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -47,8 +47,6 @@
#include <unistd.h>
#include <errno.h>
-#include <net/if.h>
-
QT_BEGIN_NAMESPACE
#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
@@ -100,16 +98,19 @@ static inline int qt_socket_select(int nfds, fd_set *readfds, fd_set *writefds,
class QSelectMutexGrabber
{
public:
- QSelectMutexGrabber(int fd, QMutex *mutex)
+ QSelectMutexGrabber(int writeFd, int readFd, QMutex *mutex)
: m_mutex(mutex)
{
if (m_mutex->tryLock())
return;
char dummy = 0;
- qt_pipe_write(fd, &dummy, 1);
+ qt_pipe_write(writeFd, &dummy, 1);
m_mutex->lock();
+
+ char buffer;
+ while (::read(readFd, &buffer, 1) > 0) {}
}
~QSelectMutexGrabber()
@@ -403,10 +404,6 @@ void QSelectThread::run()
ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0);
savedSelectErrno = errno;
- char buffer;
-
- while (::read(m_pipeEnds[0], &buffer, 1) > 0) {}
-
if(ret == 0) {
// do nothing
} else if (ret < 0) {
@@ -481,7 +478,8 @@ void QSelectThread::run()
updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
}
- m_waitCond.wait(&m_mutex);
+ if (FD_ISSET(m_pipeEnds[0], &readfds))
+ m_waitCond.wait(&m_mutex);
}
m_mutex.unlock();
@@ -497,7 +495,7 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
Q_ASSERT(QThread::currentThread() == this->thread());
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+ QSelectMutexGrabber lock(m_pipeEnds[1], m_pipeEnds[0], &m_mutex);
Q_ASSERT(!m_AOStatuses.contains(notifier));
@@ -510,7 +508,7 @@ void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
{
Q_ASSERT(QThread::currentThread() == this->thread());
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+ QSelectMutexGrabber lock(m_pipeEnds[1], m_pipeEnds[0], &m_mutex);
m_AOStatuses.remove(notifier);
@@ -521,7 +519,7 @@ void QSelectThread::restart()
{
Q_ASSERT(QThread::currentThread() == this->thread());
- QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
+ QSelectMutexGrabber lock(m_pipeEnds[1], m_pipeEnds[0], &m_mutex);
m_waitCond.wakeAll();
}
@@ -577,17 +575,13 @@ void QSelectThread::updateActivatedNotifiers(QSocketNotifier::Type type, fd_set
* check if socket is in exception set
* then signal RequestComplete for it
*/
- qWarning("exception on %d [will do setdefaultif(0) - hack]", i.key()->socket());
+ qWarning("exception on %d [will close the socket handle - hack]", i.key()->socket());
// quick fix; there is a bug
// when doing read on socket
// errors not preoperly mapped
// after offline-ing the device
// on some devices we do get exception
- // close all exiting sockets
- // and reset default IAP
- if(::setdefaultif(0) != KErrNone) // well we can't do much about it
- qWarning("setdefaultif(0) failed");
-
+ ::close(i.key()->socket());
toRemove.append(i.key());
TRequestStatus *status = i.value();
QEventDispatcherSymbian::RequestComplete(d->threadData->symbian_thread_handle, status, KErrNone);