cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: HTTP/2 server push, callback?

From: Lucas Pardue <Lucas.Pardue_at_bbc.co.uk>
Date: Thu, 28 May 2015 11:00:12 +0000

Hi Daniel,

Interesting proposal.

> This is how the callback would work:
>
> int curl_stream_push(CURL *newhandle,
> unsigned int stream_id,
> struct curl_push *headers,
> void *userp);

Does stream_id represent the stream the PUSH_PROMISE was received on, or the promised Stream ID? How useful are either of those IDs to the application?

> struct curl_push {
> const char *method; /* example: "GET" */
> const char *path; /* example: "/download-154/image.png" */
> const char *scheme; /* example: "https" */
> const char *authority; /* example: "www.example.com:443" */ };

How would you pass back additional header fields contained in the PUSH_PROMISE to the application? Could they be added to struct curl_push? Or would a callback like CURLOPT_HEADERFUNCTION be more appropriate?

> The 'newhandle' is a newly created easy handle that represents this new
> transfer. This handle is otherwise "naked" and will need a suitable set of
> options set before it will work the way the application wants it to.

Could there be a way for the new handle to automatically assume options? For example, 'inherit' the options used for the initial GET request handle, or assume a configured default set.

Regards
Lucas

-----------------------------
http://www.bbc.co.uk
This e-mail (and any attachments) is confidential and
may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in
error, please delete it from your system.
Do not use, copy or disclose the
information in any way nor act in reliance on it and notify the sender
immediately.
Please note that the BBC monitors e-mails
sent or received.
Further communication will signify your consent to
this.
-----------------------------

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-05-28