Bug 256071 - [Curl] Use CURL_WRITEFUNC_ERROR when aborting CURLOPT_WRITEFUNCTION
Summary: [Curl] Use CURL_WRITEFUNC_ERROR when aborting CURLOPT_WRITEFUNCTION
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 256079
Blocks:
  Show dependency treegraph
 
Reported: 2023-04-27 20:32 PDT by Kenji Shukuwa
Modified: 2023-05-07 22:56 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenji Shukuwa 2023-04-27 20:32:25 PDT
We are returning 0 when aborting CURLOPT_HEADERFUNCTION or CURLOPT_WRITEFUNCTION, which seems to be misuse in some cases.
So use CURL_WRITEFUNC_ERROR which was added in 7.87.0 instead.

https://github.com/curl/curl/pull/9874
---
Also, the inclination of some users has been to just return 0 to signal error, which is incorrect as that may be the number of bytes passed to the callback.
---

https://curl.se/libcurl/c/CURLOPT_WRITEFUNCTION.html
https://curl.se/libcurl/c/CURLOPT_HEADERFUNCTION.html
---
You can also abort the transfer by returning CURL_WRITEFUNC_ERROR. (7.87.0)
---
Comment 1 Kenji Shukuwa 2023-04-27 20:44:33 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13259
Comment 2 EWS 2023-04-27 20:52:21 PDT
Committed 263483@main (058484470283): <https://commits.webkit.org/263483@main>

Reviewed commits have been landed. Closing PR #13259 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-04-27 20:53:17 PDT
<rdar://problem/108641728>
Comment 4 WebKit Commit Bot 2023-04-28 00:15:31 PDT
Re-opened since this is blocked by bug 256079
Comment 5 Kenji Shukuwa 2023-05-07 22:50:42 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13563
Comment 6 EWS 2023-05-07 22:56:37 PDT
Committed 263783@main (46fe83c48439): <https://commits.webkit.org/263783@main>

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