[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] clean up some presentation and comments



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

Modified Files:
	circuit.c main.c onion.c 
Log Message:
clean up some presentation and comments


Index: circuit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuit.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- circuit.c	14 Mar 2004 22:47:10 -0000	1.151
+++ circuit.c	18 Mar 2004 19:22:55 -0000	1.152
@@ -826,7 +826,7 @@
       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,
+      log(severity,"hop: state %d, addr 0x%.8x, port %d", hop->state,
           (unsigned int)hop->addr,
           (int)hop->port);
   }
@@ -1152,15 +1152,15 @@
   crypto_dh_free(hop->handshake_state); /* don't need it anymore */
   hop->handshake_state = NULL;
 
-  log_fn(LOG_DEBUG,"hop init digest forward %u, backward %u.",
-         (unsigned)*(uint32_t*)keys, (unsigned)*(uint32_t*)(keys+20));
+  log_fn(LOG_DEBUG,"hop init digest forward 0x%.8x, backward 0x%.8x.",
+         (unsigned int)*(uint32_t*)keys, (unsigned int)*(uint32_t*)(keys+20));
   hop->f_digest = crypto_new_digest_env(CRYPTO_SHA1_DIGEST);
   crypto_digest_add_bytes(hop->f_digest, keys, 20);
   hop->b_digest = crypto_new_digest_env(CRYPTO_SHA1_DIGEST);
   crypto_digest_add_bytes(hop->b_digest, keys+20, 20);
 
-  log_fn(LOG_DEBUG,"hop init cipher forward %u, backward %u.",
-        (unsigned)*(uint32_t*)(keys+40), (unsigned) *(uint32_t*)(keys+40+16));
+  log_fn(LOG_DEBUG,"hop init cipher forward 0x%.8x, backward 0x%.8x.",
+        (unsigned int)*(uint32_t*)(keys+40), (unsigned int)*(uint32_t*)(keys+40+16));
   if (!(hop->f_crypto =
         crypto_create_init_cipher(CIRCUIT_CIPHER,keys+40,iv,1))) {
     log(LOG_WARN,"forward cipher initialization failed.");

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -d -r1.203 -r1.204
--- main.c	14 Mar 2004 17:06:29 -0000	1.203
+++ main.c	18 Mar 2004 19:22:56 -0000	1.204
@@ -54,7 +54,7 @@
 int connection_add(connection_t *conn) {
 
   if(nfds >= options.MaxConn-1) {
-    log(LOG_WARN,"connection_add(): failing because nfds is too high.");
+    log_fn(LOG_WARN,"failing because nfds is too high.");
     return -1;
   }
 
@@ -68,7 +68,7 @@
 
   nfds++;
 
-  log(LOG_INFO,"connection_add(): new conn type %s, socket %d, nfds %d.",
+  log_fn(LOG_INFO,"new conn type %s, socket %d, nfds %d.",
       CONN_TYPE_TO_STRING(conn->type), conn->s, nfds);
 
   return 0;
@@ -102,7 +102,7 @@
     return 0;
   }
 
-  /* we replace this one with the one at the end, then free it */
+  /* replace this one with the one at the end */
   nfds--;
   poll_array[current_index].fd = poll_array[nfds].fd;
   poll_array[current_index].events = poll_array[nfds].events;

Index: onion.c
===================================================================
RCS file: /home/or/cvsroot/src/or/onion.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- onion.c	3 Mar 2004 03:02:06 -0000	1.129
+++ onion.c	18 Mar 2004 19:22:56 -0000	1.130
@@ -131,15 +131,15 @@
 
   memcpy(cell.payload, payload, ONIONSKIN_REPLY_LEN);
 
-  log_fn(LOG_INFO,"init digest forward %d, backward %d.",
-         (int)*(uint32_t*)(keys), (int)*(uint32_t*)(keys+20));
+  log_fn(LOG_INFO,"init digest forward 0x%.8x, backward 0x%.8x.",
+         (unsigned int)*(uint32_t*)(keys), (unsigned int)*(uint32_t*)(keys+20));
   circ->n_digest = crypto_new_digest_env(CRYPTO_SHA1_DIGEST);
   crypto_digest_add_bytes(circ->n_digest, keys, 20);
   circ->p_digest = crypto_new_digest_env(CRYPTO_SHA1_DIGEST);
   crypto_digest_add_bytes(circ->p_digest, keys+20, 20);
 
-  log_fn(LOG_DEBUG,"init cipher forward %d, backward %d.",
-         (int)*(uint32_t*)(keys+40), (int)*(uint32_t*)(keys+40+16));
+  log_fn(LOG_DEBUG,"init cipher forward 0x%.8x, backward 0x%.8x.",
+         (unsigned int)*(uint32_t*)(keys+40), (unsigned int)*(uint32_t*)(keys+40+16));
   if (!(circ->n_crypto =
         crypto_create_init_cipher(CIRCUIT_CIPHER,keys+40,iv,0))) {
     log_fn(LOG_WARN,"Cipher initialization failed (n).");