Home | History | Annotate | Download | only in libfetch

Lines Matching defs:url

680 _http_connect(struct url *URL, struct url *purl, const char *flags)
700 if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) {
701 URL = purl;
702 URL->scheme, SCHEME_FTP) == 0) {
708 if ((conn = _fetch_connect(URL->host, URL->port, af, verbose)) == NULL)
711 if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 &&
732 static struct url *
735 struct url *purl;
803 _http_request(struct url *URL, const char *op, struct url_stat *us,
804 struct url *purl, const char *flags)
807 struct url *url, *new;
826 /* try the provided URL first */
827 url = URL;
845 if (!url->port)
846 url->port = _fetch_default_port(url->scheme);
848 /* were we redirected to an FTP URL? */
849 if (purl == NULL && strcmp(url->scheme, SCHEME_FTP) == 0) {
851 return (_ftp_request(url, "RETR", us, purl, flags));
853 return (_ftp_request(url, "STAT", us, purl, flags));
857 if ((conn = _http_connect(url, purl, flags)) == NULL)
860 host = url->host;
862 if (strchr(url->host, ':')) {
863 snprintf(hbuf, sizeof(hbuf), "[%s]", url->host);
867 if (url->port != _fetch_default_port(url->scheme)) {
873 sizeof(hbuf) - strlen(hbuf), ":%d", url->port);
879 url->scheme, host, url->doc);
882 op, url->scheme, host, url->doc);
885 op, url->doc);
901 if (need_auth || *url->user || *url->pwd) {
902 if (*url->user || *url->pwd)
903 _http_basic_auth(conn, "Authorization", url->user, url->pwd);
906 else if (fetchAuthMethod && fetchAuthMethod(url) == 0) {
907 _http_basic_auth(conn, "Authorization", url->user, url->pwd);
918 url->scheme, host, url->doc);
926 if (url->offset > 0)
927 _http_cmd(conn, "Range: bytes=%lld-", (long long)url->offset);
1028 new = fetchMakeURL(url->scheme, url->host, url->port, p,
1029 url->user, url->pwd);
1034 DEBUG(fprintf(stderr, "failed to parse new URL\n"));
1038 strcpy(new->user, url->user);
1039 strcpy(new->pwd, url->pwd);
1041 new->offset = url->offset;
1042 new->length = url->length;
1072 if (url->offset == size && url->length == 0) {
1074 offset = url->offset;
1096 if (url != URL)
1097 fetchFreeURL(url);
1098 url = new;
1135 if (URL->offset > 0 && offset > URL->offset) {
1141 URL->offset = offset;
1142 URL->length = (unsigned) clength;
1150 if (url != URL)
1151 fetchFreeURL(url);
1164 if (url != URL)
1165 fetchFreeURL(url);
1182 fetchXGetHTTP(struct url *URL, struct url_stat *us, const char *flags)
1184 return (_http_request(URL, "GET", us, _http_get_proxy(flags), flags));
1191 fetchGetHTTP(struct url *URL, const char *flags)
1193 return (fetchXGetHTTP(URL, NULL, flags));
1201 fetchPutHTTP(struct url *URL __unused, const char *flags __unused)
1211 fetchStatHTTP(struct url *URL, struct url_stat *us, const char *flags)
1215 f = _http_request(URL, "HEAD", us, _http_get_proxy(flags), flags);
1227 fetchListHTTP(struct url *url __unused, const char *flags __unused)