Title: [254909] releases/WebKitGTK/webkit-2.26/Source/WebKit
- Revision
- 254909
- Author
- [email protected]
- Date
- 2020-01-22 02:42:20 -0800 (Wed, 22 Jan 2020)
Log Message
Merge r254119 - [SOUP] HSTS Support causes page loading to fail with "Operation was cancelled"
https://bugs.webkit.org/show_bug.cgi?id=203620
Reviewed by Michael Catanzaro.
The problem is that we are assuming that request cancellation happens synchronously, but it can happen that the
async ready callback for the previous request is called after the new one has started.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::sendRequestCallback): Return early if this is a previous request already cancelled.
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.26/Source/WebKit/ChangeLog (254908 => 254909)
--- releases/WebKitGTK/webkit-2.26/Source/WebKit/ChangeLog 2020-01-22 10:26:44 UTC (rev 254908)
+++ releases/WebKitGTK/webkit-2.26/Source/WebKit/ChangeLog 2020-01-22 10:42:20 UTC (rev 254909)
@@ -1,3 +1,16 @@
+2020-01-07 Carlos Garcia Campos <[email protected]>
+
+ [SOUP] HSTS Support causes page loading to fail with "Operation was cancelled"
+ https://bugs.webkit.org/show_bug.cgi?id=203620
+
+ Reviewed by Michael Catanzaro.
+
+ The problem is that we are assuming that request cancellation happens synchronously, but it can happen that the
+ async ready callback for the previous request is called after the new one has started.
+
+ * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
+ (WebKit::NetworkDataTaskSoup::sendRequestCallback): Return early if this is a previous request already cancelled.
+
2019-10-04 Ross Kirsling <[email protected]>
Unreviewed WinCairo build fix for r250717.
Modified: releases/WebKitGTK/webkit-2.26/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp (254908 => 254909)
--- releases/WebKitGTK/webkit-2.26/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp 2020-01-22 10:26:44 UTC (rev 254908)
+++ releases/WebKitGTK/webkit-2.26/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp 2020-01-22 10:42:20 UTC (rev 254909)
@@ -296,11 +296,22 @@
void NetworkDataTaskSoup::sendRequestCallback(SoupRequest* soupRequest, GAsyncResult* result, NetworkDataTaskSoup* task)
{
RefPtr<NetworkDataTaskSoup> protectedThis = adoptRef(task);
+ if (soupRequest != task->m_soupRequest.get()) {
+ // This can happen when the request is cancelled and a new one is started before
+ // the previous async operation completed. This is common when forcing a redirection
+ // due to HSTS. We can simply ignore this old request.
+#if !ASSERT_DISABLED
+ GUniqueOutPtr<GError> error;
+ GRefPtr<GInputStream> inputStream = adoptGRef(soup_request_send_finish(soupRequest, result, &error.outPtr()));
+ ASSERT(g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED));
+#endif
+ return;
+ }
+
if (task->state() == State::Canceling || task->state() == State::Completed || !task->m_client) {
task->clearRequest();
return;
}
- ASSERT(soupRequest == task->m_soupRequest.get());
if (task->state() == State::Suspended) {
ASSERT(!task->m_pendingResult);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes