Lines Matching refs:h
80 struct hsts *h = calloc(1, sizeof(struct hsts)); in Curl_hsts_init() local
81 if(h) { in Curl_hsts_init()
82 Curl_llist_init(&h->list, NULL); in Curl_hsts_init()
84 return h; in Curl_hsts_init()
95 struct hsts *h = *hp; in Curl_hsts_cleanup() local
96 if(h) { in Curl_hsts_cleanup()
99 for(e = Curl_llist_head(&h->list); e; e = n) { in Curl_hsts_cleanup()
104 free(h->filename); in Curl_hsts_cleanup()
105 free(h); in Curl_hsts_cleanup()
110 static CURLcode hsts_create(struct hsts *h, in hsts_create() argument
116 DEBUGASSERT(h); in hsts_create()
138 Curl_llist_append(&h->list, sts, &sts->node); in hsts_create()
143 CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, in Curl_hsts_parse() argument
221 sts = Curl_hsts(h, hostname, FALSE); in Curl_hsts_parse()
236 sts = Curl_hsts(h, hostname, FALSE); in Curl_hsts_parse()
243 return hsts_create(h, hostname, subdomains, expires); in Curl_hsts_parse()
254 struct stsentry *Curl_hsts(struct hsts *h, const char *hostname, in Curl_hsts() argument
258 if(h) { in Curl_hsts()
271 for(e = Curl_llist_head(&h->list); e; e = n) { in Curl_hsts()
360 CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h, in Curl_hsts_save() argument
369 if(!h) in Curl_hsts_save()
374 if(!file && h->filename) in Curl_hsts_save()
375 file = h->filename; in Curl_hsts_save()
377 if((h->flags & CURLHSTS_READONLYFILE) || !file || !file[0]) in Curl_hsts_save()
386 for(e = Curl_llist_head(&h->list); e; e = n) { in Curl_hsts_save()
405 i.total = Curl_llist_count(&h->list); in Curl_hsts_save()
407 for(e = Curl_llist_head(&h->list); e; e = n) { in Curl_hsts_save()
421 static CURLcode hsts_add(struct hsts *h, char *line) in hsts_add() argument
446 e = Curl_hsts(h, p, subdomain); in hsts_add()
448 result = hsts_create(h, p, subdomain, expires); in hsts_add()
465 static CURLcode hsts_pull(struct Curl_easy *data, struct hsts *h) in hsts_pull() argument
470 DEBUGASSERT(h); in hsts_pull()
491 result = hsts_create(h, e.name, in hsts_pull()
513 static CURLcode hsts_load(struct hsts *h, const char *file) in hsts_load() argument
520 free(h->filename); in hsts_load()
521 h->filename = strdup(file); in hsts_load()
522 if(!h->filename) in hsts_load()
540 hsts_add(h, lineptr); in hsts_load()
552 struct hsts *h, const char *file) in Curl_hsts_loadfile() argument
554 DEBUGASSERT(h); in Curl_hsts_loadfile()
556 return hsts_load(h, file); in Curl_hsts_loadfile()
562 CURLcode Curl_hsts_loadcb(struct Curl_easy *data, struct hsts *h) in Curl_hsts_loadcb() argument
564 if(h) in Curl_hsts_loadcb()
565 return hsts_pull(data, h); in Curl_hsts_loadcb()