Bug 230818

Summary: [Curl] Set CURL_LOCK_DATA_SSL_SESSION option to reduce SSL/TLS handshake time
Product: WebKit Reporter: Takashi Komori <takashi.komori>
Component: PlatformAssignee: Takashi Komori <takashi.komori>
Status: RESOLVED FIXED    
Severity: Normal CC: Basuke.Suzuki, chris.reid, don.olmstead, ews-watchlist, galpeter, Hironori.Fujii, ross.kirsling, stephan.szabo, takashi.komori, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Takashi Komori 2021-09-26 23:16:26 PDT
By setting CURL_LOCK_DATA_SSL_SESSION option, libcurl uses the same Session ID when another connection connects the same server.
It reduces SSL/TLS handshake time.

https://curl.se/libcurl/c/curl_share_setopt.html
Comment 1 Takashi Komori 2021-09-26 23:27:26 PDT
Created attachment 439320 [details]
Patch
Comment 2 Fujii Hironori 2021-09-27 00:34:22 PDT
Comment on attachment 439320 [details]
Patch

LGTM
Comment 3 EWS 2021-09-27 14:28:25 PDT
Committed r283136 (242193@main): <https://commits.webkit.org/242193@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439320 [details].
Comment 4 Radar WebKit Bug Importer 2021-09-27 14:29:17 PDT
<rdar://problem/83591509>
Comment 5 Fujii Hironori 2021-09-28 06:15:50 PDT
WinCairo-64-bit-WKL-Debug-Tests is crashing. Reopened.

https://build.webkit.org/#/builders/32/builds/1031

SHOULD NEVER BE REACHED
..\..\Source\WebCore\platform\network\curl\CurlContext.cpp(211) : WebCore::CurlShareHandle::mutexFor

Regressions: Unexpected crashes (34)
  http/tests/IndexedDB/collect-IDB-objects.https.html [ Crash ]
  http/tests/IndexedDB/storage-limit-1.https.html [ Crash ]
  http/tests/IndexedDB/storage-limit-2.https.html [ Crash ]
  http/tests/IndexedDB/storage-limit.https.html [ Crash ]
  http/tests/eventloop/documents-with-different-protocols-do-not-share-event-loop.html [ Crash ]
  http/tests/misc/dns-prefetch-control.html [ Crash ]
  http/tests/misc/webtiming-ssl.py [ Crash ]
[...]
Comment 6 Fujii Hironori 2021-09-28 06:21:31 PDT
Committed r283166 (242214@main): <https://commits.webkit.org/242214@main>
Comment 7 Fujii Hironori 2021-09-28 06:22:20 PDT
Reverted. Reopened.
Comment 8 Takashi Komori 2021-09-28 13:47:05 PDT
Created attachment 439514 [details]
Patch
Comment 9 Takashi Komori 2021-09-28 15:43:00 PDT
(In reply to Fujii Hironori from comment #5)
> WinCairo-64-bit-WKL-Debug-Tests is crashing. Reopened.
> 
> https://build.webkit.org/#/builders/32/builds/1031
> 
> SHOULD NEVER BE REACHED
> ..\..\Source\WebCore\platform\network\curl\CurlContext.cpp(211) :
> WebCore::CurlShareHandle::mutexFor
> 
> Regressions: Unexpected crashes (34)
>   http/tests/IndexedDB/collect-IDB-objects.https.html [ Crash ]
>   http/tests/IndexedDB/storage-limit-1.https.html [ Crash ]
>   http/tests/IndexedDB/storage-limit-2.https.html [ Crash ]
>   http/tests/IndexedDB/storage-limit.https.html [ Crash ]
>  
> http/tests/eventloop/documents-with-different-protocols-do-not-share-event-
> loop.html [ Crash ]
>   http/tests/misc/dns-prefetch-control.html [ Crash ]
>   http/tests/misc/webtiming-ssl.py [ Crash ]
> [...]

The cause of the crash was that we didn't have code for exclusive control for shared SSL session.
We fixed it.
Comment 10 Takashi Komori 2021-09-28 20:16:53 PDT
Comment on attachment 439514 [details]
Patch

Clearing flags on attachment: 439514

Committed r283208 (242250@main): <https://commits.webkit.org/242250@main>
Comment 11 Takashi Komori 2021-09-28 20:16:57 PDT
All reviewed patches have been landed.  Closing bug.