Changeset 534 for trunk/src/ocatsocks.c


Ignore:
Timestamp:
11/29/09 22:37:56 (2 years ago)
Author:
eagle
Message:

merged GarliCat branch back into trunk
onioncat-privatehosts.pl added (code by zzz)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src

  • trunk/src/ocatsocks.c

    r508 r534  
    2626 
    2727#include "ocat.h" 
     28#include "ocat_netdesc.h" 
    2829 
    2930 
     
    3132static SocksQueue_t *socks_queue_ = NULL; 
    3233 
    33 #define SOCKS_BUFLEN (sizeof(SocksHdr_t) + ONION_NAME_SIZE + strlen(CNF(usrname)) + 2) 
     34#define SOCKS_BUFLEN (sizeof(SocksHdr_t) + NDESC(name_size) + strlen(CNF(usrname)) + 2) 
    3435 
    3536 
     
    3738{ 
    3839   int len, ret; 
    39    char buf[SOCKS_BUFLEN], onion[ONION_NAME_SIZE]; 
     40   char buf[SOCKS_BUFLEN], onion[NDESC(name_size)]; 
    4041   SocksHdr_t *shdr = (SocksHdr_t*) buf; 
    4142 
    4243   ipv6tonion(&sq->addr, onion); 
    43    strlcat(onion, ".onion", sizeof(onion)); 
     44   strlcat(onion, NDESC(domain), sizeof(onion)); 
    4445   log_msg(LOG_INFO, "trying to connect to \"%s\" [%s]", onion, inet_ntop(AF_INET6, &sq->addr, buf, SOCKS_BUFLEN)); 
    4546 
     
    246247{ 
    247248   int i; 
    248    char addrstr[INET6_ADDRSTRLEN], onstr[ONION_NAME_LEN], buf[SIZE_1K]; 
     249   char addrstr[INET6_ADDRSTRLEN], onstr[NDESC(name_size)], buf[SIZE_1K]; 
    249250   SocksQueue_t *squeue; 
    250251 
     
    257258      } 
    258259 
    259       snprintf(buf, SIZE_1K, "%d: %39s, %s.onion, state = %d, %s(%d), retry = %d, connect_time = %d, restart_time = %d", 
     260      snprintf(buf, SIZE_1K, "%d: %39s, %s%s, state = %d, %s(%d), retry = %d, connect_time = %d, restart_time = %d", 
    260261            i,  
    261262            addrstr,  
    262263            ipv6tonion(&squeue->addr, onstr), 
     264            NDESC(domain), 
    263265            squeue->state, 
    264266            squeue->perm ? "PERMANENT" : "TEMPORARY", 
Note: See TracChangeset for help on using the changeset viewer.