summaryrefslogtreecommitdiff
path: root/lib/altsvc.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-08-07 20:10:27 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-08-08 09:10:29 +0200
commit69b3ff5118be4eb6fdd9ef645b955cac7d2fe0ba (patch)
treeb4bf92f3a9437194236f19cbc1eaeb80ba82fe22 /lib/altsvc.h
parenta93b43cde82d7a48014990d6a31dc917c1b5f93c (diff)
downloadcurl-69b3ff5118be4eb6fdd9ef645b955cac7d2fe0ba.tar.gz
alt-svc: add protocol version selection masking
So that users can mask in/out specific HTTP versions when Alt-Svc is used. - Removed "h2c" and updated test case accordingly - Changed how the altsvc struct is laid out - Added ifdefs to make the unittest run even in a quiche-tree Closes #4201
Diffstat (limited to 'lib/altsvc.h')
-rw-r--r--lib/altsvc.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/altsvc.h b/lib/altsvc.h
index eefb45bf6..99d0499af 100644
--- a/lib/altsvc.h
+++ b/lib/altsvc.h
@@ -28,20 +28,21 @@
#include "llist.h"
enum alpnid {
- ALPN_none,
- ALPN_h1,
- ALPN_h2,
- ALPN_h2c,
- ALPN_h3
+ ALPN_none = 0,
+ ALPN_h1 = CURLALTSVC_H1,
+ ALPN_h2 = CURLALTSVC_H2,
+ ALPN_h3 = CURLALTSVC_H3
+};
+
+struct althost {
+ char *host;
+ unsigned short port;
+ enum alpnid alpnid;
};
struct altsvc {
- char *srchost;
- char *dsthost;
- unsigned short srcport;
- unsigned short dstport;
- enum alpnid srcalpnid;
- enum alpnid dstalpnid;
+ struct althost src;
+ struct althost dst;
time_t expires;
bool persist;
int prio;
@@ -68,8 +69,8 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
bool Curl_altsvc_lookup(struct altsvcinfo *asi,
enum alpnid srcalpnid, const char *srchost,
int srcport,
- enum alpnid *dstalpnid, const char **dsthost,
- int *dstport);
+ struct altsvc **dstentry,
+ int versions); /* one or more CURLALTSVC_H* bits */
#else
/* disabled */
#define Curl_altsvc_save(a,b)