[or-cvs] r6909 at Kushana: nickm | 2006-07-26 13:05:58 -0400 Clean up w (r6907 in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Wed Jul 26 19:07:39 UTC 2006


Author: nickm
Date: 2006-07-26 15:07:37 -0400 (Wed, 26 Jul 2006)
New Revision: 6907

Modified:
   tor/trunk/
   tor/trunk/src/or/circuitbuild.c
   tor/trunk/src/or/circuituse.c
   tor/trunk/src/or/connection.c
   tor/trunk/src/or/connection_edge.c
   tor/trunk/src/or/connection_or.c
   tor/trunk/src/or/control.c
   tor/trunk/src/or/directory.c
   tor/trunk/src/or/dns.c
   tor/trunk/src/or/main.c
   tor/trunk/src/or/or.h
   tor/trunk/src/or/relay.c
   tor/trunk/src/or/routerlist.c
Log:
 r6909 at Kushana:  nickm | 2006-07-26 13:05:58 -0400
 Clean up wide lines from last patch.



Property changes on: tor/trunk
___________________________________________________________________
Name: svk:merge
   - c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/oo-connections:6908
   + c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/oo-connections:6909

Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/circuitbuild.c	2006-07-26 19:07:37 UTC (rev 6907)
@@ -692,7 +692,8 @@
 
   circ->n_conn = n_conn;
   memcpy(circ->n_conn_id_digest, n_conn->identity_digest, DIGEST_LEN);
-  log_debug(LD_CIRC,"n_conn is %s:%u",n_conn->_base.address,n_conn->_base.port);
+  log_debug(LD_CIRC,"n_conn is %s:%u",
+            n_conn->_base.address,n_conn->_base.port);
 
   if (circuit_deliver_create_cell(circ, CELL_CREATE, onionskin) < 0)
     return -1;

Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/circuituse.c	2006-07-26 19:07:37 UTC (rev 6907)
@@ -255,7 +255,8 @@
 
     if (victim->n_conn)
       log_info(LD_CIRC,"Abandoning circ %s:%d:%d (state %d:%s, purpose %d)",
-               victim->n_conn->_base.address, victim->n_port, victim->n_circ_id,
+               victim->n_conn->_base.address, victim->n_port,
+               victim->n_circ_id,
                victim->state, circuit_state_to_string(victim->state),
                victim->purpose);
     else
@@ -296,7 +297,8 @@
  * Else return 0.
  */
 int
-circuit_stream_is_being_handled(edge_connection_t *conn, uint16_t port, int min)
+circuit_stream_is_being_handled(edge_connection_t *conn,
+                                uint16_t port, int min)
 {
   circuit_t *circ;
   routerinfo_t *exitrouter;

Modified: tor/trunk/src/or/connection.c
===================================================================
--- tor/trunk/src/or/connection.c	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/connection.c	2006-07-26 19:07:37 UTC (rev 6907)
@@ -2034,7 +2034,8 @@
       return connection_or_process_inbuf(TO_OR_CONN(conn));
     case CONN_TYPE_EXIT:
     case CONN_TYPE_AP:
-      return connection_edge_process_inbuf(TO_EDGE_CONN(conn), package_partial);
+      return connection_edge_process_inbuf(TO_EDGE_CONN(conn),
+                                           package_partial);
     case CONN_TYPE_DIR:
       return connection_dir_process_inbuf(TO_DIR_CONN(conn));
     case CONN_TYPE_DNSWORKER:

Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/connection_edge.c	2006-07-26 19:07:37 UTC (rev 6907)
@@ -136,7 +136,8 @@
     if (conn->_base.type == CONN_TYPE_AP) {
       connection_mark_unattached_ap(conn, END_STREAM_REASON_DESTROY);
     } else {
-      conn->_base.edge_has_sent_end = 1; /* closing the circuit, nothing to send to */
+      /* closing the circuit, nothing to send an END to */
+      conn->_base.edge_has_sent_end = 1;
       connection_mark_for_close(TO_CONN(conn));
       conn->_base.hold_open_until_flushed = 1;
     }
@@ -240,7 +241,7 @@
       connection_stop_writing(TO_CONN(conn));
       return 0;
     default:
-      log_warn(LD_BUG,"BUG: called in unexpected state %d.", conn->_base.state);
+      log_warn(LD_BUG,"BUG: called in unexpected state %d.",conn->_base.state);
       tor_fragile_assert();
       return -1;
   }
@@ -340,7 +341,8 @@
       continue;
     conn = TO_EDGE_CONN(carray[i]);
     /* if it's an internal bridge connection, don't yell its status. */
-    severity = (!conn->_base.addr && !conn->_base.port) ? LOG_INFO : LOG_NOTICE;
+    severity = (!conn->_base.addr && !conn->_base.port)
+      ? LOG_INFO : LOG_NOTICE;
     if (conn->_base.state == AP_CONN_STATE_CONTROLLER_WAIT) {
       if (now - conn->_base.timestamp_lastread >= options->SocksTimeout) {
         log_fn(severity, LD_APP, "Closing unattached stream.");
@@ -1834,9 +1836,11 @@
   connection_watch_events(conn, EV_READ);
 
   /* also, deliver a 'connected' cell back through the circuit. */
-  if (connection_edge_is_rendezvous_stream(edge_conn)) { /* rendezvous stream */
+  if (connection_edge_is_rendezvous_stream(edge_conn)) {
+    /* rendezvous stream */
     /* don't send an address back! */
-    connection_edge_send_command(edge_conn, circuit_get_by_edge_conn(edge_conn),
+    connection_edge_send_command(edge_conn,
+                                 circuit_get_by_edge_conn(edge_conn),
                                  RELAY_COMMAND_CONNECTED,
                                  NULL, 0, edge_conn->cpath_layer);
   } else { /* normal stream */
@@ -1845,7 +1849,8 @@
     set_uint32(connected_payload, htonl(conn->addr));
     set_uint32(connected_payload+4,
                htonl(dns_clip_ttl(edge_conn->address_ttl)));
-    connection_edge_send_command(edge_conn, circuit_get_by_edge_conn(edge_conn),
+    connection_edge_send_command(edge_conn,
+                                 circuit_get_by_edge_conn(edge_conn),
                                  RELAY_COMMAND_CONNECTED,
                                  connected_payload, 8, edge_conn->cpath_layer);
   }

Modified: tor/trunk/src/or/connection_or.c
===================================================================
--- tor/trunk/src/or/connection_or.c	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/connection_or.c	2006-07-26 19:07:37 UTC (rev 6907)
@@ -662,8 +662,8 @@
     return -1;
 
   if (!started_here) {
-    connection_or_init_conn_from_address(conn,conn->_base.addr,conn->_base.port,
-                                         digest_rcvd, 0);
+    connection_or_init_conn_from_address(conn,conn->_base.addr,
+                                         conn->_base.port, digest_rcvd, 0);
 
     /* Annotate that we received a TLS connection.
      * (Todo: only actually consider ourselves reachable if there

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/control.c	2006-07-26 19:07:37 UTC (rev 6907)
@@ -157,7 +157,8 @@
                                   const char *body);
 static int handle_control_setevents(control_connection_t *conn, uint32_t len,
                                     const char *body);
-static int handle_control_authenticate(control_connection_t *conn, uint32_t len,
+static int handle_control_authenticate(control_connection_t *conn,
+                                       uint32_t len,
                                        const char *body);
 static int handle_control_saveconf(control_connection_t *conn, uint32_t len,
                                    const char *body);
@@ -167,19 +168,25 @@
                                      const char *body);
 static int handle_control_getinfo(control_connection_t *conn, uint32_t len,
                                   const char *body);
-static int handle_control_extendcircuit(control_connection_t *conn, uint32_t len,
+static int handle_control_extendcircuit(control_connection_t *conn,
+                                        uint32_t len,
                                         const char *body);
-static int handle_control_setpurpose(control_connection_t *conn, int for_circuits,
+static int handle_control_setpurpose(control_connection_t *conn,
+                                     int for_circuits,
                                      uint32_t len, const char *body);
-static int handle_control_attachstream(control_connection_t *conn, uint32_t len,
+static int handle_control_attachstream(control_connection_t *conn,
+                                       uint32_t len,
                                         const char *body);
-static int handle_control_postdescriptor(control_connection_t *conn, uint32_t len,
+static int handle_control_postdescriptor(control_connection_t *conn,
+                                         uint32_t len,
                                          const char *body);
-static int handle_control_redirectstream(control_connection_t *conn, uint32_t len,
+static int handle_control_redirectstream(control_connection_t *conn,
+                                         uint32_t len,
                                          const char *body);
 static int handle_control_closestream(control_connection_t *conn, uint32_t len,
                                       const char *body);
-static int handle_control_closecircuit(control_connection_t *conn, uint32_t len,
+static int handle_control_closecircuit(control_connection_t *conn,
+                                       uint32_t len,
                                        const char *body);
 static int write_stream_target_to_buf(edge_connection_t *conn, char *buf,
                                       size_t len);
@@ -529,7 +536,8 @@
 /** Send an error message with error code <b>error</b> and body
  * <b>message</b> down the connection <b>conn</b> */
 static void
-send_control0_error(control_connection_t *conn, uint16_t error, const char *message)
+send_control0_error(control_connection_t *conn, uint16_t error,
+                    const char *message)
 {
   char buf[256];
   size_t len;
@@ -784,7 +792,8 @@
 /** Called when we receive a GETCONF message.  Parse the request, and
  * reply with a CONFVALUE or an ERROR message */
 static int
-handle_control_getconf(control_connection_t *conn, uint32_t body_len, const char *body)
+handle_control_getconf(control_connection_t *conn, uint32_t body_len,
+                       const char *body)
 {
   smartlist_t *questions = NULL;
   smartlist_t *answers = NULL;
@@ -887,7 +896,8 @@
 /** Called when we get a SETEVENTS message: update conn->event_mask,
  * and reply with DONE or ERROR. */
 static int
-handle_control_setevents(control_connection_t *conn, uint32_t len, const char *body)
+handle_control_setevents(control_connection_t *conn, uint32_t len,
+                         const char *body)
 {
   uint16_t event_code;
   uint32_t event_mask = 0;
@@ -992,7 +1002,8 @@
  * OPEN.  Reply with DONE or ERROR.
  */
 static int
-handle_control_authenticate(control_connection_t *conn, uint32_t len, const char *body)
+handle_control_authenticate(control_connection_t *conn, uint32_t len,
+                            const char *body)
 {
   int used_quoted_string = 0;
   or_options_t *options = get_options();
@@ -1157,7 +1168,8 @@
 /** Called when we get a MAPADDRESS command; try to bind all listed addresses,
  * and report success or failrue. */
 static int
-handle_control_mapaddress(control_connection_t *conn, uint32_t len, const char *body)
+handle_control_mapaddress(control_connection_t *conn, uint32_t len,
+                          const char *body)
 {
   smartlist_t *elts;
   smartlist_t *lines;
@@ -1552,7 +1564,8 @@
 /** Called when we receive a GETINFO command.  Try to fetch all requested
  * information, and reply with information or error message. */
 static int
-handle_control_getinfo(control_connection_t *conn, uint32_t len, const char *body)
+handle_control_getinfo(control_connection_t *conn, uint32_t len,
+                       const char *body)
 {
   smartlist_t *questions = NULL;
   smartlist_t *answers = NULL;
@@ -1973,7 +1986,7 @@
     return 0;
   }
   if (connection_ap_handshake_rewrite_and_attach(edge_conn,
-                                  circ ? TO_ORIGIN_CIRCUIT(circ) : NULL) < 0) {
+                               circ ? TO_ORIGIN_CIRCUIT(circ) : NULL) < 0) {
     if (STATE_IS_V0(conn->_base.state))
       send_control0_error(conn, ERR_INTERNAL, "Unable to attach stream.");
     else
@@ -2456,8 +2469,9 @@
 
  again:
   /* Try to suck a control message from the buffer. */
-  switch (fetch_from_buf_control0(conn->_base.inbuf, &body_len, &command_type, &body,
-                                conn->_base.state == CONTROL_CONN_STATE_NEEDAUTH_V0))
+  switch (fetch_from_buf_control0(conn->_base.inbuf, &body_len, &command_type,
+                          &body,
+                          conn->_base.state == CONTROL_CONN_STATE_NEEDAUTH_V0))
     {
     case -2:
       tor_free(body);

Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/directory.c	2006-07-26 19:07:37 UTC (rev 6907)
@@ -46,7 +46,8 @@
 static int purpose_is_private(uint8_t purpose);
 static char *http_get_header(const char *headers, const char *which);
 static void http_set_address_origin(const char *headers, connection_t *conn);
-static void connection_dir_download_networkstatus_failed(dir_connection_t *conn);
+static void connection_dir_download_networkstatus_failed(
+                                                      dir_connection_t *conn);
 static void connection_dir_download_routerdesc_failed(dir_connection_t *conn);
 static void dir_networkstatus_download_failed(smartlist_t *failed);
 static void dir_routerdesc_download_failed(smartlist_t *failed);
@@ -398,13 +399,15 @@
       dir_port = get_options()->HttpProxyPort;
     }
 
-    switch (connection_connect(TO_CONN(conn), conn->_base.address, addr, dir_port)) {
+    switch (connection_connect(TO_CONN(conn), conn->_base.address, addr,
+                               dir_port)) {
       case -1:
         connection_dir_request_failed(conn); /* retry if we want */
         connection_free(TO_CONN(conn));
         return;
       case 1:
-        conn->_base.state = DIR_CONN_STATE_CLIENT_SENDING; /* start flushing conn */
+        /* start flushing conn */
+        conn->_base.state = DIR_CONN_STATE_CLIENT_SENDING;
         /* fall through */
       case 0:
         /* queue the command on the outbuf */
@@ -848,7 +851,8 @@
 
   log_debug(LD_DIR,
             "Received response from directory server '%s:%d': %d %s",
-            conn->_base.address, conn->_base.port, status_code, escaped(reason));
+            conn->_base.address, conn->_base.port, status_code,
+            escaped(reason));
 
   /* now check if it's got any hints for us about our IP address. */
   if (server_mode(get_options())) {
@@ -881,7 +885,8 @@
   if (status_code == 503) {
     log_info(LD_DIR,"Received http status code %d (%s) from server "
              "'%s:%d'. I'll try again soon.",
-             status_code, escaped(reason), conn->_base.address, conn->_base.port);
+             status_code, escaped(reason), conn->_base.address,
+             conn->_base.port);
     tor_free(body); tor_free(headers); tor_free(reason);
     return -1;
   }
@@ -913,7 +918,8 @@
 
       log_info(LD_HTTP, "HTTP body from server '%s:%d' was labeled %s, "
                "but it seems to be %s.%s",
-               conn->_base.address, conn->_base.port, description1, description2,
+               conn->_base.address, conn->_base.port, description1,
+               description2,
                (compression>0 && guessed>0)?"  Trying both.":"");
     }
     /* Try declared compression first if we can. */
@@ -949,7 +955,8 @@
     if (status_code != 200) {
       log_warn(LD_DIR,"Received http status code %d (%s) from server "
                "'%s:%d'. I'll try again soon.",
-               status_code, escaped(reason), conn->_base.address, conn->_base.port);
+               status_code, escaped(reason), conn->_base.address,
+               conn->_base.port);
       tor_free(body); tor_free(headers); tor_free(reason);
       return -1;
     }
@@ -966,7 +973,8 @@
     if (status_code != 200) {
       log_warn(LD_DIR,"Received http status code %d (%s) from server "
                "'%s:%d'. I'll try again soon.",
-               status_code, escaped(reason), conn->_base.address, conn->_base.port);
+               status_code, escaped(reason), conn->_base.address,
+               conn->_base.port);
       tor_free(body); tor_free(headers); tor_free(reason);
       return -1;
     }
@@ -990,8 +998,8 @@
       log_warn(LD_DIR,
            "Received http status code %d (%s) from server "
            "'%s:%d' while fetching \"/tor/status/%s\". I'll try again soon.",
-           status_code, escaped(reason), conn->_base.address, conn->_base.port,
-           conn->requested_resource);
+           status_code, escaped(reason), conn->_base.address,
+           conn->_base.port, conn->requested_resource);
       tor_free(body); tor_free(headers); tor_free(reason);
       connection_dir_download_networkstatus_failed(conn);
       return -1;
@@ -1060,8 +1068,8 @@
       log_fn(dir_okay ? LOG_INFO : LOG_WARN, LD_DIR,
              "Received http status code %d (%s) from server '%s:%d' "
              "while fetching \"/tor/server/%s\". I'll try again soon.",
-             status_code, escaped(reason), conn->_base.address, conn->_base.port,
-             conn->requested_resource);
+             status_code, escaped(reason), conn->_base.address,
+             conn->_base.port, conn->requested_resource);
       if (!which) {
         connection_dir_download_routerdesc_failed(conn);
       } else {
@@ -1122,12 +1130,14 @@
              "'%s:%d'. Is your clock skewed? Have you mailed us your key "
              "fingerprint? Are you using the right key? Are you using a "
              "private IP address? See http://tor.eff.org/doc/"
-             "tor-doc-server.html",escaped(reason), conn->_base.address, conn->_base.port);
+             "tor-doc-server.html",escaped(reason), conn->_base.address,
+             conn->_base.port);
         break;
       default:
         log_warn(LD_GENERAL,
              "http status %d (%s) reason unexpected (server '%s:%d').",
-             status_code, escaped(reason), conn->_base.address, conn->_base.port);
+             status_code, escaped(reason), conn->_base.address,
+             conn->_base.port);
         break;
     }
     /* return 0 in all cases, since we don't want to mark any
@@ -1162,7 +1172,8 @@
       default:
         log_warn(LD_REND,"http status %d (%s) response unexpected (server "
                  "'%s:%d').",
-                 status_code, escaped(reason), conn->_base.address, conn->_base.port);
+                 status_code, escaped(reason), conn->_base.address,
+                 conn->_base.port);
         break;
     }
   }
@@ -1182,7 +1193,8 @@
       default:
         log_warn(LD_REND,"http status %d (%s) response unexpected (server "
                  "'%s:%d').",
-                 status_code, escaped(reason), conn->_base.address, conn->_base.port);
+                 status_code, escaped(reason), conn->_base.address,
+                 conn->_base.port);
         break;
     }
   }
@@ -1617,7 +1629,8 @@
     return 0;
   }
 
-  if (!strcmp(url,"/tor/dir-all-weaselhack") && (conn->_base.addr == 0x7f000001ul) &&
+  if (!strcmp(url,"/tor/dir-all-weaselhack") &&
+      (conn->_base.addr == 0x7f000001ul) &&
       authdir_mode(get_options())) {
     /* XXX until weasel rewrites his scripts  XXXX012 */
     char *new_directory=NULL;
@@ -1746,7 +1759,8 @@
                               &body, &body_len, MAX_BODY_SIZE, 0)) {
     case -1: /* overflow */
       log_warn(LD_DIRSERV,
-               "Invalid input from address '%s'. Closing.", conn->_base.address);
+               "Invalid input from address '%s'. Closing.",
+               conn->_base.address);
       return -1;
     case 0:
       log_debug(LD_DIRSERV,"command not all here yet.");
@@ -1793,7 +1807,8 @@
       connection_mark_for_close(TO_CONN(conn));
       return 0;
     default:
-      log_warn(LD_BUG,"Bug: called in unexpected state %d.", conn->_base.state);
+      log_warn(LD_BUG,"Bug: called in unexpected state %d.",
+               conn->_base.state);
       tor_fragile_assert();
       return -1;
   }

Modified: tor/trunk/src/or/dns.c
===================================================================
--- tor/trunk/src/or/dns.c	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/dns.c	2006-07-26 19:07:37 UTC (rev 6907)
@@ -380,21 +380,23 @@
         pending_connection->next = resolve->pending_connections;
         resolve->pending_connections = pending_connection;
         log_debug(LD_EXIT,"Connection (fd %d) waiting for pending DNS "
-                  "resolve of %s",
-                  exitconn->_base.s, escaped_safe_str(exitconn->_base.address));
+                  "resolve of %s", exitconn->_base.s,
+                  escaped_safe_str(exitconn->_base.address));
         exitconn->_base.state = EXIT_CONN_STATE_RESOLVING;
         return 0;
       case CACHE_STATE_VALID:
         exitconn->_base.addr = resolve->addr;
         exitconn->address_ttl = resolve->ttl;
         log_debug(LD_EXIT,"Connection (fd %d) found cached answer for %s",
-                  exitconn->_base.s, escaped_safe_str(exitconn->_base.address));
+                  exitconn->_base.s,
+                  escaped_safe_str(exitconn->_base.address));
         if (exitconn->_base.purpose == EXIT_PURPOSE_RESOLVE)
           send_resolved_cell(exitconn, RESOLVED_TYPE_IPV4);
         return 1;
       case CACHE_STATE_FAILED:
         log_debug(LD_EXIT,"Connection (fd %d) found cached error for %s",
-                  exitconn->_base.s, escaped_safe_str(exitconn->_base.address));
+                  exitconn->_base.s,
+                  escaped_safe_str(exitconn->_base.address));
         if (exitconn->_base.purpose == EXIT_PURPOSE_RESOLVE)
           send_resolved_cell(exitconn, RESOLVED_TYPE_ERROR);
         circ = circuit_get_by_edge_conn(exitconn);
@@ -766,7 +768,8 @@
 
   return 0;
 err:
-  dns_cancel_pending_resolve(exitconn->_base.address); /* also sends end and frees */
+  /* also sends end and frees */
+  dns_cancel_pending_resolve(exitconn->_base.address);
   return -1;
 }
 

Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/main.c	2006-07-26 19:07:37 UTC (rev 6907)
@@ -444,8 +444,10 @@
            "Bug: unhandled error on write for %s connection (fd %d); removing",
            conn_type_to_string(conn->type), conn->s);
       tor_fragile_assert();
-      if (CONN_IS_EDGE(conn))
-        conn->edge_has_sent_end = 1; /* otherwise we cry wolf about duplicate close */
+      if (CONN_IS_EDGE(conn)) {
+        /* otherwise we cry wolf about duplicate close */
+        conn->edge_has_sent_end = 1;
+      }
       /* XXX do we need a close-immediate here, so we don't try to flush? */
       connection_mark_for_close(conn);
     }
@@ -552,7 +554,8 @@
                "Failing connection to '%s:%d'.",
                safe_str(edge_conn->socks_request->address),
                edge_conn->socks_request->port);
-    connection_mark_unattached_ap(edge_conn, END_STREAM_REASON_NET_UNREACHABLE);
+    connection_mark_unattached_ap(edge_conn,
+                                  END_STREAM_REASON_NET_UNREACHABLE);
   }
 }
 

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/or.h	2006-07-26 19:07:37 UTC (rev 6907)
@@ -726,8 +726,6 @@
 /* Used only by DIR and AP connections: */
   char rend_query[REND_SERVICE_ID_LEN+1]; /**< What rendezvous service are we
                                            * querying for? (DIR/AP only) */
-
-
 } edge_connection_t;
 
 typedef struct dir_connection_t {
@@ -1835,11 +1833,13 @@
 void _connection_mark_unattached_ap(edge_connection_t *conn, int endreason,
                                     int line, const char *file);
 int connection_edge_reached_eof(edge_connection_t *conn);
-int connection_edge_process_inbuf(edge_connection_t *conn, int package_partial);
+int connection_edge_process_inbuf(edge_connection_t *conn,
+                                  int package_partial);
 int connection_edge_destroy(uint16_t circ_id, edge_connection_t *conn);
 int connection_edge_end(edge_connection_t *conn, char reason,
                         crypt_path_t *cpath_layer);
-int connection_edge_end_errno(edge_connection_t *conn, crypt_path_t *cpath_layer);
+int connection_edge_end_errno(edge_connection_t *conn,
+                              crypt_path_t *cpath_layer);
 int connection_edge_finished_flushing(edge_connection_t *conn);
 int connection_edge_finished_connecting(edge_connection_t *conn);
 
@@ -1865,7 +1865,8 @@
 int connection_ap_can_use_exit(edge_connection_t *conn, routerinfo_t *exit);
 void connection_ap_expire_beginning(void);
 void connection_ap_attach_pending(void);
-int connection_ap_detach_retriable(edge_connection_t *conn, origin_circuit_t *circ);
+int connection_ap_detach_retriable(edge_connection_t *conn,
+                                   origin_circuit_t *circ);
 
 void addressmap_init(void);
 void addressmap_clean(time_t now);
@@ -1912,7 +1913,8 @@
 int connection_tls_start_handshake(or_connection_t *conn, int receiving);
 int connection_tls_continue_handshake(or_connection_t *conn);
 
-void connection_or_write_cell_to_buf(const cell_t *cell, or_connection_t *conn);
+void connection_or_write_cell_to_buf(const cell_t *cell,
+                                     or_connection_t *conn);
 int connection_or_send_destroy(uint16_t circ_id, or_connection_t *conn,
                                int reason);
 
@@ -1978,8 +1980,10 @@
 
 int control_event_circuit_status(origin_circuit_t *circ,
                                  circuit_status_event_t e);
-int control_event_stream_status(edge_connection_t *conn, stream_status_event_t e);
-int control_event_or_conn_status(or_connection_t *conn, or_conn_status_event_t e);
+int control_event_stream_status(edge_connection_t *conn,
+                                stream_status_event_t e);
+int control_event_or_conn_status(or_connection_t *conn,
+                                 or_conn_status_event_t e);
 int control_event_bandwidth_used(uint32_t n_read, uint32_t n_written);
 void control_event_logmsg(int severity, unsigned int domain, const char *msg);
 int control_event_descriptors_changed(smartlist_t *routers);
@@ -2216,7 +2220,8 @@
                                  int relay_command, const char *payload,
                                  size_t payload_len,
                                  crypt_path_t *cpath_layer);
-int connection_edge_package_raw_inbuf(edge_connection_t *conn, int package_partial);
+int connection_edge_package_raw_inbuf(edge_connection_t *conn,
+                                      int package_partial);
 void connection_edge_consider_sending_sendme(edge_connection_t *conn);
 socks5_reply_status_t connection_edge_end_reason_socks5_response(int reason);
 int errno_to_end_reason(int e);

Modified: tor/trunk/src/or/relay.c
===================================================================
--- tor/trunk/src/or/relay.c	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/relay.c	2006-07-26 19:07:37 UTC (rev 6907)
@@ -396,7 +396,8 @@
   } else {
     for (tmpconn = TO_OR_CIRCUIT(circ)->n_streams; tmpconn;
          tmpconn=tmpconn->next_stream) {
-      if (rh.stream_id == tmpconn->stream_id && !tmpconn->_base.marked_for_close) {
+      if (rh.stream_id == tmpconn->stream_id &&
+          !tmpconn->_base.marked_for_close) {
         log_debug(LD_EXIT,"found conn for stream %d.", rh.stream_id);
         if (cell_direction == CELL_DIRECTION_OUT ||
             connection_edge_is_rendezvous_stream(tmpconn))
@@ -405,7 +406,8 @@
     }
     for (tmpconn = TO_OR_CIRCUIT(circ)->resolving_streams; tmpconn;
          tmpconn=tmpconn->next_stream) {
-      if (rh.stream_id == tmpconn->stream_id && !tmpconn->_base.marked_for_close) {
+      if (rh.stream_id == tmpconn->stream_id &&
+          !tmpconn->_base.marked_for_close) {
         log_debug(LD_EXIT,"found conn for stream %d.", rh.stream_id);
         return tmpconn;
       }
@@ -465,7 +467,8 @@
   if (fromconn && fromconn->_base.marked_for_close) {
     log_warn(LD_BUG,
              "Bug: called on conn that's already marked for close at %s:%d.",
-             fromconn->_base.marked_for_close_file, fromconn->_base.marked_for_close);
+             fromconn->_base.marked_for_close_file,
+             fromconn->_base.marked_for_close);
     return 0;
   }
 
@@ -780,7 +783,8 @@
     circuit_log_path(LOG_INFO,LD_APP,circ);
     connection_mark_unattached_ap(conn, reason);
   } else {
-    conn->_base.edge_has_sent_end = 1; /* we just got an 'end', don't need to send one */
+    /* we just got an 'end', don't need to send one */
+    conn->_base.edge_has_sent_end = 1;
     connection_mark_for_close(TO_CONN(conn));
   }
   return 0;
@@ -807,7 +811,8 @@
       return 0;
   }
 
-  if (conn->_base.type == CONN_TYPE_AP && rh->command == RELAY_COMMAND_CONNECTED) {
+  if (conn->_base.type == CONN_TYPE_AP &&
+      rh->command == RELAY_COMMAND_CONNECTED) {
     tor_assert(CIRCUIT_IS_ORIGIN(circ));
     if (conn->_base.state != AP_CONN_STATE_CONNECT_WAIT) {
       log_warn(LD_APP,"Got 'connected' while not in state connect_wait. "
@@ -846,7 +851,8 @@
     }
     return 0;
   }
-  if (conn->_base.type == CONN_TYPE_AP && rh->command == RELAY_COMMAND_RESOLVED) {
+  if (conn->_base.type == CONN_TYPE_AP &&
+      rh->command == RELAY_COMMAND_RESOLVED) {
     int ttl;
     int answer_len;
     if (conn->_base.state != AP_CONN_STATE_RESOLVE_WAIT) {

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2006-07-26 19:07:26 UTC (rev 6906)
+++ tor/trunk/src/or/routerlist.c	2006-07-26 19:07:37 UTC (rev 6907)
@@ -3317,9 +3317,9 @@
     if (conn->type == CONN_TYPE_DIR &&
         conn->purpose == DIR_PURPOSE_FETCH_SERVERDESC &&
         !conn->marked_for_close) {
-      dir_connection_t *dir_conn = TO_DIR_CONN(conn);
-      if (!strcmpstart(dir_conn->requested_resource, prefix))
-        dir_split_resource_into_fingerprints(dir_conn->requested_resource+p_len,
+      const char *resource = TO_DIR_CONN(conn)->requested_resource;
+      if (!strcmpstart(resource, prefix))
+        dir_split_resource_into_fingerprints(resource + p_len,
                                              tmp, NULL, 1, 0);
     }
   }



More information about the tor-commits mailing list