Changeset 279864 in webkit
- Timestamp:
- Jul 12, 2021, 9:39:26 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r279854 r279864 1 2021-07-12 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [curl] Can't finish loading some websites after r271946 started throttling low priority resources 4 https://bugs.webkit.org/show_bug.cgi?id=227863 5 6 Reviewed by Don Olmstead. 7 8 NetworkLoadScheduler started throttling low priority resource 9 loading since r271946. It uses curl_easy_pause to pause the 10 resource loads. CURLMOPT_MAX_HOST_CONNECTIONS is set to 6 to limit 11 the number of connections per host. In the certain condition, 12 curl_multi_fdset can constantly return -1 if 6 handles of the same 13 host are paused. 14 15 This patch changes CurlRequest::start not to actually start the 16 job if it is suspended. 17 18 * platform/network/curl/CurlRequest.cpp: 19 (WebCore::CurlRequest::start): 20 (WebCore::CurlRequest::suspend): 21 (WebCore::CurlRequest::resume): 22 (WebCore::CurlRequest::setupTransfer): 23 (WebCore::CurlRequest::setRequestPaused): 24 * platform/network/curl/CurlRequest.h: 25 1 26 2021-07-12 Tim Horton <timothy_horton@apple.com> 2 27 -
trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp
r278391 r279864 47 47 , m_messageQueue(WTFMove(messageQueue)) 48 48 , m_request(request.isolatedCopy()) 49 , m_s houldSuspend(shouldSuspend == ShouldSuspend::Yes)49 , m_startState(shouldSuspend == ShouldSuspend::Yes ? StartState::StartSuspended : StartState::WaitingForStart) 50 50 , m_enableMultipart(enableMultipart == EnableMultipart::Yes) 51 51 , m_formDataStream(m_request.httpBody()) … … 111 111 ASSERT(isMainThread()); 112 112 113 switch (m_startState) { 114 case StartState::DidStart: 115 ASSERT(false); 116 [[fallthrough]]; 117 case StartState::StartSuspended: 118 return; 119 } 120 121 m_startState = StartState::DidStart; 122 113 123 if (m_request.url().isLocalFile()) 114 124 invokeDidReceiveResponseForFile(m_request.url()); … … 142 152 didCancelTransfer(); 143 153 }); 144 } else 154 } else if (m_startState == StartState::DidStart) 145 155 scheduler.cancel(this); 146 156 … … 164 174 ASSERT(isMainThread()); 165 175 166 setRequestPaused(true); 176 switch (m_startState) { 177 case StartState::StartSuspended: 178 ASSERT(false); 179 [[fallthrough]]; 180 case StartState::WaitingForStart: 181 m_startState = StartState::StartSuspended; 182 break; 183 case StartState::DidStart: 184 setRequestPaused(true); 185 break; 186 } 167 187 } 168 188 … … 171 191 ASSERT(isMainThread()); 172 192 173 setRequestPaused(false); 193 switch (m_startState) { 194 case StartState::WaitingForStart: 195 ASSERT(false); 196 [[fallthrough]]; 197 case StartState::StartSuspended: 198 m_startState = StartState::WaitingForStart; 199 start(); 200 break; 201 case StartState::DidStart: 202 setRequestPaused(false); 203 break; 204 } 174 205 } 175 206 … … 239 270 m_curlHandle->setTimeout(timeoutInterval()); 240 271 241 if (m_shouldSuspend)242 setRequestPaused(true);243 244 272 m_performStartTime = MonotonicTime::now(); 245 273 … … 644 672 645 673 auto savedState = shouldBePaused(); 646 m_ shouldSuspend = m_isPausedOfRequest = paused;674 m_isPausedOfRequest = paused; 647 675 if (shouldBePaused() == savedState) 648 676 return; -
trunk/Source/WebCore/platform/network/curl/CurlRequest.h
r278391 r279864 176 176 unsigned long m_authType { CURLAUTH_ANY }; 177 177 bool m_shouldDisableServerTrustEvaluation { false }; 178 bool m_shouldSuspend { false };179 178 bool m_enableMultipart { false }; 180 179 180 enum class StartState : uint8_t { StartSuspended, WaitingForStart, DidStart }; 181 StartState m_startState; 182 181 183 std::unique_ptr<CurlHandle> m_curlHandle; 182 184 CurlFormDataStream m_formDataStream;
Note:
See TracChangeset
for help on using the changeset viewer.