Lines Matching refs:as
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
86 static void altsvc_free(struct altsvc *as)
88 free(as->src.host);
89 free(as->dst.host);
90 free(as);
100 struct altsvc *as = calloc(1, sizeof(struct altsvc));
103 if(!as)
111 free(as);
128 as->src.host = Curl_memdup0(srchost, hlen);
129 if(!as->src.host)
132 as->dst.host = Curl_memdup0(dsthost, dlen);
133 if(!as->dst.host)
136 as->src.alpnid = srcalpnid;
137 as->dst.alpnid = dstalpnid;
138 as->src.port = curlx_ultous(srcport);
139 as->dst.port = curlx_ultous(dstport);
141 return as;
143 altsvc_free(as);
187 struct altsvc *as;
189 as = altsvc_create(srchost, dsthost, srcalpn, dstalpn, srcport, dstport);
190 if(as) {
191 as->expires = expires;
192 as->prio = prio;
193 as->persist = persist ? 1 : 0;
194 Curl_llist_insert_next(&asi->list, asi->list.tail, as, &as->node);
253 static CURLcode altsvc_out(struct altsvc *as, FILE *fp)
260 CURLcode result = Curl_gmtime(as->expires, &stamp);
266 if(1 == Curl_inet_pton(AF_INET6, as->dst.host, ipv6_unused)) {
270 if(1 == Curl_inet_pton(AF_INET6, as->src.host, ipv6_unused)) {
282 Curl_alpnid2str(as->src.alpnid),
283 src6_pre, as->src.host, src6_post,
284 as->src.port,
286 Curl_alpnid2str(as->dst.alpnid),
287 dst6_pre, as->dst.host, dst6_post,
288 as->dst.port,
292 as->persist, as->prio);
353 struct altsvc *as = e->ptr;
355 altsvc_free(as);
384 /* marked as read-only, no file or zero length file name */
393 struct altsvc *as = e->ptr;
395 result = altsvc_out(as, out);
454 struct altsvc *as = e->ptr;
456 if((srcalpnid == as->src.alpnid) &&
457 (srcport == as->src.port) &&
458 hostcompare(srchost, as->src.host)) {
460 altsvc_free(as);
504 struct altsvc *as;
646 as = altsvc_createid(srchost, dsthost,
649 if(as) {
652 as->expires = maxage + time(NULL);
653 as->persist = persist;
654 Curl_llist_insert_next(&asi->list, asi->list.tail, as, &as->node);
696 struct altsvc *as = e->ptr;
698 if(as->expires < now) {
701 altsvc_free(as);
704 if((as->src.alpnid == srcalpnid) &&
705 hostcompare(srchost, as->src.host) &&
706 (as->src.port == srcport) &&
707 (versions & as->dst.alpnid)) {
709 *dstentry = as;