Lines Matching defs:fin
818 print_host(FETCH *fin, const struct urlinfo *ui)
823 fetch_printf(fin, "Host: %s", ui->host);
833 fetch_printf(fin, "Host: [%s]", h);
839 fetch_printf(fin, ":%u", ui->portnum);
840 fetch_printf(fin, "\r\n");
844 print_agent(FETCH *fin)
848 fetch_printf(fin, "User-Agent: %s\r\n", useragent);
850 fetch_printf(fin, "User-Agent: %s/%s\r\n",
856 print_cache(FETCH *fin, int isproxy)
858 fetch_printf(fin, isproxy ?
864 print_get(FETCH *fin, int hasleading, int isproxy, const struct urlinfo *oui,
877 fetch_printf(fin, "GET %s HTTP/1.0\r\n", ui->path);
878 print_host(fin, oui);
882 fetch_printf(fin, "GET %s HTTP/1.1\r\n", ui->path);
883 print_host(fin, ui);
884 fetch_printf(fin, "Accept: */*\r\n");
885 fetch_printf(fin, "Connection: close\r\n");
887 fetch_printf(fin, "%s\r\n", np->header);
892 fetch_printf(fin, "Range: bytes=" LLF "-\r\n",
925 print_proxy(FETCH *fin, int hasleading, const char *wwwauth,
935 fetch_printf(fin, "Authorization: %s\r\n", wwwauth);
942 fetch_printf(fin, "Proxy-Authorization: %s\r\n", proxyauth);
949 print_connect(FETCH *fin, const struct urlinfo *ui)
968 fetch_printf(fin, "CONNECT %s:%d HTTP/1.1\r\n", h, ui->portnum);
969 fetch_printf(fin, "Host: %s:%d\r\n", h, ui->portnum);
978 getresponseline(FETCH *fin, char *buf, size_t buflen, int *len)
983 *len = fetch_getline(fin, buf, buflen, &errormsg);
1000 getresponse(FETCH *fin, char **cp, size_t buflen, int *hcode)
1006 if ((rv = getresponseline(fin, buf, buflen, &len)) != C_OK)
1118 negotiate_connection(FETCH *fin, const char *url, const char *penv,
1134 switch (getresponse(fin, &ep, ftp_buflen, &hcode)) {
1147 if ((rv = getresponseline(fin, buf, ftp_buflen, &len)) != C_OK)
1283 connectmethod(FETCH *fin, const char *url, const char *penv,
1293 print_connect(fin, oui);
1295 print_agent(fin);
1296 *hasleading = print_proxy(fin, *hasleading, NULL, pauth->auth);
1302 fetch_printf(fin, "\r\n");
1303 if (fetch_flush(fin) == EOF) {
1314 switch (getresponse(fin, &ep, ftp_buflen, &hcode)) {
1326 if (getresponseline(fin, buf, ftp_buflen, &len) != C_OK)
1364 if ((ssl = fetch_start_ssl(fetch_fileno(fin), oui->host)) == NULL)
1366 fetch_set_ssl(fin, ssl);
1417 FETCH *volatile fin;
1428 fin = NULL;
1507 fin = fetch_open(decodedpath, "r");
1508 if (fin == NULL) {
1512 if (fstat(fetch_fileno(fin), &sb) == 0) {
1517 if (lseek(fetch_fileno(fin), restart_point, SEEK_SET)
1581 fin = fetch_fdopen(s, "r+");
1582 fetch_set_ssl(fin, ssl);
1595 switch (connectmethod(fin, url, penv, &oui, &ui,
1610 hasleading = print_get(fin, hasleading, isproxy, &oui, &ui);
1613 print_cache(fin, isproxy);
1615 print_agent(fin);
1616 hasleading = print_proxy(fin, hasleading, wauth.auth,
1624 fetch_printf(fin, "\r\n");
1625 if (fetch_flush(fin) == EOF) {
1632 switch (negotiate_connection(fin, url, penv, &pi,
1724 if (fetch_getln(xferbuf, (int)bufsize, fin) == NULL) {
1779 nr, fin);
1781 if (fetch_error(fin))
1820 if (fetch_getln(xferbuf, (int)bufsize, fin) == NULL) {
1841 if (fetch_error(fin)) {
1886 if (fin != NULL)
1887 fetch_close(fin);