cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: how to use http/2 server push?

From: Yehezkel Horowitz <horowity_at_checkpoint.com>
Date: Wed, 13 May 2015 07:22:57 +0000

>Yes, I too think that server push and HTTP/2 streams in general will only grow in importance and popularity going forward. But we also don't need to invent everything or fix every possible future problem now, we just need to lay the foundation good enough and then we continue improving and polishing this. Like we always do for all features.

>> If I was contributing code to help implement this (it's not likely, sorry)
>Don't worry about that! Right now, I think that contributing ideas and thoughts around how it should or could work is equally or perhaps even more important!

>There's a SETTINGS_ENABLE_PUSH that can completely disable pushes for the connection, but if we enable pushes they will come without any extra concent as that is sort the point with them: no extra latency inferred.
>We can also deny a new PUSH immediately if we don't want it - and that's what we do right now actually. That's typically not a terribly large penalty.

I don't see myself contributing code too, but I just want to contribute my ideas about how push should be handled by libcurl.

I think the way it should work is with an additional call back set by the application (if not, deny the PUSH).

The prototype of the push_cb is quite similar to the write_cb, but is might be polished during the development.
I can see the need to pass some identifier of the push stream and maybe some additional params.

This will allow the easy handle to use the same buffer for multiple resources, as it will immediately pass the content to the application (which should handle it as it wish).

It might be good idea to made some changes in libcurl's buffer logic in the same time, and allow the application control which buffer it will use, but this is not a mandatory change.

So the flow is something like this:
   a. configure easy_handle + set push_cb
   b. easy_perform do the request - call the regular header_cb + body_cb.
   c. as PUSH message arrive - call the push_cb

Hope this helps you in developing this amazing tool.

Regards,
Yehezkel

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