[BACK]Return to fetch.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ftp

Diff for /src/usr.bin/ftp/fetch.c between version 1.207 and 1.208

version 1.207, 2021/11/09 12:14:35 version 1.208, 2021/11/10 07:32:55
Line 336 
Line 336 
         int ishttpsurl = 0;          int ishttpsurl = 0;
 #endif /* !NOSSL */  #endif /* !NOSSL */
 #ifndef SMALL  #ifndef SMALL
         char *eurl = NULL;  
         char *full_host = NULL;          char *full_host = NULL;
         const char *scheme;          const char *scheme;
         char *locbase;          char *locbase;
Line 346 
Line 345 
         struct stat stbuf;          struct stat stbuf;
         struct tm lmt = { 0 };          struct tm lmt = { 0 };
         struct timespec ts[2];          struct timespec ts[2];
 #else  
         char *eurl = NULL;  
 #endif /* !SMALL */  #endif /* !SMALL */
         struct tls *tls = NULL;          struct tls *tls = NULL;
         int status;          int status;
Line 716 
Line 713 
 #endif /* !NOSSL */  #endif /* !NOSSL */
   
         epath = url_encode(path);          epath = url_encode(path);
 #ifndef SMALL  
         if (asprintf(&eurl, "%s%s%s%s/%s",  
             scheme,  
             full_host,  
             portnum ? ":" : "",  
             portnum ? portnum : "",  
             epath) == -1)  
                 errx(1, "Cannot build encoded URL");  
 #endif  
         if (proxyurl) {          if (proxyurl) {
 #ifndef SMALL  
                 if (verbose) {                  if (verbose) {
                         fprintf(ttyout, "Requesting %s (via %s)\n",                          fprintf(ttyout, "Requesting %s (via %s)\n",
                             eurl, proxyurl);                              origline, proxyurl);
                 }                  }
 #endif  
                 /*                  /*
                  * Host: directive must use the destination host address for                   * Host: directive must use the destination host address for
                  * the original URI (path).                   * the original URI (path).
Line 748 
Line 734 
                             proxy_credentials);                              proxy_credentials);
                 ftp_printf(fin, "\r\n");                  ftp_printf(fin, "\r\n");
         } else {          } else {
 #ifndef SMALL  
                 if (verbose)                  if (verbose)
                         fprintf(ttyout, "Requesting %s\n", eurl);                          fprintf(ttyout, "Requesting %s\n", origline);
   #ifndef SMALL
                 if (resume || timestamp) {                  if (resume || timestamp) {
                         if (stat(savefile, &stbuf) == 0) {                          if (stat(savefile, &stbuf) == 0) {
                                 if (resume)                                  if (resume)
Line 847 
Line 833 
         status = strtonum(ststr, 200, 503, &errstr);          status = strtonum(ststr, 200, 503, &errstr);
         if (errstr) {          if (errstr) {
                 strnvis(gerror, cp, sizeof gerror, VIS_SAFE);                  strnvis(gerror, cp, sizeof gerror, VIS_SAFE);
 #ifndef SMALL  
                 warnx("Error retrieving %s: %s", eurl, gerror);  
 #else  
                 warnx("Error retrieving %s: %s", origline, gerror);                  warnx("Error retrieving %s: %s", origline, gerror);
 #endif  
                 goto cleanup_url_get;                  goto cleanup_url_get;
         }          }
   
Line 897 
Line 879 
                 break;                  break;
         default:          default:
                 strnvis(gerror, cp, sizeof gerror, VIS_SAFE);                  strnvis(gerror, cp, sizeof gerror, VIS_SAFE);
 #ifndef SMALL  
                 warnx("Error retrieving %s: %s", eurl, gerror);  
 #else  
                 warnx("Error retrieving %s: %s", origline, gerror);                  warnx("Error retrieving %s: %s", origline, gerror);
 #endif  
                 goto cleanup_url_get;                  goto cleanup_url_get;
         }          }
   
Line 1034 
Line 1012 
         if (isunavail) {          if (isunavail) {
                 if (retried || retryafter != 0)                  if (retried || retryafter != 0)
                         warnx("Error retrieving %s: 503 Service Unavailable",                          warnx("Error retrieving %s: 503 Service Unavailable",
 #ifndef SMALL  
                             eurl);  
 #else  
                             origline);                              origline);
 #endif  
                 else {                  else {
                         if (verbose)                          if (verbose)
                                 fprintf(ttyout, "Retrying %s\n", origline);                                  fprintf(ttyout, "Retrying %s\n", origline);
Line 1161 
Line 1135 
   
 cleanup_url_get:  cleanup_url_get:
 #ifndef SMALL  #ifndef SMALL
         free(eurl);  
         free(full_host);          free(full_host);
 #endif /* !SMALL */  #endif /* !SMALL */
 #ifndef NOSSL  #ifndef NOSSL

Legend:
Removed from v.1.207  
changed lines
  Added in v.1.208