Title: [279576] trunk/Source/WebCore
Revision
279576
Author
[email protected]
Date
2021-07-06 00:48:10 -0700 (Tue, 06 Jul 2021)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (279575 => 279576)


--- trunk/Source/WebCore/ChangeLog	2021-07-06 07:44:20 UTC (rev 279575)
+++ trunk/Source/WebCore/ChangeLog	2021-07-06 07:48:10 UTC (rev 279576)
@@ -1,5 +1,26 @@
 2021-07-06  Fujii Hironori  <[email protected]>
 
+        [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.
+
+2021-07-06  Fujii Hironori  <[email protected]>
+
         [curl][Win] wss: WebSocket doesn't work since r271170
         https://bugs.webkit.org/show_bug.cgi?id=227694
 

Modified: trunk/Source/WebCore/platform/network/curl/CurlStream.cpp (279575 => 279576)


--- trunk/Source/WebCore/platform/network/curl/CurlStream.cpp	2021-07-06 07:44:20 UTC (rev 279575)
+++ trunk/Source/WebCore/platform/network/curl/CurlStream.cpp	2021-07-06 07:48:10 UTC (rev 279576)
@@ -100,7 +100,7 @@
     if (m_sendBuffers.size())
         FD_SET(*socket, &writefds);
 
-    if (maxfd < *socket)
+    if (maxfd < static_cast<int>(*socket))
         maxfd = *socket;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to