Skip to content

Avoid fclosing extraDataPipe - #85

Open
bwoebi wants to merge 1 commit into
amphp:2.xfrom
bwoebi:patch-2
Open

Avoid fclosing extraDataPipe#85
bwoebi wants to merge 1 commit into
amphp:2.xfrom
bwoebi:patch-2

Conversation

@bwoebi

@bwoebi bwoebi commented Aug 17, 2026

Copy link
Copy Markdown
Member

With sufficient luck, another callback installs something at a file description reusing this resources file descriptor number, wreaking havoc.

The only reference to $extraDataPipe is stored by extraDataPipeCallbackId. An explicit fclose is the worst choice. Either immediately cancel $callbackId, or simply defer to __destruct.

Deferring to destructor seems safe enough.

With sufficient luck, another callback installs something at a file description reusing this resources file descriptor number, wreaking havoc.

The only reference to $extraDataPipe is stored by extraDataPipeCallbackId. An explicit fclose is the worst choice. Either immediately cancel $callbackId, or simply defer to __destruct.

Deferring to destructor seems safe enough.
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.

1 participant