diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-08-05 20:08:19 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-08-05 20:08:19 +0000 |
commit | 960a0f0a994ba23480e14ffe5179160194fd9616 (patch) | |
tree | 250494775699fda2f0f543a350b02e89c5a77a03 /src/or/cpuworker.c | |
parent | 750bb795ac1fcb5b76b6488690400c77fbff0a3f (diff) | |
download | tor-960a0f0a994ba23480e14ffe5179160194fd9616.tar.gz tor-960a0f0a994ba23480e14ffe5179160194fd9616.zip |
r17641@31-33-44: nickm | 2008-08-05 16:07:53 -0400
Initial conversion of uint32_t addr to tor_addr_t addr in connection_t and related types. Most of the Tor wire formats using these new types are in, but the code to generate and use it is not. This is a big patch. Let me know what it breaks for you.
svn:r16435
Diffstat (limited to 'src/or/cpuworker.c')
-rw-r--r-- | src/or/cpuworker.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index e56d2787f3..77e15c748e 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -63,9 +63,10 @@ connection_cpu_finished_flushing(connection_t *conn) /** Pack addr,port,and circ_id; set *tag to the result. (See note on * cpuworker_main for wire format.) */ static void -tag_pack(char *tag, uint32_t addr, uint16_t port, circid_t circ_id) +tag_pack(char *tag, const tor_addr_t *addr, uint16_t port, circid_t circ_id) { - *(uint32_t *)tag = addr; + /*XXXX RETHINK THIS WHOLE MESS !!!! !NM NM NM NM*/ + *(uint32_t *)tag = tor_addr_to_ipv4h(addr); *(uint16_t *)(tag+4) = port; *(uint16_t *)(tag+6) = circ_id; } @@ -161,6 +162,8 @@ connection_cpu_process_inbuf(connection_t *conn) /* (Here we use connection_or_exact_get_by_addr_port rather than * get_by_identity_digest: we want a specific port here in * case there are multiple connections.) */ + /* XXXX021 This is dumb. We don't want just any connection with a matching + * IP and port: we want the exact one that sent us this CREATE cell. */ p_conn = connection_or_exact_get_by_addr_port(addr,port); if (p_conn) circ = circuit_get_by_circid_orconn(circ_id, p_conn); @@ -468,7 +471,7 @@ assign_onionskin_to_cpuworker(connection_t *cpuworker, tor_free(onionskin); return -1; } - tag_pack(tag, circ->p_conn->_base.addr, circ->p_conn->_base.port, + tag_pack(tag, &circ->p_conn->_base.addr, circ->p_conn->_base.port, circ->p_circ_id); cpuworker->state = CPUWORKER_STATE_BUSY_ONION; |