Changeset 28709 in webkit
- Timestamp:
- Dec 13, 2007 7:37:49 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r28708 r28709 1 2007-12-13 Alp Toker <alp@atoker.com> 2 3 Reviewed by Oliver Hunt. 4 5 http://bugs.webkit.org/show_bug.cgi?id=16365 6 [cURL] Acid2 test segmentation fault 7 8 This patch makes the Acid2 test pass. 9 10 Defer the cleanup of cancelled jobs and halt further transfer as early 11 as possible. 12 13 Bug found by and initial patch provided by Luca Bruno. 14 15 * platform/network/curl/ResourceHandleManager.cpp: 16 (WebCore::writeCallback): 17 (WebCore::headerCallback): 18 (WebCore::ResourceHandleManager::downloadTimerCallback): 19 (WebCore::ResourceHandleManager::cancel): 20 1 21 2007-12-13 Sam Weinig <sam@webkit.org> 2 22 -
trunk/WebCore/platform/network/curl/ResourceHandleManager.cpp
r28643 r28709 85 85 ResourceHandle* job = static_cast<ResourceHandle*>(data); 86 86 ResourceHandleInternal* d = job->getInternal(); 87 int totalSize = size * nmemb; 87 if (d->m_cancelled) 88 return 0; 89 size_t totalSize = size * nmemb; 88 90 89 91 // this shouldn't be necessary but apparently is. CURL writes the data … … 128 130 ResourceHandle* job = static_cast<ResourceHandle*>(data); 129 131 ResourceHandleInternal* d = job->getInternal(); 130 131 unsigned int totalSize = size * nmemb; 132 if (d->m_cancelled) 133 return 0; 134 size_t totalSize = size * nmemb; 132 135 ResourceHandleClient* client = d->client(); 133 136 … … 227 230 if (!msg) 228 231 break; 229 230 if (CURLMSG_DONE != msg->msg)231 continue;232 232 233 233 // find the node which has same d->m_handle as completed transfer … … 242 242 ResourceHandleInternal* d = job->getInternal(); 243 243 ASSERT(d->m_handle == handle); 244 245 if (d->m_cancelled) { 246 removeFromCurl(job); 247 continue; 248 } 249 250 if (CURLMSG_DONE != msg->msg) 251 continue; 252 244 253 if (CURLE_OK == msg->data.result) { 245 254 if (d->client()) … … 503 512 if (removeScheduledJob(job)) 504 513 return; 505 removeFromCurl(job); 514 ResourceHandleInternal* d = job->getInternal(); 515 d->m_cancelled = true; 516 if (!m_downloadTimer.isActive()) 517 m_downloadTimer.startOneShot(pollTimeSeconds); 506 518 } 507 519
Note: See TracChangeset
for help on using the changeset viewer.