[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.90 and 1.91

version 1.90, 2015/01/30 04:45:45 version 1.91, 2015/02/09 08:24:20
Line 184 
Line 184 
   
         s = -1;          s = -1;
         for (res = res0; res; res = res->ai_next) {          for (res = res0; res; res = res->ai_next) {
 #if 0   /*old behavior*/  
                 if (res != res0)        /* not on the first address */  
 #else  
                 if (res0->ai_next)      /* if we have multiple possibilities */                  if (res0->ai_next)      /* if we have multiple possibilities */
 #endif  
                 {                  {
                         if (getnameinfo(res->ai_addr, res->ai_addrlen,                          if (getnameinfo(res->ai_addr, res->ai_addrlen,
                             hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0)                              hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0)
Line 266 
Line 262 
                 code = -1;                  code = -1;
                 goto bad;                  goto bad;
         }          }
 #if defined(IPPROTO_IP) && defined(IP_TOS)  
         if (hisctladdr.su_family == AF_INET) {          if (hisctladdr.su_family == AF_INET) {
                 tos = IPTOS_LOWDELAY;                  tos = IPTOS_LOWDELAY;
                 if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0)                  if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0)
                         warn("setsockopt TOS (ignored)");                          warn("setsockopt TOS (ignored)");
         }          }
 #endif  
         cin = fdopen(s, "r");          cin = fdopen(s, "r");
         cout = fdopen(s, "w");          cout = fdopen(s, "w");
         if (cin == NULL || cout == NULL) {          if (cin == NULL || cout == NULL) {
Line 294 
Line 288 
                 code = -1;                  code = -1;
                 goto bad;                  goto bad;
         }          }
 #ifdef SO_OOBINLINE  
         {          {
         int ret, on = 1;          int ret, on = 1;
   
Line 304 
Line 297 
                 warn("setsockopt");                  warn("setsockopt");
 #endif /* !SMALL */  #endif /* !SMALL */
         }          }
 #endif /* SO_OOBINLINE */  
   
         return (hostname);          return (hostname);
 bad:  bad:
Line 808 
Line 800 
                         }                          }
                         (void)putc(c, dout);                          (void)putc(c, dout);
                         bytes++;                          bytes++;
 #if 0   /* this violates RFC */  
                         if (c == '\r') {  
                                 (void)putc('\0', dout);  
                                 bytes++;  
                         }  
 #endif  
                 }                  }
                 if (ferror(fin) || ferror(dout))                  if (ferror(fin) || ferror(dout))
                         serrno = errno;                          serrno = errno;
Line 1539 
Line 1525 
                         warn("connect");                          warn("connect");
                         goto bad;                          goto bad;
                 }                  }
 #if defined(IPPROTO_IP) && defined(IP_TOS)  
                 if (data_addr.su_family == AF_INET) {                  if (data_addr.su_family == AF_INET) {
                         on = IPTOS_THROUGHPUT;                          on = IPTOS_THROUGHPUT;
                         if (setsockopt(data, IPPROTO_IP, IP_TOS, (char *)&on,                          if (setsockopt(data, IPPROTO_IP, IP_TOS, (char *)&on,
                                        sizeof(int)) < 0)                                         sizeof(int)) < 0)
                                 warn("setsockopt TOS (ignored)");                                  warn("setsockopt TOS (ignored)");
                 }                  }
 #endif  
                 return (0);                  return (0);
         }          }
   
Line 1680 
Line 1664 
         }          }
         if (tmpno)          if (tmpno)
                 sendport = 1;                  sendport = 1;
 #if defined(IPPROTO_IP) && defined(IP_TOS)  
         if (data_addr.su_family == AF_INET) {          if (data_addr.su_family == AF_INET) {
                 on = IPTOS_THROUGHPUT;                  on = IPTOS_THROUGHPUT;
                 if (setsockopt(data, IPPROTO_IP, IP_TOS, (char *)&on,                  if (setsockopt(data, IPPROTO_IP, IP_TOS, (char *)&on,
                                sizeof(int)) < 0)                                 sizeof(int)) < 0)
                         warn("setsockopt TOS (ignored)");                          warn("setsockopt TOS (ignored)");
         }          }
 #endif  
         return (0);          return (0);
 bad:  bad:
         (void)close(data), data = -1;          (void)close(data), data = -1;
Line 1714 
Line 1696 
         }          }
         (void)close(data);          (void)close(data);
         data = s;          data = s;
 #if defined(IPPROTO_IP) && defined(IP_TOS)  
         if (from.su_family == AF_INET) {          if (from.su_family == AF_INET) {
                 int tos = IPTOS_THROUGHPUT;                  int tos = IPTOS_THROUGHPUT;
                 if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos,                  if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos,
Line 1722 
Line 1703 
                         warn("setsockopt TOS (ignored)");                          warn("setsockopt TOS (ignored)");
                 }                  }
         }          }
 #endif  
         return (fdopen(data, lmode));          return (fdopen(data, lmode));
 }  }
   

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