diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-10-10 22:31:06 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-10-10 22:31:06 -0400 |
commit | 7ea904cbc0acbe1575ff68700572da76e4e4b10d (patch) | |
tree | e893c6fd57794cc9b9cacdb414292edd2aa8cb16 /src/or/statefile.c | |
parent | 8b36d4cc2ab95acd4c2c7203afb29a051a38c5c9 (diff) | |
parent | e6d1ab3600c6bbbda7f30093fb7623581a44a325 (diff) | |
download | tor-7ea904cbc0acbe1575ff68700572da76e4e4b10d.tar.gz tor-7ea904cbc0acbe1575ff68700572da76e4e4b10d.zip |
Merge branch 'bug7011'
Conflicts:
src/or/circuitbuild.c
The conflict was trivial, since no line of code actually changed in
both branches: There was a fmt_addr() that turned into fmt_addrport()
in bug7011, and a "if (!n_conn)" that turned into "if (!n_chan)" in
master.
Diffstat (limited to 'src/or/statefile.c')
-rw-r--r-- | src/or/statefile.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/or/statefile.c b/src/or/statefile.c index 499572a071..001c4c3c4b 100644 --- a/src/or/statefile.c +++ b/src/or/statefile.c @@ -553,7 +553,7 @@ save_transport_to_state(const char *transport, if (transport_line) { /* if transport already exists in state... */ const char *prev_bindaddr = /* get its addrport... */ get_transport_bindaddr(transport_line->value, transport); - tor_asprintf(&transport_addrport, "%s:%d", fmt_addr(addr), (int)port); + transport_addrport = tor_strdup(fmt_addrport(addr, port)); /* if transport in state has the same address as this one, life is good */ if (!strcmp(prev_bindaddr, transport_addrport)) { @@ -565,9 +565,9 @@ save_transport_to_state(const char *transport, "address:port. Let's update the state file with the new " "address:port"); tor_free(transport_line->value); /* free the old line */ - tor_asprintf(&transport_line->value, "%s %s:%d", transport, - fmt_addr(addr), - (int) port); /* replace old addrport line with new line */ + /* replace old addrport line with new line */ + tor_asprintf(&transport_line->value, "%s %s", transport, + fmt_addrport(addr, port)); } } else { /* never seen this one before; save it in state for next time */ log_info(LD_CONFIG, "It's the first time we see this transport. " @@ -584,8 +584,7 @@ save_transport_to_state(const char *transport, /* allocate space for the new line and fill it in */ *next = line = tor_malloc_zero(sizeof(config_line_t)); line->key = tor_strdup("TransportProxy"); - tor_asprintf(&line->value, "%s %s:%d", transport, - fmt_addr(addr), (int) port); + tor_asprintf(&line->value, "%s %s", transport, fmt_addrport(addr, port)); next = &(line->next); } |