[or-cvs] remove redundant unpack in critical path

Nick Mathewson nickm at seul.org
Sun Feb 13 16:17:35 UTC 2005


Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv24080/src/or

Modified Files:
	relay.c 
Log Message:
remove redundant unpack in critical path

Index: relay.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/relay.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- relay.c	30 Jan 2005 21:46:42 -0000	1.37
+++ relay.c	13 Feb 2005 16:17:32 -0000	1.38
@@ -107,9 +107,9 @@
 static int relay_crypt_one_payload(crypto_cipher_env_t *cipher, char *in,
                                    int encrypt_mode) {
   char out[CELL_PAYLOAD_SIZE]; /* 'in' must be this size too */
-  relay_header_t rh;
+//  relay_header_t rh;
 
-  relay_header_unpack(&rh, in);
+//  relay_header_unpack(&rh, in);
 //  log_fn(LOG_DEBUG,"before crypt: %d",rh.recognized);
   if (( encrypt_mode && crypto_cipher_encrypt(cipher, out, in, CELL_PAYLOAD_SIZE)) ||
       (!encrypt_mode && crypto_cipher_decrypt(cipher, out, in, CELL_PAYLOAD_SIZE))) {
@@ -117,7 +117,7 @@
     return -1;
   }
   memcpy(in,out,CELL_PAYLOAD_SIZE);
-  relay_header_unpack(&rh, in);
+//  relay_header_unpack(&rh, in);
 //  log_fn(LOG_DEBUG,"after crypt: %d",rh.recognized);
   return 0;
 }



More information about the tor-commits mailing list