diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-05-12 20:58:27 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-05-12 20:58:27 +0000 |
commit | 537fb82cbb3b0488535f94bbccb0899f1b6b027a (patch) | |
tree | 9687918384012548a8a3f859b4c6e3d3ad4eb8f2 | |
parent | 32c42a0ee25fec091ee3e889578ef730b2a37959 (diff) | |
download | tor-537fb82cbb3b0488535f94bbccb0899f1b6b027a.tar.gz tor-537fb82cbb3b0488535f94bbccb0899f1b6b027a.zip |
Make some functions static
svn:r1857
-rw-r--r-- | src/or/circuit.c | 6 | ||||
-rw-r--r-- | src/or/connection.c | 6 | ||||
-rw-r--r-- | src/or/cpuworker.c | 4 | ||||
-rw-r--r-- | src/or/dns.c | 4 | ||||
-rw-r--r-- | src/or/or.h | 8 | ||||
-rw-r--r-- | src/or/rendclient.c | 7 | ||||
-rw-r--r-- | src/or/rendcommon.c | 6 |
7 files changed, 21 insertions, 20 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c index 1347b807a3..a75b168dd1 100644 --- a/src/or/circuit.c +++ b/src/or/circuit.c @@ -22,6 +22,8 @@ void circuit_expire_old_circuits(void); static void circuit_is_open(circuit_t *circ); static void circuit_build_failed(circuit_t *circ); static circuit_t *circuit_establish_circuit(uint8_t purpose, const char *exit_nickname); +static void circuit_free(circuit_t *circ); +static void circuit_free_cpath(crypt_path_t *cpath); /********* START VARIABLES **********/ @@ -112,7 +114,7 @@ circuit_t *circuit_new(uint16_t p_circ_id, connection_t *p_conn) { /** Deallocate space associated with circ. */ -void circuit_free(circuit_t *circ) { +static void circuit_free(circuit_t *circ) { tor_assert(circ); tor_assert(circ->magic == CIRCUIT_MAGIC); if (circ->n_crypto) @@ -139,7 +141,7 @@ void circuit_free(circuit_t *circ) { } /** Deallocate space associated with the linked list <b>cpath</b>. */ -void circuit_free_cpath(crypt_path_t *cpath) { +static void circuit_free_cpath(crypt_path_t *cpath) { crypt_path_t *victim, *head=cpath; if(!cpath) diff --git a/src/or/connection.c b/src/or/connection.c index 009f6d235a..bfa6174b64 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -79,6 +79,8 @@ static int connection_handle_listener_read(connection_t *conn, int new_type); static int connection_receiver_bucket_should_increase(connection_t *conn); static int connection_finished_flushing(connection_t *conn); static int connection_finished_connecting(connection_t *conn); +static int connection_read_to_buf(connection_t *conn); +static int connection_process_inbuf(connection_t *conn); /**************************************************************/ @@ -702,7 +704,7 @@ int connection_handle_read(connection_t *conn) { * * Return -1 if we want to break conn, else return 0. */ -int connection_read_to_buf(connection_t *conn) { +static int connection_read_to_buf(connection_t *conn) { int result; int at_most; @@ -1103,7 +1105,7 @@ int connection_send_destroy(uint16_t circ_id, connection_t *conn) { * This function just passes conn to the connection-specific * connection_*_process_inbuf() function. */ -int connection_process_inbuf(connection_t *conn) { +static int connection_process_inbuf(connection_t *conn) { tor_assert(conn); diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index 180b07e1ad..2943888755 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -34,7 +34,7 @@ static int num_cpuworkers_busy=0; * the last time we got a key rotation event. */ static time_t last_rotation_time=0; -int cpuworker_main(void *data); +static int cpuworker_main(void *data); static int spawn_cpuworker(void); static void spawn_enough_cpuworkers(void); static void process_pending_task(connection_t *cpuworker); @@ -183,7 +183,7 @@ done_processing: * Onionskin challenge ONIONSKIN_REPLY_LEN * Negotiated keys KEY_LEN*2+DIGEST_LEN*2 */ -int cpuworker_main(void *data) { +static int cpuworker_main(void *data) { unsigned char question[ONIONSKIN_CHALLENGE_LEN]; unsigned char question_type; int *fdarray = data; diff --git a/src/or/dns.c b/src/or/dns.c index 84b9523a4a..47163733a2 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -66,7 +66,7 @@ static void purge_expired_resolves(uint32_t now); static int assign_to_dnsworker(connection_t *exitconn); static void dns_purge_resolve(struct cached_resolve *resolve); static void dns_found_answer(char *address, uint32_t addr, char outcome); -int dnsworker_main(void *data); +static int dnsworker_main(void *data); static int spawn_dnsworker(void); static void spawn_enough_dnsworkers(void); @@ -532,7 +532,7 @@ int connection_dns_process_inbuf(connection_t *conn) { * The dnsworker runs indefinitely, until its connection is closed or an error * occurs. */ -int dnsworker_main(void *data) { +static int dnsworker_main(void *data) { char address[MAX_ADDRESSLEN]; unsigned char address_len; char answer[5]; diff --git a/src/or/or.h b/src/or/or.h index 1746d1c7ec..7be7f17be3 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -867,7 +867,6 @@ void assert_buf_ok(buf_t *buf); extern char *circuit_state_to_string[]; circuit_t *circuit_new(uint16_t p_circ_id, connection_t *p_conn); void circuit_close_all_marked(void); -void circuit_free(circuit_t *circ); void circuit_free_cpath(crypt_path_t *cpath); int _circuit_mark_for_close(circuit_t *circ); @@ -980,7 +979,6 @@ void connection_bucket_init(void); void connection_bucket_refill(struct timeval *now); int connection_handle_read(connection_t *conn); -int connection_read_to_buf(connection_t *conn); int connection_fetch_from_buf(char *string, int len, connection_t *conn); @@ -1008,8 +1006,6 @@ int connection_state_is_connecting(connection_t *conn); int connection_send_destroy(uint16_t circ_id, connection_t *conn); -int connection_process_inbuf(connection_t *conn); - void assert_connection_ok(connection_t *conn, time_t now); /********************************* connection_edge.c ***************************/ @@ -1071,7 +1067,6 @@ void cpu_init(void); void cpuworkers_rotate(void); int connection_cpu_finished_flushing(connection_t *conn); int connection_cpu_process_inbuf(connection_t *conn); -int cpuworker_main(void *data); int assign_to_cpuworker(connection_t *cpuworker, unsigned char question_type, void *task); @@ -1195,7 +1190,6 @@ int rend_client_rendezvous_acked(circuit_t *circ, const char *request, int reque int rend_client_receive_rendezvous(circuit_t *circ, const char *request, int request_len); void rend_client_desc_fetched(char *query, int success); -int rend_cmp_service_ids(const char *one, const char *two); char *rend_client_get_random_intro(char *query); int rend_parse_rendezvous_address(char *address); @@ -1211,6 +1205,8 @@ typedef struct rend_service_descriptor_t { char **intro_points; } rend_service_descriptor_t; +int rend_cmp_service_ids(const char *one, const char *two); + void rend_process_relay_cell(circuit_t *circ, int command, int length, const char *payload); diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 796f3a2d60..3727e41fcc 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -24,7 +24,7 @@ rend_client_introcirc_is_open(circuit_t *circ) /** Send the establish-rendezvous cell along a rendezvous circuit. if * it fails, mark the circ for close and return -1. else return 0. */ -int +static int rend_client_send_establish_rendezvous(circuit_t *circ) { tor_assert(circ->purpose == CIRCUIT_PURPOSE_C_ESTABLISH_REND); @@ -389,11 +389,6 @@ void rend_client_desc_fetched(char *query, int success) { } } -/** Return 0 if one and two are the same service ids, else -1 or 1 */ -int rend_cmp_service_ids(const char *one, const char *two) { - return strcasecmp(one,two); -} - /** strdup a nickname for a random introduction * point of query. return NULL if error. */ diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c index b96557d494..3260b9ff9a 100644 --- a/src/or/rendcommon.c +++ b/src/or/rendcommon.c @@ -10,6 +10,12 @@ #include "or.h" + +/** Return 0 if one and two are the same service ids, else -1 or 1 */ +int rend_cmp_service_ids(const char *one, const char *two) { + return strcasecmp(one,two); +} + /** Free the storage held by the service descriptor <b>desc</b>. */ void rend_service_descriptor_free(rend_service_descriptor_t *desc) |