summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/altsvc.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-26 13:30:18 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-26 13:30:25 (GMT)
commit42d9b3dc6af8a70f1238fce5f5db2e5910452f0b (patch)
tree8701572d53316e111fec262c78450ecc22e8762d /Utilities/cmcurl/lib/altsvc.c
parent1f47a65c7ac1b09f013543d2bd2ca38d2502f3a1 (diff)
parente5ff413f41877dc46498c384fa4f6e5b23ec1476 (diff)
downloadCMake-42d9b3dc6af8a70f1238fce5f5db2e5910452f0b.zip
CMake-42d9b3dc6af8a70f1238fce5f5db2e5910452f0b.tar.gz
CMake-42d9b3dc6af8a70f1238fce5f5db2e5910452f0b.tar.bz2
Merge topic 'update-curl' into release-3.18
e5ff413f41 curl: Set build options the way we need for CMake 0ef8fa5000 Merge branch 'upstream-curl' into update-curl 5717fdc114 curl 2020-06-23 (e9db32a0) 39f7cfad31 curl: Update script to get curl 7.71.0 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4937
Diffstat (limited to 'Utilities/cmcurl/lib/altsvc.c')
-rw-r--r--Utilities/cmcurl/lib/altsvc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/Utilities/cmcurl/lib/altsvc.c b/Utilities/cmcurl/lib/altsvc.c
index c39d86e..c2ec489 100644
--- a/Utilities/cmcurl/lib/altsvc.c
+++ b/Utilities/cmcurl/lib/altsvc.c
@@ -50,8 +50,10 @@
#define MAX_ALTSVC_ALPNLENSTR "10"
#define MAX_ALTSVC_ALPNLEN 10
-#if (defined(USE_QUICHE) || defined(USE_NGTCP2)) && !defined(UNITTESTS)
-#define H3VERSION "h3-27"
+#if defined(USE_QUICHE) && !defined(UNITTESTS)
+#define H3VERSION "h3-29"
+#elif defined(USE_NGTCP2) && !defined(UNITTESTS)
+#define H3VERSION "h3-29"
#else
#define H3VERSION "h3"
#endif
@@ -167,7 +169,6 @@ static CURLcode altsvc_add(struct altsvcinfo *asi, char *line)
as->prio = prio;
as->persist = persist ? 1 : 0;
Curl_llist_insert_next(&asi->list, asi->list.tail, as, &as->node);
- asi->num++; /* one more entry */
}
}
@@ -408,7 +409,6 @@ static void altsvc_flush(struct altsvcinfo *asi, enum alpnid srcalpnid,
strcasecompare(srchost, as->src.host)) {
Curl_llist_remove(&asi->list, e, NULL);
altsvc_free(as);
- asi->num--;
}
}
}
@@ -429,6 +429,8 @@ static time_t debugtime(void *unused)
#define time(x) debugtime(x)
#endif
+#define ISNEWLINE(x) (((x) == '\n') || (x) == '\r')
+
/*
* Curl_altsvc_parse() takes an incoming alt-svc response header and stores
* the data correctly in the cache.
@@ -474,7 +476,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
dstalpnid = alpn2alpnid(alpnbuf);
p++;
if(*p == '\"') {
- const char *dsthost;
+ const char *dsthost = "";
const char *value_ptr;
char option[32];
unsigned long num;
@@ -518,12 +520,12 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
/* Handle the optional 'ma' and 'persist' flags. Unknown flags
are skipped. */
for(;;) {
- while(*p && ISBLANK(*p) && *p != ';' && *p != ',')
+ while(ISBLANK(*p))
p++;
- if(!*p || *p == ',')
+ if(*p != ';')
break;
p++; /* pass the semicolon */
- if(!*p)
+ if(!*p || ISNEWLINE(*p))
break;
result = getalnum(&p, option, sizeof(option));
if(result) {
@@ -573,7 +575,6 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
as->expires = maxage + time(NULL);
as->persist = persist;
Curl_llist_insert_next(&asi->list, asi->list.tail, as, &as->node);
- asi->num++; /* one more entry */
infof(data, "Added alt-svc: %s:%d over %s\n", dsthost, dstport,
Curl_alpnid2str(dstalpnid));
}