summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-12-07 15:29:54 +0000
committerRoger Dingledine <arma@torproject.org>2004-12-07 15:29:54 +0000
commit802d374a99cae37ec33a098e4df79cd9165e624e (patch)
tree46a58925649c55096ac1911a5e64184570ba61e8 /src/or/circuituse.c
parenta2d80ec767b68482e6ed98fefc3162e8ab1fdb93 (diff)
downloadtor-802d374a99cae37ec33a098e4df79cd9165e624e.tar.gz
tor-802d374a99cae37ec33a098e4df79cd9165e624e.zip
I'm a bad person.
Stop treating the uint16_t's as null-terminated strings, and stop looking at the byte after them to see if it's null, because sometimes you're not allowed to look there. svn:r3108
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 5ca699388a..775af1d960 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -255,19 +255,17 @@ void circuit_expire_building(time_t now) {
void
circuit_remove_handled_ports(smartlist_t *needed_ports) {
int i;
- uint16_t port;
- char *portstring;
+ uint16_t *port;
for (i = 0; i < smartlist_len(needed_ports); ++i) {
- portstring = smartlist_get(needed_ports, i);
- port = *(uint16_t*)(portstring);
- tor_assert(port);
- if (circuit_stream_is_being_handled(NULL, port, 2)) {
+ port = smartlist_get(needed_ports, i);
+ tor_assert(*port);
+ if (circuit_stream_is_being_handled(NULL, *port, 2)) {
// log_fn(LOG_DEBUG,"Port %d is already being handled; removing.", port);
smartlist_del(needed_ports, i--);
- tor_free(portstring);
+ tor_free(port);
} else {
- log_fn(LOG_DEBUG,"Port %d is not handled.", port);
+ log_fn(LOG_DEBUG,"Port %d is not handled.", *port);
}
}
}