/[anubis]/anubis/src/proxy.c
ViewVC logotype

Diff of /anubis/src/proxy.c

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

revision 1.1.1.1 by polak, Thu Jan 30 10:41:08 2003 UTC revision 1.2 by polak, Fri Mar 7 19:53:13 2003 UTC
# Line 39  Line 39 
39  #define ATYP_IPv4           0x01  /* IPv4 */  #define ATYP_IPv4           0x01  /* IPv4 */
40  #define ATYP_DOMAINNAME     0x03  /* DOMAIN NAME */  #define ATYP_DOMAINNAME     0x03  /* DOMAIN NAME */
41  #ifdef IPV6  #ifdef IPV6
42   #define ATYP_IPv6          0x04  /* IPv6 */  # define ATYP_IPv6          0x04  /* IPv6 */
43  #endif /* IPV6 */  #endif /* IPV6 */
44    
45  static int connect_through_socks_proxy(int, char *, unsigned int);  static int connect_through_socks_proxy(int, char *, unsigned int);
# Line 349  connect_through_socks_proxy(int sd, char Line 349  connect_through_socks_proxy(int sd, char
349                          else                          else
350                                  ip = 0; /* a domain name */                                  ip = 0; /* a domain name */
351    
352                          #ifdef IPV6  #ifdef IPV6
353                          if (host[i] == ':') {                          if (host[i] == ':') {
354                                  ip = 2;                                  ip = 2;
355                                  break;                                  break;
356                          }                          }
357                          #endif /* IPV6 */  #endif /* IPV6 */
358                  }                  }
359    
360                  if (ip == 1) { /* IPv4 */                  if (ip == 1) { /* IPv4 */
# Line 383  connect_through_socks_proxy(int sd, char Line 383  connect_through_socks_proxy(int sd, char
383                          for (i = 0; i < 4; i++)                          for (i = 0; i < 4; i++)
384                                  request[offset++] = ip[z++];                                  request[offset++] = ip[z++];
385    
386                  #ifdef IPV6  #ifdef IPV6
387                  }                  }
388                  else if (ip == 2) { /* IPv6 */                  else if (ip == 2) { /* IPv6 */
389                          char tmp[5];                          char tmp[5];
# Line 407  connect_through_socks_proxy(int sd, char Line 407  connect_through_socks_proxy(int sd, char
407                                          strncpy(tmp, "0000", 4);                                          strncpy(tmp, "0000", 4);
408                                  }                                  }
409                          }                          }
410                  #endif /* IPV6 */  #endif /* IPV6 */
411    
412                  }                  }
413                  else { /* a domain name */                  else { /* a domain name */
# Line 500  connect_through_socks_proxy(int sd, char Line 500  connect_through_socks_proxy(int sd, char
500                                  }                                  }
501                                  break;                                  break;
502    
503                          #ifdef IPV6  #ifdef IPV6
504                          case ATYP_IPv6:                          case ATYP_IPv6:
505                                  memset(reply, 0, sizeof(reply));                                  memset(reply, 0, sizeof(reply));
506                                  /*                                  /*
# Line 508  connect_through_socks_proxy(int sd, char Line 508  connect_through_socks_proxy(int sd, char
508                                  */                                  */
509                                  recv(sd, reply, 18, 0);                                  recv(sd, reply, 18, 0);
510                                  break;                                  break;
511                          #endif /* IPV6 */  #endif /* IPV6 */
512                  }                  }
513          }          }
514          return 0;          return 0;

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

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