Skip to content

multi: call protocol handler done() if PROTOCONNECT or later #16681

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

Closed
wants to merge 1 commit into from

Conversation

bagder
Copy link
Member

@bagder bagder commented Mar 12, 2025

The protocol handlers' done() function would previous get called unconditionally in multi_done(), no matter how far the easy handle's state machine has transitioned.

This caused problems in IMAP which in imap_connect() initializes things that the imap_done() function assumes has occured. I think that seems like a correct assumption and we should rather make sure that the done() function is only called if we have reached the DO state.

This problem was found using OSS-Fuzz.

Assisted-by: Catena cyber

@testclutch
Copy link

Analysis of PR #16681 at 4724314c:

Test ../../tests/http/test_09_push.py::TestPush::test_09_02_h2_push failed, which has NOT been flaky recently, so there could be a real issue in this PR.

Generated by Testclutch

The protocol handlers' done() function would previous get called
unconditionally in multi_done(), no matter how far the easy handle's
state machine has transitioned.

This caused problems in IMAP which in imap_connect() initializes things
that the imap_done() function assumes has occured. I think that seems
like a correct assumption and we should rather make sure that the done()
function is only called if we have reached the PROTOCONNECT state.

This problem was found using OSS-Fuzz.

Assisted-by: Catena cyber

Closes #16681
@bagder bagder force-pushed the bagder/protocol-done-needs-do branch from 4724314 to 291e40e Compare March 12, 2025 14:04
@bagder bagder changed the title multi: call protocol handler done() only if DO or later multi: call protocol handler done() if PROTOCONNECT or later Mar 12, 2025
@bagder bagder closed this in 0bb8465 Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants