Changeset 279576 in webkit


Ignore:
Timestamp:
Jul 6, 2021, 12:48:10 AM (4 years ago)
Author:
Fujii Hironori
Message:

[curl][Win] very high CPU load on page with WebSocket
https://bugs.webkit.org/show_bug.cgi?id=227428
<rdar://problem/80150503>

Reviewed by Don Olmstead.

curl_socket_t is UINT_PTR on Windows while it is int on other
platforms. CurlStream::appendMonitoringFd was failing to update
maxfd because the following condition can't be true on Windows.

if (maxfd < *socket)

maxfd = *socket;

As the result, ::select was not called, and CurlStreamScheduler's
thread ran busy.

  • platform/network/curl/CurlStream.cpp:

(WebCore::CurlStream::appendMonitoringFd): Added static_cast.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r279575 r279576  
     12021-07-06  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [curl][Win] very high CPU load on page with WebSocket
     4        https://bugs.webkit.org/show_bug.cgi?id=227428
     5        <rdar://problem/80150503>
     6
     7        Reviewed by Don Olmstead.
     8
     9        curl_socket_t is UINT_PTR on Windows while it is int on other
     10        platforms. CurlStream::appendMonitoringFd was failing to update
     11        `maxfd` because the following condition can't be true on Windows.
     12
     13        > if (maxfd < *socket)
     14        >     maxfd = *socket;
     15
     16        As the result, ::select was not called, and CurlStreamScheduler's
     17        thread ran busy.
     18
     19        * platform/network/curl/CurlStream.cpp:
     20        (WebCore::CurlStream::appendMonitoringFd): Added static_cast.
     21
    1222021-07-06  Fujii Hironori  <Hironori.Fujii@sony.com>
    223
  • trunk/Source/WebCore/platform/network/curl/CurlStream.cpp

    r278532 r279576  
    101101        FD_SET(*socket, &writefds);
    102102
    103     if (maxfd < *socket)
     103    if (maxfd < static_cast<int>(*socket))
    104104        maxfd = *socket;
    105105}
Note: See TracChangeset for help on using the changeset viewer.