[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.89 and 1.90

version 1.89, 2009/06/04 23:37:09 version 1.90, 2009/06/13 20:01:10
Line 491 
Line 491 
                             path, buf ? buf : "", HTTP_USER_AGENT);                              path, buf ? buf : "", HTTP_USER_AGENT);
   
         } else {          } else {
   #ifndef SMALL
                   if (resume) {
                           struct stat stbuf;
   
                           if (stat(savefile, &stbuf) == 0)
                                   restart_point = stbuf.st_size;
                           else
                                   restart_point = 0;
                   }
   #endif /* !SMALL */
                 ftp_printf(fin, ssl, "GET /%s %s\r\nHost: ", path,                  ftp_printf(fin, ssl, "GET /%s %s\r\nHost: ", path,
 #ifndef SMALL  #ifndef SMALL
                         resume ? "HTTP/1.1" :                          restart_point ? "HTTP/1.1" :
 #endif /* !SMALL */  #endif /* !SMALL */
                         "HTTP/1.0");                          "HTTP/1.0");
                 if (strchr(host, ':')) {                  if (strchr(host, ':')) {
Line 521 
Line 531 
 #ifndef SMALL  #ifndef SMALL
                 if (port && strcmp(port, (ishttpsurl ? "443" : "80")) != 0)                  if (port && strcmp(port, (ishttpsurl ? "443" : "80")) != 0)
                         ftp_printf(fin, ssl, ":%s", port);                          ftp_printf(fin, ssl, ":%s", port);
                 if (resume) {                  if (restart_point)
                         int ret;  
                         struct stat stbuf;  
   
                         ret = stat(savefile, &stbuf);  
                         if (ret < 0) {  
                                 if (verbose)  
                                         fprintf(ttyout, "\n");  
                                 warn("Can't open %s", savefile);  
                                 goto cleanup_url_get;  
                         }  
                         restart_point = stbuf.st_size;  
                         ftp_printf(fin, ssl, "\r\nRange: bytes=%lld-",                          ftp_printf(fin, ssl, "\r\nRange: bytes=%lld-",
                                 (long long)restart_point);                                  (long long)restart_point);
                 }  
 #else /* !SMALL */  #else /* !SMALL */
                 if (port && strcmp(port, "80") != 0)                  if (port && strcmp(port, "80") != 0)
                         ftp_printf(fin, ssl, ":%s", port);                          ftp_printf(fin, ssl, ":%s", port);
Line 637 
Line 635 
                         if (errstr != NULL)                          if (errstr != NULL)
                                 goto improper;                                  goto improper;
 #ifndef SMALL  #ifndef SMALL
                         if (resume)                          if (restart_point)
                                 filesize += restart_point;                                  filesize += restart_point;
 #endif /* !SMALL */  #endif /* !SMALL */
 #define LOCATION "Location: "  #define LOCATION "Location: "

Legend:
Removed from v.1.89  
changed lines
  Added in v.1.90