-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpClient] improve handling of HTTP/2 PUSH, disable it by default #33444
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
Conversation
2d20fdd
to
f5b9d3a
Compare
f5b9d3a
to
ea0c174
Compare
ea0c174
to
3e56bdf
Compare
@@ -50,24 +50,19 @@ public function log($level, $message, array $context = []) | ||
$client = new CurlHttpClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this test be updated to opt-in for push, now that it is disabled by default ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, fixed
note that the test doesn't work, but we skip it
I prefer keeping it this way so that we are reminded about it in the future :)
3e56bdf
to
019bce7
Compare
@@ -120,9 +120,6 @@ public function __construct(CurlClientState $multi, $ch, array $options = null, | ||
|
||
if (\in_array($waitFor, ['headers', 'destruct'], true)) { | ||
try { | ||
if (\defined('CURLOPT_STREAM_WEIGHT')) { | ||
curl_setopt($ch, CURLOPT_STREAM_WEIGHT, 32); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this closes #32529
…y default (nicolas-grekas) This PR was merged into the 4.3 branch. Discussion ---------- [HttpClient] improve handling of HTTP/2 PUSH, disable it by default | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This follows discussions with @dunglas For the test cases, https://http2-push.io is down, let's use Akamai instead This PR now considers the proxy settings before accepting a pushed response. It also splits the responsibility of dealing with accepting pushed responses in method `acceptPushForRequest`. The logic in this method could also be delegated to a userland callback passed as an option. Let's wait for someone with an actual use case before adding the option. This PR also disables HTTP/2 PUSH by default because it is not stable: locally, with the latest curl version, enabling this on a server that pushes things fails with `Failure when receiving data from the peer`. This is not ready for prime time in either ext-curl or the underlying libcurl. You can still enable it explicitly by passing some positive number to the constructor. Commits ------- 019bce7 [HttpClient] improve handling of HTTP/2 PUSH
…ndled properly (dunglas) This PR was merged into the 4.3 branch. Discussion ---------- [HttpClient] Fix a bug preventing Server Pushes to be handled properly | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a Follows #33444. Commits ------- e1fbaeb [HttpClient] Fix a bug preventing Server Pushes to be handled properly
Thank you |
This PR was merged into the 4.3 branch. Discussion ---------- [HttpClient] Re-enable Server Push support | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a <!-- prefix each issue number with "Fix #", if any --> | License | MIT | Doc PR | n/a #33444 disabled Server Push support for the CURL implementation, but `HttpClient::create()` has been forgotten and override this parameter, consequently for most users Server Push wasn't disabled at all. The root issue affecting the tests are actually a misconfiguration of Akamai servers (we need our own test infrastructure). According to my testing, Server Push support works very smoothly. Also, it can cause problems only if the server actually pushes responses (which is still rare). So I propose to re-enable Push Support everywhere. Commits ------- 8483842 Re-enable push support for HttpClient
This follows discussions with @dunglas
For the test cases, https://http2-push.io is down, let's use Akamai instead
This PR now considers the proxy settings before accepting a pushed response.
It also splits the responsibility of dealing with accepting pushed responses in method
acceptPushForRequest
.The logic in this method could also be delegated to a userland callback passed as an option. Let's wait for someone with an actual use case before adding the option.
This PR also disables HTTP/2 PUSH by default because it is not stable: locally, with the latest curl version, enabling this on a server that pushes things fails with
Failure when receiving data from the peer
. This is not ready for prime time in either ext-curl or the underlying libcurl. You can still enable it explicitly by passing some positive number to the constructor.