patch to fix running the program only as an op

svn:r27
This commit is contained in:
Roger Dingledine 2002-07-03 17:30:59 +00:00
parent a5be23d475
commit 66c6f2231e
4 changed files with 5 additions and 3 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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 */

View File

@ -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);