[or-cvs] more useful logging for rend services and clients

Roger Dingledine arma at seul.org
Fri Apr 16 11:48:05 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	rendclient.c rendservice.c 
Log Message:
more useful logging for rend services and clients


Index: rendclient.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendclient.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- rendclient.c	16 Apr 2004 08:21:35 -0000	1.40
+++ rendclient.c	16 Apr 2004 11:48:03 -0000	1.41
@@ -208,13 +208,13 @@
         nickname = rend_client_get_random_intro(circ->rend_query);
         assert(nickname);
         if (!router_get_by_nickname(nickname)) {
-          log_fn(LOG_WARN, "Advertised intro point '%s' is not known. Closing.",
-                 nickname);
+          log_fn(LOG_WARN, "Advertised intro point '%s' for %s is not known. Closing.",
+                 nickname, circ->rend_query);
           circuit_mark_for_close(circ);
           return -1;
         }
-        log_fn(LOG_INFO, "Chose new intro point %s for %s (circ %d)",
-               nickname, circ->rend_query, circ->n_circ_id);
+        log_fn(LOG_INFO, "Chose new intro point %s for %s (circ %d, %d choices left)",
+               nickname, circ->rend_query, circ->n_circ_id, ent->parsed->n_intro_points);
         circ->state = CIRCUIT_STATE_BUILDING;
         tor_free(circ->build_state->chosen_exit);
         circ->build_state->chosen_exit = tor_strdup(nickname);

Index: rendservice.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendservice.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- rendservice.c	15 Apr 2004 02:02:46 -0000	1.55
+++ rendservice.c	16 Apr 2004 11:48:03 -0000	1.56
@@ -769,8 +769,11 @@
 
     /* Find out which introduction points we have in progress for this service. */
     for (j=0;j< smartlist_len(service->intro_nodes); ++j) {
-      router = router_get_by_nickname(smartlist_get(service->intro_nodes,j));
+      intro = smartlist_get(service->intro_nodes, j);
+      router = router_get_by_nickname(intro);
       if (!router || !find_intro_circuit(router,service->pk_digest)) {
+        log_fn(LOG_INFO,"Giving up on %s as intro point for %s.",
+                intro, service->service_id);
         smartlist_del(service->intro_nodes,j--);
         changed = service->desc_is_dirty = 1;
       }
@@ -794,15 +797,16 @@
                                          service->intro_exclude_nodes,
                                          exclude_routers);
       if (!router) {
-        log_fn(LOG_WARN, "Could only establish %d introduction points",
-               smartlist_len(service->intro_nodes));
+        log_fn(LOG_WARN, "Could only establish %d introduction points for %s",
+               smartlist_len(service->intro_nodes), service->service_id);
         break;
       }
       changed = 1;
       smartlist_add(intro_routers, router);
       smartlist_add(exclude_routers, router);
       smartlist_add(service->intro_nodes, tor_strdup(router->nickname));
-      log_fn(LOG_INFO,"Picked router %s as an intro point.", router->nickname);
+      log_fn(LOG_INFO,"Picked router %s as an intro point for %s.", router->nickname,
+             service->service_id);
     }
 
     /* Reset exclude_routers to include obsolete routers only for the next
@@ -818,7 +822,8 @@
       intro = smartlist_get(service->intro_nodes, j);
       r = rend_service_launch_establish_intro(service, intro);
       if (r<0) {
-        log_fn(LOG_WARN, "Error launching circuit to node %s", intro);
+        log_fn(LOG_WARN, "Error launching circuit to node %s for service %s",
+               intro, service->service_id);
       }
     }
   }



More information about the tor-commits mailing list