Changeset 30121 in webkit


Ignore:
Timestamp:
Feb 10, 2008, 11:02:43 AM (18 years ago)
Author:
kevino@webkit.org
Message:

Don't call select() for CURL when there are no valid file descriptors.
http://bugs.webkit.org/show_bug.cgi?id=17178

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r30117 r30121  
     12008-02-09  Kevin Ollivier  <kevino@theolliviers.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Calling select() when all the file descriptors are NULL
     6        stops the file download on Windows. As a result, do not
     7        call select() when there are no valid descriptors.
     8
     9        http://bugs.webkit.org/show_bug.cgi?id=17178
     10
     11        * platform/network/curl/ResourceHandleManager.cpp:
     12        (WebCore::ResourceHandleManager::downloadTimerCallback):
     13
    1142008-02-09  Dan Bernstein  <mitz@apple.com>
    215
  • trunk/WebCore/platform/network/curl/ResourceHandleManager.cpp

    r30076 r30121  
    272272    // Temporarily disable timers since signals may interrupt select(), raising EINTR errors on some platforms
    273273    setDeferringTimers(true);
    274     int rc;
     274    int rc = 0;
    275275    do {
    276276        FD_ZERO(&fdread);
     
    278278        FD_ZERO(&fdexcep);
    279279        curl_multi_fdset(m_curlMultiHandle, &fdread, &fdwrite, &fdexcep, &maxfd);
    280         rc = ::select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
     280        // When the 3 file descriptors are empty, winsock will return -1
     281        // and bail out, stopping the file download. So make sure we
     282        // have valid file descriptors before calling select.
     283        if (maxfd >= 0)
     284            rc = ::select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
    281285    } while (rc == -1 && errno == EINTR);
    282286    setDeferringTimers(false);
Note: See TracChangeset for help on using the changeset viewer.