Lines Matching full:url
106 #define FILE_URL "file://" /* file URL prefix */
107 #define FTP_URL "ftp://" /* ftp URL prefix */
108 #define HTTP_URL "http://" /* http URL prefix */
268 url_decode(char *url) in url_decode() argument
272 if (EMPTYSTRING(url)) in url_decode()
274 p = q = (unsigned char *)url; in url_decode()
291 * Parse URL of form (per RFC3986):
302 * leading `/' unless it's an ftp:// URL, as this makes things easier
304 * host and the URL-path removed, but any additional leading slashes
305 * in the URL-path are retained (because they imply that we should
309 * input URL output path
322 parse_url(const char *url, const char *desc, url_t *utype, in parse_url() argument
330 if (url == NULL || desc == NULL || utype == NULL || uuser == NULL in parse_url()
334 DPRINTF("parse_url: %s `%s'\n", desc, url); in parse_url()
336 origurl = url; in parse_url()
342 if (STRNEQUAL(url, HTTP_URL)) { in parse_url()
343 url += sizeof(HTTP_URL) - 1; in parse_url()
347 } else if (STRNEQUAL(url, FTP_URL)) { in parse_url()
348 url += sizeof(FTP_URL) - 1; in parse_url()
352 } else if (STRNEQUAL(url, FILE_URL)) { in parse_url()
353 url += sizeof(FILE_URL) - 1; in parse_url()
356 warnx("Invalid %s `%s'", desc, url); in parse_url()
368 if (*url == '\0') in parse_url()
372 ep = strchr(url, '/'); in parse_url()
374 thost = ftp_strdup(url); in parse_url()
376 len = ep - url; in parse_url()
378 (void)strlcpy(thost, url, len + 1); in parse_url()
470 * Retrieve URL, via a proxy if necessary, using HTTP.
478 fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) in fetch_url() argument
513 DPRINTF("fetch_url: `%s' proxyenv `%s'\n", url, STRorNULL(proxyenv)); in fetch_url()
525 if (parse_url(url, "URL", &urltype, &uuser, &pass, &host, &port, in fetch_url()
531 warnx("No support for non local file URL `%s'", url); in fetch_url()
537 rval = fetch_ftp(url); in fetch_url()
541 warnx("Invalid URL (no file after host) `%s'", url); in fetch_url()
561 rval = fetch_ftp(url); in fetch_url()
565 "output file) `%s'", url); in fetch_url()
621 /* check URL against list of no_proxied sites */ in fetch_url()
652 rval = fetch_ftp(url); in fetch_url()
659 warnx("Can't restart via proxy URL `%s'", in fetch_url()
663 if (parse_url(proxyenv, "proxy URL", &purltype, in fetch_url()
673 warnx("Malformed proxy URL `%s'", in fetch_url()
696 path = ftp_strdup(url); in fetch_url()
762 fprintf(ttyout, "Requesting %s\n", url); in fetch_url()
1034 rval = fetch_url(url, location, in fetch_url()
1082 rval = fetch_url(url, proxyenv, in fetch_url()
1133 url, savefile); in fetch_url()
1365 * Retrieve ftp URL or classic ftp argument using FTP.
1370 fetch_ftp(const char *url) in fetch_ftp() argument
1382 DPRINTF("fetch_ftp: `%s'\n", url); in fetch_ftp()
1388 if (STRNEQUAL(url, FTP_URL)) { in fetch_ftp()
1389 if ((parse_url(url, "URL", &urltype, &uuser, &pass, in fetch_ftp()
1393 warnx("Invalid URL `%s'", url); in fetch_ftp()
1409 "Directory listing via a URL is not supported"); in fetch_ftp()
1412 warnx("Invalid suffix `%s' in URL `%s'", cp, in fetch_ftp()
1413 url); in fetch_ftp()
1420 host = ftp_strdup(url); in fetch_ftp()
1447 * a path of the form `/file' (resulting from a URL of the form in fetch_ftp()
1454 * classic `[user@]host:[file]' or URL `ftp://host/file'.) in fetch_ftp()
1460 * resulting from an URL of the form `ftp://host//file'.) in fetch_ftp()
1547 * If we are dealing with an `ftp://host/path' URL in fetch_ftp()
1625 " RFC3986 to support the empty directory in the URL pathname (`//'),\n" in fetch_ftp()
1627 " Try the same URL without the `//' in the URL pathname.\n" in fetch_ftp()
1710 go_fetch(const char *url) in go_fetch() argument
1718 if (STRNEQUAL(url, ABOUT_URL)) { in go_fetch()
1719 url += sizeof(ABOUT_URL) -1; in go_fetch()
1720 if (strcasecmp(url, "ftp") == 0 || in go_fetch()
1721 strcasecmp(url, "tnftp") == 0) { in go_fetch()
1725 } else if (strcasecmp(url, "lukem") == 0) { in go_fetch()
1729 } else if (strcasecmp(url, "netbsd") == 0) { in go_fetch()
1733 } else if (strcasecmp(url, "version") == 0) { in go_fetch()
1743 fprintf(ttyout, "`%s' is an interesting topic.\n", url); in go_fetch()
1753 if (STRNEQUAL(url, HTTP_URL) || STRNEQUAL(url, FILE_URL)) in go_fetch()
1754 return (fetch_url(url, NULL, NULL, NULL)); in go_fetch()
1757 * Try FTP URL-style and host:file arguments next. in go_fetch()
1758 * If ftpproxy is set with an FTP URL, use fetch_url() in go_fetch()
1762 if (!EMPTYSTRING(proxyenv) && STRNEQUAL(url, FTP_URL)) in go_fetch()
1763 return (fetch_url(url, NULL, NULL, NULL)); in go_fetch()
1765 return (fetch_ftp(url)); in go_fetch()
1865 warnx("Invalid URL `%s'", path); in auto_put()
1877 DPRINTF("auto_put: URL `%s' argv[2] `%s'\n", in auto_put()