From fcf817f8976fb4ae2a255d54d1fc1eb1b11fdbfb Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 15 Aug 2008 13:55:01 +0000 Subject: Switch global_identifier on connections to a 64-bit field and move it to connection_t. When procession onionskins, look up the connection by this field rather than by addr:port. This will keep us from dropping onionskins. How many dropped circuits are dropped because of this bug? svn:r16558 --- src/or/or.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/or/or.h') diff --git a/src/or/or.h b/src/or/or.h index ceecd9296b..80bcd1b745 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -904,6 +904,9 @@ typedef struct connection_t { /** Another connection that's connected to this one in lieu of a socket. */ struct connection_t *linked_conn; + /** Unique identifier for this connection. */ + uint64_t global_identifier; + /* XXXX021 move this into a subtype. */ struct evdns_server_port *dns_server_port; @@ -1014,10 +1017,6 @@ typedef struct edge_connection_t { /** The reason why this connection is closing; passed to the controller. */ uint16_t end_reason; - /** Quasi-global identifier for this connection; used for control.c */ - /* XXXX NM This can get re-used after 2**32 streams */ - uint32_t global_identifier; - /** Bytes read since last call to control_event_stream_bandwidth_used() */ uint32_t n_read; @@ -2858,9 +2857,7 @@ connection_write_to_buf_zlib(const char *string, size_t len, _connection_write_to_buf_impl(string, len, TO_CONN(conn), done ? -1 : 1); } -or_connection_t *connection_or_exact_get_by_addr_port(uint32_t addr, - uint16_t port); -edge_connection_t *connection_get_by_global_id(uint32_t id); +connection_t *connection_get_by_global_id(uint64_t id); connection_t *connection_get_by_type(int type); connection_t *connection_get_by_type_purpose(int type, int purpose); -- cgit v1.2.3-54-g00ecf