php / php/php-src

OpenSSL streams liveness check should be always non blocking

Open
#13,489 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Extension: openssl Feature
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

Currently all OpenSSL streams use TCP connection. There is no point for liveness check to ever use timeout and it makes the check with and without timeout inconsistent because if it's used without timeout (which is always the case for internal PHP function like php_stream_eof), then it succeed even if no data is read - it fails only if there is an error - this is especially important for non blocking mode. However if it's used with timeout and the timeout expires, it return false. There does not seem much advantage to do that and considering that it is unused and it makes the code significantly more complex, we should remove this handling and always return immediately.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the OpenSSL stream liveness-check implementation and inspect how timeout and non-blocking paths are handled. The work is complete when the check returns immediately without timeout handling while preserving the documented behavior for errors and non-blocking streams; identify or run the relevant stream tests if the repository provides them.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.