aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-06-17 14:31:05 +0000
committerRoger Dingledine <arma@torproject.org>2003-06-17 14:31:05 +0000
commit05a8c264ff4bff8ea13596759b3a4f0ef153041d (patch)
tree62fa3e11086f0454aa4f7ef2b4bba2df2f5a74a9 /src/or/or.h
parentcb8ebfcf294f2b77173b9512bd1c6bc9e87cb030 (diff)
downloadtor-05a8c264ff4bff8ea13596759b3a4f0ef153041d.tar
tor-05a8c264ff4bff8ea13596759b3a4f0ef153041d.tar.gz
overhaul the dns farm: cut its size in half
i've eliminated the master dns process, so now the workers just act like regular connections and are handled by the normal pollarray. everything seems to still work. ;) svn:r327
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 80392bcf1..3a75f29ea 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -62,11 +62,12 @@
#define CONN_TYPE_AP 7
#define CONN_TYPE_DIR_LISTENER 8
#define CONN_TYPE_DIR 9
-#define CONN_TYPE_DNSMASTER 10
+#define CONN_TYPE_DNSWORKER 10
#define LISTENER_STATE_READY 0
-#define DNSMASTER_STATE_OPEN 0
+#define DNSWORKER_STATE_IDLE 0
+#define DNSWORKER_STATE_BUSY 1
/* how to read these states:
* foo_CONN_STATE_bar_baz:
@@ -83,7 +84,7 @@
#define OR_CONN_STATE_SERVER_NONCE_WAIT 8 /* waiting for confirmation of nonce */
#define OR_CONN_STATE_OPEN 9 /* ready to send/receive cells. */
-#define EXIT_CONN_STATE_RESOLVING 0 /* waiting for response from dnsmaster */
+#define EXIT_CONN_STATE_RESOLVING 0 /* waiting for response from dns farm */
#define EXIT_CONN_STATE_CONNECTING 1 /* waiting for connect() to finish */
#define EXIT_CONN_STATE_OPEN 2
#if 0
@@ -267,6 +268,9 @@ struct connection_t {
/* Used while negotiating OR/OR connections */
char nonce[8];
+
+/* Used by worker connections */
+ int num_processed;
};
@@ -646,7 +650,7 @@ int connection_dir_handle_listener_read(connection_t *conn);
int connection_dns_finished_flushing(connection_t *conn);
int connection_dns_process_inbuf(connection_t *conn);
-void init_cache_tree(void);
+void dns_init(void);
int dns_resolve(connection_t *exitconn);
int dns_master_start(void);
@@ -664,6 +668,7 @@ connection_t *connection_twin_get_by_addr_port(uint32_t addr, uint16_t port);
connection_t *connection_exact_get_by_addr_port(uint32_t addr, uint16_t port);
connection_t *connection_get_by_type(int type);
+connection_t *connection_get_by_type_state(int type, int state);
void connection_watch_events(connection_t *conn, short events);
void connection_stop_reading(connection_t *conn);