Changeset 664


Ignore:
Timestamp:
Mar 10, 2010, 1:27:13 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib: Sockets: Don't call select() on a temporarily disabled socket.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/kernel/qeventdispatcher_pm.cpp

    r659 r664  
    443443                // add the socket back to the set
    444444                int sockfd = notifier->socket();
    445                 fd_set *set = instance->setForType(notifier->type());
    446                 FD_SET(sockfd, set);
     445                FD_SET(sockfd, instance->setForType(notifier->type()));
    447446                instance->updateMaxSockFd(sockfd, Add);
    448447                // inform the select thread that this socket may be included
     
    745744                for (Sockets::const_iterator it = sockets.constBegin();
    746745                      it != sockets.constEnd(); ++it) {
    747                     maxSockfd = qMax(toSocket(it.key()), maxSockfd);
     746                    int fd = toSocket(it.key());
     747                    if (FD_ISSET(fd, &readS) || FD_ISSET(fd, &writeS) ||
     748                        FD_ISSET(fd, &exS))
     749                        maxSockfd = qMax(fd, maxSockfd);
    748750                }
    749751            }
     
    812814                    }
    813815                    if (isSet) {
    814                         fd_set *set = setForType(type);
    815                         FD_CLR(sockfd, set);
     816                        FD_CLR(sockfd, setForType(type));
    816817                        updateMaxSockFd(sockfd, Remove);
    817818                        WinPostMsg(it.value().second, WM_U_SEM_SELECT, MPFROMLONG(it.key()), 0);
Note: See TracChangeset for help on using the changeset viewer.