[tor-commits] [tor/master] Fix whitespace issues in patches merged today so far

nickm at torproject.org nickm at torproject.org
Thu Sep 8 00:25:05 UTC 2011


commit d3ff167e098fa44e4ec30c7e6f50127a8c99dae7
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Sep 7 20:26:58 2011 -0400

    Fix whitespace issues in patches merged today so far
---
 src/or/connection.c      |    3 ++-
 src/or/connection_edge.c |   16 +++++++++-------
 src/or/connection_edge.h |    1 -
 src/or/or.h              |    4 ++--
 src/or/relay.c           |   25 +++++++++++++------------
 5 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index deb6d2c..790383b 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -970,7 +970,8 @@ connection_create_listener(const struct sockaddr *listensockaddr,
         log_warn(LD_NET,"Unable to chown() %s socket: user %s not found.",
                  address, options->User);
       } else if (chown(address, pw->pw_uid, pw->pw_gid) < 0) {
-        log_warn(LD_NET,"Unable to chown() %s socket: %s.", address, strerror(errno));
+        log_warn(LD_NET,"Unable to chown() %s socket: %s.",
+                 address, strerror(errno));
         goto err;
       }
     }
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 0d2c10f..f59f44c 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -140,7 +140,7 @@ connection_edge_process_inbuf(edge_connection_t *conn, int package_partial)
 
   switch (conn->_base.state) {
     case AP_CONN_STATE_SOCKS_WAIT:
-      if (connection_ap_handshake_process_socks(EDGE_TO_ENTRY_CONN(conn)) < 0) {
+      if (connection_ap_handshake_process_socks(EDGE_TO_ENTRY_CONN(conn)) <0) {
         /* already marked */
         return -1;
       }
@@ -619,7 +619,8 @@ connection_ap_expire_beginning(void)
     if (connection_ap_detach_retriable(entry_conn, TO_ORIGIN_CIRCUIT(circ),
                                        END_STREAM_REASON_TIMEOUT)<0) {
       if (!base_conn->marked_for_close)
-        connection_mark_unattached_ap(entry_conn, END_STREAM_REASON_CANT_ATTACH);
+        connection_mark_unattached_ap(entry_conn,
+                                      END_STREAM_REASON_CANT_ATTACH);
     }
   } SMARTLIST_FOREACH_END(base_conn);
 }
@@ -743,7 +744,8 @@ circuit_discard_optional_exit_enclaves(extend_info_t *info)
  * Returns -1 on err, 1 on success, 0 on not-yet-sure.
  */
 int
-connection_ap_detach_retriable(entry_connection_t *conn, origin_circuit_t *circ,
+connection_ap_detach_retriable(entry_connection_t *conn,
+                               origin_circuit_t *circ,
                                int reason)
 {
   control_event_stream_status(conn, STREAM_EVENT_FAILED_RETRIABLE, reason);
@@ -939,8 +941,8 @@ addressmap_clear_excluded_trackexithosts(const or_options_t *options)
     if (len < 6)
       continue; /* malformed. */
     dot = target + len - 6; /* dot now points to just before .exit */
-    while(dot > target && *dot != '.')
-	dot--;
+    while (dot > target && *dot != '.')
+      dot--;
     if (*dot == '.') dot++;
     nodename = tor_strndup(dot, len-5-(dot-target));;
     node = node_get_by_nickname(nodename, 0);
@@ -2455,8 +2457,8 @@ connection_ap_handshake_send_begin(entry_connection_t *ap_conn)
       connection_ap_supports_optimistic_data(ap_conn)) {
     log_info(LD_APP, "Sending up to %ld + %ld bytes of queued-up data",
              (long)connection_get_inbuf_len(base_conn),
-	     ap_conn->sending_optimistic_data ?
-               (long)generic_buffer_len(ap_conn->sending_optimistic_data) : 0);
+             ap_conn->sending_optimistic_data ?
+             (long)generic_buffer_len(ap_conn->sending_optimistic_data) : 0);
     if (connection_edge_package_raw_inbuf(edge_conn, 1, NULL) < 0) {
       connection_mark_for_close(base_conn);
     }
diff --git a/src/or/connection_edge.h b/src/or/connection_edge.h
index 75a54e8..830667e 100644
--- a/src/or/connection_edge.h
+++ b/src/or/connection_edge.h
@@ -105,7 +105,6 @@ hostname_type_t parse_extended_hostname(char *address, int allowdotexit);
 int get_pf_socket(void);
 #endif
 
-
 int connection_edge_compatible_with_circuit(const entry_connection_t *conn,
                                             const origin_circuit_t *circ);
 int connection_edge_update_circuit_isolation(const entry_connection_t *conn,
diff --git a/src/or/or.h b/src/or/or.h
index ff94a3e..bf404df 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1389,8 +1389,8 @@ static edge_connection_t *TO_EDGE_CONN(connection_t *);
 /** Convert a connection_t* to an entry_connection_t*; assert if the cast is
  * invalid. */
 static entry_connection_t *TO_ENTRY_CONN(connection_t *);
-/** Convert a edge_connection_t* to an entry_connection_t*; assert if the cast is
- * invalid. */
+/** Convert a edge_connection_t* to an entry_connection_t*; assert if the cast
+ * is invalid. */
 static entry_connection_t *EDGE_TO_ENTRY_CONN(edge_connection_t *);
 /** Convert a connection_t* to an control_connection_t*; assert if the cast is
  * invalid. */
diff --git a/src/or/relay.c b/src/or/relay.c
index 5bbcf0a..318c6c7 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -715,8 +715,8 @@ connection_ap_process_end_not_open(
   (void) layer_hint; /* unused */
 
   if (rh->length > 0 && edge_reason_is_retriable(reason) &&
-      !connection_edge_is_rendezvous_stream(edge_conn) /* avoid retry if rend */
-      ) {
+      /* avoid retry if rend */
+      !connection_edge_is_rendezvous_stream(edge_conn)) {
     const char *chosen_exit_digest =
       circ->build_state->chosen_exit->identity_digest;
     log_info(LD_APP,"Address '%s' refused due to '%s'. Considering retrying.",
@@ -999,7 +999,8 @@ connection_edge_process_relay_cell_not_open(
         connection_ap_handshake_socks_resolved(entry_conn,
                                                RESOLVED_TYPE_ERROR_TRANSIENT,
                                                0, NULL, 0, TIME_MAX);
-        connection_mark_unattached_ap(entry_conn,END_STREAM_REASON_TORPROTOCOL);
+        connection_mark_unattached_ap(entry_conn,
+                                      END_STREAM_REASON_TORPROTOCOL);
         return 0;
       }
     }
@@ -1356,7 +1357,7 @@ int
 connection_edge_package_raw_inbuf(edge_connection_t *conn, int package_partial,
                                   int *max_cells)
 {
-  size_t amount_to_process, length;
+  size_t bytes_to_process, length;
   char payload[CELL_PAYLOAD_SIZE];
   circuit_t *circ;
   const unsigned domain = conn->_base.type == CONN_TYPE_AP ? LD_APP : LD_EXIT;
@@ -1403,26 +1404,26 @@ connection_edge_package_raw_inbuf(edge_connection_t *conn, int package_partial,
     entry_conn->sending_optimistic_data != NULL;
 
   if (PREDICT_UNLIKELY(sending_from_optimistic)) {
-    amount_to_process = generic_buffer_len(entry_conn->sending_optimistic_data);
-    if (PREDICT_UNLIKELY(!amount_to_process)) {
+    bytes_to_process = generic_buffer_len(entry_conn->sending_optimistic_data);
+    if (PREDICT_UNLIKELY(!bytes_to_process)) {
       log_warn(LD_BUG, "sending_optimistic_data was non-NULL but empty");
-      amount_to_process = connection_get_inbuf_len(TO_CONN(conn));
+      bytes_to_process = connection_get_inbuf_len(TO_CONN(conn));
       sending_from_optimistic = 0;
     }
   } else {
-    amount_to_process = connection_get_inbuf_len(TO_CONN(conn));
+    bytes_to_process = connection_get_inbuf_len(TO_CONN(conn));
   }
 
-  if (!amount_to_process)
+  if (!bytes_to_process)
     return 0;
 
-  if (!package_partial && amount_to_process < RELAY_PAYLOAD_SIZE)
+  if (!package_partial && bytes_to_process < RELAY_PAYLOAD_SIZE)
     return 0;
 
-  if (amount_to_process > RELAY_PAYLOAD_SIZE) {
+  if (bytes_to_process > RELAY_PAYLOAD_SIZE) {
     length = RELAY_PAYLOAD_SIZE;
   } else {
-    length = amount_to_process;
+    length = bytes_to_process;
   }
   stats_n_data_bytes_packaged += length;
   stats_n_data_cells_packaged += 1;



More information about the tor-commits mailing list