[or-cvs] r13700: Whitespace fixes (in tor/trunk: . src/common src/or)

nickm at seul.org nickm at seul.org
Sun Feb 24 22:11:19 UTC 2008


Author: nickm
Date: 2008-02-24 17:11:18 -0500 (Sun, 24 Feb 2008)
New Revision: 13700

Modified:
   tor/trunk/
   tor/trunk/src/common/crypto.c
   tor/trunk/src/or/connection.c
   tor/trunk/src/or/dirserv.c
   tor/trunk/src/or/networkstatus.c
   tor/trunk/src/or/router.c
Log:
 r14422 at tombo:  nickm | 2008-02-24 17:09:56 -0500
 Whitespace fixes



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r14422] on 49666b30-7950-49c5-bedf-9dc8f3168102

Modified: tor/trunk/src/common/crypto.c
===================================================================
--- tor/trunk/src/common/crypto.c	2008-02-24 22:11:12 UTC (rev 13699)
+++ tor/trunk/src/common/crypto.c	2008-02-24 22:11:18 UTC (rev 13700)
@@ -643,7 +643,8 @@
   tor_assert(to);
   tor_assert(fromlen<INT_MAX);
 
-  r = RSA_public_encrypt((int)fromlen, (unsigned char*)from, (unsigned char*)to,
+  r = RSA_public_encrypt((int)fromlen,
+                         (unsigned char*)from, (unsigned char*)to,
                          env->key, crypto_get_rsa_padding(padding));
   if (r<0) {
     crypto_log_errors(LOG_WARN, "performing RSA encryption");
@@ -698,7 +699,8 @@
   tor_assert(from);
   tor_assert(to);
   tor_assert(fromlen < INT_MAX);
-  r = RSA_public_decrypt((int)fromlen, (unsigned char*)from, (unsigned char*)to,
+  r = RSA_public_decrypt((int)fromlen,
+                         (unsigned char*)from, (unsigned char*)to,
                          env->key, RSA_PKCS1_PADDING);
 
   if (r<0) {
@@ -715,7 +717,7 @@
  */
 int
 crypto_pk_public_checksig_digest(crypto_pk_env_t *env, const char *data,
-                                 size_t datalen, const char *sig, size_t siglen)
+                               size_t datalen, const char *sig, size_t siglen)
 {
   char digest[DIGEST_LEN];
   char *buf;

Modified: tor/trunk/src/or/connection.c
===================================================================
--- tor/trunk/src/or/connection.c	2008-02-24 22:11:12 UTC (rev 13699)
+++ tor/trunk/src/or/connection.c	2008-02-24 22:11:18 UTC (rev 13700)
@@ -2647,12 +2647,13 @@
 set_constrained_socket_buffers(int sock, int size)
 {
   void *sz = (void*)&size;
-  if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, sz,(socklen_t)sizeof(size)) < 0) {
+  socklen_t sz_sz = (socklen_t) sizeof(size);
+  if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, sz, sz_sz) < 0) {
     int e = tor_socket_errno(sock);
     log_warn(LD_NET, "setsockopt() to constrain send "
              "buffer to %d bytes failed: %s", size, tor_socket_strerror(e));
   }
-  if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, sz,(socklen_t)sizeof(size)) < 0) {
+  if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, sz, sz_sz) < 0) {
     int e = tor_socket_errno(sock);
     log_warn(LD_NET, "setsockopt() to constrain recv "
              "buffer to %d bytes failed: %s", size, tor_socket_strerror(e));

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2008-02-24 22:11:12 UTC (rev 13699)
+++ tor/trunk/src/or/dirserv.c	2008-02-24 22:11:18 UTC (rev 13700)
@@ -2673,8 +2673,10 @@
     SMARTLIST_FOREACH(digests, const char *, d,
        {
          if (router_digest_is_me(d)) {
-           if (router_get_my_routerinfo()) /* make sure desc_routerinfo exists */
-             smartlist_add(descs_out, &(router_get_my_routerinfo()->cache_info));
+           /* make sure desc_routerinfo exists */
+           routerinfo_t *ri = router_get_my_routerinfo();
+           if (ri)
+             smartlist_add(descs_out, &(ri->cache_info));
          } else {
            routerinfo_t *ri = router_get_by_digest(d);
            /* Don't actually serve a descriptor that everyone will think is

Modified: tor/trunk/src/or/networkstatus.c
===================================================================
--- tor/trunk/src/or/networkstatus.c	2008-02-24 22:11:12 UTC (rev 13699)
+++ tor/trunk/src/or/networkstatus.c	2008-02-24 22:11:18 UTC (rev 13700)
@@ -1130,7 +1130,7 @@
     tor_assert(c->fresh_until < start);
     /* We must download the next one before c is invalid: */
     tor_assert(start+dl_interval < c->valid_until);
-    time_to_download_next_consensus = start + crypto_rand_int((int)dl_interval);
+    time_to_download_next_consensus = start +crypto_rand_int((int)dl_interval);
     {
       char tbuf1[ISO_TIME_LEN+1];
       char tbuf2[ISO_TIME_LEN+1];

Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c	2008-02-24 22:11:12 UTC (rev 13699)
+++ tor/trunk/src/or/router.c	2008-02-24 22:11:18 UTC (rev 13700)
@@ -1099,11 +1099,12 @@
 int
 router_extrainfo_digest_is_me(const char *digest)
 {
-  if (!router_get_my_extrainfo())
+  extrainfo_t *ei = router_get_my_extrainfo();
+  if (!ei)
     return 0;
 
   return !memcmp(digest,
-                 &(router_get_my_extrainfo()->cache_info).signed_descriptor_digest,
+                 ei->cache_info.signed_descriptor_digest,
                  DIGEST_LEN);
 }
 



More information about the tor-commits mailing list