diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-11-11 23:09:42 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-11-11 23:09:42 -0500 |
commit | ae5cdb8fa74b53c9777ee0e5ae797df5bf1951e4 (patch) | |
tree | fba7c377339620b4679ffa12fa89e876705e6b54 /src/or/circuitbuild.c | |
parent | 67e7dbca80de8850d5db06278532ed60cf52058a (diff) | |
parent | 2c51cd2b109fce903aeef2e9d405013f12875bf8 (diff) | |
download | tor-ae5cdb8fa74b53c9777ee0e5ae797df5bf1951e4.tar.gz tor-ae5cdb8fa74b53c9777ee0e5ae797df5bf1951e4.zip |
Merge remote branch 'public/refactor_pports'
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 20a7a0d074..1741548130 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2419,24 +2419,12 @@ new_route_len(uint8_t purpose, extend_info_t *exit, return routelen; } -/** Fetch the list of predicted ports, dup it into a smartlist of - * uint16_t's, remove the ones that are already handled by an - * existing circuit, and return it. - */ +/** Return a newly allocated list of uint16_t * for each predicted port not + * handled by a current circuit. */ static smartlist_t * circuit_get_unhandled_ports(time_t now) { - smartlist_t *source = rep_hist_get_predicted_ports(now); - smartlist_t *dest = smartlist_create(); - uint16_t *tmp; - int i; - - for (i = 0; i < smartlist_len(source); ++i) { - tmp = tor_malloc(sizeof(uint16_t)); - memcpy(tmp, smartlist_get(source, i), sizeof(uint16_t)); - smartlist_add(dest, tmp); - } - + smartlist_t *dest = rep_hist_get_predicted_ports(now); circuit_remove_handled_ports(dest); return dest; } |