[BACK]Return to ftp.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ftp

Diff for /src/usr.bin/ftp/ftp.c between version 1.72 and 1.73

version 1.72, 2008/06/25 21:15:19 version 1.73, 2008/07/08 21:07:57
Line 257 
Line 257 
         }          }
 #ifdef SO_OOBINLINE  #ifdef SO_OOBINLINE
         {          {
         int on = 1;          int ret, on = 1;
   
         if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *)&on, sizeof(on))          ret = setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *)&on, sizeof(on));
                 < 0 && debug) {  #ifndef SMALL
                         warn("setsockopt");          if (ret < 0 && debug)
                 }                  warn("setsockopt");
   #endif /* !SMALL */
         }          }
 #endif /* SO_OOBINLINE */  #endif /* SO_OOBINLINE */
   
Line 294 
Line 295 
         sig_t oldintr;          sig_t oldintr;
   
         abrtflag = 0;          abrtflag = 0;
   #ifndef SMALL
         if (debug) {          if (debug) {
                 fputs("---> ", ttyout);                  fputs("---> ", ttyout);
                 va_start(ap, fmt);                  va_start(ap, fmt);
Line 307 
Line 309 
                 putc('\n', ttyout);                  putc('\n', ttyout);
                 (void)fflush(ttyout);                  (void)fflush(ttyout);
         }          }
   #endif /* !SMALL */
         if (cout == NULL) {          if (cout == NULL) {
                 warnx("No control connection for command.");                  warnx("No control connection for command.");
                 code = -1;                  code = -1;
Line 338 
Line 341 
 void  void
 send_noop_char()  send_noop_char()
 {  {
   #ifndef SMALL
         if (debug)          if (debug)
                 fprintf(ttyout, "---> %c\n", noop[current_nop_pos]);                  fprintf(ttyout, "---> %c\n", noop[current_nop_pos]);
   #endif /* !SMALL */
         fputc(noop[current_nop_pos++], cout);          fputc(noop[current_nop_pos++], cout);
         (void)fflush(cout);          (void)fflush(cout);
         if (current_nop_pos >= NOOP_LENGTH) {          if (current_nop_pos >= NOOP_LENGTH) {
Line 363 
Line 368 
         /* finish sending last incomplete noop */          /* finish sending last incomplete noop */
         if (current_nop_pos != 0) {          if (current_nop_pos != 0) {
                 fputs(&(noop[current_nop_pos]), cout);                  fputs(&(noop[current_nop_pos]), cout);
   #ifndef SMALL
                 if (debug)                  if (debug)
                         fprintf(ttyout, "---> %s\n", &(noop[current_nop_pos]));                          fprintf(ttyout, "---> %s\n", &(noop[current_nop_pos]));
   #endif /* !SMALL */
                 (void)fflush(cout);                  (void)fflush(cout);
                 current_nop_pos = 0;                  current_nop_pos = 0;
                 full_noops_sent++;                  full_noops_sent++;
Line 1245 
Line 1252 
                         warn("socket");                          warn("socket");
                         return (1);                          return (1);
                 }                  }
   #ifndef SMALL
                 if ((options & SO_DEBUG) &&                  if ((options & SO_DEBUG) &&
                     setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on,                      setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on,
                                sizeof(on)) < 0)                                 sizeof(on)) < 0)
                         warn("setsockopt (ignored)");                          warn("setsockopt (ignored)");
   #endif /* !SMALL */
                 switch (data_addr.su_family) {                  switch (data_addr.su_family) {
                 case AF_INET:                  case AF_INET:
                         if (epsv4 && !epsv4bad) {                          if (epsv4 && !epsv4bad) {
Line 1270 
Line 1279 
                                 }                                  }
                                 if (result != COMPLETE) {                                  if (result != COMPLETE) {
                                         epsv4bad = 1;                                          epsv4bad = 1;
   #ifndef SMALL
                                         if (debug) {                                          if (debug) {
                                                 fputs(                                                  fputs(
 "disabling epsv4 for this connection\n",  "disabling epsv4 for this connection\n",
                                                     ttyout);                                                      ttyout);
                                         }                                          }
   #endif /* !SMALL */
                                 }                                  }
                         }                          }
                         if (result != COMPLETE)                          if (result != COMPLETE)
Line 1513 
Line 1524 
                 warn("bind");                  warn("bind");
                 goto bad;                  goto bad;
         }          }
   #ifndef SMALL
         if (options & SO_DEBUG &&          if (options & SO_DEBUG &&
             setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on,              setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on,
                         sizeof(on)) < 0)                          sizeof(on)) < 0)
                 warn("setsockopt (ignored)");                  warn("setsockopt (ignored)");
   #endif /* !SMALL */
         namelen = sizeof(data_addr);          namelen = sizeof(data_addr);
         if (getsockname(data, (struct sockaddr *)&data_addr, &namelen) < 0) {          if (getsockname(data, (struct sockaddr *)&data_addr, &namelen) < 0) {
                 warn("getsockname");                  warn("getsockname");
Line 1553 
Line 1566 
                                     af_tmp, hname, pbuf);                                      af_tmp, hname, pbuf);
                                 if (result != COMPLETE) {                                  if (result != COMPLETE) {
                                         epsv4bad = 1;                                          epsv4bad = 1;
   #ifndef SMALL
                                         if (debug) {                                          if (debug) {
                                                 fputs(                                                  fputs(
 "disabling epsv4 for this connection\n",  "disabling epsv4 for this connection\n",
                                                     ttyout);                                                      ttyout);
                                         }                                          }
   #endif /* !SMALL */
                                 }                                  }
                         }                          }
                         break;                          break;

Legend:
Removed from v.1.72  
changed lines
  Added in v.1.73