/[inetutils]/inetutils/ftp/ftp.c
ViewVC logotype

Diff of /inetutils/ftp/ftp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by ams, Sat Jan 22 14:53:07 2005 UTC revision 1.26 by gray, Tue Oct 11 11:16:13 2005 UTC
# Line 63  static char sccsid[] = "@(#)ftp.c      8.6 (B Line 63  static char sccsid[] = "@(#)ftp.c      8.6 (B
63  #include <arpa/telnet.h>  #include <arpa/telnet.h>
64    
65  #include <ctype.h>  #include <ctype.h>
66  #include <err.h>  #include <error.h>
67  #include <errno.h>  #include <errno.h>
68  #include <fcntl.h>  #include <fcntl.h>
69  #include <netdb.h>  #include <netdb.h>
# Line 122  hookup(host, port) Line 122  hookup(host, port)
122          hisctladdr.sin_addr.s_addr = inet_addr(host);          hisctladdr.sin_addr.s_addr = inet_addr(host);
123          if (hisctladdr.sin_addr.s_addr != -1) {          if (hisctladdr.sin_addr.s_addr != -1) {
124                  hisctladdr.sin_family = AF_INET;                  hisctladdr.sin_family = AF_INET;
125                  (void) strncpy(hostnamebuf, host, sizeof(hostnamebuf));                  strncpy(hostnamebuf, host, sizeof(hostnamebuf));
126          } else {          } else {
127                  hp = gethostbyname(host);                  hp = gethostbyname(host);
128                  if (hp == NULL) {                  if (hp == NULL) {
129  #ifdef HAVE_HSTRERROR  #ifdef HAVE_HSTRERROR
130                          warnx("%s: %s", host, hstrerror(h_errno));                          error (0, 0, "%s: %s", host, hstrerror(h_errno));
131  #else  #else
132                          extern char *__progname;                          extern char *__progname;
133                          char *pfx =                          char *pfx =
# Line 146  hookup(host, port) Line 146  hookup(host, port)
146                                  hp->h_addr,                                  hp->h_addr,
147  #endif  #endif
148                                  hp->h_length);                                  hp->h_length);
149                  (void) strncpy(hostnamebuf, hp->h_name, sizeof(hostnamebuf));                  strncpy(hostnamebuf, hp->h_name, sizeof(hostnamebuf));
150          }          }
151          hostname = hostnamebuf;          hostname = hostnamebuf;
152          s = socket(hisctladdr.sin_family, SOCK_STREAM, 0);          s = socket(hisctladdr.sin_family, SOCK_STREAM, 0);
153          if (s < 0) {          if (s < 0) {
154                  warn("socket");                  error (0, errno, "socket");
155                  code = -1;                  code = -1;
156                  return (0);                  return (0);
157          }          }
# Line 163  hookup(host, port) Line 163  hookup(host, port)
163                          char *ia;                          char *ia;
164    
165                          ia = inet_ntoa(hisctladdr.sin_addr);                          ia = inet_ntoa(hisctladdr.sin_addr);
166                          errno = oerrno;                          error (0, oerrno, "connect to address %s", ia);
                         warn("connect to address %s", ia);  
167                          hp->h_addr_list++;                          hp->h_addr_list++;
168                          memmove((caddr_t)&hisctladdr.sin_addr,                          memmove((caddr_t)&hisctladdr.sin_addr,
169                                          hp->h_addr_list[0], hp->h_length);                                          hp->h_addr_list[0], hp->h_length);
170                          fprintf(stdout, "Trying %s...\n",                          fprintf(stdout, "Trying %s...\n",
171                                  inet_ntoa(hisctladdr.sin_addr));                                  inet_ntoa(hisctladdr.sin_addr));
172                          (void) close(s);                          close(s);
173                          s = socket(hisctladdr.sin_family, SOCK_STREAM, 0);                          s = socket(hisctladdr.sin_family, SOCK_STREAM, 0);
174                          if (s < 0) {                          if (s < 0) {
175                                  warn("socket");                                  error (0, errno, "socket");
176                                  code = -1;                                  code = -1;
177                                  return (0);                                  return (0);
178                          }                          }
179                          continue;                          continue;
180                  }                  }
181  #endif  #endif
182                  warn("connect");                  error (0, errno, "connect");
183                  code = -1;                  code = -1;
184                  goto bad;                  goto bad;
185          }          }
186          len = sizeof (myctladdr);          len = sizeof (myctladdr);
187          if (getsockname(s, (struct sockaddr *)&myctladdr, &len) < 0) {          if (getsockname(s, (struct sockaddr *)&myctladdr, &len) < 0) {
188                  warn("getsockname");                  error (0, errno, "getsockname");
189                  code = -1;                  code = -1;
190                  goto bad;                  goto bad;
191          }          }
192  #if defined (IP_TOS) && defined (IPPROTO_IP) && defined (IPTOS_LOWDELAY)  #if defined (IP_TOS) && defined (IPPROTO_IP) && defined (IPTOS_LOWDELAY)
193          tos = IPTOS_LOWDELAY;          tos = IPTOS_LOWDELAY;
194          if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0)          if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0)
195                  warn("setsockopt TOS (ignored)");                  error (0, errno, "setsockopt TOS (ignored)");
196  #endif  #endif
197          cin = fdopen(s, "r");          cin = fdopen(s, "r");
198          /* dup(s) is for sake of stdio implementations who do not          /* dup(s) is for sake of stdio implementations who do not
199                  allow two fdopen's on the same file-descriptor */                  allow two fdopen's on the same file-descriptor */
200          cout = fdopen(dup(s), "w");          cout = fdopen(dup(s), "w");
201          if (cin == NULL || cout == NULL) {          if (cin == NULL || cout == NULL) {
202                  warnx("fdopen failed.");                  error (0, 0, "fdopen failed.");
203                  if (cin)                  if (cin)
204                          (void) fclose(cin);                          fclose(cin);
205                  if (cout)                  if (cout)
206                          (void) fclose(cout);                          fclose(cout);
207                  code = -1;                  code = -1;
208                  goto bad;                  goto bad;
209          }          }
# Line 212  hookup(host, port) Line 211  hookup(host, port)
211                  printf("Connected to %s.\n", hostname);                  printf("Connected to %s.\n", hostname);
212          if (getreply(0) > 2) {  /* read startup message from server */          if (getreply(0) > 2) {  /* read startup message from server */
213                  if (cin)                  if (cin)
214                          (void) fclose(cin);                          fclose(cin);
215                  if (cout)                  if (cout)
216                          (void) fclose(cout);                          fclose(cout);
217                  code = -1;                  code = -1;
218                  goto bad;                  goto bad;
219          }          }
# Line 224  hookup(host, port) Line 223  hookup(host, port)
223    
224          if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *)&on, sizeof(on))          if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *)&on, sizeof(on))
225                  < 0 && debug) {                  < 0 && debug) {
226                          warn("setsockopt");                          error (0, errno, "setsockopt");
227                  }                  }
228          }          }
229  #endif /* SO_OOBINLINE */  #endif /* SO_OOBINLINE */
230    
231          return (hostname);          return (hostname);
232  bad:  bad:
233          (void) close(s);          close(s);
234          return ((char *)0);          return NULL;
235  }  }
236    
237  int  int
# Line 283  login(host) Line 282  login(host)
282                  n = command("ACCT %s", acct);                  n = command("ACCT %s", acct);
283          }          }
284          if (n != COMPLETE) {          if (n != COMPLETE) {
285                  warnx("Login failed.");                  error (0, 0, "Login failed.");
286                  return (0);                  return (0);
287          }          }
288          if (!aflag && acct != NULL)          if (!aflag && acct != NULL)
289                  (void) command("ACCT %s", acct);                  command("ACCT %s", acct);
290          if (proxy)          if (proxy)
291                  return (1);                  return (1);
292          for (n = 0; n < macnum; ++n) {          for (n = 0; n < macnum; ++n) {
# Line 299  login(host) Line 298  login(host)
298                          if (!line)                          if (!line)
299                                  quit (0, 0);                                  quit (0, 0);
300  #endif  #endif
301                          (void) strcpy(line, "$init");                          strcpy(line, "$init");
302                          makeargv();                          makeargv();
303                          domacro(margc, margv);                          domacro(margc, margv);
304                          break;                          break;
# Line 308  login(host) Line 307  login(host)
307          return (1);          return (1);
308  }  }
309    
310  void  RETSIGTYPE
311  cmdabort(sig)  cmdabort(int sig ARG_UNUSED)
   int sig;  
312  {  {
313    
314          printf("\n");          printf("\n");
315          (void) fflush(stdout);          fflush(stdout);
316          abrtflag++;          abrtflag++;
317          if (ptflag)          if (ptflag)
318                  longjmp(ptabort,1);                  longjmp(ptabort,1);
# Line 351  va_dcl Line 349  va_dcl
349                          vfprintf(stdout, fmt, ap);                          vfprintf(stdout, fmt, ap);
350                  va_end(ap);                  va_end(ap);
351                  printf("\n");                  printf("\n");
352                  (void) fflush(stdout);                  fflush(stdout);
353          }          }
354          if (cout == NULL) {          if (cout == NULL) {
355                  warn("No control connection for command");                  error (0, 0, "No control connection for command");
356                  code = -1;                  code = -1;
357                  return (0);                  return (0);
358          }          }
# Line 368  va_dcl Line 366  va_dcl
366          vfprintf(cout, fmt, ap);          vfprintf(cout, fmt, ap);
367          va_end(ap);          va_end(ap);
368          fprintf(cout, "\r\n");          fprintf(cout, "\r\n");
369          (void) fflush(cout);          fflush(cout);
370          cpend = 1;          cpend = 1;
371          r = getreply(!strcmp(fmt, "QUIT"));          r = getreply(!strcmp(fmt, "QUIT"));
372          if (abrtflag && oldintr != SIG_IGN)          if (abrtflag && oldintr != SIG_IGN)
373                  (*oldintr)(SIGINT);                  (*oldintr)(SIGINT);
374          (void) signal(SIGINT, oldintr);          signal(SIGINT, oldintr);
375          return (r);          return (r);
376  }  }
377    
# Line 401  getreply(expecteof) Line 399  getreply(expecteof)
399                                  case WONT:                                  case WONT:
400                                          c = getc(cin);                                          c = getc(cin);
401                                          fprintf(cout, "%c%c%c", IAC, DONT, c);                                          fprintf(cout, "%c%c%c", IAC, DONT, c);
402                                          (void) fflush(cout);                                          fflush(cout);
403                                          break;                                          break;
404                                  case DO:                                  case DO:
405                                  case DONT:                                  case DONT:
406                                          c = getc(cin);                                          c = getc(cin);
407                                          fprintf(cout, "%c%c%c", IAC, WONT, c);                                          fprintf(cout, "%c%c%c", IAC, WONT, c);
408                                          (void) fflush(cout);                                          fflush(cout);
409                                          break;                                          break;
410                                  default:                                  default:
411                                          break;                                          break;
# Line 417  getreply(expecteof) Line 415  getreply(expecteof)
415                          dig++;                          dig++;
416                          if (c == EOF) {                          if (c == EOF) {
417                                  if (expecteof) {                                  if (expecteof) {
418                                          (void) signal(SIGINT,oldintr);                                          signal(SIGINT,oldintr);
419                                          code = 221;                                          code = 221;
420                                          return (0);                                          return (0);
421                                  }                                  }
422                                  lostpeer();                                  lostpeer();
423                                  if (verbose) {                                  if (verbose) {
424                                          printf("421 Service not available, remote server has closed connection\n");                                          printf("421 Service not available, remote server has closed connection\n");
425                                          (void) fflush(stdout);                                          fflush(stdout);
426                                  }                                  }
427                                  code = 421;                                  code = 421;
428                                  return (4);                                  return (4);
# Line 434  getreply(expecteof) Line 432  getreply(expecteof)
432                                  if (proxflag &&                                  if (proxflag &&
433                                     (dig == 1 || dig == 5 && verbose == 0))                                     (dig == 1 || dig == 5 && verbose == 0))
434                                          printf("%s:",hostname);                                          printf("%s:",hostname);
435                                  (void) putchar(c);                                  putchar(c);
436                          }                          }
437                          if (dig < 4 && isdigit(c))                          if (dig < 4 && isdigit(c))
438                                  code = code * 10 + (c - '0');                                  code = code * 10 + (c - '0');
# Line 461  getreply(expecteof) Line 459  getreply(expecteof)
459                                  *cp++ = c;                                  *cp++ = c;
460                  }                  }
461                  if (verbose > 0 || verbose > -1 && n == '5') {                  if (verbose > 0 || verbose > -1 && n == '5') {
462                          (void) putchar(c);                          putchar(c);
463                          (void) fflush (stdout);                          fflush (stdout);
464                  }                  }
465                  if (continuation && code != originalcode) {                  if (continuation && code != originalcode) {
466                          if (originalcode == 0)                          if (originalcode == 0)
# Line 472  getreply(expecteof) Line 470  getreply(expecteof)
470                  *cp = '\0';                  *cp = '\0';
471                  if (n != '1')                  if (n != '1')
472                          cpend = 0;                          cpend = 0;
473                  (void) signal(SIGINT,oldintr);                  signal(SIGINT,oldintr);
474                  if (code == 421 || originalcode == 421)                  if (code == 421 || originalcode == 421)
475                          lostpeer();                          lostpeer();
476                  if (abrtflag && oldintr != cmdabort && oldintr != SIG_IGN)                  if (abrtflag && oldintr != cmdabort && oldintr != SIG_IGN)
# Line 503  abortsend(sig) Line 501  abortsend(sig)
501          mflag = 0;          mflag = 0;
502          abrtflag = 0;          abrtflag = 0;
503          printf("\nsend aborted\nwaiting for remote to finish abort\n");          printf("\nsend aborted\nwaiting for remote to finish abort\n");
504          (void) fflush(stdout);          fflush(stdout);
505          longjmp(sendabort, 1);          longjmp(sendabort, 1);
506  }  }
507    
# Line 539  sendrequest(cmd, local, remote, printnam Line 537  sendrequest(cmd, local, remote, printnam
537          lmode = "w";          lmode = "w";
538          if (setjmp(sendabort)) {          if (setjmp(sendabort)) {
539                  while (cpend) {                  while (cpend) {
540                          (void) getreply(0);                          getreply(0);
541                  }                  }
542                  if (data >= 0) {                  if (data >= 0) {
543                          (void) close(data);                          close(data);
544                          data = -1;                          data = -1;
545                  }                  }
546                  if (oldintr)                  if (oldintr)
547                          (void) signal(SIGINT,oldintr);                          signal(SIGINT,oldintr);
548                  if (oldintp)                  if (oldintp)
549                          (void) signal(SIGPIPE,oldintp);                          signal(SIGPIPE,oldintp);
550                  code = -1;                  code = -1;
551                  return;                  return;
552          }          }
# Line 559  sendrequest(cmd, local, remote, printnam Line 557  sendrequest(cmd, local, remote, printnam
557                  oldintp = signal(SIGPIPE,SIG_IGN);                  oldintp = signal(SIGPIPE,SIG_IGN);
558                  fin = popen(local + 1, "r");                  fin = popen(local + 1, "r");
559                  if (fin == NULL) {                  if (fin == NULL) {
560                          warn("%s", local + 1);                          error (0, errno, "%s", local + 1);
561                          (void) signal(SIGINT, oldintr);                          signal(SIGINT, oldintr);
562                          (void) signal(SIGPIPE, oldintp);                          signal(SIGPIPE, oldintp);
563                          code = -1;                          code = -1;
564                          return;                          return;
565                  }                  }
# Line 569  sendrequest(cmd, local, remote, printnam Line 567  sendrequest(cmd, local, remote, printnam
567          } else {          } else {
568                  fin = fopen(local, "r");                  fin = fopen(local, "r");
569                  if (fin == NULL) {                  if (fin == NULL) {
570                          warn("local: %s", local);                          error (0, errno, "local: %s", local);
571                          (void) signal(SIGINT, oldintr);                          signal(SIGINT, oldintr);
572                          code = -1;                          code = -1;
573                          return;                          return;
574                  }                  }
# Line 578  sendrequest(cmd, local, remote, printnam Line 576  sendrequest(cmd, local, remote, printnam
576                  if (fstat(fileno(fin), &st) < 0 ||                  if (fstat(fileno(fin), &st) < 0 ||
577                      (st.st_mode&S_IFMT) != S_IFREG) {                      (st.st_mode&S_IFMT) != S_IFREG) {
578                          fprintf(stdout, "%s: not a plain file.\n", local);                          fprintf(stdout, "%s: not a plain file.\n", local);
579                          (void) signal(SIGINT, oldintr);                          signal(SIGINT, oldintr);
580                          fclose(fin);                          fclose(fin);
581                          code = -1;                          code = -1;
582                          return;                          return;
583                  }                  }
584          }          }
585          if (initconn()) {          if (initconn()) {
586                  (void) signal(SIGINT, oldintr);                  signal(SIGINT, oldintr);
587                  if (oldintp)                  if (oldintp)
588                          (void) signal(SIGPIPE, oldintp);                          signal(SIGPIPE, oldintp);
589                  code = -1;                  code = -1;
590                  if (closefunc != NULL)                  if (closefunc != NULL)
591                          (*closefunc)(fin);                          (*closefunc)(fin);
# Line 610  sendrequest(cmd, local, remote, printnam Line 608  sendrequest(cmd, local, remote, printnam
608                          break;                          break;
609                  }                  }
610                  if (rc < 0) {                  if (rc < 0) {
611                          warn("local: %s", local);                          error (0, errno, "local: %s", local);
612                          restart_point = 0;                          restart_point = 0;
613                          if (closefunc != NULL)                          if (closefunc != NULL)
614                                  (*closefunc)(fin);                                  (*closefunc)(fin);
# Line 628  sendrequest(cmd, local, remote, printnam Line 626  sendrequest(cmd, local, remote, printnam
626          }          }
627          if (remote) {          if (remote) {
628                  if (command("%s %s", cmd, remote) != PRELIM) {                  if (command("%s %s", cmd, remote) != PRELIM) {
629                          (void) signal(SIGINT, oldintr);                          signal(SIGINT, oldintr);
630                          if (oldintp)                          if (oldintp)
631                                  (void) signal(SIGPIPE, oldintp);                                  signal(SIGPIPE, oldintp);
632                          if (closefunc != NULL)                          if (closefunc != NULL)
633                                  (*closefunc)(fin);                                  (*closefunc)(fin);
634                          return;                          return;
635                  }                  }
636          } else          } else
637                  if (command("%s", cmd) != PRELIM) {                  if (command("%s", cmd) != PRELIM) {
638                          (void) signal(SIGINT, oldintr);                          signal(SIGINT, oldintr);
639                          if (oldintp)                          if (oldintp)
640                                  (void) signal(SIGPIPE, oldintp);                                  signal(SIGPIPE, oldintp);
641                          if (closefunc != NULL)                          if (closefunc != NULL)
642                                  (*closefunc)(fin);                                  (*closefunc)(fin);
643                          return;                          return;
# Line 647  sendrequest(cmd, local, remote, printnam Line 645  sendrequest(cmd, local, remote, printnam
645          dout = dataconn(lmode);          dout = dataconn(lmode);
646          if (dout == NULL)          if (dout == NULL)
647                  goto abort;                  goto abort;
648          (void) gettimeofday(&start, (struct timezone *)0);          gettimeofday(&start, (struct timezone *)0);
649          oldintp = signal(SIGPIPE, SIG_IGN);          oldintp = signal(SIGPIPE, SIG_IGN);
650          switch (curtype) {          switch (curtype) {
651    
# Line 661  sendrequest(cmd, local, remote, printnam Line 659  sendrequest(cmd, local, remote, printnam
659                                          break;                                          break;
660                          if (hash) {                          if (hash) {
661                                  while (bytes >= local_hashbytes) {                                  while (bytes >= local_hashbytes) {
662                                          (void) putchar('#');                                          putchar('#');
663                                          local_hashbytes += hashbytes;                                          local_hashbytes += hashbytes;
664                                  }                                  }
665                                  (void) fflush(stdout);                                  fflush(stdout);
666                          }                          }
667                  }                  }
668                  if (hash && bytes > 0) {                  if (hash && bytes > 0) {
669                          if (bytes < local_hashbytes)                          if (bytes < local_hashbytes)
670                                  (void) putchar('#');                                  putchar('#');
671                          (void) putchar('\n');                          putchar('\n');
672                          (void) fflush(stdout);                          fflush(stdout);
673                  }                  }
674                  if (c < 0)                  if (c < 0)
675                          warn("local: %s", local);                          error (0, errno, "local: %s", local);
676                  if (d < 0) {                  if (d < 0) {
677                          if (errno != EPIPE)                          if (errno != EPIPE)
678                                  warn("netout");                                  error (0, errno, "netout");
679                          bytes = -1;                          bytes = -1;
680                  }                  }
681                  break;                  break;
# Line 686  sendrequest(cmd, local, remote, printnam Line 684  sendrequest(cmd, local, remote, printnam
684                  while ((c = getc(fin)) != EOF) {                  while ((c = getc(fin)) != EOF) {
685                          if (c == '\n') {                          if (c == '\n') {
686                                  while (hash && (bytes >= local_hashbytes)) {                                  while (hash && (bytes >= local_hashbytes)) {
687                                          (void) putchar('#');                                          putchar('#');
688                                          (void) fflush(stdout);                                          fflush(stdout);
689                                          local_hashbytes += hashbytes;                                          local_hashbytes += hashbytes;
690                                  }                                  }
691                                  if (ferror(dout))                                  if (ferror(dout))
692                                          break;                                          break;
693                                  (void) putc('\r', dout);                                  putc('\r', dout);
694                                  bytes++;                                  bytes++;
695                          }                          }
696                          (void) putc(c, dout);                          putc(c, dout);
697                          bytes++;                          bytes++;
698          /*              if (c == '\r') {                                */          /*              if (c == '\r') {                                */
699          /*              (void)  putc('\0', dout);  // this violates rfc */          /*              (void)  putc('\0', dout);  // this violates rfc */
# Line 704  sendrequest(cmd, local, remote, printnam Line 702  sendrequest(cmd, local, remote, printnam
702                  }                  }
703                  if (hash) {                  if (hash) {
704                          if (bytes < local_hashbytes)                          if (bytes < local_hashbytes)
705                                  (void) putchar('#');                                  putchar('#');
706                          (void) putchar('\n');                          putchar('\n');
707                          (void) fflush(stdout);                          fflush(stdout);
708                  }                  }
709                  if (ferror(fin))                  if (ferror(fin))
710                          warn("local: %s", local);                          error (0, errno, "local: %s", local);
711                  if (ferror(dout)) {                  if (ferror(dout)) {
712                          if (errno != EPIPE)                          if (errno != EPIPE)
713                                  warn("netout");                                  error (0, errno, "netout");
714                          bytes = -1;                          bytes = -1;
715                  }                  }
716                  break;                  break;
717          }          }
718          if (closefunc != NULL)          if (closefunc != NULL)
719                  (*closefunc)(fin);                  (*closefunc)(fin);
720          (void) fclose(dout);          fclose(dout);
721          (void) gettimeofday(&stop, (struct timezone *)0);          gettimeofday(&stop, (struct timezone *)0);
722          (void) getreply(0);          getreply(0);
723          (void) signal(SIGINT, oldintr);          signal(SIGINT, oldintr);
724          if (oldintp)          if (oldintp)
725                  (void) signal(SIGPIPE, oldintp);                  signal(SIGPIPE, oldintp);
726          if (bytes > 0)          if (bytes > 0)
727                  ptransfer("sent", bytes, &start, &stop);                  ptransfer("sent", bytes, &start, &stop);
728          return;          return;
729  abort:  abort:
730          (void) signal(SIGINT, oldintr);          signal(SIGINT, oldintr);
731          if (oldintp)          if (oldintp)
732                  (void) signal(SIGPIPE, oldintp);                  signal(SIGPIPE, oldintp);
733          if (!cpend) {          if (!cpend) {
734                  code = -1;                  code = -1;
735                  return;                  return;
736          }          }
737          if (data >= 0) {          if (data >= 0) {
738                  (void) close(data);                  close(data);
739                  data = -1;                  data = -1;
740          }          }
741          if (dout)          if (dout)
742                  (void) fclose(dout);                  fclose(dout);
743          (void) getreply(0);          getreply(0);
744          code = -1;          code = -1;
745          if (closefunc != NULL && fin != NULL)          if (closefunc != NULL && fin != NULL)
746                  (*closefunc)(fin);                  (*closefunc)(fin);
747          (void) gettimeofday(&stop, (struct timezone *)0);          gettimeofday(&stop, (struct timezone *)0);
748          if (bytes > 0)          if (bytes > 0)
749                  ptransfer("sent", bytes, &start, &stop);                  ptransfer("sent", bytes, &start, &stop);
750  }  }
# Line 761  abortrecv(sig) Line 759  abortrecv(sig)
759          mflag = 0;          mflag = 0;
760          abrtflag = 0;          abrtflag = 0;
761          printf("\nreceive aborted\nwaiting for remote to finish abort\n");          printf("\nreceive aborted\nwaiting for remote to finish abort\n");
762          (void) fflush(stdout);          fflush(stdout);
763          longjmp(recvabort, 1);          longjmp(recvabort, 1);
764  }  }
765    
# Line 796  recvrequest(cmd, local, remote, lmode, p Line 794  recvrequest(cmd, local, remote, lmode, p
794          tcrflag = !crflag && is_retr;          tcrflag = !crflag && is_retr;
795          if (setjmp(recvabort)) {          if (setjmp(recvabort)) {
796                  while (cpend) {                  while (cpend) {
797                          (void) getreply(0);                          getreply(0);
798                  }                  }
799                  if (data >= 0) {                  if (data >= 0) {
800                          (void) close(data);                          close(data);
801                          data = -1;                          data = -1;
802                  }                  }
803                  if (oldintr)                  if (oldintr)
804                          (void) signal(SIGINT, oldintr);                          signal(SIGINT, oldintr);
805                  code = -1;                  code = -1;
806                  return;                  return;
807          }          }
808          oldintr = signal(SIGINT, abortrecv);          oldintr = signal(SIGINT, abortrecv);
809          if (strcmp(local, "-") && *local != '|') {          if (strcmp(local, "-") && *local != '|') {
810                  if (runique && (local = gunique(local)) == NULL) {                  if (runique && (local = gunique(local)) == NULL) {
811                          (void) signal(SIGINT, oldintr);                          signal(SIGINT, oldintr);
812                          code = -1;                          code = -1;
813                          return;                          return;
814                  }                  }
# Line 821  recvrequest(cmd, local, remote, lmode, p Line 819  recvrequest(cmd, local, remote, lmode, p
819          } else if (curtype != type)          } else if (curtype != type)
820                  changetype(type, 0);                  changetype(type, 0);
821          if (initconn()) {          if (initconn()) {
822                  (void) signal(SIGINT, oldintr);                  signal(SIGINT, oldintr);
823                  code = -1;                  code = -1;
824                  return;                  return;
825          }          }
# Line 832  recvrequest(cmd, local, remote, lmode, p Line 830  recvrequest(cmd, local, remote, lmode, p
830                  return;                  return;
831          if (remote) {          if (remote) {
832                  if (command("%s %s", cmd, remote) != PRELIM) {                  if (command("%s %s", cmd, remote) != PRELIM) {
833                          (void) signal(SIGINT, oldintr);                          signal(SIGINT, oldintr);
834                          return;                          return;
835                  }                  }
836          } else {          } else {
837                  if (command("%s", cmd) != PRELIM) {                  if (command("%s", cmd) != PRELIM) {
838                          (void) signal(SIGINT, oldintr);                          signal(SIGINT, oldintr);
839                          return;                          return;
840                  }                  }
841          }          }
# Line 850  recvrequest(cmd, local, remote, lmode, p Line 848  recvrequest(cmd, local, remote, lmode, p
848                  oldintp = signal(SIGPIPE, SIG_IGN);                  oldintp = signal(SIGPIPE, SIG_IGN);
849                  fout = popen(local + 1, "w");                  fout = popen(local + 1, "w");
850                  if (fout == NULL) {                  if (fout == NULL) {
851                          warn("%s", local+1);                          error (0, errno, "%s", local+1);
852                          goto abort;                          goto abort;
853                  }                  }
854                  closefunc = pclose;                  closefunc = pclose;
855          } else {          } else {
856                  fout = fopen(local, lmode);                  fout = fopen(local, lmode);
857                  if (fout == NULL) {                  if (fout == NULL) {
858                          warn("local: %s", local);                          error (0, errno, "local: %s", local);
859                          goto abort;                          goto abort;
860                  }                  }
861                  closefunc = fclose;                  closefunc = fclose;
# Line 865  recvrequest(cmd, local, remote, lmode, p Line 863  recvrequest(cmd, local, remote, lmode, p
863          blksize = BUFSIZ;          blksize = BUFSIZ;
864          if (blksize > bufsize) {          if (blksize > bufsize) {
865                  if (buf)                  if (buf)
866                          (void) free(buf);                          free(buf);
867                  buf = malloc((unsigned)blksize);                  buf = malloc((unsigned)blksize);
868                  if (buf == NULL) {                  if (buf == NULL) {
869                          warn("malloc");                          error (0, errno, "malloc");
870                          bufsize = 0;                          bufsize = 0;
871                          goto abort;                          goto abort;
872                  }                  }
873                  bufsize = blksize;                  bufsize = blksize;
874          }          }
875          (void) gettimeofday(&start, (struct timezone *)0);          gettimeofday(&start, (struct timezone *)0);
876          switch (curtype) {          switch (curtype) {
877    
878          case TYPE_I:          case TYPE_I:
879          case TYPE_L:          case TYPE_L:
880                  if (restart_point &&                  if (restart_point &&
881                      lseek(fileno(fout), restart_point, SEEK_SET) < 0) {                      lseek(fileno(fout), restart_point, SEEK_SET) < 0) {
882                          warn("local: %s", local);                          error (0, errno, "local: %s", local);
883                          if (closefunc != NULL)                          if (closefunc != NULL)
884                                  (*closefunc)(fout);                                  (*closefunc)(fout);
885                          return;                          return;
# Line 893  recvrequest(cmd, local, remote, lmode, p Line 891  recvrequest(cmd, local, remote, lmode, p
891                          bytes += c;                          bytes += c;
892                          if (hash) {                          if (hash) {
893                                  while (bytes >= local_hashbytes) {                                  while (bytes >= local_hashbytes) {
894                                          (void) putchar('#');                                          putchar('#');
895                                          local_hashbytes += hashbytes;                                          local_hashbytes += hashbytes;
896                                  }                                  }
897                                  (void) fflush(stdout);                                  fflush(stdout);
898                          }                          }
899                  }                  }
900                  if (hash && bytes > 0) {                  if (hash && bytes > 0) {
901                          if (bytes < local_hashbytes)                          if (bytes < local_hashbytes)
902                                  (void) putchar('#');                                  putchar('#');
903                          (void) putchar('\n');                          putchar('\n');
904                          (void) fflush(stdout);                          fflush(stdout);
905                  }                  }
906                  if (c < 0) {                  if (c < 0) {
907                          if (errno != EPIPE)                          if (errno != EPIPE)
908                                  warn("netin");                                  error (0, errno, "netin");
909                          bytes = -1;                          bytes = -1;
910                  }                  }
911                  if (d < c) {                  if (d < c) {
912                          if (d < 0)                          if (d < 0)
913                                  warn("local: %s", local);                                  error (0, errno, "local: %s", local);
914                          else                          else
915                                  warnx("%s: short write", local);                                  error (0, 0, "%s: short write", local);
916                  }                  }
917                  break;                  break;
918    
# Line 933  recvrequest(cmd, local, remote, lmode, p Line 931  recvrequest(cmd, local, remote, lmode, p
931                          }                          }
932                          if (fseek(fout, 0L, SEEK_CUR) < 0) {                          if (fseek(fout, 0L, SEEK_CUR) < 0) {
933  done:  done:
934                                  warn("local: %s", local);                                  error (0, errno, "local: %s", local);
935                                  if (closefunc != NULL)                                  if (closefunc != NULL)
936                                          (*closefunc)(fout);                                          (*closefunc)(fout);
937                                  return;                                  return;
# Line 944  done: Line 942  done:
942                                  bare_lfs++;                                  bare_lfs++;
943                          while (c == '\r') {                          while (c == '\r') {
944                                  while (hash && (bytes >= local_hashbytes)) {                                  while (hash && (bytes >= local_hashbytes)) {
945                                          (void) putchar('#');                                          putchar('#');
946                                          (void) fflush(stdout);                                          fflush(stdout);
947                                          local_hashbytes += hashbytes;                                          local_hashbytes += hashbytes;
948                                  }                                  }
949                                  bytes++;                                  bytes++;
950                                  if ((c = getc(din)) != '\n' || tcrflag) {                                  if ((c = getc(din)) != '\n' || tcrflag) {
951                                          if (ferror(fout))                                          if (ferror(fout))
952                                                  goto break2;                                                  goto break2;
953                                          (void) putc('\r', fout);                                          putc('\r', fout);
954                                          if (c == '\0') {                                          if (c == '\0') {
955                                                  bytes++;                                                  bytes++;
956                                                  goto contin2;                                                  goto contin2;
# Line 961  done: Line 959  done:
959                                                  goto contin2;                                                  goto contin2;
960                                  }                                  }
961                          }                          }
962                          (void) putc(c, fout);                          putc(c, fout);
963                          bytes++;                          bytes++;
964          contin2:        ;          contin2:        ;
965                  }                  }
# Line 972  break2: Line 970  break2:
970                  }                  }
971                  if (hash) {                  if (hash) {
972                          if (bytes < local_hashbytes)                          if (bytes < local_hashbytes)
973                                  (void) putchar('#');                                  putchar('#');
974                          (void) putchar('\n');                          putchar('\n');
975                          (void) fflush(stdout);                          fflush(stdout);
976                  }                  }
977                  if (ferror(din)) {                  if (ferror(din)) {
978                          if (errno != EPIPE)                          if (errno != EPIPE)
979                                  warn("netin");                                  error (0, errno, "netin");
980                          bytes = -1;                          bytes = -1;
981                  }                  }
982                  if (ferror(fout))                  if (ferror(fout))
983                          warn("local: %s", local);                          error (0, errno, "local: %s", local);
984                  break;                  break;
985          }          }
986          if (closefunc != NULL)          if (closefunc != NULL)
987                  (*closefunc)(fout);                  (*closefunc)(fout);
988          (void) signal(SIGINT, oldintr);          signal(SIGINT, oldintr);
989          if (oldintp)          if (oldintp)
990                  (void) signal(SIGPIPE, oldintp);                  signal(SIGPIPE, oldintp);
991          (void) fclose(din);          fclose(din);
992          (void) gettimeofday(&stop, (struct timezone *)0);          gettimeofday(&stop, (struct timezone *)0);
993          (void) getreply(0);          getreply(0);
994          if (bytes > 0 && is_retr)          if (bytes > 0 && is_retr)
995                  ptransfer("received", bytes, &start, &stop);                  ptransfer("received", bytes, &start, &stop);
996          return;          return;
# Line 1001  abort: Line 999  abort:
999  /* abort using RFC959 recommended IP,SYNC sequence  */  /* abort using RFC959 recommended IP,SYNC sequence  */
1000    
1001          if (oldintp)          if (oldintp)
1002                  (void) signal(SIGPIPE, oldintr);                  signal(SIGPIPE, oldintr);
1003          (void) signal(SIGINT, SIG_IGN);          signal(SIGINT, SIG_IGN);
1004          if (!cpend) {          if (!cpend) {
1005                  code = -1;                  code = -1;
1006                  (void) signal(SIGINT, oldintr);                  signal(SIGINT, oldintr);
1007                  return;                  return;
1008          }          }
1009    
1010          abort_remote(din);          abort_remote(din);
1011          code = -1;          code = -1;
1012          if (data >= 0) {          if (data >= 0) {
1013                  (void) close(data);                  close(data);
1014                  data = -1;                  data = -1;
1015          }          }
1016          if (closefunc != NULL && fout != NULL)          if (closefunc != NULL && fout != NULL)
1017                  (*closefunc)(fout);                  (*closefunc)(fout);
1018          if (din)          if (din)
1019                  (void) fclose(din);                  fclose(din);
1020          (void) gettimeofday(&stop, (struct timezone *)0);          gettimeofday(&stop, (struct timezone *)0);
1021          if (bytes > 0)          if (bytes > 0)
1022                  ptransfer("received", bytes, &start, &stop);                  ptransfer("received", bytes, &start, &stop);
1023          (void) signal(SIGINT, oldintr);          signal(SIGINT, oldintr);
1024  }  }
1025    
1026  /*  /*
# Line 1096  noport: Line 1094  noport:
1094          if (sendport)          if (sendport)
1095                  data_addr.sin_port = 0; /* let system pick one */                  data_addr.sin_port = 0; /* let system pick one */
1096          if (data != -1)          if (data != -1)
1097                  (void) close(data);                  close(data);
1098          data = socket(AF_INET, SOCK_STREAM, 0);          data = socket(AF_INET, SOCK_STREAM, 0);
1099          if (data < 0) {          if (data < 0) {
1100                  warn("socket");                  error (0, errno, "socket");
1101                  if (tmpno)                  if (tmpno)
1102                          sendport = 1;                          sendport = 1;
1103                  return (1);                  return (1);
1104          }          }
1105          if (!sendport)          if (!sendport)
1106                  if (setsockopt(data, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof (on)) < 0) {                  if (setsockopt(data, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof (on)) < 0) {
1107                          warn("setsockopt (reuse address)");                          error (0, errno, "setsockopt (reuse address)");
1108                          goto bad;                          goto bad;
1109                  }                  }
1110          if (bind(data, (struct sockaddr *)&data_addr, sizeof (data_addr)) < 0) {          if (bind(data, (struct sockaddr *)&data_addr, sizeof (data_addr)) < 0) {
1111                  warn("bind");                  error (0, errno, "bind");
1112                  goto bad;                  goto bad;
1113          }          }
1114          if (options & SO_DEBUG &&          if (options & SO_DEBUG &&
1115              setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on, sizeof (on)) < 0)              setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on, sizeof (on)) < 0)
1116                  warn("setsockopt (ignored)");                  error (0, errno, "setsockopt (ignored)");
1117          len = sizeof (data_addr);          len = sizeof (data_addr);
1118          if (getsockname(data, (struct sockaddr *)&data_addr, &len) < 0) {          if (getsockname(data, (struct sockaddr *)&data_addr, &len) < 0) {
1119                  warn("getsockname");                  error (0, errno, "getsockname");
1120                  goto bad;                  goto bad;
1121          }          }
1122          if (listen(data, 1) < 0)          if (listen(data, 1) < 0)
1123                  warn("listen");                  error (0, errno, "listen");
1124          if (sendport) {          if (sendport) {
1125                  a = (char *)&data_addr.sin_addr;                  a = (char *)&data_addr.sin_addr;
1126                  p = (char *)&data_addr.sin_port;                  p = (char *)&data_addr.sin_port;
# Line 1143  noport: Line 1141  noport:
1141  #if defined (IP_TOS) && defined (IPPROTO_IP) && defined (IPTOS_THROUGHPUT)  #if defined (IP_TOS) && defined (IPPROTO_IP) && defined (IPTOS_THROUGHPUT)
1142          on = IPTOS_THROUGHPUT;          on = IPTOS_THROUGHPUT;
1143          if (setsockopt(data, IPPROTO_IP, IP_TOS, (char *)&on, sizeof(int)) < 0)          if (setsockopt(data, IPPROTO_IP, IP_TOS, (char *)&on, sizeof(int)) < 0)
1144                  warn("setsockopt TOS (ignored)");                  error (0, errno, "setsockopt TOS (ignored)");
1145  #endif  #endif
1146          return (0);          return (0);
1147  bad:  bad:
1148          (void) close(data), data = -1;          close(data), data = -1;
1149          if (tmpno)          if (tmpno)
1150                  sendport = 1;                  sendport = 1;
1151          return (1);          return (1);
# Line 1165  dataconn(lmode) Line 1163  dataconn(lmode)
1163    
1164          s = accept(data, (struct sockaddr *) &from, &fromlen);          s = accept(data, (struct sockaddr *) &from, &fromlen);
1165          if (s < 0) {          if (s < 0) {
1166                  warn("accept");                  error (0, errno, "accept");
1167                  (void) close(data), data = -1;                  close(data), data = -1;
1168                  return (NULL);                  return (NULL);
1169          }          }
1170          (void) close(data);          close(data);
1171          data = s;          data = s;
1172  #if defined (IP_TOS) && defined (IPPROTO_IP) && defined (IPTOS_THROUGHPUT)  #if defined (IP_TOS) && defined (IPPROTO_IP) && defined (IPTOS_THROUGHPUT)
1173          tos = IPTOS_THROUGHPUT;          tos = IPTOS_THROUGHPUT;
1174          if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0)          if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0)
1175                  warn("setsockopt TOS (ignored)");                  error (0, errno, "setsockopt TOS (ignored)");
1176  #endif  #endif
1177          return (fdopen(data, lmode));          return (fdopen(data, lmode));
1178  }  }
# Line 1304  pswitch(flag) Line 1302  pswitch(flag)
1302          mcase = op->mcse;          mcase = op->mcse;
1303          ip->ntflg = ntflag;          ip->ntflg = ntflag;
1304          ntflag = op->ntflg;          ntflag = op->ntflg;
1305          (void) strncpy(ip->nti, ntin, sizeof(ntin) - 1);          strncpy(ip->nti, ntin, sizeof(ntin) - 1);
1306          (ip->nti)[strlen(ip->nti)] = '\0';          (ip->nti)[strlen(ip->nti)] = '\0';
1307          (void) strcpy(ntin, op->nti);          strcpy(ntin, op->nti);
1308          (void) strncpy(ip->nto, ntout, sizeof(ntout) - 1);          strncpy(ip->nto, ntout, sizeof(ntout) - 1);
1309          (ip->nto)[strlen(ip->nto)] = '\0';          (ip->nto)[strlen(ip->nto)] = '\0';
1310          (void) strcpy(ntout, op->nto);          strcpy(ntout, op->nto);
1311          ip->mapflg = mapflag;          ip->mapflg = mapflag;
1312          mapflag = op->mapflg;          mapflag = op->mapflg;
1313    
# Line 1325  pswitch(flag) Line 1323  pswitch(flag)
1323          mapout = op->mo;          mapout = op->mo;
1324          op->mo = 0;          op->mo = 0;
1325    
1326          (void) signal(SIGINT, oldintr);          signal(SIGINT, oldintr);
1327          if (abrtflag) {          if (abrtflag) {
1328                  abrtflag = 0;                  abrtflag = 0;
1329                  (*oldintr)(SIGINT);                  (*oldintr)(SIGINT);
# Line 1338  abortpt(sig) Line 1336  abortpt(sig)
1336  {  {
1337    
1338          printf("\n");          printf("\n");
1339          (void) fflush(stdout);          fflush(stdout);
1340          ptabflg++;          ptabflg++;
1341          mflag = 0;          mflag = 0;
1342          abrtflag = 0;          abrtflag = 0;
# Line 1387  proxtrans(cmd, local, remote) Line 1385  proxtrans(cmd, local, remote)
1385                  goto abort;                  goto abort;
1386          oldintr = signal(SIGINT, abortpt);          oldintr = signal(SIGINT, abortpt);
1387          if (command("%s %s", cmd, remote) != PRELIM) {          if (command("%s %s", cmd, remote) != PRELIM) {
1388                  (void) signal(SIGINT, oldintr);                  signal(SIGINT, oldintr);
1389                  pswitch(1);                  pswitch(1);
1390                  return;                  return;
1391          }          }
# Line 1397  proxtrans(cmd, local, remote) Line 1395  proxtrans(cmd, local, remote)
1395          if (command("%s %s", cmd2, local) != PRELIM)          if (command("%s %s", cmd2, local) != PRELIM)
1396                  goto abort;                  goto abort;
1397          ptflag++;          ptflag++;
1398          (void) getreply(0);          getreply(0);
1399          pswitch(0);          pswitch(0);
1400          (void) getreply(0);          getreply(0);
1401          (void) signal(SIGINT, oldintr);          signal(SIGINT, oldintr);
1402          pswitch(1);          pswitch(1);
1403          ptflag = 0;          ptflag = 0;
1404          printf("local: %s remote: %s\n", local, remote);          printf("local: %s remote: %s\n", local, remote);
1405          return;          return;
1406  abort:  abort:
1407          (void) signal(SIGINT, SIG_IGN);          signal(SIGINT, SIG_IGN);
1408          ptflag = 0;          ptflag = 0;
1409          if (strcmp(cmd, "RETR") && !proxy)          if (strcmp(cmd, "RETR") && !proxy)
1410                  pswitch(1);                  pswitch(1);
# Line 1421  abort: Line 1419  abort:
1419                  pswitch(1);                  pswitch(1);
1420                  if (ptabflg)                  if (ptabflg)
1421                          code = -1;                          code = -1;
1422                  (void) signal(SIGINT, oldintr);                  signal(SIGINT, oldintr);
1423                  return;                  return;
1424          }          }
1425          if (cpend)          if (cpend)
# Line 1435  abort: Line 1433  abort:
1433                          pswitch(1);                          pswitch(1);
1434                          if (ptabflg)                          if (ptabflg)
1435                                  code = -1;                                  code = -1;
1436                          (void) signal(SIGINT, oldintr);                          signal(SIGINT, oldintr);
1437                          return;                          return;
1438                  }                  }
1439          }          }
# Line 1447  abort: Line 1445  abort:
1445                  FD_SET(fileno(cin), &mask);                  FD_SET(fileno(cin), &mask);
1446                  if ((nfnd = empty(&mask, 10)) <= 0) {                  if ((nfnd = empty(&mask, 10)) <= 0) {
1447                          if (nfnd < 0) {                          if (nfnd < 0) {
1448                                  warn("abort");                                  error (0, errno, "abort");
1449                          }                          }
1450                          if (ptabflg)                          if (ptabflg)
1451                                  code = -1;                                  code = -1;
1452                          lostpeer();                          lostpeer();
1453                  }                  }
1454                  (void) getreply(0);                  getreply(0);
1455                  (void) getreply(0);                  getreply(0);
1456          }          }
1457          if (proxy)          if (proxy)
1458                  pswitch(0);                  pswitch(0);
1459          pswitch(1);          pswitch(1);
1460          if (ptabflg)          if (ptabflg)
1461                  code = -1;                  code = -1;
1462          (void) signal(SIGINT, oldintr);          signal(SIGINT, oldintr);
1463  }  }
1464    
1465  void  void
# Line 1476  reset(argc, argv) Line 1474  reset(argc, argv)
1474          while (nfnd > 0) {          while (nfnd > 0) {
1475                  FD_SET(fileno(cin), &mask);                  FD_SET(fileno(cin), &mask);
1476                  if ((nfnd = empty(&mask,0)) < 0) {                  if ((nfnd = empty(&mask,0)) < 0) {
1477                          warn("reset");                          error (0, errno, "reset");
1478                          code = -1;                          code = -1;
1479                          lostpeer();                          lostpeer();
1480                  }                  }
1481                  else if (nfnd) {                  else if (nfnd) {
1482                          (void) getreply(0);                          getreply(0);
1483                  }                  }
1484          }          }
1485  }  }
# Line 1551  abort_remote(din) Line 1549  abort_remote(din)
1549           */           */
1550          sprintf(buf, "%c%c%c", IAC, IP, IAC);          sprintf(buf, "%c%c%c", IAC, IP, IAC);
1551          if (send(fileno(cout), buf, 3, MSG_OOB) != 3)          if (send(fileno(cout), buf, 3, MSG_OOB) != 3)
1552                  warn("abort");                  error (0, errno, "abort");
1553          fprintf(cout,"%cABOR\r\n", DM);          fprintf(cout,"%cABOR\r\n", DM);
1554          (void) fflush(cout);          fflush(cout);
1555          FD_ZERO(&mask);          FD_ZERO(&mask);
1556          FD_SET(fileno(cin), &mask);          FD_SET(fileno(cin), &mask);
1557          if (din) {          if (din) {
# Line 1561  abort_remote(din) Line 1559  abort_remote(din)
1559          }          }
1560          if ((nfnd = empty(&mask, 10)) <= 0) {          if ((nfnd = empty(&mask, 10)) <= 0) {
1561                  if (nfnd < 0) {                  if (nfnd < 0) {
1562                          warn("abort");                          error (0, errno, "abort");
1563                  }                  }
1564                  if (ptabflg)                  if (ptabflg)
1565                          code = -1;                          code = -1;
# Line 1573  abort_remote(din) Line 1571  abort_remote(din)
1571          }          }
1572          if (getreply(0) == ERROR && code == 552) {          if (getreply(0) == ERROR && code == 552) {
1573                  /* 552 needed for nic style abort */                  /* 552 needed for nic style abort */
1574                  (void) getreply(0);                  getreply(0);
1575          }          }
1576          (void) getreply(0);          getreply(0);
1577  }  }

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26