[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.1 and 1.2

version 1.1, 1997/02/03 01:02:37 version 1.2, 1997/02/03 01:05:37
Line 1 
Line 1 
   /*      $OpenBSD$       */
 /*      $NetBSD: fetch.c,v 1.2 1997/02/01 10:45:00 lukem Exp $  */  /*      $NetBSD: fetch.c,v 1.2 1997/02/01 10:45:00 lukem Exp $  */
   
 /*-  /*-
Line 37 
Line 38 
  */   */
   
 #ifndef lint  #ifndef lint
 static char rcsid[] = "$NetBSD: fetch.c,v 1.2 1997/02/01 10:45:00 lukem Exp $";  static char rcsid[] = "$OpenBSD$";
 #endif /* not lint */  #endif /* not lint */
   
 /*  /*
Line 260 
Line 261 
         oldintr = NULL;          oldintr = NULL;
         if (setjmp(httpabort)) {          if (setjmp(httpabort)) {
                 if (oldintr)                  if (oldintr)
                         (void) signal(SIGINT, oldintr);                          (void)signal(SIGINT, oldintr);
                 goto cleanup_http_get;                  goto cleanup_http_get;
         }          }
         oldintr = signal(SIGINT, aborthttp);          oldintr = signal(SIGINT, aborthttp);
Line 283 
Line 284 
                 }                  }
                 if (hash && !progress) {                  if (hash && !progress) {
                         while (bytes >= hashbytes) {                          while (bytes >= hashbytes) {
                                 (void) putchar('#');                                  (void)putchar('#');
                                 hashbytes += mark;                                  hashbytes += mark;
                         }                          }
                         (void) fflush(stdout);                          (void)fflush(stdout);
                 }                  }
         }          }
         if (hash && !progress && bytes > 0) {          if (hash && !progress && bytes > 0) {
                 if (bytes < mark)                  if (bytes < mark)
                         (void) putchar('#');                          (void)putchar('#');
                 (void) putchar('\n');                  (void)putchar('\n');
                 (void) fflush(stdout);                  (void)fflush(stdout);
         }          }
         if (len != 0) {          if (len != 0) {
                 warn("Reading from socket");                  warn("Reading from socket");
Line 301 
Line 302 
         }          }
         progressmeter(1);          progressmeter(1);
         if (verbose)          if (verbose)
                 printf("Successfully retrieved file.\n");                  puts("Successfully retrieved file.");
         (void) signal(SIGINT, oldintr);          (void)signal(SIGINT, oldintr);
   
         close(s);          close(s);
         close(out);          close(out);
         if (proxy)          if (proxy)
                 free(proxy);                  free(proxy);
         return(0);          return (0);
   
 improper:  improper:
         warnx("improper response from %s", host);          warnx("improper response from %s", host);
Line 317 
Line 318 
                 close(s);                  close(s);
         if (proxy)          if (proxy)
                 free(proxy);                  free(proxy);
         return(-1);          return (-1);
 }  }
   
 /*  /*
Line 328 
Line 329 
 {  {
   
         alarmtimer(0);          alarmtimer(0);
         printf("\nhttp fetch aborted\n");          puts("\nhttp fetch aborted");
         (void) fflush(stdout);          (void)fflush(stdout);
         longjmp(httpabort, 1);          longjmp(httpabort, 1);
 }  }
   
Line 338 
Line 339 
  * files of the form "host:path", "ftp://host/path" using the   * files of the form "host:path", "ftp://host/path" using the
  * ftp protocol, and files of the form "http://host/path" using   * ftp protocol, and files of the form "http://host/path" using
  * the http protocol.   * the http protocol.
  * If path has a trailing "/", then return(-1);   * If path has a trailing "/", then return (-1);
  * the path will be cd-ed into and the connection remains open,   * the path will be cd-ed into and the connection remains open,
  * and the function will return -1 (to indicate the connection   * and the function will return -1 (to indicate the connection
  * is alive).   * is alive).
Line 362 
Line 363 
         if (setjmp(toplevel)) {          if (setjmp(toplevel)) {
                 if (connected)                  if (connected)
                         disconnect(0, NULL);                          disconnect(0, NULL);
                 return(argpos + 1);                  return (argpos + 1);
         }          }
         (void) signal(SIGINT, intr);          (void)signal(SIGINT, intr);
         (void) signal(SIGPIPE, lostpeer);          (void)signal(SIGPIPE, lostpeer);
   
         /*          /*
          * Loop through as long as there's files to fetch.           * Loop through as long as there's files to fetch.

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2