Lines Matching refs:url

102 static struct url cached_host;
905 ftp_authenticate(conn_t *conn, struct url *url, struct url *purl) in ftp_authenticate() argument
914 if (url->user[0] == '\0') in ftp_authenticate()
915 fetch_netrc_auth(url); in ftp_authenticate()
916 user = url->user; in ftp_authenticate()
922 if (purl && url->port == fetch_default_port(url->scheme)) in ftp_authenticate()
923 e = ftp_cmd(conn, "USER %s@%s", user, url->host); in ftp_authenticate()
925 e = ftp_cmd(conn, "USER %s@%s@%d", user, url->host, url->port); in ftp_authenticate()
931 pwd = url->pwd; in ftp_authenticate()
955 ftp_connect(struct url *url, struct url *purl, const char *flags) in ftp_connect() argument
981 conn = fetch_connect(url->host, url->port, af, verbose); in ftp_connect()
995 if ((e = ftp_authenticate(conn, url, purl)) != FTP_LOGGED_IN) in ftp_connect()
1026 ftp_isconnected(struct url *url) in ftp_isconnected() argument
1029 && (strcmp(url->host, cached_host.host) == 0) in ftp_isconnected()
1030 && (strcmp(url->user, cached_host.user) == 0) in ftp_isconnected()
1031 && (strcmp(url->pwd, cached_host.pwd) == 0) in ftp_isconnected()
1032 && (url->port == cached_host.port)); in ftp_isconnected()
1039 ftp_cached_connect(struct url *url, struct url *purl, const char *flags) in ftp_cached_connect() argument
1045 if (!url->port) in ftp_cached_connect()
1046 url->port = fetch_default_port(url->scheme); in ftp_cached_connect()
1049 if (ftp_isconnected(url)) { in ftp_cached_connect()
1056 if ((conn = ftp_connect(url, purl, flags)) == NULL) in ftp_cached_connect()
1061 memcpy(&cached_host, url, sizeof(*url)); in ftp_cached_connect()
1068 static struct url *
1069 ftp_get_proxy(struct url * url, const char *flags) in ftp_get_proxy() argument
1071 struct url *purl; in ftp_get_proxy()
1076 if (fetch_no_proxy_match(url->host)) in ftp_get_proxy()
1101 ftp_request(struct url *url, const char *op, struct url_stat *us, in ftp_request() argument
1102 struct url *purl, const char *flags) in ftp_request()
1111 return (http_request(url, "HEAD", us, purl, flags)); in ftp_request()
1113 return (http_request(url, "GET", us, purl, flags)); in ftp_request()
1121 conn = ftp_cached_connect(url, purl, flags); in ftp_request()
1128 if (ftp_cwd(conn, url->doc) == -1) in ftp_request()
1132 if (us && ftp_stat(conn, url->doc, us) == -1 in ftp_request()
1149 return (ftp_transfer(conn, op, url->doc, oflag, url->offset, flags)); in ftp_request()
1160 fetchXGetFTP(struct url *url, struct url_stat *us, const char *flags) in fetchXGetFTP() argument
1162 return (ftp_request(url, "RETR", us, ftp_get_proxy(url, flags), flags)); in fetchXGetFTP()
1169 fetchGetFTP(struct url *url, const char *flags) in fetchGetFTP() argument
1171 return (fetchXGetFTP(url, NULL, flags)); in fetchGetFTP()
1178 fetchPutFTP(struct url *url, const char *flags) in fetchPutFTP() argument
1180 return (ftp_request(url, CHECK_FLAG('a') ? "APPE" : "STOR", NULL, in fetchPutFTP()
1181 ftp_get_proxy(url, flags), flags)); in fetchPutFTP()
1188 fetchStatFTP(struct url *url, struct url_stat *us, const char *flags) in fetchStatFTP() argument
1192 f = ftp_request(url, "STAT", us, ftp_get_proxy(url, flags), flags); in fetchStatFTP()
1207 fetchListFTP(struct url *url __unused, const char *flags __unused) in fetchListFTP()