From 3042cb50439d553f39450876b9e5af4bece67583 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 13 Sep 2015 16:07:05 +0200 Subject: http2: added three stream prio/deps options CURLOPT_STREAM_DEPENDS CURLOPT_STREAM_DEPENDS_E CURLOPT_STREAM_PRIORITY --- lib/url.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index ed8659675..866fee2eb 100644 --- a/lib/url.c +++ b/lib/url.c @@ -111,6 +111,7 @@ int curl_win32_idn_to_ascii(const char *in, char **out); #include "telnet.h" #include "tftp.h" #include "http.h" +#include "http2.h" #include "file.h" #include "curl_ldap.h" #include "ssh.h" @@ -616,6 +617,8 @@ CURLcode Curl_init_userdefined(struct UserDefined *set) set->expect_100_timeout = 1000L; /* Wait for a second by default. */ set->sep_headers = TRUE; /* separated header lists by default */ + + Curl_http2_init_userset(set); return result; } @@ -673,6 +676,8 @@ CURLcode Curl_open(struct SessionHandle **curl) data->wildcard.filelist = NULL; data->set.fnmatch = ZERO_NULL; data->set.maxconnects = DEFAULT_CONNCACHE_SIZE; /* for easy handles */ + + Curl_http2_init_state(&data->state); } if(result) { @@ -2658,6 +2663,29 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, case CURLOPT_PIPEWAIT: data->set.pipewait = (0 != va_arg(param, long))?TRUE:FALSE; break; + case CURLOPT_STREAM_PRIORITY: +#ifndef USE_NGHTTP2 + return CURLE_NOT_BUILT_IN; +#else + arg = va_arg(param, long); + if((arg>=1) && (arg <= 256)) + data->set.stream_prio = (int)arg; + break; +#endif + case CURLOPT_STREAM_DEPENDS: + case CURLOPT_STREAM_DEPENDS_E: + { +#ifndef USE_NGHTTP2 + return CURLE_NOT_BUILT_IN; +#else + struct SessionHandle *dep = va_arg(param, struct SessionHandle *); + if(dep && GOOD_EASY_HANDLE(dep)) { + data->set.stream_depends_on = dep; + data->set.stream_depends_e = (option == CURLOPT_STREAM_DEPENDS_E); + } + break; +#endif + } default: /* unknown tag and its companion, just ignore: */ result = CURLE_UNKNOWN_OPTION; -- cgit v1.2.3