diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-07-02 23:32:17 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-07-02 23:32:17 -0400 |
commit | c0de533c56a02c5557236c5baac6b9d57133467f (patch) | |
tree | 8ee7f4f7b310c8375f01e6ab1181e823d899a2b0 /src/or | |
parent | ded6bbf70a3b63bb423b241c66684becefb1cff7 (diff) | |
download | tor-c0de533c56a02c5557236c5baac6b9d57133467f.tar.gz tor-c0de533c56a02c5557236c5baac6b9d57133467f.zip |
Simplify parse_client_transport_line
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/config.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/or/config.c b/src/or/config.c index e172f7310a..a94abb0501 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -4680,10 +4680,8 @@ parse_client_transport_line(const char *line, int validate_only) } name = smartlist_get(items, 0); - smartlist_del_keeporder(items, 0); - socks_ver_str = smartlist_get(items, 0); - smartlist_del_keeporder(items, 0); + socks_ver_str = smartlist_get(items, 1); if (!strcmp(socks_ver_str,"socks4")) socks_ver = PROXY_SOCKS4; @@ -4695,8 +4693,7 @@ parse_client_transport_line(const char *line, int validate_only) goto err; } - addrport = smartlist_get(items, 0); - smartlist_del_keeporder(items, 0); + addrport = smartlist_get(items, 2); if (tor_addr_port_parse(addrport, &addr, &port)<0) { log_warn(LD_CONFIG, "Error parsing transport " @@ -4714,8 +4711,7 @@ parse_client_transport_line(const char *line, int validate_only) log_debug(LD_DIR, "Transport %s found at %s:%d", name, fmt_addr(&addr), (int)port); - if (transport_add_from_config(&addr, port, name, - socks_ver) < 0) + if (transport_add_from_config(&addr, port, name, socks_ver) < 0) goto err; } @@ -4728,9 +4724,6 @@ parse_client_transport_line(const char *line, int validate_only) done: SMARTLIST_FOREACH(items, char*, s, tor_free(s)); smartlist_free(items); - tor_free(socks_ver_str); - tor_free(name); - tor_free(addrport); return r; } |