Lines Matching refs:as

88 static void altsvc_free(struct altsvc *as)  in altsvc_free()  argument
90 free(as->src.host); in altsvc_free()
91 free(as->dst.host); in altsvc_free()
92 free(as); in altsvc_free()
103 struct altsvc *as = calloc(1, sizeof(struct altsvc)); in altsvc_createid() local
105 if(!as) in altsvc_createid()
112 free(as); in altsvc_createid()
129 as->src.host = Curl_memdup0(srchost, hlen); in altsvc_createid()
130 if(!as->src.host) in altsvc_createid()
133 as->dst.host = Curl_memdup0(dsthost, dlen); in altsvc_createid()
134 if(!as->dst.host) in altsvc_createid()
137 as->src.alpnid = srcalpnid; in altsvc_createid()
138 as->dst.alpnid = dstalpnid; in altsvc_createid()
139 as->src.port = curlx_ultous(srcport); in altsvc_createid()
140 as->dst.port = curlx_ultous(dstport); in altsvc_createid()
142 return as; in altsvc_createid()
144 altsvc_free(as); in altsvc_createid()
189 struct altsvc *as; in altsvc_add() local
191 as = altsvc_create(srchost, dsthost, srcalpn, dstalpn, srcport, dstport); in altsvc_add()
192 if(as) { in altsvc_add()
193 as->expires = expires; in altsvc_add()
194 as->prio = prio; in altsvc_add()
195 as->persist = persist ? 1 : 0; in altsvc_add()
196 Curl_llist_append(&asi->list, as, &as->node); in altsvc_add()
247 static CURLcode altsvc_out(struct altsvc *as, FILE *fp) in altsvc_out() argument
254 CURLcode result = Curl_gmtime(as->expires, &stamp); in altsvc_out()
260 if(1 == Curl_inet_pton(AF_INET6, as->dst.host, ipv6_unused)) { in altsvc_out()
264 if(1 == Curl_inet_pton(AF_INET6, as->src.host, ipv6_unused)) { in altsvc_out()
276 Curl_alpnid2str(as->src.alpnid), in altsvc_out()
277 src6_pre, as->src.host, src6_post, in altsvc_out()
278 as->src.port, in altsvc_out()
280 Curl_alpnid2str(as->dst.alpnid), in altsvc_out()
281 dst6_pre, as->dst.host, dst6_post, in altsvc_out()
282 as->dst.port, in altsvc_out()
286 as->persist, as->prio); in altsvc_out()
345 struct altsvc *as = Curl_node_elem(e); in Curl_altsvc_cleanup() local
347 altsvc_free(as); in Curl_altsvc_cleanup()
385 struct altsvc *as = Curl_node_elem(e); in Curl_altsvc_save() local
387 result = altsvc_out(as, out); in Curl_altsvc_save()
446 struct altsvc *as = Curl_node_elem(e); in altsvc_flush() local
448 if((srcalpnid == as->src.alpnid) && in altsvc_flush()
449 (srcport == as->src.port) && in altsvc_flush()
450 hostcompare(srchost, as->src.host)) { in altsvc_flush()
452 altsvc_free(as); in altsvc_flush()
494 struct altsvc *as; in Curl_altsvc_parse() local
636 as = altsvc_createid(srchost, dsthost, dstlen, in Curl_altsvc_parse()
639 if(as) { in Curl_altsvc_parse()
642 as->expires = maxage + time(NULL); in Curl_altsvc_parse()
643 as->persist = persist; in Curl_altsvc_parse()
644 Curl_llist_append(&asi->list, as, &as->node); in Curl_altsvc_parse()
686 struct altsvc *as = Curl_node_elem(e); in Curl_altsvc_lookup() local
688 if(as->expires < now) { in Curl_altsvc_lookup()
691 altsvc_free(as); in Curl_altsvc_lookup()
694 if((as->src.alpnid == srcalpnid) && in Curl_altsvc_lookup()
695 hostcompare(srchost, as->src.host) && in Curl_altsvc_lookup()
696 (as->src.port == srcport) && in Curl_altsvc_lookup()
697 (versions & (int)as->dst.alpnid)) { in Curl_altsvc_lookup()
699 *dstentry = as; in Curl_altsvc_lookup()