Lines Matching refs:sfp
109 FILE *sfp = NULL; /* socket to web/ftp server */
254 if (sfp) fclose(sfp);
255 sfp = open_socket(lsa);
259 fprintf(sfp, "GET %stp://%s/%s HTTP/1.1\r\n",
263 fprintf(sfp, "GET /%s HTTP/1.1\r\n", target.path);
266 fprintf(sfp, "Host: %s\r\nUser-Agent: %s\r\n",
271 fprintf(sfp, "Proxy-Authorization: Basic %s\r\n"+6,
275 fprintf(sfp, "Proxy-Authorization: Basic %s\r\n",
281 fprintf(sfp, "Range: bytes=%"OFF_FMT"d-\r\n", beg_range);
284 fputs(extra_headers, sfp);
286 fprintf(sfp, "Connection: close\r\n\r\n");
292 if (fgets(buf, sizeof(buf), sfp) == NULL)
303 while (gethdr(buf, sizeof(buf), sfp, &n) != NULL)
326 while ((str = gethdr(buf, sizeof(buf), sfp, &n)) != NULL) {
360 dfp = sfp;
370 sfp = open_socket(lsa);
371 if (ftpcmd(NULL, NULL, sfp, buf) != 220)
381 switch (ftpcmd("USER ", target.user, sfp, buf)) {
385 if (ftpcmd("PASS ", str, sfp, buf) == 230)
392 ftpcmd("TYPE I", NULL, sfp, buf);
397 if (ftpcmd("SIZE ", target.path, sfp, buf) == 213) {
408 if (ftpcmd("PASV", NULL, sfp, buf) != 227) {
429 if (ftpcmd(buf, NULL, sfp, buf) == 350)
433 if (ftpcmd("RETR ", target.path, sfp, buf) > 150)
438 fclose(sfp);
496 if (ftpcmd(NULL, NULL, sfp, buf) != 226)
498 ftpcmd("QUIT", NULL, sfp, buf);