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

[or-cvs] Make new logging stuff work on windows; fix a couple of win...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv27993/src/or

Modified Files:
	circuituse.c main.c rendclient.c routerlist.c 
Log Message:
Make new logging stuff work on windows; fix a couple of windows typos.

Index: circuituse.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/circuituse.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- circuituse.c	11 Nov 2005 19:25:30 -0000	1.88
+++ circuituse.c	15 Nov 2005 03:05:18 -0000	1.89
@@ -743,7 +743,7 @@
  * last hop need not be an exit node. Return the newly allocated circuit on
  * success, or NULL on failure. */
 circuit_t *
-circuit_launch_by_extend_info(uint8_t purpose, extend_info_t *info,
+circuit_launch_by_extend_info(uint8_t purpose, extend_info_t *extend_info,
                int need_uptime, int need_capacity, int internal)
 {
   circuit_t *circ;
@@ -753,10 +753,10 @@
     return NULL;
   }
 
-  if ((info || purpose != CIRCUIT_PURPOSE_C_GENERAL) &&
+  if ((extend_info || purpose != CIRCUIT_PURPOSE_C_GENERAL) &&
       purpose != CIRCUIT_PURPOSE_TESTING) {
     /* see if there are appropriate circs available to cannibalize. */
-    circ = circuit_find_to_cannibalize(CIRCUIT_PURPOSE_C_GENERAL, info,
+    circ = circuit_find_to_cannibalize(CIRCUIT_PURPOSE_C_GENERAL, extend_info,
                                        need_uptime, need_capacity, internal);
     if (circ) {
       info(LD_CIRC,"Cannibalizing circ '%s' for purpose %d",
@@ -775,8 +775,8 @@
         case CIRCUIT_PURPOSE_S_CONNECT_REND:
         case CIRCUIT_PURPOSE_C_GENERAL:
           /* need to add a new hop */
-          tor_assert(info);
-          if (circuit_extend_to_new_exit(circ, info) < 0)
+          tor_assert(extend_info);
+          if (circuit_extend_to_new_exit(circ, extend_info) < 0)
             return NULL;
           break;
         default:
@@ -796,7 +796,7 @@
   }
 
   /* try a circ. if it fails, circuit_mark_for_close will increment n_circuit_failures */
-  return circuit_establish_circuit(purpose, info,
+  return circuit_establish_circuit(purpose, extend_info,
                                    need_uptime, need_capacity, internal);
 }
 

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.588
retrieving revision 1.589
diff -u -d -r1.588 -r1.589
--- main.c	14 Nov 2005 04:39:49 -0000	1.588
+++ main.c	15 Nov 2005 03:05:19 -0000	1.589
@@ -1567,7 +1567,7 @@
 void
 nt_service_body(int argc, char **argv)
 {
-  int err;
+  int r;
   service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
   service_status.dwCurrentState = SERVICE_START_PENDING;
   service_status.dwControlsAccepted =
@@ -1585,21 +1585,21 @@
 
   // check for torrc
   if (nt_torrc_is_present()) {
-    err = tor_init(backup_argc, backup_argv); // refactor this part out of tor_main and do_main_loop
-    if (err) {
-      err = NT_SERVICE_ERROR_TORINIT_FAILED;
+    r = tor_init(backup_argc, backup_argv); // refactor this part out of tor_main and do_main_loop
+    if (r) {
+      r = NT_SERVICE_ERROR_TORINIT_FAILED;
     }
   }
   else {
     err(LD_CONFIG, "torrc is not in the current working directory. The Tor service will not start.");
-    err = NT_SERVICE_ERROR_NO_TORRC;
+    r = NT_SERVICE_ERROR_NO_TORRC;
   }
 
-  if (err) {
+  if (r) {
     // failed.
     service_status.dwCurrentState = SERVICE_STOPPED;
-    service_status.dwWin32ExitCode = err;
-    service_status.dwServiceSpecificExitCode = err;
+    service_status.dwWin32ExitCode = r;
+    service_status.dwServiceSpecificExitCode = r;
     SetServiceStatus(hStatus, &service_status);
     return;
   }

Index: rendclient.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/rendclient.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- rendclient.c	25 Oct 2005 18:01:01 -0000	1.97
+++ rendclient.c	15 Nov 2005 03:05:21 -0000	1.98
@@ -216,10 +216,10 @@
                                        circ->rend_query) > 0) {
       /* There are introduction points left. Re-extend the circuit to
        * another intro point and try again. */
-      extend_info_t *info;
+      extend_info_t *extend_info;
       int result;
-      info = rend_client_get_random_intro(circ->rend_query);
-      if (!info) {
+      extend_info = rend_client_get_random_intro(circ->rend_query);
+      if (!extend_info) {
         warn(LD_REND, "No introduction points left for %s. Closing.",
                safe_str(circ->rend_query));
         circuit_mark_for_close(circ);
@@ -229,9 +229,9 @@
            "Got nack for %s from %s. Re-extending circ %d, this time to %s.",
            safe_str(circ->rend_query),
            circ->build_state->chosen_exit->nickname, circ->n_circ_id,
-           info->nickname);
-      result = circuit_extend_to_new_exit(circ, info);
-      extend_info_free(info);
+           extend_info->nickname);
+      result = circuit_extend_to_new_exit(circ, extend_info);
+      extend_info_free(extend_info);
       return result;
     }
   }

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.364
retrieving revision 1.365
diff -u -d -r1.364 -r1.365
--- routerlist.c	11 Nov 2005 17:16:24 -0000	1.364
+++ routerlist.c	15 Nov 2005 03:05:23 -0000	1.365
@@ -2348,12 +2348,12 @@
 }
 
 /** If <b>policy</b> implicitly allows connections to any port on
- * 127.*, 192.168.*, etc, then warn (if <b>warn</b> is set) and return
+ * 127.*, 192.168.*, etc, then warn (if <b>should_warn</b> is set) and return
  * true.  Else return false.
  **/
 int
 exit_policy_implicitly_allows_local_networks(addr_policy_t *policy,
-                                             int warn)
+                                             int should_warn)
 {
   addr_policy_t *p;
   int r=0,i;
@@ -2372,7 +2372,7 @@
     /* log_fn(LOG_INFO,"Checking network %s", private_networks[i].network); */
     if (policy_includes_addr_mask_implicitly(
               policy, private_networks[i].addr, private_networks[i].mask, &p)) {
-      if (warn)
+      if (should_warn)
         warn(LD_CONFIG, "Exit policy %s implicitly accepts %s",
                p?p->string:"(default)",
                private_networks[i].network);