Browse Source

patch to fix running the program only as an op

svn:r27
Roger Dingledine 23 years ago
parent
commit
66c6f2231e
4 changed files with 5 additions and 3 deletions
  1. 1 1
      src/or/connection.c
  2. 2 2
      src/or/connection_or.c
  3. 1 0
      src/or/main.c
  4. 1 0
      src/or/or.h

+ 1 - 1
src/or/connection.c

@@ -241,7 +241,7 @@ connection_t *connection_connect_to_router_as_op(routerinfo_t *router, RSA *prke
   if(learn_local(&local) < 0)
     return NULL;
   local.sin_port = htons(local_or_port);
-  return connection_or_connect_as_or(router, prkey, &local);
+  return connection_or_connect_as_op(router, prkey, &local);
 }
 
 int connection_read_to_buf(connection_t *conn) {

+ 2 - 2
src/or/connection_or.c

@@ -53,7 +53,7 @@ int connection_or_finished_flushing(connection_t *conn) {
       }
       /* the connect has finished. */
 
-      log(LOG_DEBUG,"connection_or_finished_flushing() : Connection to router %s:%u established.",
+      log(LOG_DEBUG,"connection_or_finished_flushing() : OP connection to router %s:%u established.",
           conn->address,ntohs(conn->port));
 
       return or_handshake_op_send_keys(conn);
@@ -71,7 +71,7 @@ int connection_or_finished_flushing(connection_t *conn) {
       }
       /* the connect has finished. */
 
-      log(LOG_DEBUG,"connection_or_finished_flushing() : Connection to router %s:%u established.",
+      log(LOG_DEBUG,"connection_or_finished_flushing() : OR connection to router %s:%u established.",
           conn->address,ntohs(conn->port));
 
       return or_handshake_client_send_auth(conn);

+ 1 - 0
src/or/main.c

@@ -8,6 +8,7 @@ static char *args = "hf:e:n:l:";
 
 int loglevel = LOG_DEBUG;
 
+//int global_role = ROLE_AP_LISTEN;
 int global_role = ROLE_OR_LISTEN | ROLE_OR_CONNECT_ALL | ROLE_OP_LISTEN | ROLE_AP_LISTEN;
 /* FIXME defaulting to all roles for now. should make it a config option though */
 

+ 1 - 0
src/or/or.h

@@ -475,6 +475,7 @@ int or_handshake_server_process_nonce(connection_t *conn);
 
 connection_t *connect_to_router_as_or(routerinfo_t *router, RSA *prkey, struct sockaddr_in *local);
 connection_t *connection_or_connect_as_or(routerinfo_t *router, RSA *prkey, struct sockaddr_in *local);
+connection_t *connection_or_connect_as_op(routerinfo_t *router, RSA *prkey, struct sockaddr_in *local);
 
 int connection_or_create_listener(RSA *prkey, struct sockaddr_in *local);
 int connection_or_handle_listener_read(connection_t *conn);