[or-cvs] remove trailing whitespace

Roger Dingledine arma at seul.org
Wed Dec 17 21:09:33 UTC 2003


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	buffers.c circuit.c command.c config.c connection.c 
	connection_edge.c connection_or.c directory.c dirserv.c 
	onion.c or.h router.c routerlist.c test.c tor_main.c 
Log Message:
remove trailing whitespace


Index: buffers.c
===================================================================
RCS file: /home/or/cvsroot/src/or/buffers.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- buffers.c	17 Dec 2003 09:42:28 -0000	1.57
+++ buffers.c	17 Dec 2003 21:09:31 -0000	1.58
@@ -71,7 +71,7 @@
    * MIN_BUF_SHRINK_SIZE.
    */
   new_len = buf->len / 2;
-  while (buf->datalen < new_len/4 && new_len/2 > MIN_BUF_SHRINK_SIZE) 
+  while (buf->datalen < new_len/4 && new_len/2 > MIN_BUF_SHRINK_SIZE)
     new_len /= 2;
   log_fn(LOG_DEBUG,"Shrinking buffer from %d to %d bytes.",
          (int)buf->len, (int)new_len);
@@ -91,7 +91,7 @@
  * Otherwise, return index of the first character in buf _after_ the
  * first instance of str.
  */
-static int find_str_in_str(const char *str, int str_len, 
+static int find_str_in_str(const char *str, int str_len,
                            const char *buf, int buf_len)
 {
   const char *location;
@@ -216,14 +216,14 @@
     return 0;
 
   r = tor_tls_read(tls, buf->mem+buf->datalen, at_most);
-  if (r<0) 
+  if (r<0)
     return r;
   buf->datalen += r;
   log_fn(LOG_DEBUG,"Read %d bytes. %d on inbuf.",r, (int)buf->datalen);
   return r;
-} 
+}
 
-int flush_buf(int s, buf_t *buf, int *buf_flushlen) 
+int flush_buf(int s, buf_t *buf, int *buf_flushlen)
 {
 
   /* push from buf onto s
@@ -264,7 +264,7 @@
   }
 }
 
-int flush_buf_tls(tor_tls *tls, buf_t *buf, int *buf_flushlen) 
+int flush_buf_tls(tor_tls *tls, buf_t *buf, int *buf_flushlen)
 {
   int r;
   assert(tls && BUF_OK(buf) && buf_flushlen);
@@ -325,7 +325,7 @@
  *   them), remove them from buf, and return 1.
  *   (If headers or body is NULL, discard that part of the buf.)
  *   If a headers or body doesn't fit in the arg, return -1.
- * 
+ *
  * Else, change nothing and return 0.
  */
 int fetch_from_buf_http(buf_t *buf,
@@ -358,7 +358,7 @@
   }
 
 #define CONTENT_LENGTH "\r\nContent-Length: "
-  i = find_str_in_str(CONTENT_LENGTH, strlen(CONTENT_LENGTH), 
+  i = find_str_in_str(CONTENT_LENGTH, strlen(CONTENT_LENGTH),
                       headers, headerlen);
   if(i > 0) {
     contentlen = atoi(headers+i);

Index: circuit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuit.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- circuit.c	17 Dec 2003 09:42:28 -0000	1.123
+++ circuit.c	17 Dec 2003 21:09:31 -0000	1.124
@@ -7,7 +7,7 @@
 extern or_options_t options; /* command-line and config-file options */
 
 static void circuit_free_cpath_node(crypt_path_t *victim);
-static circ_id_t get_unique_circ_id_by_conn(connection_t *conn, int circ_id_type);  
+static circ_id_t get_unique_circ_id_by_conn(connection_t *conn, int circ_id_type);
 
 unsigned long stats_n_relay_cells_relayed = 0;
 unsigned long stats_n_relay_cells_delivered = 0;
@@ -54,7 +54,7 @@
 }
 
 circuit_t *circuit_new(circ_id_t p_circ_id, connection_t *p_conn) {
-  circuit_t *circ; 
+  circuit_t *circ;
 
   circ = tor_malloc_zero(sizeof(circuit_t));
 
@@ -344,7 +344,7 @@
   char recognized=0;
 
   assert(cell && circ);
-  assert(cell_direction == CELL_DIRECTION_OUT || cell_direction == CELL_DIRECTION_IN); 
+  assert(cell_direction == CELL_DIRECTION_OUT || cell_direction == CELL_DIRECTION_IN);
 
   log_fn(LOG_DEBUG,"direction %d, streamid %d before crypt.", cell_direction, *(int*)(cell->payload+1));
 
@@ -409,7 +409,7 @@
 
   assert(inlen < CELL_NETWORK_SIZE);
 
-  if(cell_direction == CELL_DIRECTION_IN) { 
+  if(cell_direction == CELL_DIRECTION_IN) {
     if(circ->cpath) { /* we're at the beginning of the circuit.
                          We'll want to do layered crypts. */
       thishop = circ->cpath;
@@ -453,7 +453,7 @@
       /* don't check for recognized. only the OP can recognize a stream on the way back. */
 
     }
-  } else if(cell_direction == CELL_DIRECTION_OUT) { 
+  } else if(cell_direction == CELL_DIRECTION_OUT) {
     if(circ->cpath) { /* we're at the beginning of the circuit. We'll want to do layered crypts. */
 
       thishop = *layer_hint; /* we already know which layer, from when we package_raw_inbuf'ed */
@@ -604,12 +604,12 @@
   if(circ->n_conn)
     connection_send_destroy(circ->n_circ_id, circ->n_conn);
   for(conn=circ->n_streams; conn; conn=conn->next_stream) {
-    connection_send_destroy(circ->n_circ_id, conn); 
+    connection_send_destroy(circ->n_circ_id, conn);
   }
   if(circ->p_conn)
     connection_send_destroy(circ->n_circ_id, circ->p_conn);
   for(conn=circ->p_streams; conn; conn=conn->next_stream) {
-    connection_send_destroy(circ->p_circ_id, conn); 
+    connection_send_destroy(circ->p_circ_id, conn);
   }
   if (circ->state == CIRCUIT_STATE_BUILDING ||
       circ->state == CIRCUIT_STATE_OR_WAIT) {
@@ -638,7 +638,7 @@
         if(circ->p_conn == conn) /* it's closing behind us */
           circ->p_conn = NULL;
         circuit_close(circ);
-      }  
+      }
       return;
     case CONN_TYPE_AP:
     case CONN_TYPE_EXIT:
@@ -692,8 +692,8 @@
       log(severity,"Building: desired len %d, planned exit node %s.",
           circ->build_state->desired_path_len, circ->build_state->chosen_exit);
     for(hop=circ->cpath;hop->next != circ->cpath; hop=hop->next)
-      log(severity,"hop: state %d, addr %x, port %d", hop->state, 
-          (unsigned int)hop->addr, 
+      log(severity,"hop: state %d, addr %x, port %d", hop->state,
+          (unsigned int)hop->addr,
           (int)hop->port);
   }
 }
@@ -744,7 +744,7 @@
 /* Number of consecutive failures so far; should only be touched by
  * circuit_launch_new and circuit_*_failure_count.
  */
-static int n_circuit_failures = 0; 
+static int n_circuit_failures = 0;
 
 /* Return -1 if you aren't going to try to make a circuit, 0 if you did try. */
 int circuit_launch_new(void) {
@@ -820,7 +820,7 @@
     log_fn(LOG_DEBUG,"connecting in progress (or finished). Good.");
     return 0; /* return success. The onion/circuit/etc will be taken care of automatically
                * (may already have been) whenever n_conn reaches OR_CONN_STATE_OPEN.
-               */ 
+               */
   } else { /* it (or a twin) is already open. use it. */
     circ->n_addr = n_conn->addr;
     circ->n_port = n_conn->port;
@@ -1084,7 +1084,7 @@
   assert(cp->b_crypto);
   assert(cp->addr);
   assert(cp->port);
-  switch(cp->state) 
+  switch(cp->state)
     {
     case CPATH_STATE_CLOSED:
     case CPATH_STATE_OPEN:
@@ -1120,7 +1120,7 @@
   }
 }
 
-void assert_circuit_ok(const circuit_t *c) 
+void assert_circuit_ok(const circuit_t *c)
 {
   connection_t *conn;
 

Index: command.c
===================================================================
RCS file: /home/or/cvsroot/src/or/command.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- command.c	16 Dec 2003 09:48:17 -0000	1.50
+++ command.c	17 Dec 2003 21:09:31 -0000	1.51
@@ -21,7 +21,7 @@
                                int *num, int *time,
                                void (*func)(cell_t *, connection_t *)) {
   struct timeval start, end;
-  long time_passed; 
+  long time_passed;
 
   *num += 1;
 
@@ -46,7 +46,7 @@
 
   if(now > current_second) { /* the second has rolled over */
     /* print stats */
-    log(LOG_INFO,"At end of second:"); 
+    log(LOG_INFO,"At end of second:");
     log(LOG_INFO,"Create:    %d (%d ms)", num_create, create_time/1000);
     log(LOG_INFO,"Created:   %d (%d ms)", num_created, created_time/1000);
     log(LOG_INFO,"Relay:     %d (%d ms)", num_relay, relay_time/1000);

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- config.c	14 Dec 2003 05:08:28 -0000	1.77
+++ config.c	17 Dec 2003 21:09:31 -0000	1.78
@@ -50,7 +50,7 @@
   char *s;
   int i = 1;
 
-  while(i < argc-1) { 
+  while(i < argc-1) {
     if(!strcmp(argv[i],"-f")) {
 //      log(LOG_DEBUG,"Commandline: skipping over -f.");
       i+=2; /* this is the config file option. ignore it. */
@@ -119,7 +119,7 @@
   log_fn(LOG_DEBUG,"Recognized keyword '%s' as %s, using value '%s'.",c->key,key,c->value);
 
   switch(type) {
-    case CONFIG_TYPE_INT:   
+    case CONFIG_TYPE_INT:
       *(int *)arg = atoi(c->value);
       break;
     case CONFIG_TYPE_BOOL:
@@ -205,7 +205,7 @@
     }
 
     list = list->next;
-  }  
+  }
 }
 
 /* prints the usage of tor. */
@@ -300,7 +300,7 @@
     previous_runasdaemon = options->RunAsDaemon;
     free_options(options);
   }
-  init_options(options); 
+  init_options(options);
 
   if(argc > 1 && (!strcmp(argv[1], "-h") || !strcmp(argv[1],"--help"))) {
     print_usage();
@@ -330,7 +330,7 @@
   config_assign(options,cl);
   config_free_lines(cl);
   config_close(cf);
- 
+
 /* go through command-line variables too */
   cl = config_get_commandlines(argc,argv);
   config_assign(options,cl);
@@ -394,7 +394,7 @@
   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.");

Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -d -r1.141 -r1.142
--- connection.c	16 Dec 2003 22:56:50 -0000	1.141
+++ connection.c	17 Dec 2003 21:09:31 -0000	1.142
@@ -146,7 +146,7 @@
   memcpy(&(bindaddr.sin_addr.s_addr),rent->h_addr,rent->h_length);
 
   s = socket(PF_INET,SOCK_STREAM,IPPROTO_TCP);
-  if (s < 0) { 
+  if (s < 0) {
     log_fn(LOG_WARN,"Socket creation failed.");
     return -1;
   }
@@ -246,7 +246,7 @@
   return 0;
 }
 
-/* take conn, make a nonblocking socket; try to connect to 
+/* take conn, make a nonblocking socket; try to connect to
  * addr:port (they arrive in *host order*). If fail, return -1. Else
  * assign s to conn->s: if connected return 1, if eagain return 0.
  * address is used to make the logs useful.
@@ -343,7 +343,7 @@
   }
 
   if(connection_read_to_buf(conn) < 0) {
-    if(conn->type == CONN_TYPE_DIR && 
+    if(conn->type == CONN_TYPE_DIR &&
       (conn->state == DIR_CONN_STATE_CONNECTING_FETCH ||
        conn->state == DIR_CONN_STATE_CONNECTING_UPLOAD)) {
        /* it's a directory server and connecting failed: forget about this router */
@@ -485,7 +485,7 @@
       /* case TOR_TLS_DONE:
        * for TOR_TLS_DONE, fall through to check if the flushlen
        * is empty, so we can stop writing.
-       */  
+       */
     }
   } else {
     if(flush_buf(conn->s, conn->outbuf, &conn->outbuf_flushlen) < 0)
@@ -520,7 +520,7 @@
   int i, n;
   connection_t *conn;
   connection_t **carray;
- 
+
   get_connection_array(&carray,&n);
   for(i=0;i<n;i++) {
     conn = carray[i];
@@ -547,13 +547,13 @@
     log(LOG_INFO,"connection_twin_get_by_addr_port(): Found exact match.");
     return conn;
   }
- 
+
   /* now check if any of the other open connections are a twin for this one */
- 
+
   router = router_get_by_addr_port(addr,port);
   if(!router)
     return NULL;
- 
+
   get_connection_array(&carray,&n);
   for(i=0;i<n;i++) {
     conn = carray[i];
@@ -571,7 +571,7 @@
   int i, n;
   connection_t *conn;
   connection_t **carray;
- 
+
   get_connection_array(&carray,&n);
   for(i=0;i<n;i++) {
     conn = carray[i];
@@ -585,7 +585,7 @@
   int i, n;
   connection_t *conn;
   connection_t **carray;
- 
+
   get_connection_array(&carray,&n);
   for(i=0;i<n;i++) {
     conn = carray[i];
@@ -599,7 +599,7 @@
   int i, n;
   connection_t *conn, *best=NULL;
   connection_t **carray;
- 
+
   get_connection_array(&carray,&n);
   for(i=0;i<n;i++) {
     conn = carray[i];
@@ -616,7 +616,7 @@
   if(!connection_speaks_cells(conn))
     return 0; /* edge connections don't use receiver_buckets */
   if(conn->state != OR_CONN_STATE_OPEN)
-    return 0; /* only open connections play the rate limiting game */  
+    return 0; /* only open connections play the rate limiting game */
 
   assert(conn->bandwidth > 0);
   if(conn->receiver_bucket > 9*conn->bandwidth)
@@ -653,7 +653,7 @@
   assert(conn);
 
   if(!connection_speaks_cells(conn)) {
-     log_fn(LOG_INFO,"CircID %d: At an edge. Marking connection for close.", 
+     log_fn(LOG_INFO,"CircID %d: At an edge. Marking connection for close.",
             circ_id);
      if(connection_edge_end(conn, END_STREAM_REASON_DESTROY, conn->cpath_layer) < 0)
        log_fn(LOG_WARN,"1: I called connection_edge_end redundantly.");
@@ -682,9 +682,9 @@
     case CONN_TYPE_DIR:
       return connection_dir_process_inbuf(conn);
     case CONN_TYPE_DNSWORKER:
-      return connection_dns_process_inbuf(conn); 
+      return connection_dns_process_inbuf(conn);
     case CONN_TYPE_CPUWORKER:
-      return connection_cpu_process_inbuf(conn); 
+      return connection_cpu_process_inbuf(conn);
     default:
       log_fn(LOG_WARN,"got unexpected conn->type %d.", conn->type);
       return -1;
@@ -724,7 +724,7 @@
 
   /* XXX check: wants_to_read, wants_to_write, s, poll_index,
    * marked_for_close. */
-  
+
   /* buffers */
   if (!connection_is_listener(conn)) {
     assert(conn->inbuf);
@@ -735,7 +735,7 @@
   assert(!now || conn->timestamp_lastwritten <= now);
   assert(conn->timestamp_created <= conn->timestamp_lastread);
   assert(conn->timestamp_created <= conn->timestamp_lastwritten);
-  
+
   /* XXX Fix this; no longer so.*/
 #if 0
   if(conn->type != CONN_TYPE_OR && conn->type != CONN_TYPE_DIR)
@@ -758,7 +758,7 @@
     if (conn->state != OR_CONN_STATE_CONNECTING)
       assert(conn->tls);
   }
-  
+
   if (conn->type != CONN_TYPE_EXIT && conn->type != CONN_TYPE_AP) {
     assert(!conn->stream_id[0]);
     assert(!conn->next_stream);
@@ -768,7 +768,7 @@
     assert(!conn->done_sending);
     assert(!conn->done_receiving);
   } else {
-    assert(!conn->next_stream || 
+    assert(!conn->next_stream ||
            conn->next_stream->type == CONN_TYPE_EXIT ||
            conn->next_stream->type == CONN_TYPE_AP);
     if(conn->type == CONN_TYPE_AP && conn->state == AP_CONN_STATE_OPEN)
@@ -781,7 +781,7 @@
     assert(!conn->socks_request);
   }
 
-  switch(conn->type) 
+  switch(conn->type)
     {
     case CONN_TYPE_OR_LISTENER:
     case CONN_TYPE_AP_LISTENER:

Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_edge.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- connection_edge.c	16 Dec 2003 22:56:50 -0000	1.79
+++ connection_edge.c	17 Dec 2003 21:09:31 -0000	1.80
@@ -27,7 +27,7 @@
 
   if(conn->inbuf_reached_eof) {
 #ifdef HALF_OPEN
-    /* eof reached; we're done reading, but we might want to write more. */ 
+    /* eof reached; we're done reading, but we might want to write more. */
     conn->done_receiving = 1;
     shutdown(conn->s, 0); /* XXX check return, refactor NM */
     if (conn->done_sending) {
@@ -38,7 +38,7 @@
                                    NULL, 0, conn->cpath_layer);
     }
     return 0;
-#else 
+#else
     /* eof reached, kill it. */
     log_fn(LOG_INFO,"conn (fd %d) reached eof. Closing.", conn->s);
     if(connection_edge_end(conn, END_STREAM_REASON_DONE, conn->cpath_layer) < 0)
@@ -676,7 +676,7 @@
   memcpy(payload, ap_conn->stream_id, STREAM_ID_SIZE);
   payload_len = STREAM_ID_SIZE + 1 +
     snprintf(payload+STREAM_ID_SIZE,CELL_PAYLOAD_SIZE-RELAY_HEADER_SIZE-STREAM_ID_SIZE,
-             "%s:%d", 
+             "%s:%d",
              string_addr ? string_addr : ap_conn->socks_request->address,
              ap_conn->socks_request->port);
 
@@ -692,7 +692,7 @@
   /* XXX Right now, we rely on the socks client not to send us any data
    * XXX until we've sent back a socks reply.  (If it does, we could wind
    * XXX up packaging that data and sending it to the exit, then later having
-   * XXX the exit refuse us.)  
+   * XXX the exit refuse us.)
    * XXX Perhaps we should grow an AP_CONN_STATE_CONNECTING state.
    */
   log_fn(LOG_INFO,"Address/port sent, ap socket %d, n_circ_id %d",ap_conn->s,circ->n_circ_id);
@@ -865,7 +865,7 @@
 static SPLAY_HEAD(client_dns_tree, client_dns_entry) client_dns_root;
 
 static int compare_client_dns_entries(struct client_dns_entry *a,
-                                      struct client_dns_entry *b) 
+                                      struct client_dns_entry *b)
 {
   return strcasecmp(a->address, b->address);
 }
@@ -962,7 +962,7 @@
 
   if(!client_dns_size)
     return;
-  expired_entries = tor_malloc(client_dns_size * 
+  expired_entries = tor_malloc(client_dns_size *
                                sizeof(struct client_dns_entry *));
 
   now = time(NULL);

Index: connection_or.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_or.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- connection_or.c	16 Dec 2003 09:48:17 -0000	1.80
+++ connection_or.c	17 Dec 2003 21:09:31 -0000	1.81
@@ -118,7 +118,7 @@
       return NULL;
     case 0:
       connection_set_poll_socket(conn);
-      connection_watch_events(conn, POLLIN | POLLOUT | POLLERR); 
+      connection_watch_events(conn, POLLIN | POLLOUT | POLLERR);
       /* writable indicates finish, readable indicates broken link,
          error indicates broken link on windows */
       conn->state = OR_CONN_STATE_CONNECTING;
@@ -248,7 +248,7 @@
   assert(connection_speaks_cells(conn));
 
   cell_pack(n, cellp);
- 
+
   connection_write_to_buf(n, CELL_NETWORK_SIZE, conn);
 }
 
@@ -262,13 +262,13 @@
          conn->s,(int)buf_datalen(conn->inbuf),tor_tls_get_pending_bytes(conn->tls));
   if(buf_datalen(conn->inbuf) < CELL_NETWORK_SIZE) /* entire response available? */
     return 0; /* not yet */
- 
+
   connection_fetch_from_buf(buf, CELL_NETWORK_SIZE, conn);
- 
+
   /* retrieve cell info from buf (create the host-order struct from the
    * network-order string) */
   cell_unpack(&cell, buf);
- 
+
   command_process_cell(&cell, conn);
 
   goto loop; /* process the remainder of the buffer */

Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/src/or/directory.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- directory.c	17 Dec 2003 09:42:28 -0000	1.55
+++ directory.c	17 Dec 2003 21:09:31 -0000	1.56
@@ -165,7 +165,7 @@
     return -1; /* XXX send some helpful http error code */
   }
 
-  log_fn(LOG_DEBUG,"Dumping directory to client."); 
+  log_fn(LOG_DEBUG,"Dumping directory to client.");
   connection_write_to_buf(answerstring, strlen(answerstring), conn);
   connection_write_to_buf(cp, dlen, conn);
   conn->state = DIR_CONN_STATE_SERVER_WRITING;

Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dirserv.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- dirserv.c	17 Dec 2003 09:20:29 -0000	1.23
+++ dirserv.c	17 Dec 2003 21:09:31 -0000	1.24
@@ -141,7 +141,7 @@
   }
 }
 
-void 
+void
 dirserv_free_fingerprint_list()
 {
   int i;
@@ -285,17 +285,17 @@
   tor_free(desc_tmp);
   if (ri)
     routerinfo_free(ri);
-  
+
   return -1;
 }
 
-void 
+void
 directory_set_dirty()
 {
   the_directory_is_dirty = 1;
 }
 
-int 
+int
 dirserv_init_from_directory_string(const char *dir)
 {
   const char *cp = dir;
@@ -343,7 +343,7 @@
     if (i)
       strcat(cp, " ");
     strcat(cp, nickname_lst[i]);
-    while (*cp) 
+    while (*cp)
       ++cp;
   }
   return 0;

Index: onion.c
===================================================================
RCS file: /home/or/cvsroot/src/or/onion.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- onion.c	17 Dec 2003 05:58:30 -0000	1.114
+++ onion.c	17 Dec 2003 21:09:31 -0000	1.115
@@ -111,7 +111,7 @@
 
   /* now victim points to the element that needs to be removed */
 
-  free(victim); 
+  free(victim);
 }
 
 /* given a response payload and keys, initialize, then send a created cell back */
@@ -266,7 +266,7 @@
           carray[j]->marked_for_close ||
           circuit_stream_is_being_handled(carray[j]))
         continue; /* Skip everything but APs in CIRCUIT_WAIT */
-      switch (connection_ap_can_use_exit(carray[j], dir->routers[i])) 
+      switch (connection_ap_can_use_exit(carray[j], dir->routers[i]))
         {
         case -1:
           log_fn(LOG_DEBUG,"%s (index %d) would reject this stream.",
@@ -283,7 +283,7 @@
                  dir->routers[i]->nickname, i, n_maybe_supported[i]);
         }
     } /* End looping over connections. */
-    if (n_supported[i] > best_support) { 
+    if (n_supported[i] > best_support) {
       /* If this router is better than previous ones, remember its index
        * and goodness, and start counting how many routers are this good. */
       best_support = n_supported[i]; best_support_idx = i; n_best_support=1;
@@ -372,7 +372,7 @@
 
   router_get_routerlist(&rl);
   r = new_route_len(options.PathlenCoinWeight, rl->routers, rl->n_routers);
-  if (r < 0) 
+  if (r < 0)
     return NULL;
   exit = choose_good_exit_server(rl);
   if(!exit)
@@ -459,10 +459,10 @@
       ++cur_len;
     }
   }
-  if (cur_len >= state->desired_path_len) { 
-    log_fn(LOG_DEBUG, "Path is complete: %d steps long", 
+  if (cur_len >= state->desired_path_len) {
+    log_fn(LOG_DEBUG, "Path is complete: %d steps long",
            state->desired_path_len);
-    return 1; 
+    return 1;
   }
   log_fn(LOG_DEBUG, "Path is %d long; we want %d", cur_len,
          state->desired_path_len);
@@ -544,7 +544,7 @@
   hop->package_window = CIRCWINDOW_START;
   hop->deliver_window = CIRCWINDOW_START;
 
-  log_fn(LOG_DEBUG, "Extended circuit path with %s for hop %d", 
+  log_fn(LOG_DEBUG, "Extended circuit path with %s for hop %d",
          choice->nickname, cur_len);
 
   *router_out = choice;
@@ -600,7 +600,7 @@
    * of 'challenge' to 0.  This means that our symmetric key is really
    * only 127 bits.
    */
-  challenge[0] &= 0x7f; 
+  challenge[0] &= 0x7f;
 
   if (crypto_dh_get_public(dh, challenge+16, dhbytes))
     goto err;

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -d -r1.210 -r1.211
--- or.h	17 Dec 2003 09:42:28 -0000	1.210
+++ or.h	17 Dec 2003 21:09:31 -0000	1.211
@@ -317,7 +317,7 @@
 
 /* Used only by OR connections: */
   tor_tls *tls;
-  circ_id_t next_circ_id; /* Which circ_id do we try to use next on this connection? 
+  circ_id_t next_circ_id; /* Which circ_id do we try to use next on this connection?
                            * This is always in the range 0..1<<15-1.*/
 
   /* bandwidth and receiver_bucket only used by ORs in OPEN state: */
@@ -337,7 +337,7 @@
   int done_receiving;
   char has_sent_end; /* for debugging: set once we've set the stream end,
                         and check in circuit_about_to_close_connection() */
-  
+
   /* Used only by AP connections */
   socks_request_t *socks_request;
 };
@@ -362,18 +362,18 @@
 typedef struct {
   char *address;
   char *nickname;
- 
+
   uint32_t addr; /* all host order */
   uint16_t or_port;
   uint16_t socks_port;
   uint16_t dir_port;
 
   time_t published_on;
- 
+
   crypto_pk_env_t *onion_pkey; /* public RSA key for onions */
   crypto_pk_env_t *link_pkey;  /* public RSA key for TLS */
   crypto_pk_env_t *identity_pkey;  /* public RSA key for signing */
- 
+
   int is_running;
 
   /* link info */
@@ -389,7 +389,7 @@
   time_t published_on;
 } routerlist_t;
 
-struct crypt_path_t { 
+struct crypt_path_t {
 
   /* crypto environments */
   crypto_cipher_env_t *f_crypto;
@@ -735,7 +735,7 @@
 
 int onionskin_answer(circuit_t *circ, unsigned char *payload, unsigned char *keys);
 
-int onion_extend_cpath(crypt_path_t **head_ptr, cpath_build_state_t *state, 
+int onion_extend_cpath(crypt_path_t **head_ptr, cpath_build_state_t *state,
                        routerinfo_t **router_out);
 
 int onion_skin_create(crypto_pk_env_t *router_key,

Index: router.c
===================================================================
RCS file: /home/or/cvsroot/src/or/router.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- router.c	17 Dec 2003 09:42:28 -0000	1.5
+++ router.c	17 Dec 2003 21:09:31 -0000	1.6
@@ -224,7 +224,7 @@
   router_get_routerlist(&rl);
   for (i=0;i<rl->n_routers;i++) {
     router = rl->routers[i];
-    if(!connection_exact_get_by_addr_port(router->addr,router->or_port)) { 
+    if(!connection_exact_get_by_addr_port(router->addr,router->or_port)) {
       /* not in the list */
       log_fn(LOG_DEBUG,"connecting to OR %s:%u.",router->address,router->or_port);
       connection_or_connect(router);
@@ -378,11 +378,11 @@
   int result=0;
   struct exit_policy_t *tmpe;
 #ifdef DEBUG_ROUTER_DUMP_ROUTER_TO_STRING
-  char *s_tmp, *s_dup; 
+  char *s_tmp, *s_dup;
   const char *cp;
   routerinfo_t *ri_tmp;
 #endif
-  
+
   get_platform_str(platform, sizeof(platform));
 
   if (crypto_pk_cmp_keys(ident_key, router->identity_pkey)) {
@@ -408,8 +408,8 @@
     return -1;
   }
   strftime(published, 32, "%Y-%m-%d %H:%M:%S", gmtime(&router->published_on));
-  
-  result = snprintf(s, maxlen, 
+
+  result = snprintf(s, maxlen,
                     "router %s %s %d %d %d %d\n"
                     "platform %s\n"
                     "published %s\n"
@@ -493,8 +493,8 @@
   written += strlen(s+written);
   strcat(s+written, "-----END SIGNATURE-----\n");
   written += strlen(s+written);
-  
-  if (written > maxlen-2) 
+
+  if (written > maxlen-2)
     return -1;
   /* include a last '\n' */
   s[written] = '\n';
@@ -504,7 +504,7 @@
   cp = s_tmp = s_dup = tor_strdup(s);
   ri_tmp = router_get_entry_from_string(&cp);
   if (!ri_tmp) {
-    log_fn(LOG_ERR, "We just generated a router descriptor we can't parse: <<%s>>", 
+    log_fn(LOG_ERR, "We just generated a router descriptor we can't parse: <<%s>>",
            s);
     return -1;
   }

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- routerlist.c	15 Dec 2003 21:35:52 -0000	1.11
+++ routerlist.c	17 Dec 2003 21:09:31 -0000	1.12
@@ -75,7 +75,7 @@
 static int
 router_get_routerlist_from_directory_impl(const char *s, routerlist_t **dest,
                                           crypto_pk_env_t *pkey);
-static int router_add_exit_policy(routerinfo_t *router, 
+static int router_add_exit_policy(routerinfo_t *router,
                                   directory_token_t *tok);
 static int router_resolve_routerlist(routerlist_t *dir);
 
@@ -87,7 +87,7 @@
 #else
 #define router_get_next_token _router_get_next_token
 #endif
-static int router_get_hash_impl(const char *s, char *digest, 
+static int router_get_hash_impl(const char *s, char *digest,
                                 const char *start_str,
                                 const char *end_str);
 static void router_release_token(directory_token_t *tok);
@@ -161,7 +161,7 @@
   return NULL;
 }
 
-routerinfo_t *router_get_by_link_pk(crypto_pk_env_t *pk) 
+routerinfo_t *router_get_by_link_pk(crypto_pk_env_t *pk)
 {
   int i;
   routerinfo_t *router;
@@ -296,16 +296,16 @@
                               "router ","router-signature");
 }
 
-/* return 0 if myversion is in versionlist. Else return -1.  (versionlist 
+/* return 0 if myversion is in versionlist. Else return -1.  (versionlist
  * contains a comma-separated list of versions.) */
-int compare_recommended_versions(const char *myversion, 
+int compare_recommended_versions(const char *myversion,
                                  const char *versionlist) {
   int len_myversion = strlen(myversion);
   char *comma;
   const char *end = versionlist + strlen(versionlist);
 
   log_fn(LOG_DEBUG,"checking '%s' in '%s'.", myversion, versionlist);
-  
+
   for(;;) {
     comma = strchr(versionlist, ',');
     if( ((comma ? comma : end) - versionlist == len_myversion) &&
@@ -356,7 +356,7 @@
   rent = (struct hostent *)gethostbyname(router->address);
   if (!rent) {
     log_fn(LOG_WARN,"Could not get address for router %s.",router->address);
-    return -1; 
+    return -1;
   }
   assert(rent->h_length == 4);
   memcpy(&router->addr, rent->h_addr,rent->h_length);
@@ -426,7 +426,7 @@
       if (tmpe->msk == 0 && (port >= tmpe->prt_min && port <= tmpe->prt_max)) {
         /* The exit policy is accept/reject *:port */
         match = 1;
-      } else if (port >= tmpe->prt_min && port <= tmpe->prt_max && 
+      } else if (port >= tmpe->prt_min && port <= tmpe->prt_max &&
                  tmpe->policy_type == EXIT_POLICY_REJECT) {
         /* The exit policy is reject ???:port */
         maybe_reject = 1;
@@ -477,7 +477,6 @@
     return 0; /* no, might accept some */
 }
 
- 
 /* Helper function: parse a directory from 's' and, when done, store the
  * resulting routerlist in *dest, freeing the old value if necessary.
  * If pkey is provided, we check the directory signature with pkey.
@@ -496,7 +495,7 @@
   char *good_nickname_lst[1024];
   int n_good_nicknames = 0;
   int i;
-  
+
   /* Local helper macro: get the next token from s (advancing s) and
    * bail on failure. */
 #define NEXT_TOK()                                                      \
@@ -538,7 +537,7 @@
   if (!strptime(ARGS[0], "%Y-%m-%d %H:%M:%S", &published)) {
     log_fn(LOG_WARN, "Published time was unparseable"); goto err;
   }
-  published_on = tor_timegm(&published);  
+  published_on = tor_timegm(&published);
 
   NEXT_TOK();
   TOK_IS(K_RECOMMENDED_SOFTWARE, "recommended-software");
@@ -558,7 +557,7 @@
   /* Read the router list from s, advancing s up past the end of the last
    * router. */
   if (router_get_list_from_string_impl(&s, &new_dir,
-                                       n_good_nicknames, 
+                                       n_good_nicknames,
                                        (const char**)good_nickname_lst)) {
     log_fn(LOG_WARN, "Error reading routers from directory");
     goto err;
@@ -588,7 +587,7 @@
   NEXT_TOK();
   TOK_IS(_EOF, "end of directory");
 
-  if (*dest) 
+  if (*dest)
     routerlist_free(*dest);
   *dest = new_dir;
 
@@ -648,7 +647,7 @@
       log_fn(LOG_WARN, "too many routers");
       routerinfo_free(router);
       continue;
-    } 
+    }
     if (n_good_nicknames>=0) {
       router->is_running = 0;
       for (i = 0; i < n_good_nicknames; ++i) {
@@ -714,7 +713,7 @@
   }
 
   router = tor_malloc_zero(sizeof(routerinfo_t));
-  router->onion_pkey = router->identity_pkey = router->link_pkey = NULL; 
+  router->onion_pkey = router->identity_pkey = router->link_pkey = NULL;
 
   if (N_ARGS != 6) {
     log_fn(LOG_WARN,"Wrong # of arguments to \"router\"");
@@ -725,12 +724,12 @@
     log_fn(LOG_WARN,"Router nickname too long.");
     goto err;
   }
-  if (strspn(router->nickname, LEGAL_NICKNAME_CHARACTERS) != 
+  if (strspn(router->nickname, LEGAL_NICKNAME_CHARACTERS) !=
       strlen(router->nickname)) {
     log_fn(LOG_WARN, "Router nickname contains illegal characters.");
     goto err;
   }
-  
+
   /* read router.address */
   router->address = tor_strdup(ARGS[1]);
   router->addr = 0;
@@ -741,10 +740,10 @@
     log_fn(LOG_WARN,"or_port unreadable or 0. Failing.");
     goto err;
   }
-  
+
   /* Router->socks_port */
   router->socks_port = atoi(ARGS[3]);
-  
+
   /* Router->dir_port */
   router->dir_port = atoi(ARGS[4]);
 
@@ -754,9 +753,9 @@
     log_fn(LOG_WARN,"bandwidth unreadable or 0. Failing.");
     goto err;
   }
-  
+
   log_fn(LOG_DEBUG,"or_port %d, socks_port %d, dir_port %d, bandwidth %u.",
-    router->or_port, router->socks_port, router->dir_port, 
+    router->or_port, router->socks_port, router->dir_port,
     (unsigned) router->bandwidth);
 
   /* XXX Later, require platform before published. */
@@ -764,7 +763,7 @@
   if (tok->tp == K_PLATFORM) {
     NEXT_TOKEN();
   }
-  
+
   if (tok->tp != K_PUBLISHED) {
     log_fn(LOG_WARN, "Missing published time"); goto err;
   }
@@ -809,7 +808,7 @@
     router_add_exit_policy(router, tok);
     NEXT_TOKEN();
   }
-  
+
   if (tok->tp != K_ROUTER_SIGNATURE) {
     log_fn(LOG_WARN,"Missing router signature");
     goto err;
@@ -830,12 +829,12 @@
     log_fn(LOG_WARN, "Mismatched signature");
     goto err;
   }
-  
+
   router_release_token(tok); /* free the signature */
   return router;
 
 err:
-  router_release_token(tok); 
+  router_release_token(tok);
   routerinfo_free(router);
   return NULL;
 #undef ARGS
@@ -912,7 +911,7 @@
   address = arg;
   mask = strchr(arg,'/');
   port = strchr(mask?mask:arg,':');
-  /* Break 'arg' into separate strings.  'arg' was already strdup'd by 
+  /* Break 'arg' into separate strings.  'arg' was already strdup'd by
    * _router_get_next_token, so it's safe to modify.
    */
   if (mask)
@@ -1034,7 +1033,7 @@
 router_release_token(directory_token_t *tok)
 {
   int i;
-  switch (tok->tp) 
+  switch (tok->tp)
     {
     case _SIGNATURE:
       free(tok->val.signature);
@@ -1071,7 +1070,7 @@
   tok->val.error = "";
 
   router_release_token(tok);
-  
+
   *s = eat_whitespace(*s);
   if (!**s) {
     tok->tp = _EOF;
@@ -1086,7 +1085,7 @@
       if (!next) { tok->val.error = "No public key end tag found"; return -1; }
       next = strchr(next, '\n'); /* Part of OR_PUBLICKEY_END_TAG; can't fail.*/
       ++next;
-      if (!(pkey = crypto_new_pk_env(CRYPTO_PK_RSA))) 
+      if (!(pkey = crypto_new_pk_env(CRYPTO_PK_RSA)))
         return -1;
       if (crypto_pk_read_public_key_from_string(pkey, *s, next-*s)) {
         crypto_free_pk_env(pkey);
@@ -1100,7 +1099,7 @@
     } else if (! strncmp(*s, OR_SIGNATURE_BEGIN_TAG, next-*s)) {
       /* We have a -----BEGIN SIGNATURE----- */
       /* Advance past newline; can't fail. */
-      *s = strchr(*s, '\n'); 
+      *s = strchr(*s, '\n');
       ++*s;
       /* Find end of base64'd data */
       next = strstr(*s, OR_SIGNATURE_END_TAG);
@@ -1182,10 +1181,10 @@
 }
 
 #ifdef DEBUG_ROUTER_TOKENS
-static void 
+static void
 router_dump_token(directory_token_t *tok) {
   int i;
-  switch(tok->tp) 
+  switch(tok->tp)
     {
     case _SIGNATURE:
       puts("(signature)");
@@ -1239,7 +1238,7 @@
  *
  * If no such substring exists, return -1.
  */
-static int router_get_hash_impl(const char *s, char *digest, 
+static int router_get_hash_impl(const char *s, char *digest,
                                 const char *start_str,
                                 const char *end_str)
 {

Index: test.c
===================================================================
RCS file: /home/or/cvsroot/src/or/test.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- test.c	16 Dec 2003 08:21:58 -0000	1.57
+++ test.c	17 Dec 2003 21:09:31 -0000	1.58
@@ -73,7 +73,7 @@
   }
   write(s, str, 256);
   close(s);
-  
+
   s = open("/tmp/tor_test/data", O_RDONLY, 0);
   eof = 0;
   i = read_to_buf(s, 10, buf, &eof);
@@ -99,7 +99,7 @@
   test_eq(i, 6);
   test_memeq(str+10, (char*)_buf_peek_raw_buffer(buf2), 6);
   buf_free(buf2);
-  
+
   /* Now test when buffer is filled with more data to read. */
   buf2 = buf_new_with_capacity(32);
   i = read_to_buf(s, 128, buf2, &eof);
@@ -126,14 +126,14 @@
 
   close(s);
 
-  /**** 
+  /****
    * find_on_inbuf
    ****/
   buf_free(buf);
   buf = buf_new();
   s = open("/tmp/tor_test/data", O_RDONLY, 0);
   eof = 0;
-  i = read_to_buf(s, 1024, buf, &eof); 
+  i = read_to_buf(s, 1024, buf, &eof);
   test_eq(256, i);
   close(s);
 
@@ -176,7 +176,7 @@
   /* Test when buffer is overfull. */
 #if 0
   buflen = 18;
-  test_eq(-1, write_to_buf("This string will not fit.", 25, 
+  test_eq(-1, write_to_buf("This string will not fit.", 25,
                            &buf, &buflen, &buf_datalen));
   test_eq(buf_datalen, 16);
   test_memeq(buf, "Hello worldXYZZY--", 18);
@@ -213,7 +213,7 @@
   test_memneq(p1, p2, CRYPTO_DH_SIZE);
   test_assert(! crypto_dh_get_public(dh2, p2, CRYPTO_DH_SIZE));
   test_memneq(p1, p2, CRYPTO_DH_SIZE);
-  
+
   memset(s1, 0, CRYPTO_DH_SIZE);
   memset(s2, 0xFF, CRYPTO_DH_SIZE);
   s1len = crypto_dh_compute_secret(dh1, p2, CRYPTO_DH_SIZE, s1, 50);
@@ -221,20 +221,20 @@
   test_assert(s1len > 0);
   test_eq(s1len, s2len);
   test_memeq(s1, s2, s1len);
-  
+
   crypto_dh_free(dh1);
   crypto_dh_free(dh2);
 }
 
-void 
-test_crypto() 
+void
+test_crypto()
 {
   crypto_cipher_env_t *env1, *env2;
   crypto_pk_env_t *pk1, *pk2;
   char *data1, *data2, *data3, *cp;
   FILE *f;
   int i, j;
-  int str_ciphers[] = { CRYPTO_CIPHER_IDENTITY, 
+  int str_ciphers[] = { CRYPTO_CIPHER_IDENTITY,
                         CRYPTO_CIPHER_DES,
                         CRYPTO_CIPHER_RC4,
                         CRYPTO_CIPHER_3DES,
@@ -251,7 +251,7 @@
   crypto_rand(100, data1);
   crypto_rand(100, data2);
   test_memneq(data1,data2,100);
-  
+
   /* Try out identity ciphers. */
   env1 = crypto_new_cipher_env(CRYPTO_CIPHER_IDENTITY);
   test_neq(env1, 0);
@@ -261,10 +261,10 @@
   for(i = 0; i < 1024; ++i) {
     data1[i] = (char) i*73;
   }
-  crypto_cipher_encrypt(env1, data1, 1024, data2); 
+  crypto_cipher_encrypt(env1, data1, 1024, data2);
   test_memeq(data1, data2, 1024);
   crypto_free_cipher_env(env1);
-  
+
   /* Now, test encryption and decryption with stream ciphers. */
   data1[0]='\0';
   for(i = 1023; i>0; i -= 35)
@@ -335,7 +335,7 @@
     crypto_free_cipher_env(env1);
     crypto_free_cipher_env(env2);
   }
-  
+
   /* Test vectors for stream ciphers. */
   /* XXXX Look up some test vectors for the ciphers and make sure we match. */
 
@@ -356,7 +356,7 @@
 
   test_eq(128, crypto_pk_keysize(pk1));
   test_eq(128, crypto_pk_keysize(pk2));
-  
+
   test_eq(128, crypto_pk_public_encrypt(pk2, "Hello whirled.", 15, data1,
                                         RSA_PKCS1_OAEP_PADDING));
   test_eq(128, crypto_pk_public_encrypt(pk1, "Hello whirled.", 15, data2,
@@ -377,7 +377,7 @@
   memcpy(data2+1, "XYZZY", 5);  /* This has fails ~ once-in-2^40 */
   test_eq(-1, crypto_pk_private_decrypt(pk1, data2, 128, data3,
                                         RSA_PKCS1_OAEP_PADDING));
-  
+
   /* File operations: save and load private key */
   f = fopen("/tmp/tor_test/pkey1", "wb");
   test_assert(! crypto_pk_write_private_key_to_file(pk1, f));
@@ -387,7 +387,7 @@
   fclose(f);
   test_eq(15, crypto_pk_private_decrypt(pk2, data1, 128, data3,
                                         RSA_PKCS1_OAEP_PADDING));
-  test_assert(! crypto_pk_read_private_key_from_filename(pk2, 
+  test_assert(! crypto_pk_read_private_key_from_filename(pk2,
                                                "/tmp/tor_test/pkey1"));
   test_eq(15, crypto_pk_private_decrypt(pk2, data1, 128, data3,
                                         RSA_PKCS1_OAEP_PADDING));
@@ -398,9 +398,9 @@
   test_eq(10, crypto_pk_public_checksig(pk1, data2, 128, data3));
   test_streq(data3, "Ossifrage");
   /*XXXX test failed signing*/
-    
-  crypto_free_pk_env(pk1);  
-  crypto_free_pk_env(pk2);  
+
+  crypto_free_pk_env(pk1);
+  crypto_free_pk_env(pk2);
 
   /* Base64 tests */
   strcpy(data1, "Test string that contains 35 chars.");
@@ -419,7 +419,7 @@
 
 }
 
-void 
+void
 test_util() {
   struct timeval start, end;
   struct tm a_time;
@@ -470,7 +470,7 @@
   int i,num;
 
   names = parse_nickname_list("  foo bar	 baz quux  ", &num);
-  test_eq(num,4); 
+  test_eq(num,4);
   test_streq(names[0],"foo");
   test_streq(names[1],"bar");
   test_streq(names[2],"baz");
@@ -491,7 +491,7 @@
   /* server-side */
   char s_buf[ONIONSKIN_REPLY_LEN];
   char s_keys[40];
-  
+
   /* shared */
   crypto_pk_env_t *pk = NULL;
 
@@ -506,11 +506,11 @@
   memset(s_buf, 0, ONIONSKIN_REPLY_LEN);
   memset(s_keys, 0, 40);
   test_assert(! onion_skin_server_handshake(c_buf, pk, s_buf, s_keys, 40));
-  
+
   /* client handshake 2 */
   memset(c_keys, 0, 40);
   test_assert(! onion_skin_client_handshake(c_dh, s_buf, c_keys, 40));
-  
+
   crypto_dh_free(c_dh);
 
   if (memcmp(c_keys, s_keys, 40)) {
@@ -544,7 +544,7 @@
   test_assert(! crypto_pk_generate_key(pk1));
   test_assert(! crypto_pk_generate_key(pk2));
   test_assert(! crypto_pk_generate_key(pk3));
-  
+
   r1.address = "testaddr1.foo.bar";
   r1.addr = 0xc0a80001u; /* 192.168.0.1 */
   r1.published_on = 0;
@@ -581,16 +581,16 @@
   r2.bandwidth = 3000;
   r2.exit_policy = &ex1;
 
-  test_assert(!crypto_pk_write_public_key_to_string(pk1, &pk1_str, 
+  test_assert(!crypto_pk_write_public_key_to_string(pk1, &pk1_str,
                                                     &pk1_str_len));
-  test_assert(!crypto_pk_write_public_key_to_string(pk2 , &pk2_str, 
+  test_assert(!crypto_pk_write_public_key_to_string(pk2 , &pk2_str,
                                                     &pk2_str_len));
-  test_assert(!crypto_pk_write_public_key_to_string(pk3 , &pk3_str, 
+  test_assert(!crypto_pk_write_public_key_to_string(pk3 , &pk3_str,
                                                     &pk3_str_len));
 
   memset(buf, 0, 2048);
   test_assert(router_dump_router_to_string(buf, 2048, &r1, pk2)>0);
-  
+
   strcpy(buf2, "router Magri testaddr1.foo.bar 9000 9002 9003 1000\n"
          "platform Tor "VERSION" on ");
   strcat(buf2, get_uname());
@@ -604,9 +604,9 @@
   strcat(buf2, pk2_str);
   strcat(buf2, "router-signature\n");
   buf[strlen(buf2)] = '\0'; /* Don't compare the sig; it's never the same twice*/
-  
+
   test_streq(buf, buf2);
-  
+
   test_assert(router_dump_router_to_string(buf, 2048, &r1, pk2)>0);
   cp = buf;
   rp1 = router_get_entry_from_string((const char**)&cp);
@@ -621,7 +621,7 @@
   test_assert(crypto_pk_cmp_keys(rp1->identity_pkey, pk2) == 0);
   test_assert(rp1->exit_policy == NULL);
 
-#if 0 
+#if 0
   /* XXX Once we have exit policies, test this again. XXX */
   strcpy(buf2, "router tor.tor.tor 9005 0 0 3000\n");
   strcat(buf2, pk2_str);
@@ -652,7 +652,7 @@
   test_assert(rp2->exit_policy->next->next == NULL);
 #endif
 
-#if 0 
+#if 0
   /* XXX To re-enable this test, we need to separate directory generation
    * XXX from the directory backend again.  Do this the next time we have
    * XXX directory trouble. */
@@ -664,11 +664,11 @@
   dir1->routers[1] = &r2;
   test_assert(! dump_signed_directory_to_string_impl(buf, 4096, dir1, pk1));
   /* puts(buf); */
-  
+
   test_assert(! router_get_dir_from_string_impl(buf, &dir2, pk1));
   test_eq(2, dir2->n_routers);
 #endif
- 
+
   tor_free(pk1_str);
   tor_free(pk2_str);
   if (pk1) crypto_free_pk_env(pk1);
@@ -689,8 +689,8 @@
   test_eq(-1, compare_recommended_versions("a", ""));
 }
 
-int 
-main(int c, char**v){ 
+int
+main(int c, char**v){
 #if 0
   or_options_t options; /* command-line and config-file options */
 

Index: tor_main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/tor_main.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- tor_main.c	8 Oct 2003 02:04:08 -0000	1.2
+++ tor_main.c	17 Dec 2003 21:09:31 -0000	1.3
@@ -4,7 +4,7 @@
 
 int tor_main(int argc, char *argv[]);
 
-int main(int argc, char *argv[]) 
+int main(int argc, char *argv[])
 {
   return tor_main(argc, argv);
 }



More information about the tor-commits mailing list