[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.174 and 1.175

version 1.174, 2019/10/13 15:09:26 version 1.175, 2019/10/23 16:47:53
Line 49 
Line 49 
 #include <netdb.h>  #include <netdb.h>
 #include <fcntl.h>  #include <fcntl.h>
 #include <signal.h>  #include <signal.h>
   #include <vis.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdarg.h>  #include <stdarg.h>
 #include <errno.h>  #include <errno.h>
Line 185 
Line 186 
 {  {
         char pbuf[NI_MAXSERV], hbuf[NI_MAXHOST], *cp, *portnum, *path, ststr[4];          char pbuf[NI_MAXSERV], hbuf[NI_MAXHOST], *cp, *portnum, *path, ststr[4];
         char *hosttail, *cause = "unknown", *newline, *host, *port, *buf = NULL;          char *hosttail, *cause = "unknown", *newline, *host, *port, *buf = NULL;
         char *epath, *redirurl, *loctail, *h, *p;          char *epath, *redirurl, *loctail, *h, *p, gerror[200];
         int error, i, isftpurl = 0, isfileurl = 0, isredirect = 0, rval = -1;          int error, i, isftpurl = 0, isfileurl = 0, isredirect = 0, rval = -1;
         int isunavail = 0, retryafter = -1;          int isunavail = 0, retryafter = -1;
         struct addrinfo hints, *res0, *res;          struct addrinfo hints, *res0, *res;
Line 787 
Line 788 
         strlcpy(ststr, cp, sizeof(ststr));          strlcpy(ststr, cp, sizeof(ststr));
         status = strtonum(ststr, 200, 503, &errstr);          status = strtonum(ststr, 200, 503, &errstr);
         if (errstr) {          if (errstr) {
                 warnx("Error retrieving file: %s", cp);                  strnvis(gerror, cp, sizeof gerror, VIS_SAFE);
                   warnx("Error retrieving %s: %s", origline, gerror);
                 goto cleanup_url_get;                  goto cleanup_url_get;
         }          }
   
Line 828 
Line 830 
                 isunavail = 1;                  isunavail = 1;
                 break;                  break;
         default:          default:
                 warnx("Error retrieving file: %s", cp);                  strnvis(gerror, cp, sizeof gerror, VIS_SAFE);
                   warnx("Error retrieving %s: %s", origline, gerror);
                 goto cleanup_url_get;                  goto cleanup_url_get;
         }          }
   
Line 940 
Line 943 
   
         if (isunavail) {          if (isunavail) {
                 if (retried || retryafter != 0)                  if (retried || retryafter != 0)
                         warnx("Error retrieving file: 503 Service Unavailable");                          warnx("Error retrieving %s: 503 Service Unavailable",
                               origline);
                 else {                  else {
                         if (verbose)                          if (verbose)
                                 fprintf(ttyout, "Retrying %s\n", origline);                                  fprintf(ttyout, "Retrying %s\n", origline);

Legend:
Removed from v.1.174  
changed lines
  Added in v.1.175