Lines Matching refs:uri
516 static void request_init(struct Request *req, const struct URI *uri) {
517 req->host = strcopy(uri->host, uri->hostlen);
518 req->port = uri->port;
519 req->path = strcopy(uri->path, uri->pathlen);
520 req->hostport = strcopy(uri->hostport, uri->hostportlen);
531 * Fetches the resource denoted by |uri|.
533 static void fetch_uri(const struct URI *uri) {
544 request_init(&req, uri);
627 static int parse_uri(struct URI *res, const char *uri) {
632 len = strlen(uri);
633 if (len < 9 || memcmp("https://", uri, 8) != 0) {
637 res->host = res->hostport = &uri[offset];
639 if (uri[offset] == '[') {
645 if (uri[i] == ']') {
654 if (strchr(delims, uri[i]) != NULL) {
667 if (uri[offset] == ':') {
673 if (strchr(delims, uri[i]) != NULL) {
676 if ('0' <= uri[i] && uri[i] <= '9') {
678 port += uri[i] - '0';
693 res->hostportlen = (size_t)(uri + offset + ipv6addr - res->host);
695 if (uri[i] == '#') {
703 res->path = &uri[offset];
710 struct URI uri;
735 rv = parse_uri(&uri, argv[1]);
739 fetch_uri(&uri);