Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[curl] Obtain the Content-Length and request header size ourselves. #28693

Merged
merged 1 commit into from
May 31, 2024

Conversation

kshukuwa
Copy link
Contributor

@kshukuwa kshukuwa commented May 17, 2024

8a9f0f2

[curl] Obtain the Content-Length and request header size ourselves.
https://bugs.webkit.org/show_bug.cgi?id=272445

Reviewed by Fujii Hironori.

Since curl 8.7.0, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T and
CURLINFO_REQUEST_SIZE  are no longer available in the header callback.
For this reason, we will obtain the Content-Length and request header
size ourselves.

* LayoutTests/platform/wincairo/TestExpectations:
* Source/WebCore/platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::addExtraNetworkLoadMetrics):
* Source/WebCore/platform/network/curl/CurlContext.h:
* Source/WebCore/platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didReceiveDebugInfo):
(WebCore::CurlRequest::networkLoadMetrics):
(WebCore::CurlRequest::getContentLength):
* Source/WebCore/platform/network/curl/CurlRequest.h:

Canonical link: https://commits.webkit.org/279553@main

7c61b98

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2 βœ… πŸ§ͺ wincairo-tests
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  wpe-cairo
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ›  gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress βœ… πŸ§ͺ api-gtk
βœ… πŸ›  watch
βœ… πŸ›  πŸ§ͺ unsafe-merge βœ… πŸ›  watch-sim

@fujii
Copy link
Contributor

fujii commented May 17, 2024

Is this a libcurl bug? Did you report? Do you think this patch should be landed even if the upstream libcurl will fix the bug?

@kshukuwa
Copy link
Contributor Author

I reported this but have not received any response. So I don't know if it's a bug in libcurl or not.
https://curl.se/mail/lib-2024-05/0028.html

On the other hand, the description of curl_easy_getinfo says " Use this function after a performed transfer if you want to get transfer related data. ", so it may not be recommended to call curl_easy_getinfo within a header callback.

https://curl.se/libcurl/c/curl_easy_getinfo.html

In that case, this patch may be the right direction. On the other hand, there is some information that can only be obtained by curl_easy_getinfo, so I think it is better to continue using it for the information that can be obtained.

@kshukuwa
Copy link
Contributor Author

Could you please add the merge-queue label to merge this PR?

@fujii fujii added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label May 31, 2024
https://bugs.webkit.org/show_bug.cgi?id=272445

Reviewed by Fujii Hironori.

Since curl 8.7.0, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T and
CURLINFO_REQUEST_SIZE  are no longer available in the header callback.
For this reason, we will obtain the Content-Length and request header
size ourselves.

* LayoutTests/platform/wincairo/TestExpectations:
* Source/WebCore/platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::addExtraNetworkLoadMetrics):
* Source/WebCore/platform/network/curl/CurlContext.h:
* Source/WebCore/platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didReceiveDebugInfo):
(WebCore::CurlRequest::networkLoadMetrics):
(WebCore::CurlRequest::getContentLength):
* Source/WebCore/platform/network/curl/CurlRequest.h:

Canonical link: https://commits.webkit.org/279553@main
@webkit-commit-queue
Copy link
Collaborator

Committed 279553@main (8a9f0f2): https://commits.webkit.org/279553@main

Reviewed commits have been landed. Closing PR #28693 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label May 31, 2024
@webkit-commit-queue webkit-commit-queue merged commit 8a9f0f2 into WebKit:main May 31, 2024
@kshukuwa kshukuwa deleted the eng/bug272445 branch May 31, 2024 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants