[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.192 and 1.193

version 1.192, 2020/02/20 00:45:09 version 1.193, 2020/02/22 00:58:28
Line 326 
Line 326 
         char *proxyhost = NULL;          char *proxyhost = NULL;
 #ifndef NOSSL  #ifndef NOSSL
         char *sslpath = NULL, *sslhost = NULL;          char *sslpath = NULL, *sslhost = NULL;
         int ishttpurl = 0, ishttpsurl = 0;          int ishttpsurl = 0;
 #endif /* !NOSSL */  #endif /* !NOSSL */
 #ifndef SMALL  #ifndef SMALL
         char *full_host = NULL;          char *full_host = NULL;
Line 347 
Line 347 
                 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 NOSSL  
                 ishttpurl = 1;  
 #endif /* !NOSSL */  
 #ifndef SMALL  #ifndef SMALL
                 scheme = HTTP_URL;                  scheme = HTTP_URL;
 #endif /* !SMALL */  #endif /* !SMALL */
Line 374 
Line 371 
   
         path = strchr(host, '/');               /* Find path */          path = strchr(host, '/');               /* Find path */
   
 #ifndef NOSSL  
         /*          /*
          * Look for auth header in host.           * Look for auth header in host.
          * Basic auth from RFC 2617, valid characters for path are in           * Basic auth from RFC 2617, valid characters for path are in
          * RFC 3986 section 3.3.           * RFC 3986 section 3.3.
          */           */
         if (ishttpurl || ishttpsurl) {          if (!isftpurl) {
                 p = strchr(host, '@');                  p = strchr(host, '@');
                 if (p != NULL && (path == NULL || p < path)) {                  if (p != NULL && (path == NULL || p < path)) {
                         *p++ = '\0';                          *p++ = '\0';
Line 391 
Line 387 
                         path = strchr(host, '/');                          path = strchr(host, '/');
                 }                  }
         }          }
 #endif /* !NOSSL */  
   
         if (EMPTYSTRING(path)) {          if (EMPTYSTRING(path)) {
                 if (outfile) {                          /* No slash, but */                  if (outfile) {                          /* No slash, but */
Line 735 
Line 730 
                                 restart_point = 0;                                  restart_point = 0;
                 }                  }
 #endif  /* SMALL */  #endif  /* SMALL */
 #ifndef NOSSL  
                 if (credentials) {                  if (credentials) {
                         ftp_printf(fin,                          ftp_printf(fin,
                             "GET /%s HTTP/1.1\r\n"                              "GET /%s HTTP/1.1\r\n"
Line 745 
Line 739 
                         free(credentials);                          free(credentials);
                         credentials = NULL;                          credentials = NULL;
                 } else                  } else
 #endif  /* NOSSL */  
                         ftp_printf(fin,                          ftp_printf(fin,
                             "GET /%s HTTP/1.1\r\n"                              "GET /%s HTTP/1.1\r\n"
                             "Connection: close\r\n"                              "Connection: close\r\n"

Legend:
Removed from v.1.192  
changed lines
  Added in v.1.193