rfc:curl_http2_push

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:curl_http2_push [2015/11/18 22:14]
davey
rfc:curl_http2_push [2017/09/22 13:28] (current)
Line 3: Line 3:
   * Date: 2015-10-01   * Date: 2015-10-01
   * Author: Davey Shafik, davey@php.net   * Author: Davey Shafik, davey@php.net
-  * Status: Draft+  * Status: Implemented (PHP 7.1)
   * First Published at: https://wiki.php.net/rfc/curl_http2_push   * First Published at: https://wiki.php.net/rfc/curl_http2_push
  
Line 12: Line 12:
 Server push allows the server to push additional resources relevant to the requested resource directly to the client proactively. Server push allows the server to push additional resources relevant to the requested resource directly to the client proactively.
  
-Server push is available in libcurl since 7.44.0.+Server push is available in libcurl since 7.44.0, but broken till the as-yet-unreleased 7.46.0 (See: [[https://github.com/bagder/curl/issues/529|this]] and [[https://github.com/bagder/curl/issues/530|this]] github issues for details).
  
 ===== Libcurl Implementation ===== ===== Libcurl Implementation =====
Line 30: Line 30:
 $transfers = 1; $transfers = 1;
  
-$callback = function($parent_ch, $pushed_ch, int $num_headers, array $headers) use (&$transfers) {+$callback = function($parent_ch, $pushed_ch, array $headers) use (&$transfers) {
  $transfers++; // increment to keep track of the number of concurrent requests  $transfers++; // increment to keep track of the number of concurrent requests
  return CURL_PUSH_OK;  return CURL_PUSH_OK;
Line 79: Line 79:
 We do not support ''CURLMOPT_PUSHDATA''. Instead, the user can use closures and ''use'' with references to replicate this behavior. We do not support ''CURLMOPT_PUSHDATA''. Instead, the user can use closures and ''use'' with references to replicate this behavior.
  
-libcurl exposes the push headers with two functions functions ''curl_pushheader_bynum()'' and ''curl_pushheader_byname()''. We can use ''curl_pushheader_bynum()'' to create an array of header lines. These would then be parsed in user land (as with regular request headers)+libcurl exposes the push headers with two functions functions ''curl_pushheader_bynum()'' and ''curl_pushheader_byname()''. We can use ''curl_pushheader_bynum()'' to create an array of header lines. These would then be parsed in user land (as with regular request headers).
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 117: Line 117:
 ===== Open Issues ===== ===== Open Issues =====
  
-Some memory leaks+Possibly a memory leak in libcurl
  
 ===== Future Scope ===== ===== Future Scope =====
Line 123: Line 123:
 This change should track libcurl. This change should track libcurl.
  
-===== Proposed Voting Choices =====+===== Vote =====
  
-Two choices: Add, Deny +Simple Yes/No option. Requires 50%+1 to be accepted. 
-50% required as this is not a language change+ 
 +This vote will close on 13:00 UTC on Wed 2015-12-23 
 + 
 +<doodle title="Add HTTP/2 Server Push Support to ext/curl" auth="davey" voteType="single" closed="true"> 
 +   * Yes 
 +   * No 
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
  
-(rough) Working patch can be found [[https://github.com/dshafik/php-src/compare/curl-http2-push|here]]+  - Working patch can be found [[https://github.com/dshafik/php-src/compare/curl-http2-push|here]] 
 +  - Docker container for easy testing can be found [[http://github.com/dshafik/php-http2-push-example|here]]
  
 ===== Implementation ===== ===== Implementation =====
  
-After the project is implemented, this section should contain  +Server push support has been implemented in PHP 7.1 with [[http://git.php.net/?p=php-src.git;a=commit;h=ad15e1ccdabc678103e356535919e829ba9a0281|commit ad15e1cc]], and is documented in the [[http://php.net/manual/function.curl-multi-setopt.php|curl_multi_setopt man page]]. 
-  - the version(s) it was merged to + 
-  - a link to the git commit(s) +The language specification is not affected by this RFC.
-  - a link to the PHP manual entry for the feature+
  
 ===== References ===== ===== References =====
Line 146: Line 152:
 ===== Rejected Features ===== ===== Rejected Features =====
  
-Keep this updated with features that were discussed on the mail lists.+None
rfc/curl_http2_push.1447884843.txt.gz · Last modified: 2017/09/22 13:28 (external edit)