Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88203 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93764 invoked from network); 15 Sep 2015 02:11:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Sep 2015 02:11:55 -0000 Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.160.177 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.160.177 mail-yk0-f177.google.com Received: from [209.85.160.177] ([209.85.160.177:33543] helo=mail-yk0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E0/00-28087-96E77F55 for ; Mon, 14 Sep 2015 22:11:54 -0400 Received: by ykft14 with SMTP id t14so19874052ykf.0 for ; Mon, 14 Sep 2015 19:11:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to:content-type; bh=uAyMO10KJDx4zxDopTPm5sEG82nH1YRf7bSkSOtoJio=; b=ObsiL18wuPQcUmaBtQD4MqQupWMDFXCoVN/7ig9ktzD6fpLQK3gJ6xNW531/ZsT7Vr es8T9vUhakM6BhAqFxybz3euM5biR/8mc7ig0yiUFv8kEUiunjN6k2IIkY8Qs0ESZA5y OEdZkmt69djjKZIeNgVxxPJRE/lb8RxcwU7dKTJbqJc6c9BOmjgYIZmF7xMKzxDkBgsb 65ALvGAtbKRv+f77TuGt30c4iD4TafqDNmjNjXrV6g5NbTdaUMZhFOCg17qSOU4MubBo OGp1aZJPVTr1Qc440Swt7Qj3IZS7yaxszlrBSSZolnHK4FQ4P0FzQ/lp8uQ8LwLmMk3f bXtA== X-Gm-Message-State: ALoCoQl+LnSCCNcYVXXD6RMNbaXnW/J1LvtPdMQXuKggxz+ID8xqj06utMnfTi8H9ZMv52xsON8h MIME-Version: 1.0 X-Received: by 10.129.148.197 with SMTP id l188mr18447667ywg.118.1442283111306; Mon, 14 Sep 2015 19:11:51 -0700 (PDT) Sender: me@daveyshafik.com Received: by 10.129.55.136 with HTTP; Mon, 14 Sep 2015 19:11:51 -0700 (PDT) Date: Mon, 14 Sep 2015 19:11:51 -0700 X-Google-Sender-Auth: oBQsj7OnX-8_BiqxXIffTPDUb8E Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=94eb2c07b550842a98051fbfb4a3 Subject: HTTP/2 Server Push support in ext/curl From: davey@php.net (Davey Shafik) --94eb2c07b550842a98051fbfb4a3 Content-Type: text/plain; charset=UTF-8 Hey all, I'm trying to work up a patch for ext/perl to allow the CURLMOPT_PUSHFUNCTION and CURLMOPT_PUSHDATA options, which allow for HTTP/2 Server Push. PUSHFUNCTION allow you to register a callback that can accept/reject an HTTP/2 server push by returning either CURL_PUSH_OK (0), or CURL_PUSH_DENY (1) PUSHDATA allows you to pass in a pointer that is passed straight into the callback untouched. So, I'm wondering a few things: 1) Should it be possible to register _multiple_ callbacks, if so we'd need something like CURL_PUSH_PASSTHRU or some such to indicate it should move to the next callback in the chain. This obviously differs from the libcurl behavior, perhaps something to bring back to libcurl though? It would allow different callbacks for say, different content types (if that's available in the request, not sure yet :P) 1.1) If we allow multiples, do we allow removing them, what does that API look like? 2) For PUSHDATA would we pass through a referenced user land variable? or do we just ignore this feature? My thinking on implementation was to have curl_multi_setopt store the callback[s] (not sure where?), and have a fixed _php_curl_pushfunction function that would be registered as the callback for libcurl, and would just pass it's arguments through to the callback[s]. The issue with this is that I need to figure out stuff like the push headers being passed through. There are two functions curl_pushheader_bynum() and curl_pushheader_byname() which are meant to be used to access the struct that contains the headers, so I figured I can expose those two functions in user land, and I guess make the headers a resource that is passed into the callback? The alternative seems to be to resolve that in the extension and pass through an array or something? I'd rather not be creating _new_ resources, but ext/curl obviously has a precedence of using them, so it would fit the UX. Any thoughts? I'd love to get this into PHP 7.1 (or before, if possible!). Thanks, - Davey --94eb2c07b550842a98051fbfb4a3--