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

Diff for /src/usr.bin/nc/socks.c between version 1.18 and 1.19

version 1.18, 2010/04/20 07:26:35 version 1.19, 2011/02/12 15:54:18
Line 222 
Line 222 
                 if (cnt != wlen)                  if (cnt != wlen)
                         err(1, "write failed (%zu/%zu)", cnt, wlen);                          err(1, "write failed (%zu/%zu)", cnt, wlen);
   
                 cnt = atomicio(read, proxyfd, buf, 10);                  cnt = atomicio(read, proxyfd, buf, 4);
                 if (cnt != 10)                  if (cnt != 4)
                         err(1, "read failed (%zu/10)", cnt);                          err(1, "read failed (%zu/4)", cnt);
                 if (buf[1] != 0)                  if (buf[1] != 0)
                         errx(1, "connection failed, SOCKS error %d", buf[1]);                          errx(1, "connection failed, SOCKS error %d", buf[1]);
                   switch (buf[3]) {
                   case SOCKS_IPV4:
                           cnt = atomicio(read, proxyfd, buf + 4, 6);
                           if (cnt != 6)
                                   err(1, "read failed (%d/6)", cnt);
                           break;
                   case SOCKS_IPV6:
                           cnt = atomicio(read, proxyfd, buf + 4, 18);
                           if (cnt != 18)
                                   err(1, "read failed (%d/18)", cnt);
                           break;
                   default:
                           errx(1, "connection failed, unsupported address type");
                   }
         } else if (socksv == 4) {          } else if (socksv == 4) {
                 /* This will exit on lookup failure */                  /* This will exit on lookup failure */
                 decode_addrport(host, port, (struct sockaddr *)&addr,                  decode_addrport(host, port, (struct sockaddr *)&addr,

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19