10000 [HttpClient] the stream is not select()able · Issue #34944 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpClient] the stream is not select()able #34944

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
Nek- opened this issue Dec 12, 2019 · 2 comments
Closed

[HttpClient] the stream is not select()able #34944

Nek- opened this issue Dec 12, 2019 · 2 comments

Comments

@Nek-
Copy link
Contributor
Nek- commented Dec 12, 2019

Symfony version(s) affected: 4.4+
PHP version: 7.3.9

Description
The stream generated by the response is supposed to be stream_selec()able according to the documentation.

How to reproduce

$client = \Symfony\Component\HttpClient\HttpClient::create();
$response = $client->request('GET', 'https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-10.2.0-amd64-standard.iso');

$stream = $response->toStream();

$read = [$stream];
$write = [];
$except = [];

// the following returns false !
$success = @stream_select($read, $write, $except, null, 0);
var_dump($success);

// According to PHP documentation "this can happen if the system call is interrupted by an incoming signal"
// wut?
@nicolas-grekas
Copy link
Member

Only NativeHttpClient is stream-selectable. That's because curl doesn't expose any low level file handle we could pass to stream select. That's something that is missing - a feature request for bugs.php.net...

@Nek-
Copy link
Contributor Author
Nek- commented Dec 12, 2019

Oh. And an issue of the documentation then I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0