http2: initial HTTP/2 server push types/docs

This commit is contained in:
Daniel Stenberg
2015-06-01 10:22:41 +02:00
parent f6af9aef7e
commit 19d5bcd66a
4 changed files with 194 additions and 3 deletions

View File

@@ -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;