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

[or-cvs] r9451: there's such a thing as too much indirection (tor/trunk/src/or)



Author: arma
Date: 2007-01-28 03:06:00 -0500 (Sun, 28 Jan 2007)
New Revision: 9451

Modified:
   tor/trunk/src/or/directory.c
   tor/trunk/src/or/or.h
   tor/trunk/src/or/router.c
Log:
there's such a thing as too much indirection


Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2007-01-28 07:46:13 UTC (rev 9450)
+++ tor/trunk/src/or/directory.c	2007-01-28 08:06:00 UTC (rev 9451)
@@ -31,13 +31,6 @@
  *   connection_finished_connecting() in connection.c
  */
 static void
-directory_initiate_command(const char *address, uint32_t addr, uint16_t port,
-                           int supports_begindir,
-                           const char *digest, uint8_t purpose,
-                           int private_connection, const char *resource,
-                           const char *payload, size_t payload_len);
-
-static void
 directory_send_command(dir_connection_t *conn,
                        int purpose, int direct, const char *resource,
                        const char *payload, size_t payload_len);
@@ -224,33 +217,6 @@
   }
 }
 
-/** Launch a new connection to the directory server <b>router</b> to upload or
- * download a service or rendezvous descriptor. <b>purpose</b> determines what
- * kind of directory connection we're launching, and must be one of
- * DIR_PURPOSE_{FETCH|UPLOAD}_{DIR|RENDDESC}.
- *
- * When uploading, <b>payload</b> and <b>payload_len</b> determine the content
- * of the HTTP post.  Otherwise, <b>payload</b> should be NULL.
- *
- * When fetching a rendezvous descriptor, <b>resource</b> is the service ID we
- * want to fetch.
- */
-void
-directory_initiate_command_router(routerinfo_t *router,
-                                  int supports_begindir,
-                                  uint8_t purpose,
-                                  int private_connection,
-                                  const char *resource,
-                                  const char *payload,
-                                  size_t payload_len)
-{
-  directory_initiate_command(router->address, router->addr, router->dir_port,
-                             supports_begindir,
-                             router->cache_info.identity_digest,
-                             purpose, private_connection, resource,
-                             payload, payload_len);
-}
-
 /** Launch a new connection to the directory server <b>status</b> to upload or
  * download a server or rendezvous descriptor. <b>purpose</b> determines what
  * kind of directory connection we're launching, and must be one of
@@ -398,7 +364,7 @@
  * <b>addr</b>, whose directory port is <b>dir_port</b>, whose tor version
  * <b>supports_begindir</b>, and whose identity key digest is
  * <b>digest</b>. */
-static void
+void
 directory_initiate_command(const char *address, uint32_t addr,
                            uint16_t dir_port, int supports_begindir,
                            const char *digest, uint8_t purpose,

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2007-01-28 07:46:13 UTC (rev 9450)
+++ tor/trunk/src/or/or.h	2007-01-28 08:06:00 UTC (rev 9451)
@@ -2328,13 +2328,6 @@
                                   size_t payload_len);
 void directory_get_from_dirserver(uint8_t purpose, const char *resource,
                                   int retry_if_no_servers);
-void directory_initiate_command_router(routerinfo_t *router,
-                                       int supports_begindir,
-                                       uint8_t purpose,
-                                       int private_connection,
-                                       const char *resource,
-                                       const char *payload,
-                                       size_t payload_len);
 void directory_initiate_command_routerstatus(routerstatus_t *status,
                                              uint8_t purpose,
                                              int private_connection,
@@ -2350,6 +2343,12 @@
 int connection_dir_finished_flushing(dir_connection_t *conn);
 int connection_dir_finished_connecting(dir_connection_t *conn);
 void connection_dir_request_failed(dir_connection_t *conn);
+void directory_initiate_command(const char *address, uint32_t addr,
+                                uint16_t dir_port, int supports_begindir,
+                                const char *digest, uint8_t purpose,
+                                int private_connection, const char *resource,
+                                const char *payload, size_t payload_len);
+
 int dir_split_resource_into_fingerprints(const char *resource,
                                     smartlist_t *fp_out, int *compresseed_out,
                                     int decode_hex, int sort_uniq);

Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c	2007-01-28 07:46:13 UTC (rev 9450)
+++ tor/trunk/src/or/router.c	2007-01-28 08:06:00 UTC (rev 9451)
@@ -496,8 +496,11 @@
                 CONN_TYPE_DIR, me->addr, me->dir_port,
                 DIR_PURPOSE_FETCH_SERVERDESC)) {
     /* ask myself, via tor, for my server descriptor. */
-    directory_initiate_command_router(me, 0, DIR_PURPOSE_FETCH_SERVERDESC,
-                                      1, "authority", NULL, 0);
+    directory_initiate_command(me->address, me->addr, me->dir_port,
+                               0, me->cache_info.identity_digest,
+                               DIR_PURPOSE_FETCH_SERVERDESC,
+                               1, "authority", NULL, 0);
+
     control_event_server_status(LOG_NOTICE,
                                 "CHECKING_REACHABILITY DIRADDRESS=%s:%d",
                                 me->address, me->dir_port);