Commit 1969c8a9 authored by Roger Dingledine's avatar Roger Dingledine
Browse files

client now survives going offline better

fix badness in usage()
if neither socksport nor orrport is defined, quit
obsolete connection_flush_buf()


svn:r780
parent 3c4b4c8c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -23,10 +23,10 @@ Do you want to run a tor server?
  resolution works. Make sure other people can reliably resolve the
  Address you chose.

  Then run tor to generate keys. One of the generated files is your
  'fingerprint' file. Mail it to arma@mit.edu. Remember that you won't
  be able to authenticate to the other tor nodes until I've added you
  to the directory.
  Then run tor to generate keys. One of the files generated
  in your DataDirectory is your 'fingerprint' file. Mail it to
  arma@mit.edu. Remember that you won't be able to authenticate to the
  other tor nodes until I've added you to the directory.

Configuring tsocks:

+4 −7
Original line number Diff line number Diff line
mutiny suggests: if none of the ports is defined maybe it shouldn't start.
aaron got a crash in tor_timegm in tzset on os x, with -l warn but not with -l debug.
Oct 25 04:29:17.017 [warn] directory_initiate_command(): No running dirservers known. This is really bad.
rename ACI to CircID
rotate tls-level connections -- make new ones, expire old ones.
dirserver shouldn't put you in running-routers list if you haven't
  uploading a descriptor recently
  uploaded a descriptor recently
look at having smallcells and largecells
separate trying to rebuild a circuit because you have none from trying to rebuild a
  circuit because the current one is stale
@@ -32,9 +29,9 @@ ARMA - arma claims
Short-term:
        . integrate rep_ok functions, see what breaks
        - update tor faq
        . obey SocksBindAddress, ORBindAddress
        o obey SocksBindAddress, ORBindAddress
        - warn if we're running as root
        - make connection_flush_buf() more obviously obsolete
        o make connection_flush_buf() more obviously obsolete
        . let hup reread the config file, eg so we can get new exit
          policies without restarting
        - use times(2) rather than gettimeofday to measure how long it
@@ -78,7 +75,7 @@ Short-term:
                        - make sure exiting from the not-last hop works
                        - logic to find last *open* hop, not last hop, in cpath
                        - choose exit nodes by exit policies
        - Remember address and port when resolving. 
        - Remember address and port when beginning. 
        - Extend by nickname/hostname/something, not by IP.

On-going
+6 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ void print_usage(void) {
         "-e <policy>\t\tExit policy\n"
         "-l <level>\t\tLog level\n"
         "-m <max>\t\tMax number of connections\n"
         "-s <IP>\t\t\tAddress to bind to for Socks\n"
         "-s <IP>\t\t\tPort to bind to for Socks\n"
         );
  /* split things up to be ANSI compliant */
  printf("-n <nick>\t\tNickname of router\n"
@@ -353,6 +353,11 @@ int getconfig(int argc, char **argv, or_options_t *options) {
    result = -1;
  }

  if(options->SocksPort == 0 && options->ORPort == 0) {
    log(LOG_WARN,"SocksPort and ORPort are both undefined? Quitting.");
    result = -1;
  } 

  if(options->DirPort < 0) {
    log(LOG_WARN,"DirPort option can't be negative.");
    result = -1;
+0 −4
Original line number Diff line number Diff line
@@ -429,10 +429,6 @@ int connection_outbuf_too_full(connection_t *conn) {
  return (conn->outbuf_flushlen > 10*CELL_PAYLOAD_SIZE);
}

int connection_flush_buf(connection_t *conn) {
  return flush_buf(conn->s, conn->outbuf, &conn->outbuf_flushlen);
}

/* return -1 if you want to break the conn, else return 0 */
int connection_handle_write(connection_t *conn) {

+3 −3
Original line number Diff line number Diff line
@@ -578,7 +578,7 @@ static int connection_ap_handshake_socks_reply(connection_t *conn, char *reply,

  if(replylen) { /* we already have a reply in mind */
    connection_write_to_buf(reply, replylen, conn);
    return connection_flush_buf(conn); /* try to flush it */
    return flush_buf(conn->s, conn->outbuf, &conn->outbuf_flushlen); /* try to flush it */
  }
  if(conn->socks_version == 4) {
    memset(buf,0,SOCKS4_NETWORK_LEN);
@@ -587,7 +587,7 @@ static int connection_ap_handshake_socks_reply(connection_t *conn, char *reply,
    buf[1] = (success ? SOCKS4_GRANTED : SOCKS4_REJECT);
    /* leave version, destport, destip zero */
    connection_write_to_buf(buf, SOCKS4_NETWORK_LEN, conn);
    return connection_flush_buf(conn); /* try to flush it */
    return flush_buf(conn->s, conn->outbuf, &conn->outbuf_flushlen); /* try to flush it */
  }
  if(conn->socks_version == 5) {
    buf[0] = 5; /* version 5 */
@@ -598,7 +598,7 @@ static int connection_ap_handshake_socks_reply(connection_t *conn, char *reply,
    buf[3] = 1; /* ipv4 addr */
    memset(buf+4,0,6); /* XXX set external addr/port to 0, see what breaks */
    connection_write_to_buf(buf,10,conn);
    return connection_flush_buf(conn); /* try to flush it */
    return flush_buf(conn->s, conn->outbuf, &conn->outbuf_flushlen); /* try to flush it */
  }
  return 0; /* if socks_version isn't 4 or 5, don't send anything */
}
Loading