Skip to content

Protect transfer.kill() the way transfer.abort() is protected#2028

Open
karlseguin wants to merge 1 commit intomainfrom
http_client_safe_kill
Open

Protect transfer.kill() the way transfer.abort() is protected#2028
karlseguin wants to merge 1 commit intomainfrom
http_client_safe_kill

Conversation

@karlseguin
Copy link
Copy Markdown
Collaborator

Transfer.abort() is protected from aborting the transfer while inside of a libcurl callback (since libcurl doesn't support mutating the easy while inside of a callback AND it causes issues in the zig code).

This applies similar logic to Transfer.kill() which is less likely to be called but worse if it is called in a callback, as transfer.kill() deinit's the transfer - something the callback caller is not expecting. Since killing isn't safe to do, we flag the transfer as aborted AND null/noop all the callbacks.

Fixes WPT crash /content-security-policy/frame-src/frame-src-blocked-path-matching.sub.html

Transfer.abort() is protected from aborting the transfer while inside of a
libcurl callback (since libcurl doesn't support mutating the easy while inside
of a callback AND it causes issues in the zig code).

This applies similar logic to Transfer.kill() which is less likely to be called
but worse if it is called in a callback, as transfer.kill() deinit's the
transfer - something the callback caller is not expecting. Since killing isn't
safe to do, we flag the transfer as aborted AND null/noop all the callbacks.

Fixes WPT crash /content-security-policy/frame-src/frame-src-blocked-path-matching.sub.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant