From 70191958b5db1814e13ef90856a9f70a5186e733 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 1 Jun 2015 10:22:41 +0200 Subject: http2: initial HTTP/2 server push types/docs --- include/curl/multi.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'include') diff --git a/include/curl/multi.h b/include/curl/multi.h index 0d859f8fd..ed3a3a793 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -283,6 +283,32 @@ typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ void *userp); /* private callback pointer */ +/* + * Name: curl_push_callback + * + * Desc: This callback gets called when a new stream is being pushed by the + * server. It approves or denies the new stream. + * + * Returns: CURL_PUSH_OK or CURL_PUSH_DENY. + */ +#define CURL_PUSH_OK 0 +#define CURL_PUSH_DENY 1 + +struct curl_headerpair { + unsigned char *name; /* zero terminated name */ + size_t namelen; /* length of 'name' */ + unsigned char *value; /* zero terminated name */ + size_t valuelen; /* length of 'value' */ +}; + +struct curl_pushheaders; /* forward declaration only */ + +typedef int (*curl_push_callback)(CURL *parent, + CURL *easy, + int num_headers, + struct curl_pushheaders *headers, + void *userp); + CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, int *running_handles); @@ -370,6 +396,12 @@ typedef enum { /* maximum number of open connections in total */ CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13), + /* This is the server push callback function pointer */ + CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14), + + /* This is the argument passed to the server push callback */ + CINIT(PUSHDATA, OBJECTPOINT, 15), + CURLMOPT_LASTENTRY /* the last unused */ } CURLMoption; -- cgit v1.2.3