[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.180 and 1.181

version 1.180, 2019/12/02 22:32:18 version 1.181, 2019/12/05 10:26:25
Line 201 
Line 201 
         char *proxyhost = NULL;          char *proxyhost = NULL;
 #ifndef NOSSL  #ifndef NOSSL
         char *sslpath = NULL, *sslhost = NULL;          char *sslpath = NULL, *sslhost = NULL;
         char *full_host = NULL;  
         const char *scheme;  
         int ishttpurl = 0, ishttpsurl = 0;          int ishttpurl = 0, ishttpsurl = 0;
 #endif /* !NOSSL */  #endif /* !NOSSL */
 #ifndef SMALL  #ifndef SMALL
           char *full_host = NULL;
           const char *scheme;
         char *locbase;          char *locbase;
         struct addrinfo *ares = NULL;          struct addrinfo *ares = NULL;
 #endif  #endif /* !SMALL */
         struct tls *tls = NULL;          struct tls *tls = NULL;
         int status;          int status;
         int save_errno;          int save_errno;
Line 222 
Line 222 
                 errx(1, "Can't allocate memory to parse URL");                  errx(1, "Can't allocate memory to parse URL");
         if (strncasecmp(newline, HTTP_URL, sizeof(HTTP_URL) - 1) == 0) {          if (strncasecmp(newline, HTTP_URL, sizeof(HTTP_URL) - 1) == 0) {
                 host = newline + sizeof(HTTP_URL) - 1;                  host = newline + sizeof(HTTP_URL) - 1;
 #ifndef SMALL  #ifndef NOSSL
                 ishttpurl = 1;                  ishttpurl = 1;
   #endif /* !NOSSL */
   #ifndef SMALL
                 scheme = HTTP_URL;                  scheme = HTTP_URL;
 #endif /* !SMALL */  #endif /* !SMALL */
         } else if (strncasecmp(newline, FTP_URL, sizeof(FTP_URL) - 1) == 0) {          } else if (strncasecmp(newline, FTP_URL, sizeof(FTP_URL) - 1) == 0) {
Line 235 
Line 237 
         } else if (strncasecmp(newline, FILE_URL, sizeof(FILE_URL) - 1) == 0) {          } else if (strncasecmp(newline, FILE_URL, sizeof(FILE_URL) - 1) == 0) {
                 host = newline + sizeof(FILE_URL) - 1;                  host = newline + sizeof(FILE_URL) - 1;
                 isfileurl = 1;                  isfileurl = 1;
 #ifndef NOSSL  #ifndef SMALL
                 scheme = FILE_URL;                  scheme = FILE_URL;
   #endif /* !SMALL */
   #ifndef NOSSL
         } else if (strncasecmp(newline, HTTPS_URL, sizeof(HTTPS_URL) - 1) == 0) {          } else if (strncasecmp(newline, HTTPS_URL, sizeof(HTTPS_URL) - 1) == 0) {
                 host = newline + sizeof(HTTPS_URL) - 1;                  host = newline + sizeof(HTTPS_URL) - 1;
                 ishttpsurl = 1;                  ishttpsurl = 1;
   #ifndef SMALL
                 scheme = HTTPS_URL;                  scheme = HTTPS_URL;
   #endif /* !SMALL */
 #endif /* !NOSSL */  #endif /* !NOSSL */
         } else          } else
                 errx(1, "url_get: Invalid URL '%s'", newline);                  errx(1, "url_get: Invalid URL '%s'", newline);
Line 1084 
Line 1090 
         warnx("Improper response from %s", host);          warnx("Improper response from %s", host);
   
 cleanup_url_get:  cleanup_url_get:
 #ifndef NOSSL  #ifndef SMALL
         free(full_host);          free(full_host);
   #endif /* !SMALL */
   #ifndef NOSSL
         free(sslhost);          free(sslhost);
 #endif /* !NOSSL */  #endif /* !NOSSL */
         ftp_close(&fin, &tls, &fd);          ftp_close(&fin, &tls, &fd);

Legend:
Removed from v.1.180  
changed lines
  Added in v.1.181