tor-commits
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 1 participants
- 216171 discussions
commit 8b4195f0217d24bae6dfac944b469dc05b30bcd6
Author: Benjamin Kerensa <bkerensa(a)ubuntu.com>
Date: Sun Mar 10 18:45:23 2013 -0700
Fix typos in a few log messages
---
src/or/routerset.c | 2 +-
src/or/transports.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/or/routerset.c b/src/or/routerset.c
index 1eca5b6..2e41f7f 100644
--- a/src/or/routerset.c
+++ b/src/or/routerset.c
@@ -141,7 +141,7 @@ routerset_parse(routerset_t *target, const char *s, const char *description)
log_debug(LD_CONFIG, "Adding address %s to %s", nick, description);
smartlist_add(target->policies, p);
} else {
- log_warn(LD_CONFIG, "Entry '%s' in %s is misformed.", nick,
+ log_warn(LD_CONFIG, "Entry '%s' in %s is malformed.", nick,
description);
r = -1;
tor_free(nick);
diff --git a/src/or/transports.c b/src/or/transports.c
index 647b293..945d422 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -339,12 +339,12 @@ transport_add_from_config(const tor_addr_t *addr, uint16_t port,
transport_free(t);
return -1;
case 1:
- log_info(LD_GENERAL, "Succesfully registered transport %s at %s.",
+ log_info(LD_GENERAL, "Successfully registered transport %s at %s.",
t->name, fmt_addrport(&t->addr, t->port));
transport_free(t); /* falling */
return 0;
case 0:
- log_info(LD_GENERAL, "Succesfully registered transport %s at %s.",
+ log_info(LD_GENERAL, "Successfully registered transport %s at %s.",
t->name, fmt_addrport(&t->addr, t->port));
return 0;
}
@@ -676,10 +676,10 @@ register_client_proxy(const managed_proxy_t *mp)
transport_free(transport_tmp);
break;
case 0:
- log_info(LD_GENERAL, "Succesfully registered transport %s", t->name);
+ log_info(LD_GENERAL, "Successfully registered transport %s", t->name);
break;
case 1:
- log_info(LD_GENERAL, "Succesfully registered transport %s", t->name);
+ log_info(LD_GENERAL, "Successfully registered transport %s", t->name);
transport_free(transport_tmp);
break;
}
1
0
commit ecc5f7bcd7d9669521e3b3b9275b18dff98c4270
Author: Damian Johnson <atagar(a)torproject.org>
Date: Sun Mar 10 11:28:58 2013 -0700
'To Russia With Love' tutorial
Soviet themed tutorial for programmatically starting tor and reading a site
through it. I've been wanting to write this for quite a long time...
https://trac.torproject.org/7505
---
.../label/resources/to_russia_with_love.xcf | Bin 0 -> 5699 bytes
docs/_static/label/to_russia_with_love.png | Bin 0 -> 2924 bytes
docs/_static/locale_selection_output.png | Bin 0 -> 37229 bytes
docs/_static/section/tutorial/soviet.png | Bin 0 -> 4679 bytes
docs/contents.rst | 1 +
docs/tutorial.rst | 16 +++++
docs/tutorial/to_russia_with_love.rst | 70 ++++++++++++++++++++
7 files changed, 87 insertions(+), 0 deletions(-)
diff --git a/docs/_static/label/resources/to_russia_with_love.xcf b/docs/_static/label/resources/to_russia_with_love.xcf
new file mode 100644
index 0000000..1fa449e
Binary files /dev/null and b/docs/_static/label/resources/to_russia_with_love.xcf differ
diff --git a/docs/_static/label/to_russia_with_love.png b/docs/_static/label/to_russia_with_love.png
new file mode 100644
index 0000000..9a2d1c6
Binary files /dev/null and b/docs/_static/label/to_russia_with_love.png differ
diff --git a/docs/_static/locale_selection_output.png b/docs/_static/locale_selection_output.png
new file mode 100644
index 0000000..2afbaa7
Binary files /dev/null and b/docs/_static/locale_selection_output.png differ
diff --git a/docs/_static/section/tutorial/soviet.png b/docs/_static/section/tutorial/soviet.png
new file mode 100644
index 0000000..c54c3d8
Binary files /dev/null and b/docs/_static/section/tutorial/soviet.png differ
diff --git a/docs/contents.rst b/docs/contents.rst
index fbf2495..d2fee6a 100644
--- a/docs/contents.rst
+++ b/docs/contents.rst
@@ -6,6 +6,7 @@ Contents
tutorial
tutorial/the_little_relay_that_could
+ tutorial/to_russia_with_love
tutorial/mirror_mirror_on_the_wall
download
diff --git a/docs/tutorial.rst b/docs/tutorial.rst
index 68572fd..967682b 100644
--- a/docs/tutorial.rst
+++ b/docs/tutorial.rst
@@ -9,6 +9,12 @@ Tutorial
License: Public Domain
Alternate: https://openclipart.org/detail/1128/train-roadsign-by-ryanlerch
+ * To Russia With Love - soviet.png
+ Source: https://openclipart.org/detail/146017/flag-of-the-soviet-union-by-marxist-l…
+ Author: Unknown
+ License: Public Domain (not a subject of copyright according the Russian civil code)
+ Alternate: https://openclipart.org/detail/85555/communist-sabbatarian-ribbon-by-rones-…
+
* Mirror Mirror On The Wall - mirror.png
Source: https://openclipart.org/detail/152155/mirror-frame-by-gsagri04
Author: Unknown (gsagri04?)
@@ -31,6 +37,16 @@ feet wet by jumping straight in with some tutorials...
"Hello World" for talking with Tor. This will step you through
configuring Tor and writing your first script to talk with it.
+ * - .. image:: /_static/section/tutorial/soviet.png
+ :target: tutorial/to_russia_with_love.html
+
+ - .. image:: /_static/label/to_russia_with_love.png
+ :target: tutorial/to_russia_with_love.html
+
+ Rather than talking to Tor, we'll now talk **through** it. In this
+ tutorial we'll programmatically start Tor then use it to read a site
+ through mother Russia!
+
* - .. image:: /_static/section/tutorial/mirror.png
:target: tutorial/mirror_mirror_on_the_wall.html
diff --git a/docs/tutorial/to_russia_with_love.rst b/docs/tutorial/to_russia_with_love.rst
new file mode 100644
index 0000000..7fb7c66
--- /dev/null
+++ b/docs/tutorial/to_russia_with_love.rst
@@ -0,0 +1,70 @@
+To Russia With Love
+===================
+
+Say it's 1982, the height of the Cold War, and you're a journalist doing a piece on how the Internet looks from behind the Iron Curtain. Ignoring the minor detail that the Internet doesn't yet exist, we'll walk you through how you could do it - no passport required!
+
+The Internet isn't uniform. Localization, censorship, and selective service based on your IP's geographic location can make the Internet a very different place depending on where you're coming from.
+
+Tor relays are scattered all over the world and, as such, you can pretend to be from any place running an exit. This can be especially useful to evade pesky geolocational restrictions, such as news sites that refuse to work while you're traveling abroad.
+
+Tor makes `configuring your exit locale <https://www.torproject.org/docs/faq.html.en#ChooseEntryExit>`_ easy through the **ExitNodes** torrc option. Note that you don't need a control port (or even stem) to do this, though they can be useful if you later want to do something more elaborate.
+
+In the following example we're using stem to `start Tor <../api/process.html>`_, then reading a site through it with `PycURL <http://pycurl.sourceforge.net/>`_. This is not always reliable (some relays are lemons) so you may need to run this more than once.
+
+**Do not rely on the following not to leak.** Though it seems to work, DNS resolution and other edge cases might expose your real IP. If you have a suggestion for how to improve this example then please `let me know <http://www.atagar.com/contact/>`_!
+
+::
+
+ import StringIO
+
+ import pycurl
+ import stem.process
+
+ from stem.util import term
+
+ SOCKS_PORT = 7000
+
+ def curl(url):
+ """
+ Uses pycurl to fetch a site using the proxy on the SOCKS_PORT.
+ """
+
+ output = StringIO.StringIO()
+
+ query = pycurl.Curl()
+ query.setopt(pycurl.URL, url)
+ query.setopt(pycurl.PROXY, 'localhost')
+ query.setopt(pycurl.PROXYPORT, SOCKS_PORT)
+ query.setopt(pycurl.PROXYTYPE, pycurl.PROXYTYPE_SOCKS5)
+ query.setopt(pycurl.WRITEFUNCTION, output.write)
+
+ try:
+ query.perform()
+ return output.getvalue()
+ except pycurl.error, exc:
+ return "Unable to reach %s (%s)" % (url, exc)
+
+ # Start an instance of tor configured to only exit through Russia. This prints
+ # tor's bootstrap information as it starts.
+
+ def print_bootstrap_lines(line):
+ if "Bootstrapped " in line:
+ print term.format(line, term.Color.BLUE)
+
+ print term.format("Starting Tor:\n", term.Attr.BOLD)
+
+ tor_process = stem.process.launch_tor_with_config(
+ config = {
+ 'SocksPort': str(SOCKS_PORT),
+ 'ExitNodes': '{ru}',
+ },
+ init_msg_handler = print_bootstrap_lines,
+ )
+
+ print term.format("\nChecking our endpoint:\n", term.Attr.BOLD)
+ print term.format(curl("http://www.atagar.com/echo.php"), term.Color.BLUE)
+
+ tor_process.kill() # stops tor
+
+.. image:: /_static/locale_selection_output.png
+
1
0
commit 99dbc604fb6781163d2cdf5262b759cbdc62c71a
Author: Damian Johnson <atagar(a)torproject.org>
Date: Sun Mar 10 17:41:58 2013 -0700
Making stem.util.term public
Now that we're using it for a tutorial we should vend this module. I'm a little
unsure about the name of the format() function since there's a builtin by that
name, but I'm having a hard time thinking of something better.
---
docs/api.rst | 1 +
stem/util/term.py | 3 ---
2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/docs/api.rst b/docs/api.rst
index 82dba0c..92eb200 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -44,4 +44,5 @@ Utilities
* `stem.util.enum <api/util/enum.html>`_ - Enumeration class.
* `stem.util.str_tools <api/util/str_tools.html>`_ - String utilities.
* `stem.util.system <api/util/system.html>`_ - Tools related to the local system.
+* `stem.util.term <api/util/term.html>`_ - Tools for interacting with the terminal.
diff --git a/stem/util/term.py b/stem/util/term.py
index 05efcfe..61ba15e 100644
--- a/stem/util/term.py
+++ b/stem/util/term.py
@@ -4,9 +4,6 @@
"""
Utilities for working with the terminal.
-**These functions are not being vended to stem users. They may change in the
-future, use them at your own risk.**
-
**Module Overview:**
::
1
0
10 Mar '13
commit 301faf281391698e44eb3a8d400b477716a74fd4
Merge: 74c3394 339df5d
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sun Mar 10 19:52:43 2013 -0400
Merge branch 'bug8447_squashed' into maint-0.2.4
src/or/channel.c | 8 +++---
src/or/circuitbuild.c | 2 +-
src/or/circuitlist.c | 30 +++++++++++-----------
src/or/circuitmux.c | 22 ++++++++--------
src/or/circuituse.c | 61 ++++++++++++++++++++++++----------------------
src/or/command.c | 34 +++++++++++++------------
src/or/connection_edge.c | 12 ++++----
src/or/connection_or.c | 1 -
src/or/cpuworker.c | 5 +--
src/or/rendclient.c | 12 ++++----
src/or/rendmid.c | 58 ++++++++++++++++++++++----------------------
src/or/rendservice.c | 54 ++++++++++++++++++++++------------------
12 files changed, 154 insertions(+), 145 deletions(-)
1
0
commit 339df5df085e2115c01881cf628abe5ed3fbd456
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sun Mar 10 08:32:58 2013 -0400
Fix 8447: use %u to format circid_t.
Now that circid_t is 4 bytes long, the default integer promotions will
leave it alone when sizeof(int) == 4, which will leave us formatting an
unsigned as an int. That's technically undefined behavior.
Fixes bug 8447 on bfffc1f0fc7616a25c32da2eb759dade4651659e. Bug not
in any released Tor.
---
src/or/channel.c | 8 +++---
src/or/circuitbuild.c | 2 +-
src/or/circuitlist.c | 30 +++++++++++-----------
src/or/circuitmux.c | 22 ++++++++--------
src/or/circuituse.c | 61 ++++++++++++++++++++++++----------------------
src/or/command.c | 34 +++++++++++++------------
src/or/connection_edge.c | 12 ++++----
src/or/connection_or.c | 1 -
src/or/cpuworker.c | 5 +--
src/or/rendclient.c | 12 ++++----
src/or/rendmid.c | 58 ++++++++++++++++++++++----------------------
src/or/rendservice.c | 54 ++++++++++++++++++++++------------------
12 files changed, 154 insertions(+), 145 deletions(-)
diff --git a/src/or/channel.c b/src/or/channel.c
index f8afc40..82db061 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -2607,17 +2607,17 @@ channel_send_destroy(circid_t circ_id, channel_t *chan, int reason)
cell.command = CELL_DESTROY;
cell.payload[0] = (uint8_t) reason;
log_debug(LD_OR,
- "Sending destroy (circID %d) on channel %p "
+ "Sending destroy (circID %u) on channel %p "
"(global ID " U64_FORMAT ")",
- circ_id, chan,
+ (unsigned)circ_id, chan,
U64_PRINTF_ARG(chan->global_identifier));
channel_write_cell(chan, &cell);
} else {
log_warn(LD_BUG,
- "Someone called channel_send_destroy() for circID %d "
+ "Someone called channel_send_destroy() for circID %u "
"on a channel " U64_FORMAT " at %p in state %s (%d)",
- circ_id, U64_PRINTF_ARG(chan->global_identifier),
+ (unsigned)circ_id, U64_PRINTF_ARG(chan->global_identifier),
chan, channel_state_to_string(chan->state),
chan->state);
}
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 8a3a36a..fbe94a9 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -523,7 +523,7 @@ circuit_deliver_create_cell(circuit_t *circ, const create_cell_t *create_cell,
log_warn(LD_CIRC,"failed to get unique circID.");
return -1;
}
- log_debug(LD_CIRC,"Chosen circID %u.", id);
+ log_debug(LD_CIRC,"Chosen circID %u.", (unsigned)id);
circuit_set_n_circid_chan(circ, id, circ->n_chan);
memset(&cell, 0, sizeof(cell_t));
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index ef32680..17e18c7 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -780,13 +780,13 @@ circuit_dump_conn_details(int severity,
circuit_t *circ,
int conn_array_index,
const char *type,
- int this_circid,
- int other_circid)
+ circid_t this_circid,
+ circid_t other_circid)
{
- tor_log(severity, LD_CIRC, "Conn %d has %s circuit: circID %d "
- "(other side %d), state %d (%s), born %ld:",
- conn_array_index, type, this_circid, other_circid, circ->state,
- circuit_state_to_string(circ->state),
+ tor_log(severity, LD_CIRC, "Conn %d has %s circuit: circID %u "
+ "(other side %u), state %d (%s), born %ld:",
+ conn_array_index, type, (unsigned)this_circid, (unsigned)other_circid,
+ circ->state, circuit_state_to_string(circ->state),
(long)circ->timestamp_began.tv_sec);
if (CIRCUIT_IS_ORIGIN(circ)) { /* circ starts at this node */
circuit_log_path(severity, LD_CIRC, TO_ORIGIN_CIRCUIT(circ));
@@ -843,12 +843,12 @@ circuit_dump_chan_details(int severity,
circuit_t *circ,
channel_t *chan,
const char *type,
- int this_circid,
- int other_circid)
+ circid_t this_circid,
+ circid_t other_circid)
{
- tor_log(severity, LD_CIRC, "Conn %p has %s circuit: circID %d "
- "(other side %d), state %d (%s), born %ld:",
- chan, type, this_circid, other_circid, circ->state,
+ tor_log(severity, LD_CIRC, "Conn %p has %s circuit: circID %u "
+ "(other side %u), state %d (%s), born %ld:",
+ chan, type, (unsigned)this_circid, (unsigned)other_circid, circ->state,
circuit_state_to_string(circ->state),
(long)circ->timestamp_began.tv_sec);
if (CIRCUIT_IS_ORIGIN(circ)) { /* circ starts at this node */
@@ -943,16 +943,16 @@ circuit_get_by_circid_channel_impl(circid_t circ_id, channel_t *chan)
if (found && found->circuit) {
log_debug(LD_CIRC,
"circuit_get_by_circid_channel_impl() returning circuit %p for"
- " circ_id %d, channel ID " U64_FORMAT " (%p)",
- found->circuit, circ_id,
+ " circ_id %u, channel ID " U64_FORMAT " (%p)",
+ found->circuit, (unsigned)circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan);
return found->circuit;
}
log_debug(LD_CIRC,
"circuit_get_by_circid_channel_impl() found nothing for"
- " circ_id %d, channel ID " U64_FORMAT " (%p)",
- circ_id,
+ " circ_id %u, channel ID " U64_FORMAT " (%p)",
+ (unsigned)circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan);
return NULL;
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index dcc1901..545cfd0 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -425,9 +425,9 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
} else {
/* Complain and move on */
log_warn(LD_CIRC,
- "Circuit %d/channel " U64_FORMAT " had direction == "
+ "Circuit %u/channel " U64_FORMAT " had direction == "
"CELL_DIRECTION_IN, but isn't an or_circuit_t",
- to_remove->circ_id,
+ (unsigned)to_remove->circ_id,
U64_PRINTF_ARG(to_remove->chan_id));
}
@@ -449,16 +449,16 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
} else {
/* Complain and move on */
log_warn(LD_CIRC,
- "Couldn't find circuit %d (for channel " U64_FORMAT ")",
- to_remove->circ_id,
+ "Couldn't find circuit %u (for channel " U64_FORMAT ")",
+ (unsigned)to_remove->circ_id,
U64_PRINTF_ARG(to_remove->chan_id));
}
} else {
/* Complain and move on */
log_warn(LD_CIRC,
- "Couldn't find channel " U64_FORMAT " (for circuit id %d)",
+ "Couldn't find channel " U64_FORMAT " (for circuit id %u)",
U64_PRINTF_ARG(to_remove->chan_id),
- to_remove->circ_id);
+ (unsigned)to_remove->circ_id);
}
/* Assert that we don't have un-freed policy data for this circuit */
@@ -905,7 +905,7 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t *circ,
log_info(LD_CIRC,
"Circuit %u on channel " U64_FORMAT " was already attached to "
"cmux %p (trying to attach to %p)",
- circ_id, U64_PRINTF_ARG(channel_id),
+ (unsigned)circ_id, U64_PRINTF_ARG(channel_id),
((direction == CELL_DIRECTION_OUT) ?
circ->n_mux : TO_OR_CIRCUIT(circ)->p_mux),
cmux);
@@ -938,7 +938,7 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t *circ,
*/
log_debug(LD_CIRC,
"Attaching circuit %u on channel " U64_FORMAT " to cmux %p",
- circ_id, U64_PRINTF_ARG(channel_id), cmux);
+ (unsigned)circ_id, U64_PRINTF_ARG(channel_id), cmux);
/*
* Assert that the circuit doesn't already have a mux for this
@@ -1138,8 +1138,8 @@ circuitmux_make_circuit_active(circuitmux_t *cmux, circuit_t *circ,
/* If we're already active, log a warning and finish */
if (already_active) {
log_warn(LD_CIRC,
- "Circuit %d on channel " U64_FORMAT " was already active",
- circ_id, U64_PRINTF_ARG(chan->global_identifier));
+ "Circuit %u on channel " U64_FORMAT " was already active",
+ (unsigned)circ_id, U64_PRINTF_ARG(chan->global_identifier));
return;
}
@@ -1236,7 +1236,7 @@ circuitmux_make_circuit_inactive(circuitmux_t *cmux, circuit_t *circ,
if (already_inactive) {
log_warn(LD_CIRC,
"Circuit %d on channel " U64_FORMAT " was already inactive",
- circ_id, U64_PRINTF_ARG(chan->global_identifier));
+ (unsigned)circ_id, U64_PRINTF_ARG(chan->global_identifier));
return;
}
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index c061203..51d8716 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -695,9 +695,9 @@ circuit_expire_building(void)
case CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT:
case CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED:
/* If we have reached this line, we want to spare the circ for now. */
- log_info(LD_CIRC,"Marking circ %d (state %d:%s, purpose %d) "
+ log_info(LD_CIRC,"Marking circ %u (state %d:%s, purpose %d) "
"as timed-out HS circ",
- victim->n_circ_id,
+ (unsigned)victim->n_circ_id,
victim->state, circuit_state_to_string(victim->state),
victim->purpose);
TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out = 1;
@@ -713,9 +713,9 @@ circuit_expire_building(void)
if (!(options->CloseHSServiceRendCircuitsImmediatelyOnTimeout) &&
!(TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out) &&
victim->purpose == CIRCUIT_PURPOSE_S_CONNECT_REND) {
- log_info(LD_CIRC,"Marking circ %d (state %d:%s, purpose %d) "
+ log_info(LD_CIRC,"Marking circ %u (state %d:%s, purpose %d) "
"as timed-out HS circ; relaunching rendezvous attempt.",
- victim->n_circ_id,
+ (unsigned)victim->n_circ_id,
victim->state, circuit_state_to_string(victim->state),
victim->purpose);
TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out = 1;
@@ -728,7 +728,7 @@ circuit_expire_building(void)
"Abandoning circ %u %s:%d (state %d,%d:%s, purpose %d, "
"len %d)", TO_ORIGIN_CIRCUIT(victim)->global_identifier,
channel_get_canonical_remote_descr(victim->n_chan),
- victim->n_circ_id,
+ (unsigned)victim->n_circ_id,
TO_ORIGIN_CIRCUIT(victim)->has_opened,
victim->state, circuit_state_to_string(victim->state),
victim->purpose,
@@ -737,7 +737,8 @@ circuit_expire_building(void)
log_info(LD_CIRC,
"Abandoning circ %u %d (state %d,%d:%s, purpose %d, len %d)",
TO_ORIGIN_CIRCUIT(victim)->global_identifier,
- victim->n_circ_id, TO_ORIGIN_CIRCUIT(victim)->has_opened,
+ (unsigned)victim->n_circ_id,
+ TO_ORIGIN_CIRCUIT(victim)->has_opened,
victim->state,
circuit_state_to_string(victim->state), victim->purpose,
TO_ORIGIN_CIRCUIT(victim)->build_state->desired_path_len);
@@ -1070,9 +1071,10 @@ circuit_expire_old_circuits_clientside(void)
circ->timestamp_dirty + get_options()->MaxCircuitDirtiness <
now.tv_sec &&
!TO_ORIGIN_CIRCUIT(circ)->p_streams /* nothing attached */ ) {
- log_debug(LD_CIRC, "Closing n_circ_id %d (dirty %ld sec ago, "
+ log_debug(LD_CIRC, "Closing n_circ_id %u (dirty %ld sec ago, "
"purpose %d)",
- circ->n_circ_id, (long)(now.tv_sec - circ->timestamp_dirty),
+ (unsigned)circ->n_circ_id,
+ (long)(now.tv_sec - circ->timestamp_dirty),
circ->purpose);
/* Don't do this magic for testing circuits. Their death is governed
* by circuit_expire_building */
@@ -1153,8 +1155,8 @@ circuit_expire_old_circuits_serverside(time_t now)
!or_circ->n_streams && !or_circ->resolving_streams &&
or_circ->p_chan &&
channel_when_last_xmit(or_circ->p_chan) <= cutoff) {
- log_info(LD_CIRC, "Closing circ_id %d (empty %d secs ago)",
- or_circ->p_circ_id,
+ log_info(LD_CIRC, "Closing circ_id %u (empty %d secs ago)",
+ (unsigned)or_circ->p_circ_id,
(int)(now - channel_when_last_xmit(or_circ->p_chan)));
circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED);
}
@@ -1896,8 +1898,8 @@ link_apconn_to_circ(entry_connection_t *apconn, origin_circuit_t *circ,
const node_t *exitnode;
/* add it into the linked list of streams on this circuit */
- log_debug(LD_APP|LD_CIRC, "attaching new conn to circ. n_circ_id %d.",
- circ->base_.n_circ_id);
+ log_debug(LD_APP|LD_CIRC, "attaching new conn to circ. n_circ_id %u.",
+ (unsigned)circ->base_.n_circ_id);
/* reset it, so we can measure circ timeouts */
ENTRY_TO_CONN(apconn)->timestamp_lastread = time(NULL);
ENTRY_TO_EDGE_CONN(apconn)->next_stream = circ->p_streams;
@@ -2121,8 +2123,8 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
return retval;
log_debug(LD_APP|LD_CIRC,
- "Attaching apconn to circ %d (stream %d sec old).",
- circ->base_.n_circ_id, conn_age);
+ "Attaching apconn to circ %u (stream %d sec old).",
+ (unsigned)circ->base_.n_circ_id, conn_age);
/* print the circ's path, so people can figure out which circs are
* sucking. */
circuit_log_path(LOG_INFO,LD_APP|LD_CIRC,circ);
@@ -2147,7 +2149,7 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
log_info(LD_REND,
"rend joined circ %d already here. attaching. "
"(stream %d sec old)",
- rendcirc->base_.n_circ_id, conn_age);
+ (unsigned)rendcirc->base_.n_circ_id, conn_age);
/* Mark rendezvous circuits as 'newly dirty' every time you use
* them, since the process of rebuilding a rendezvous circ is so
* expensive. There is a tradeoff between linkability and
@@ -2168,9 +2170,9 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (rendcirc && (rendcirc->base_.purpose ==
CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED)) {
log_info(LD_REND,
- "pending-join circ %d already here, with intro ack. "
+ "pending-join circ %u already here, with intro ack. "
"Stalling. (stream %d sec old)",
- rendcirc->base_.n_circ_id, conn_age);
+ (unsigned)rendcirc->base_.n_circ_id, conn_age);
return 0;
}
@@ -2182,10 +2184,10 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (retval > 0) {
/* one has already sent the intro. keep waiting. */
tor_assert(introcirc);
- log_info(LD_REND, "Intro circ %d present and awaiting ack (rend %d). "
+ log_info(LD_REND, "Intro circ %u present and awaiting ack (rend %u). "
"Stalling. (stream %d sec old)",
- introcirc->base_.n_circ_id,
- rendcirc ? rendcirc->base_.n_circ_id : 0,
+ (unsigned)introcirc->base_.n_circ_id,
+ rendcirc ? (unsigned)rendcirc->base_.n_circ_id : 0,
conn_age);
return 0;
}
@@ -2195,16 +2197,17 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (rendcirc && introcirc &&
rendcirc->base_.purpose == CIRCUIT_PURPOSE_C_REND_READY) {
log_info(LD_REND,
- "ready rend circ %d already here (no intro-ack yet on "
- "intro %d). (stream %d sec old)",
- rendcirc->base_.n_circ_id,
- introcirc->base_.n_circ_id, conn_age);
+ "ready rend circ %u already here (no intro-ack yet on "
+ "intro %u). (stream %d sec old)",
+ (unsigned)rendcirc->base_.n_circ_id,
+ (unsigned)introcirc->base_.n_circ_id, conn_age);
tor_assert(introcirc->base_.purpose == CIRCUIT_PURPOSE_C_INTRODUCING);
if (introcirc->base_.state == CIRCUIT_STATE_OPEN) {
- log_info(LD_REND,"found open intro circ %d (rend %d); sending "
+ log_info(LD_REND,"found open intro circ %u (rend %u); sending "
"introduction. (stream %d sec old)",
- introcirc->base_.n_circ_id, rendcirc->base_.n_circ_id,
+ (unsigned)introcirc->base_.n_circ_id,
+ (unsigned)rendcirc->base_.n_circ_id,
conn_age);
switch (rend_client_send_introduction(introcirc, rendcirc)) {
case 0: /* success */
@@ -2228,10 +2231,10 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
}
}
- log_info(LD_REND, "Intro (%d) and rend (%d) circs are not both ready. "
+ log_info(LD_REND, "Intro (%u) and rend (%u) circs are not both ready. "
"Stalling conn. (%d sec old)",
- introcirc ? introcirc->base_.n_circ_id : 0,
- rendcirc ? rendcirc->base_.n_circ_id : 0, conn_age);
+ introcirc ? (unsigned)introcirc->base_.n_circ_id : 0,
+ rendcirc ? (unsigned)rendcirc->base_.n_circ_id : 0, conn_age);
return 0;
}
}
diff --git a/src/or/command.c b/src/or/command.c
index dfe4f65..876ff52 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -16,7 +16,6 @@
* callbacks registered in command_setup_channel(),
* called when channels are created in circuitbuild.c
*/
-
#include "or.h"
#include "channel.h"
#include "circuitbuild.h"
@@ -195,9 +194,9 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
tor_assert(chan);
log_debug(LD_OR,
- "Got a CREATE cell for circ_id %d on channel " U64_FORMAT
+ "Got a CREATE cell for circ_id %u on channel " U64_FORMAT
" (%p)",
- cell->circ_id,
+ (unsigned)cell->circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan);
if (we_are_hibernating()) {
@@ -240,8 +239,8 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
(!id_is_high &&
chan->circ_id_type == CIRC_ID_TYPE_LOWER)) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
- "Received create cell with unexpected circ_id %d. Closing.",
- cell->circ_id);
+ "Received create cell with unexpected circ_id %u. Closing.",
+ (unsigned)cell->circ_id);
channel_send_destroy(cell->circ_id, chan,
END_CIRC_REASON_TORPROTOCOL);
return;
@@ -250,9 +249,10 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
if (circuit_id_in_use_on_channel(cell->circ_id, chan)) {
const node_t *node = node_get_by_id(chan->identity_digest);
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
- "Received CREATE cell (circID %d) for known circ. "
+ "Received CREATE cell (circID %u) for known circ. "
"Dropping (age %d).",
- cell->circ_id, (int)(time(NULL) - channel_when_created(chan)));
+ (unsigned)cell->circ_id,
+ (int)(time(NULL) - channel_when_created(chan)));
if (node) {
char *p = esc_for_log(node_get_platform(node));
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
@@ -341,8 +341,8 @@ command_process_created_cell(cell_t *cell, channel_t *chan)
if (!circ) {
log_info(LD_OR,
- "(circID %d) unknown circ (probably got a destroy earlier). "
- "Dropping.", cell->circ_id);
+ "(circID %u) unknown circ (probably got a destroy earlier). "
+ "Dropping.", (unsigned)cell->circ_id);
return;
}
@@ -412,8 +412,9 @@ command_process_relay_cell(cell_t *cell, channel_t *chan)
if (!circ) {
log_debug(LD_OR,
- "unknown circuit %d on connection from %s. Dropping.",
- cell->circ_id, channel_get_canonical_remote_descr(chan));
+ "unknown circuit %u on connection from %s. Dropping.",
+ (unsigned)cell->circ_id,
+ channel_get_canonical_remote_descr(chan));
return;
}
@@ -447,9 +448,9 @@ command_process_relay_cell(cell_t *cell, channel_t *chan)
or_circuit_t *or_circ = TO_OR_CIRCUIT(circ);
if (or_circ->remaining_relay_early_cells == 0) {
log_fn(LOG_PROTOCOL_WARN, LD_OR,
- "Received too many RELAY_EARLY cells on circ %d from %s."
+ "Received too many RELAY_EARLY cells on circ %u from %s."
" Closing circuit.",
- cell->circ_id,
+ (unsigned)cell->circ_id,
safe_str(channel_get_canonical_remote_descr(chan)));
circuit_mark_for_close(circ, END_CIRC_REASON_TORPROTOCOL);
return;
@@ -487,11 +488,12 @@ command_process_destroy_cell(cell_t *cell, channel_t *chan)
circ = circuit_get_by_circid_channel(cell->circ_id, chan);
if (!circ) {
- log_info(LD_OR,"unknown circuit %d on connection from %s. Dropping.",
- cell->circ_id, channel_get_canonical_remote_descr(chan));
+ log_info(LD_OR,"unknown circuit %u on connection from %s. Dropping.",
+ (unsigned)cell->circ_id,
+ channel_get_canonical_remote_descr(chan));
return;
}
- log_debug(LD_OR,"Received for circID %d.",cell->circ_id);
+ log_debug(LD_OR,"Received for circID %u.",(unsigned)cell->circ_id);
reason = (uint8_t)cell->payload[0];
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index fcbcb95..84d5565 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -218,8 +218,8 @@ int
connection_edge_destroy(circid_t circ_id, edge_connection_t *conn)
{
if (!conn->base_.marked_for_close) {
- log_info(LD_EDGE,
- "CircID %d: At an edge. Marking connection for close.", circ_id);
+ log_info(LD_EDGE, "CircID %u: At an edge. Marking connection for close.",
+ (unsigned) circ_id);
if (conn->base_.type == CONN_TYPE_AP) {
entry_connection_t *entry_conn = EDGE_TO_ENTRY_CONN(conn);
connection_mark_unattached_ap(entry_conn, END_STREAM_REASON_DESTROY);
@@ -1847,8 +1847,8 @@ connection_ap_handshake_send_begin(entry_connection_t *ap_conn)
edge_conn->deliver_window = STREAMWINDOW_START;
base_conn->state = AP_CONN_STATE_CONNECT_WAIT;
log_info(LD_APP,"Address/port sent, ap socket "TOR_SOCKET_T_FORMAT
- ", n_circ_id %d",
- base_conn->s, circ->base_.n_circ_id);
+ ", n_circ_id %u",
+ base_conn->s, (unsigned)circ->base_.n_circ_id);
control_event_stream_status(ap_conn, STREAM_EVENT_SENT_CONNECT, 0);
/* If there's queued-up data, send it now */
@@ -1949,8 +1949,8 @@ connection_ap_handshake_send_resolve(entry_connection_t *ap_conn)
base_conn->address = tor_strdup("(Tor_internal)");
base_conn->state = AP_CONN_STATE_RESOLVE_WAIT;
log_info(LD_APP,"Address sent for resolve, ap socket "TOR_SOCKET_T_FORMAT
- ", n_circ_id %d",
- base_conn->s, circ->base_.n_circ_id);
+ ", n_circ_id %u",
+ base_conn->s, (unsigned)circ->base_.n_circ_id);
control_event_stream_status(ap_conn, STREAM_EVENT_NEW, 0);
control_event_stream_status(ap_conn, STREAM_EVENT_SENT_RESOLVE, 0);
return 0;
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index c4415c5..3616363 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -9,7 +9,6 @@
* \brief Functions to handle OR connections, TLS handshaking, and
* cells on the network.
**/
-
#include "or.h"
#include "buffers.h"
/*
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index af5f91a..38c6613 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -11,7 +11,6 @@
*
* Right now, we only use this for processing onionskins.
**/
-
#include "or.h"
#include "buffers.h"
#include "channel.h"
@@ -341,8 +340,8 @@ connection_cpu_process_inbuf(connection_t *conn)
circ = NULL;
log_debug(LD_OR,
"Unpacking cpuworker reply, chan_id is " U64_FORMAT
- ", circ_id is %d",
- U64_PRINTF_ARG(chan_id), circ_id);
+ ", circ_id is %u",
+ U64_PRINTF_ARG(chan_id), (unsigned)circ_id);
p_chan = channel_find_by_global_id(chan_id);
if (p_chan)
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 61e3b91..7115bf2 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -111,14 +111,14 @@ rend_client_reextend_intro_circuit(origin_circuit_t *circ)
// XXX: should we not re-extend if hs_circ_has_timed_out?
if (circ->remaining_relay_early_cells) {
log_info(LD_REND,
- "Re-extending circ %d, this time to %s.",
- circ->base_.n_circ_id,
+ "Re-extending circ %u, this time to %s.",
+ (unsigned)circ->base_.n_circ_id,
safe_str_client(extend_info_describe(extend_info)));
result = circuit_extend_to_new_exit(circ, extend_info);
} else {
log_info(LD_REND,
- "Closing intro circ %d (out of RELAY_EARLY cells).",
- circ->base_.n_circ_id);
+ "Closing intro circ %u (out of RELAY_EARLY cells).",
+ (unsigned)circ->base_.n_circ_id);
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_FINISHED);
/* connection_ap_handshake_attach_circuit will launch a new intro circ. */
result = 0;
@@ -386,8 +386,8 @@ rend_client_introduction_acked(origin_circuit_t *circ,
if (circ->base_.purpose != CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) {
log_warn(LD_PROTOCOL,
- "Received REND_INTRODUCE_ACK on unexpected circuit %d.",
- circ->base_.n_circ_id);
+ "Received REND_INTRODUCE_ACK on unexpected circuit %u.",
+ (unsigned)circ->base_.n_circ_id);
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL);
return -1;
}
diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index 1046ce3..1bd11f6 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -32,8 +32,8 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request,
int reason = END_CIRC_REASON_INTERNAL;
log_info(LD_REND,
- "Received an ESTABLISH_INTRO request on circuit %d",
- circ->p_circ_id);
+ "Received an ESTABLISH_INTRO request on circuit %u",
+ (unsigned) circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
@@ -114,8 +114,8 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request,
memcpy(circ->rend_token, pk_digest, DIGEST_LEN);
log_info(LD_REND,
- "Established introduction point on circuit %d for service %s",
- circ->p_circ_id, safe_str(serviceid));
+ "Established introduction point on circuit %u for service %s",
+ (unsigned) circ->p_circ_id, safe_str(serviceid));
return 0;
truncated:
@@ -139,13 +139,13 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
char serviceid[REND_SERVICE_ID_LEN_BASE32+1];
char nak_body[1];
- log_info(LD_REND, "Received an INTRODUCE1 request on circuit %d",
- circ->p_circ_id);
+ log_info(LD_REND, "Received an INTRODUCE1 request on circuit %u",
+ (unsigned)circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_warn(LD_PROTOCOL,
- "Rejecting INTRODUCE1 on non-OR or non-edge circuit %d.",
- circ->p_circ_id);
+ "Rejecting INTRODUCE1 on non-OR or non-edge circuit %u.",
+ (unsigned)circ->p_circ_id);
goto err;
}
@@ -155,9 +155,9 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
*/
if (request_len < (DIGEST_LEN+(MAX_NICKNAME_LEN+1)+REND_COOKIE_LEN+
DH_KEY_LEN+CIPHER_KEY_LEN+PKCS1_OAEP_PADDING_OVERHEAD)) {
- log_warn(LD_PROTOCOL, "Impossibly short INTRODUCE1 cell on circuit %d; "
+ log_warn(LD_PROTOCOL, "Impossibly short INTRODUCE1 cell on circuit %u; "
"responding with nack.",
- circ->p_circ_id);
+ (unsigned)circ->p_circ_id);
goto err;
}
@@ -168,17 +168,17 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
intro_circ = circuit_get_intro_point((char*)request);
if (!intro_circ) {
log_info(LD_REND,
- "No intro circ found for INTRODUCE1 cell (%s) from circuit %d; "
+ "No intro circ found for INTRODUCE1 cell (%s) from circuit %u; "
"responding with nack.",
- safe_str(serviceid), circ->p_circ_id);
+ safe_str(serviceid), (unsigned)circ->p_circ_id);
goto err;
}
log_info(LD_REND,
"Sending introduction request for service %s "
- "from circ %d to circ %d",
- safe_str(serviceid), circ->p_circ_id,
- intro_circ->p_circ_id);
+ "from circ %u to circ %u",
+ safe_str(serviceid), (unsigned)circ->p_circ_id,
+ (unsigned)intro_circ->p_circ_id);
/* Great. Now we just relay the cell down the circuit. */
if (relay_send_command_from_edge(0, TO_CIRCUIT(intro_circ),
@@ -221,8 +221,8 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request,
char hexid[9];
int reason = END_CIRC_REASON_TORPROTOCOL;
- log_info(LD_REND, "Received an ESTABLISH_RENDEZVOUS request on circuit %d",
- circ->p_circ_id);
+ log_info(LD_REND, "Received an ESTABLISH_RENDEZVOUS request on circuit %u",
+ (unsigned)circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_warn(LD_PROTOCOL,
@@ -256,8 +256,8 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request,
base16_encode(hexid,9,(char*)request,4);
log_info(LD_REND,
- "Established rendezvous point on circuit %d for cookie %s",
- circ->p_circ_id, hexid);
+ "Established rendezvous point on circuit %u for cookie %s",
+ (unsigned)circ->p_circ_id, hexid);
return 0;
err:
@@ -279,16 +279,16 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_info(LD_REND,
- "Tried to complete rendezvous on non-OR or non-edge circuit %d.",
- circ->p_circ_id);
+ "Tried to complete rendezvous on non-OR or non-edge circuit %u.",
+ (unsigned)circ->p_circ_id);
reason = END_CIRC_REASON_TORPROTOCOL;
goto err;
}
if (request_len != REND_COOKIE_LEN+DH_KEY_LEN+DIGEST_LEN) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
- "Rejecting RENDEZVOUS1 cell with bad length (%d) on circuit %d.",
- (int)request_len, circ->p_circ_id);
+ "Rejecting RENDEZVOUS1 cell with bad length (%d) on circuit %u.",
+ (int)request_len, (unsigned)circ->p_circ_id);
reason = END_CIRC_REASON_TORPROTOCOL;
goto err;
}
@@ -296,8 +296,8 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
base16_encode(hexid, sizeof(hexid), (const char*)request, 4);
log_info(LD_REND,
- "Got request for rendezvous from circuit %d to cookie %s.",
- circ->p_circ_id, hexid);
+ "Got request for rendezvous from circuit %u to cookie %s.",
+ (unsigned)circ->p_circ_id, hexid);
rend_circ = circuit_get_rendezvous((char*)request);
if (!rend_circ) {
@@ -314,15 +314,15 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
(char*)(request+REND_COOKIE_LEN),
request_len-REND_COOKIE_LEN, NULL)) {
log_warn(LD_GENERAL,
- "Unable to send RENDEZVOUS2 cell to client on circuit %d.",
- rend_circ->p_circ_id);
+ "Unable to send RENDEZVOUS2 cell to client on circuit %u.",
+ (unsigned)rend_circ->p_circ_id);
goto err;
}
/* Join the circuits. */
log_info(LD_REND,
- "Completing rendezvous: circuit %d joins circuit %d (cookie %s)",
- circ->p_circ_id, rend_circ->p_circ_id, hexid);
+ "Completing rendezvous: circuit %u joins circuit %u (cookie %s)",
+ (unsigned)circ->p_circ_id, (unsigned)rend_circ->p_circ_id, hexid);
circuit_change_purpose(TO_CIRCUIT(circ), CIRCUIT_PURPOSE_REND_ESTABLISHED);
circuit_change_purpose(TO_CIRCUIT(rend_circ),
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index a066e02..a8f63dd 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1126,8 +1126,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
/* Do some initial validation and logging before we parse the cell */
if (circuit->base_.purpose != CIRCUIT_PURPOSE_S_INTRO) {
log_warn(LD_PROTOCOL,
- "Got an INTRODUCE2 over a non-introduction circuit %d.",
- circuit->base_.n_circ_id);
+ "Got an INTRODUCE2 over a non-introduction circuit %u.",
+ (unsigned) circuit->base_.n_circ_id);
goto err;
}
@@ -1161,8 +1161,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
goto err;
}
- log_info(LD_REND, "Received INTRODUCE2 cell for service %s on circ %d.",
- escaped(serviceid), circuit->base_.n_circ_id);
+ log_info(LD_REND, "Received INTRODUCE2 cell for service %s on circ %u.",
+ escaped(serviceid), (unsigned)circuit->base_.n_circ_id);
/* use intro key instead of service key. */
intro_key = circuit->intro_key;
@@ -1177,7 +1177,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (!parsed_req) {
goto log_error;
} else if (err_msg) {
- log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id);
+ log_info(LD_REND, "%s on circ %u.", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
tor_free(err_msg);
}
@@ -1187,7 +1188,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) {
goto log_error;
} else if (err_msg) {
- log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id);
+ log_info(LD_REND, "%s on circ %u.", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
tor_free(err_msg);
}
@@ -1223,7 +1225,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) {
goto log_error;
} else if (err_msg) {
- log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id);
+ log_info(LD_REND, "%s on circ %u.", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
tor_free(err_msg);
}
@@ -1233,7 +1236,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) {
goto log_error;
} else if (err_msg) {
- log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id);
+ log_info(LD_REND, "%s on circ %u.", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
tor_free(err_msg);
}
@@ -1243,7 +1247,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) {
goto log_error;
} else if (err_msg) {
- log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id);
+ log_info(LD_REND, "%s on circ %u.", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
tor_free(err_msg);
}
stage_descr = NULL;
@@ -1393,7 +1398,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
}
}
- log_warn(LD_REND, "%s on circ %d", err_msg, circuit->base_.n_circ_id);
+ log_warn(LD_REND, "%s on circ %u", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
err:
status = -1;
if (dh) crypto_dh_free(dh);
@@ -2417,8 +2423,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
service = rend_service_get_by_pk_digest(
circuit->rend_data->rend_pk_digest);
if (!service) {
- log_warn(LD_REND, "Unrecognized service ID %s on introduction circuit %d.",
- serviceid, circuit->base_.n_circ_id);
+ log_warn(LD_REND, "Unrecognized service ID %s on introduction circuit %u.",
+ serviceid, (unsigned)circuit->base_.n_circ_id);
reason = END_CIRC_REASON_NOSUCHSERVICE;
goto err;
}
@@ -2461,8 +2467,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
}
log_info(LD_REND,
- "Established circuit %d as introduction point for service %s",
- circuit->base_.n_circ_id, serviceid);
+ "Established circuit %u as introduction point for service %s",
+ (unsigned)circuit->base_.n_circ_id, serviceid);
/* Use the intro key instead of the service key in ESTABLISH_INTRO. */
intro_key = circuit->intro_key;
@@ -2496,8 +2502,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
RELAY_COMMAND_ESTABLISH_INTRO,
buf, len, circuit->cpath->prev)<0) {
log_info(LD_GENERAL,
- "Couldn't send introduction request for service %s on circuit %d",
- serviceid, circuit->base_.n_circ_id);
+ "Couldn't send introduction request for service %s on circuit %u",
+ serviceid, (unsigned)circuit->base_.n_circ_id);
reason = END_CIRC_REASON_INTERNAL;
goto err;
}
@@ -2539,8 +2545,8 @@ rend_service_intro_established(origin_circuit_t *circuit,
service = rend_service_get_by_pk_digest(
circuit->rend_data->rend_pk_digest);
if (!service) {
- log_warn(LD_REND, "Unknown service on introduction circuit %d.",
- circuit->base_.n_circ_id);
+ log_warn(LD_REND, "Unknown service on introduction circuit %u.",
+ (unsigned)circuit->base_.n_circ_id);
goto err;
}
service->desc_is_dirty = time(NULL);
@@ -2549,8 +2555,8 @@ rend_service_intro_established(origin_circuit_t *circuit,
base32_encode(serviceid, REND_SERVICE_ID_LEN_BASE32 + 1,
circuit->rend_data->rend_pk_digest, REND_SERVICE_ID_LEN);
log_info(LD_REND,
- "Received INTRO_ESTABLISHED cell on circuit %d for service %s",
- circuit->base_.n_circ_id, serviceid);
+ "Received INTRO_ESTABLISHED cell on circuit %u for service %s",
+ (unsigned)circuit->base_.n_circ_id, serviceid);
/* Getting a valid INTRODUCE_ESTABLISHED means we've successfully
* used the circ */
@@ -2597,9 +2603,9 @@ rend_service_rendezvous_has_opened(origin_circuit_t *circuit)
circuit->rend_data->rend_pk_digest, REND_SERVICE_ID_LEN);
log_info(LD_REND,
- "Done building circuit %d to rendezvous with "
+ "Done building circuit %u to rendezvous with "
"cookie %s for service %s",
- circuit->base_.n_circ_id, hexcookie, serviceid);
+ (unsigned)circuit->base_.n_circ_id, hexcookie, serviceid);
/* Clear the 'in-progress HS circ has timed out' flag for
* consistency with what happens on the client side; this line has
@@ -3339,8 +3345,8 @@ rend_service_set_connection_addr_port(edge_connection_t *conn,
circ->rend_data->rend_pk_digest);
if (!service) {
log_warn(LD_REND, "Couldn't find any service associated with pk %s on "
- "rendezvous circuit %d; closing.",
- serviceid, circ->base_.n_circ_id);
+ "rendezvous circuit %u; closing.",
+ serviceid, (unsigned)circ->base_.n_circ_id);
return -1;
}
matching_ports = smartlist_new();
1
0
10 Mar '13
commit 4235425fce7f3c1feeba8e7b41b7e2e3372bda9a
Merge: 62ef02a 301faf2
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sun Mar 10 19:53:31 2013 -0400
Merge remote-tracking branch 'origin/maint-0.2.4'
src/or/channel.c | 8 +++---
src/or/circuitbuild.c | 2 +-
src/or/circuitlist.c | 30 +++++++++++-----------
src/or/circuitmux.c | 22 ++++++++--------
src/or/circuituse.c | 61 ++++++++++++++++++++++++----------------------
src/or/command.c | 34 +++++++++++++------------
src/or/connection_edge.c | 12 ++++----
src/or/connection_or.c | 1 -
src/or/cpuworker.c | 5 +--
src/or/rendclient.c | 12 ++++----
src/or/rendmid.c | 58 ++++++++++++++++++++++----------------------
src/or/rendservice.c | 54 ++++++++++++++++++++++------------------
12 files changed, 154 insertions(+), 145 deletions(-)
1
0
[tor/maint-0.2.4] Merge branch 'bug8447_squashed' into maint-0.2.4
by nickm@torproject.org 10 Mar '13
by nickm@torproject.org 10 Mar '13
10 Mar '13
commit 301faf281391698e44eb3a8d400b477716a74fd4
Merge: 74c3394 339df5d
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sun Mar 10 19:52:43 2013 -0400
Merge branch 'bug8447_squashed' into maint-0.2.4
src/or/channel.c | 8 +++---
src/or/circuitbuild.c | 2 +-
src/or/circuitlist.c | 30 +++++++++++-----------
src/or/circuitmux.c | 22 ++++++++--------
src/or/circuituse.c | 61 ++++++++++++++++++++++++----------------------
src/or/command.c | 34 +++++++++++++------------
src/or/connection_edge.c | 12 ++++----
src/or/connection_or.c | 1 -
src/or/cpuworker.c | 5 +--
src/or/rendclient.c | 12 ++++----
src/or/rendmid.c | 58 ++++++++++++++++++++++----------------------
src/or/rendservice.c | 54 ++++++++++++++++++++++------------------
12 files changed, 154 insertions(+), 145 deletions(-)
1
0
10 Mar '13
commit 339df5df085e2115c01881cf628abe5ed3fbd456
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Sun Mar 10 08:32:58 2013 -0400
Fix 8447: use %u to format circid_t.
Now that circid_t is 4 bytes long, the default integer promotions will
leave it alone when sizeof(int) == 4, which will leave us formatting an
unsigned as an int. That's technically undefined behavior.
Fixes bug 8447 on bfffc1f0fc7616a25c32da2eb759dade4651659e. Bug not
in any released Tor.
---
src/or/channel.c | 8 +++---
src/or/circuitbuild.c | 2 +-
src/or/circuitlist.c | 30 +++++++++++-----------
src/or/circuitmux.c | 22 ++++++++--------
src/or/circuituse.c | 61 ++++++++++++++++++++++++----------------------
src/or/command.c | 34 +++++++++++++------------
src/or/connection_edge.c | 12 ++++----
src/or/connection_or.c | 1 -
src/or/cpuworker.c | 5 +--
src/or/rendclient.c | 12 ++++----
src/or/rendmid.c | 58 ++++++++++++++++++++++----------------------
src/or/rendservice.c | 54 ++++++++++++++++++++++------------------
12 files changed, 154 insertions(+), 145 deletions(-)
diff --git a/src/or/channel.c b/src/or/channel.c
index f8afc40..82db061 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -2607,17 +2607,17 @@ channel_send_destroy(circid_t circ_id, channel_t *chan, int reason)
cell.command = CELL_DESTROY;
cell.payload[0] = (uint8_t) reason;
log_debug(LD_OR,
- "Sending destroy (circID %d) on channel %p "
+ "Sending destroy (circID %u) on channel %p "
"(global ID " U64_FORMAT ")",
- circ_id, chan,
+ (unsigned)circ_id, chan,
U64_PRINTF_ARG(chan->global_identifier));
channel_write_cell(chan, &cell);
} else {
log_warn(LD_BUG,
- "Someone called channel_send_destroy() for circID %d "
+ "Someone called channel_send_destroy() for circID %u "
"on a channel " U64_FORMAT " at %p in state %s (%d)",
- circ_id, U64_PRINTF_ARG(chan->global_identifier),
+ (unsigned)circ_id, U64_PRINTF_ARG(chan->global_identifier),
chan, channel_state_to_string(chan->state),
chan->state);
}
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 8a3a36a..fbe94a9 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -523,7 +523,7 @@ circuit_deliver_create_cell(circuit_t *circ, const create_cell_t *create_cell,
log_warn(LD_CIRC,"failed to get unique circID.");
return -1;
}
- log_debug(LD_CIRC,"Chosen circID %u.", id);
+ log_debug(LD_CIRC,"Chosen circID %u.", (unsigned)id);
circuit_set_n_circid_chan(circ, id, circ->n_chan);
memset(&cell, 0, sizeof(cell_t));
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index ef32680..17e18c7 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -780,13 +780,13 @@ circuit_dump_conn_details(int severity,
circuit_t *circ,
int conn_array_index,
const char *type,
- int this_circid,
- int other_circid)
+ circid_t this_circid,
+ circid_t other_circid)
{
- tor_log(severity, LD_CIRC, "Conn %d has %s circuit: circID %d "
- "(other side %d), state %d (%s), born %ld:",
- conn_array_index, type, this_circid, other_circid, circ->state,
- circuit_state_to_string(circ->state),
+ tor_log(severity, LD_CIRC, "Conn %d has %s circuit: circID %u "
+ "(other side %u), state %d (%s), born %ld:",
+ conn_array_index, type, (unsigned)this_circid, (unsigned)other_circid,
+ circ->state, circuit_state_to_string(circ->state),
(long)circ->timestamp_began.tv_sec);
if (CIRCUIT_IS_ORIGIN(circ)) { /* circ starts at this node */
circuit_log_path(severity, LD_CIRC, TO_ORIGIN_CIRCUIT(circ));
@@ -843,12 +843,12 @@ circuit_dump_chan_details(int severity,
circuit_t *circ,
channel_t *chan,
const char *type,
- int this_circid,
- int other_circid)
+ circid_t this_circid,
+ circid_t other_circid)
{
- tor_log(severity, LD_CIRC, "Conn %p has %s circuit: circID %d "
- "(other side %d), state %d (%s), born %ld:",
- chan, type, this_circid, other_circid, circ->state,
+ tor_log(severity, LD_CIRC, "Conn %p has %s circuit: circID %u "
+ "(other side %u), state %d (%s), born %ld:",
+ chan, type, (unsigned)this_circid, (unsigned)other_circid, circ->state,
circuit_state_to_string(circ->state),
(long)circ->timestamp_began.tv_sec);
if (CIRCUIT_IS_ORIGIN(circ)) { /* circ starts at this node */
@@ -943,16 +943,16 @@ circuit_get_by_circid_channel_impl(circid_t circ_id, channel_t *chan)
if (found && found->circuit) {
log_debug(LD_CIRC,
"circuit_get_by_circid_channel_impl() returning circuit %p for"
- " circ_id %d, channel ID " U64_FORMAT " (%p)",
- found->circuit, circ_id,
+ " circ_id %u, channel ID " U64_FORMAT " (%p)",
+ found->circuit, (unsigned)circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan);
return found->circuit;
}
log_debug(LD_CIRC,
"circuit_get_by_circid_channel_impl() found nothing for"
- " circ_id %d, channel ID " U64_FORMAT " (%p)",
- circ_id,
+ " circ_id %u, channel ID " U64_FORMAT " (%p)",
+ (unsigned)circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan);
return NULL;
diff --git a/src/or/circuitmux.c b/src/or/circuitmux.c
index dcc1901..545cfd0 100644
--- a/src/or/circuitmux.c
+++ b/src/or/circuitmux.c
@@ -425,9 +425,9 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
} else {
/* Complain and move on */
log_warn(LD_CIRC,
- "Circuit %d/channel " U64_FORMAT " had direction == "
+ "Circuit %u/channel " U64_FORMAT " had direction == "
"CELL_DIRECTION_IN, but isn't an or_circuit_t",
- to_remove->circ_id,
+ (unsigned)to_remove->circ_id,
U64_PRINTF_ARG(to_remove->chan_id));
}
@@ -449,16 +449,16 @@ circuitmux_detach_all_circuits(circuitmux_t *cmux)
} else {
/* Complain and move on */
log_warn(LD_CIRC,
- "Couldn't find circuit %d (for channel " U64_FORMAT ")",
- to_remove->circ_id,
+ "Couldn't find circuit %u (for channel " U64_FORMAT ")",
+ (unsigned)to_remove->circ_id,
U64_PRINTF_ARG(to_remove->chan_id));
}
} else {
/* Complain and move on */
log_warn(LD_CIRC,
- "Couldn't find channel " U64_FORMAT " (for circuit id %d)",
+ "Couldn't find channel " U64_FORMAT " (for circuit id %u)",
U64_PRINTF_ARG(to_remove->chan_id),
- to_remove->circ_id);
+ (unsigned)to_remove->circ_id);
}
/* Assert that we don't have un-freed policy data for this circuit */
@@ -905,7 +905,7 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t *circ,
log_info(LD_CIRC,
"Circuit %u on channel " U64_FORMAT " was already attached to "
"cmux %p (trying to attach to %p)",
- circ_id, U64_PRINTF_ARG(channel_id),
+ (unsigned)circ_id, U64_PRINTF_ARG(channel_id),
((direction == CELL_DIRECTION_OUT) ?
circ->n_mux : TO_OR_CIRCUIT(circ)->p_mux),
cmux);
@@ -938,7 +938,7 @@ circuitmux_attach_circuit(circuitmux_t *cmux, circuit_t *circ,
*/
log_debug(LD_CIRC,
"Attaching circuit %u on channel " U64_FORMAT " to cmux %p",
- circ_id, U64_PRINTF_ARG(channel_id), cmux);
+ (unsigned)circ_id, U64_PRINTF_ARG(channel_id), cmux);
/*
* Assert that the circuit doesn't already have a mux for this
@@ -1138,8 +1138,8 @@ circuitmux_make_circuit_active(circuitmux_t *cmux, circuit_t *circ,
/* If we're already active, log a warning and finish */
if (already_active) {
log_warn(LD_CIRC,
- "Circuit %d on channel " U64_FORMAT " was already active",
- circ_id, U64_PRINTF_ARG(chan->global_identifier));
+ "Circuit %u on channel " U64_FORMAT " was already active",
+ (unsigned)circ_id, U64_PRINTF_ARG(chan->global_identifier));
return;
}
@@ -1236,7 +1236,7 @@ circuitmux_make_circuit_inactive(circuitmux_t *cmux, circuit_t *circ,
if (already_inactive) {
log_warn(LD_CIRC,
"Circuit %d on channel " U64_FORMAT " was already inactive",
- circ_id, U64_PRINTF_ARG(chan->global_identifier));
+ (unsigned)circ_id, U64_PRINTF_ARG(chan->global_identifier));
return;
}
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index c061203..51d8716 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -695,9 +695,9 @@ circuit_expire_building(void)
case CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT:
case CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED:
/* If we have reached this line, we want to spare the circ for now. */
- log_info(LD_CIRC,"Marking circ %d (state %d:%s, purpose %d) "
+ log_info(LD_CIRC,"Marking circ %u (state %d:%s, purpose %d) "
"as timed-out HS circ",
- victim->n_circ_id,
+ (unsigned)victim->n_circ_id,
victim->state, circuit_state_to_string(victim->state),
victim->purpose);
TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out = 1;
@@ -713,9 +713,9 @@ circuit_expire_building(void)
if (!(options->CloseHSServiceRendCircuitsImmediatelyOnTimeout) &&
!(TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out) &&
victim->purpose == CIRCUIT_PURPOSE_S_CONNECT_REND) {
- log_info(LD_CIRC,"Marking circ %d (state %d:%s, purpose %d) "
+ log_info(LD_CIRC,"Marking circ %u (state %d:%s, purpose %d) "
"as timed-out HS circ; relaunching rendezvous attempt.",
- victim->n_circ_id,
+ (unsigned)victim->n_circ_id,
victim->state, circuit_state_to_string(victim->state),
victim->purpose);
TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out = 1;
@@ -728,7 +728,7 @@ circuit_expire_building(void)
"Abandoning circ %u %s:%d (state %d,%d:%s, purpose %d, "
"len %d)", TO_ORIGIN_CIRCUIT(victim)->global_identifier,
channel_get_canonical_remote_descr(victim->n_chan),
- victim->n_circ_id,
+ (unsigned)victim->n_circ_id,
TO_ORIGIN_CIRCUIT(victim)->has_opened,
victim->state, circuit_state_to_string(victim->state),
victim->purpose,
@@ -737,7 +737,8 @@ circuit_expire_building(void)
log_info(LD_CIRC,
"Abandoning circ %u %d (state %d,%d:%s, purpose %d, len %d)",
TO_ORIGIN_CIRCUIT(victim)->global_identifier,
- victim->n_circ_id, TO_ORIGIN_CIRCUIT(victim)->has_opened,
+ (unsigned)victim->n_circ_id,
+ TO_ORIGIN_CIRCUIT(victim)->has_opened,
victim->state,
circuit_state_to_string(victim->state), victim->purpose,
TO_ORIGIN_CIRCUIT(victim)->build_state->desired_path_len);
@@ -1070,9 +1071,10 @@ circuit_expire_old_circuits_clientside(void)
circ->timestamp_dirty + get_options()->MaxCircuitDirtiness <
now.tv_sec &&
!TO_ORIGIN_CIRCUIT(circ)->p_streams /* nothing attached */ ) {
- log_debug(LD_CIRC, "Closing n_circ_id %d (dirty %ld sec ago, "
+ log_debug(LD_CIRC, "Closing n_circ_id %u (dirty %ld sec ago, "
"purpose %d)",
- circ->n_circ_id, (long)(now.tv_sec - circ->timestamp_dirty),
+ (unsigned)circ->n_circ_id,
+ (long)(now.tv_sec - circ->timestamp_dirty),
circ->purpose);
/* Don't do this magic for testing circuits. Their death is governed
* by circuit_expire_building */
@@ -1153,8 +1155,8 @@ circuit_expire_old_circuits_serverside(time_t now)
!or_circ->n_streams && !or_circ->resolving_streams &&
or_circ->p_chan &&
channel_when_last_xmit(or_circ->p_chan) <= cutoff) {
- log_info(LD_CIRC, "Closing circ_id %d (empty %d secs ago)",
- or_circ->p_circ_id,
+ log_info(LD_CIRC, "Closing circ_id %u (empty %d secs ago)",
+ (unsigned)or_circ->p_circ_id,
(int)(now - channel_when_last_xmit(or_circ->p_chan)));
circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED);
}
@@ -1896,8 +1898,8 @@ link_apconn_to_circ(entry_connection_t *apconn, origin_circuit_t *circ,
const node_t *exitnode;
/* add it into the linked list of streams on this circuit */
- log_debug(LD_APP|LD_CIRC, "attaching new conn to circ. n_circ_id %d.",
- circ->base_.n_circ_id);
+ log_debug(LD_APP|LD_CIRC, "attaching new conn to circ. n_circ_id %u.",
+ (unsigned)circ->base_.n_circ_id);
/* reset it, so we can measure circ timeouts */
ENTRY_TO_CONN(apconn)->timestamp_lastread = time(NULL);
ENTRY_TO_EDGE_CONN(apconn)->next_stream = circ->p_streams;
@@ -2121,8 +2123,8 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
return retval;
log_debug(LD_APP|LD_CIRC,
- "Attaching apconn to circ %d (stream %d sec old).",
- circ->base_.n_circ_id, conn_age);
+ "Attaching apconn to circ %u (stream %d sec old).",
+ (unsigned)circ->base_.n_circ_id, conn_age);
/* print the circ's path, so people can figure out which circs are
* sucking. */
circuit_log_path(LOG_INFO,LD_APP|LD_CIRC,circ);
@@ -2147,7 +2149,7 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
log_info(LD_REND,
"rend joined circ %d already here. attaching. "
"(stream %d sec old)",
- rendcirc->base_.n_circ_id, conn_age);
+ (unsigned)rendcirc->base_.n_circ_id, conn_age);
/* Mark rendezvous circuits as 'newly dirty' every time you use
* them, since the process of rebuilding a rendezvous circ is so
* expensive. There is a tradeoff between linkability and
@@ -2168,9 +2170,9 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (rendcirc && (rendcirc->base_.purpose ==
CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED)) {
log_info(LD_REND,
- "pending-join circ %d already here, with intro ack. "
+ "pending-join circ %u already here, with intro ack. "
"Stalling. (stream %d sec old)",
- rendcirc->base_.n_circ_id, conn_age);
+ (unsigned)rendcirc->base_.n_circ_id, conn_age);
return 0;
}
@@ -2182,10 +2184,10 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (retval > 0) {
/* one has already sent the intro. keep waiting. */
tor_assert(introcirc);
- log_info(LD_REND, "Intro circ %d present and awaiting ack (rend %d). "
+ log_info(LD_REND, "Intro circ %u present and awaiting ack (rend %u). "
"Stalling. (stream %d sec old)",
- introcirc->base_.n_circ_id,
- rendcirc ? rendcirc->base_.n_circ_id : 0,
+ (unsigned)introcirc->base_.n_circ_id,
+ rendcirc ? (unsigned)rendcirc->base_.n_circ_id : 0,
conn_age);
return 0;
}
@@ -2195,16 +2197,17 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (rendcirc && introcirc &&
rendcirc->base_.purpose == CIRCUIT_PURPOSE_C_REND_READY) {
log_info(LD_REND,
- "ready rend circ %d already here (no intro-ack yet on "
- "intro %d). (stream %d sec old)",
- rendcirc->base_.n_circ_id,
- introcirc->base_.n_circ_id, conn_age);
+ "ready rend circ %u already here (no intro-ack yet on "
+ "intro %u). (stream %d sec old)",
+ (unsigned)rendcirc->base_.n_circ_id,
+ (unsigned)introcirc->base_.n_circ_id, conn_age);
tor_assert(introcirc->base_.purpose == CIRCUIT_PURPOSE_C_INTRODUCING);
if (introcirc->base_.state == CIRCUIT_STATE_OPEN) {
- log_info(LD_REND,"found open intro circ %d (rend %d); sending "
+ log_info(LD_REND,"found open intro circ %u (rend %u); sending "
"introduction. (stream %d sec old)",
- introcirc->base_.n_circ_id, rendcirc->base_.n_circ_id,
+ (unsigned)introcirc->base_.n_circ_id,
+ (unsigned)rendcirc->base_.n_circ_id,
conn_age);
switch (rend_client_send_introduction(introcirc, rendcirc)) {
case 0: /* success */
@@ -2228,10 +2231,10 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
}
}
- log_info(LD_REND, "Intro (%d) and rend (%d) circs are not both ready. "
+ log_info(LD_REND, "Intro (%u) and rend (%u) circs are not both ready. "
"Stalling conn. (%d sec old)",
- introcirc ? introcirc->base_.n_circ_id : 0,
- rendcirc ? rendcirc->base_.n_circ_id : 0, conn_age);
+ introcirc ? (unsigned)introcirc->base_.n_circ_id : 0,
+ rendcirc ? (unsigned)rendcirc->base_.n_circ_id : 0, conn_age);
return 0;
}
}
diff --git a/src/or/command.c b/src/or/command.c
index dfe4f65..876ff52 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -16,7 +16,6 @@
* callbacks registered in command_setup_channel(),
* called when channels are created in circuitbuild.c
*/
-
#include "or.h"
#include "channel.h"
#include "circuitbuild.h"
@@ -195,9 +194,9 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
tor_assert(chan);
log_debug(LD_OR,
- "Got a CREATE cell for circ_id %d on channel " U64_FORMAT
+ "Got a CREATE cell for circ_id %u on channel " U64_FORMAT
" (%p)",
- cell->circ_id,
+ (unsigned)cell->circ_id,
U64_PRINTF_ARG(chan->global_identifier), chan);
if (we_are_hibernating()) {
@@ -240,8 +239,8 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
(!id_is_high &&
chan->circ_id_type == CIRC_ID_TYPE_LOWER)) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
- "Received create cell with unexpected circ_id %d. Closing.",
- cell->circ_id);
+ "Received create cell with unexpected circ_id %u. Closing.",
+ (unsigned)cell->circ_id);
channel_send_destroy(cell->circ_id, chan,
END_CIRC_REASON_TORPROTOCOL);
return;
@@ -250,9 +249,10 @@ command_process_create_cell(cell_t *cell, channel_t *chan)
if (circuit_id_in_use_on_channel(cell->circ_id, chan)) {
const node_t *node = node_get_by_id(chan->identity_digest);
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
- "Received CREATE cell (circID %d) for known circ. "
+ "Received CREATE cell (circID %u) for known circ. "
"Dropping (age %d).",
- cell->circ_id, (int)(time(NULL) - channel_when_created(chan)));
+ (unsigned)cell->circ_id,
+ (int)(time(NULL) - channel_when_created(chan)));
if (node) {
char *p = esc_for_log(node_get_platform(node));
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
@@ -341,8 +341,8 @@ command_process_created_cell(cell_t *cell, channel_t *chan)
if (!circ) {
log_info(LD_OR,
- "(circID %d) unknown circ (probably got a destroy earlier). "
- "Dropping.", cell->circ_id);
+ "(circID %u) unknown circ (probably got a destroy earlier). "
+ "Dropping.", (unsigned)cell->circ_id);
return;
}
@@ -412,8 +412,9 @@ command_process_relay_cell(cell_t *cell, channel_t *chan)
if (!circ) {
log_debug(LD_OR,
- "unknown circuit %d on connection from %s. Dropping.",
- cell->circ_id, channel_get_canonical_remote_descr(chan));
+ "unknown circuit %u on connection from %s. Dropping.",
+ (unsigned)cell->circ_id,
+ channel_get_canonical_remote_descr(chan));
return;
}
@@ -447,9 +448,9 @@ command_process_relay_cell(cell_t *cell, channel_t *chan)
or_circuit_t *or_circ = TO_OR_CIRCUIT(circ);
if (or_circ->remaining_relay_early_cells == 0) {
log_fn(LOG_PROTOCOL_WARN, LD_OR,
- "Received too many RELAY_EARLY cells on circ %d from %s."
+ "Received too many RELAY_EARLY cells on circ %u from %s."
" Closing circuit.",
- cell->circ_id,
+ (unsigned)cell->circ_id,
safe_str(channel_get_canonical_remote_descr(chan)));
circuit_mark_for_close(circ, END_CIRC_REASON_TORPROTOCOL);
return;
@@ -487,11 +488,12 @@ command_process_destroy_cell(cell_t *cell, channel_t *chan)
circ = circuit_get_by_circid_channel(cell->circ_id, chan);
if (!circ) {
- log_info(LD_OR,"unknown circuit %d on connection from %s. Dropping.",
- cell->circ_id, channel_get_canonical_remote_descr(chan));
+ log_info(LD_OR,"unknown circuit %u on connection from %s. Dropping.",
+ (unsigned)cell->circ_id,
+ channel_get_canonical_remote_descr(chan));
return;
}
- log_debug(LD_OR,"Received for circID %d.",cell->circ_id);
+ log_debug(LD_OR,"Received for circID %u.",(unsigned)cell->circ_id);
reason = (uint8_t)cell->payload[0];
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index fcbcb95..84d5565 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -218,8 +218,8 @@ int
connection_edge_destroy(circid_t circ_id, edge_connection_t *conn)
{
if (!conn->base_.marked_for_close) {
- log_info(LD_EDGE,
- "CircID %d: At an edge. Marking connection for close.", circ_id);
+ log_info(LD_EDGE, "CircID %u: At an edge. Marking connection for close.",
+ (unsigned) circ_id);
if (conn->base_.type == CONN_TYPE_AP) {
entry_connection_t *entry_conn = EDGE_TO_ENTRY_CONN(conn);
connection_mark_unattached_ap(entry_conn, END_STREAM_REASON_DESTROY);
@@ -1847,8 +1847,8 @@ connection_ap_handshake_send_begin(entry_connection_t *ap_conn)
edge_conn->deliver_window = STREAMWINDOW_START;
base_conn->state = AP_CONN_STATE_CONNECT_WAIT;
log_info(LD_APP,"Address/port sent, ap socket "TOR_SOCKET_T_FORMAT
- ", n_circ_id %d",
- base_conn->s, circ->base_.n_circ_id);
+ ", n_circ_id %u",
+ base_conn->s, (unsigned)circ->base_.n_circ_id);
control_event_stream_status(ap_conn, STREAM_EVENT_SENT_CONNECT, 0);
/* If there's queued-up data, send it now */
@@ -1949,8 +1949,8 @@ connection_ap_handshake_send_resolve(entry_connection_t *ap_conn)
base_conn->address = tor_strdup("(Tor_internal)");
base_conn->state = AP_CONN_STATE_RESOLVE_WAIT;
log_info(LD_APP,"Address sent for resolve, ap socket "TOR_SOCKET_T_FORMAT
- ", n_circ_id %d",
- base_conn->s, circ->base_.n_circ_id);
+ ", n_circ_id %u",
+ base_conn->s, (unsigned)circ->base_.n_circ_id);
control_event_stream_status(ap_conn, STREAM_EVENT_NEW, 0);
control_event_stream_status(ap_conn, STREAM_EVENT_SENT_RESOLVE, 0);
return 0;
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index c4415c5..3616363 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -9,7 +9,6 @@
* \brief Functions to handle OR connections, TLS handshaking, and
* cells on the network.
**/
-
#include "or.h"
#include "buffers.h"
/*
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index af5f91a..38c6613 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -11,7 +11,6 @@
*
* Right now, we only use this for processing onionskins.
**/
-
#include "or.h"
#include "buffers.h"
#include "channel.h"
@@ -341,8 +340,8 @@ connection_cpu_process_inbuf(connection_t *conn)
circ = NULL;
log_debug(LD_OR,
"Unpacking cpuworker reply, chan_id is " U64_FORMAT
- ", circ_id is %d",
- U64_PRINTF_ARG(chan_id), circ_id);
+ ", circ_id is %u",
+ U64_PRINTF_ARG(chan_id), (unsigned)circ_id);
p_chan = channel_find_by_global_id(chan_id);
if (p_chan)
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 61e3b91..7115bf2 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -111,14 +111,14 @@ rend_client_reextend_intro_circuit(origin_circuit_t *circ)
// XXX: should we not re-extend if hs_circ_has_timed_out?
if (circ->remaining_relay_early_cells) {
log_info(LD_REND,
- "Re-extending circ %d, this time to %s.",
- circ->base_.n_circ_id,
+ "Re-extending circ %u, this time to %s.",
+ (unsigned)circ->base_.n_circ_id,
safe_str_client(extend_info_describe(extend_info)));
result = circuit_extend_to_new_exit(circ, extend_info);
} else {
log_info(LD_REND,
- "Closing intro circ %d (out of RELAY_EARLY cells).",
- circ->base_.n_circ_id);
+ "Closing intro circ %u (out of RELAY_EARLY cells).",
+ (unsigned)circ->base_.n_circ_id);
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_FINISHED);
/* connection_ap_handshake_attach_circuit will launch a new intro circ. */
result = 0;
@@ -386,8 +386,8 @@ rend_client_introduction_acked(origin_circuit_t *circ,
if (circ->base_.purpose != CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) {
log_warn(LD_PROTOCOL,
- "Received REND_INTRODUCE_ACK on unexpected circuit %d.",
- circ->base_.n_circ_id);
+ "Received REND_INTRODUCE_ACK on unexpected circuit %u.",
+ (unsigned)circ->base_.n_circ_id);
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL);
return -1;
}
diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index 1046ce3..1bd11f6 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -32,8 +32,8 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request,
int reason = END_CIRC_REASON_INTERNAL;
log_info(LD_REND,
- "Received an ESTABLISH_INTRO request on circuit %d",
- circ->p_circ_id);
+ "Received an ESTABLISH_INTRO request on circuit %u",
+ (unsigned) circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
@@ -114,8 +114,8 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request,
memcpy(circ->rend_token, pk_digest, DIGEST_LEN);
log_info(LD_REND,
- "Established introduction point on circuit %d for service %s",
- circ->p_circ_id, safe_str(serviceid));
+ "Established introduction point on circuit %u for service %s",
+ (unsigned) circ->p_circ_id, safe_str(serviceid));
return 0;
truncated:
@@ -139,13 +139,13 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
char serviceid[REND_SERVICE_ID_LEN_BASE32+1];
char nak_body[1];
- log_info(LD_REND, "Received an INTRODUCE1 request on circuit %d",
- circ->p_circ_id);
+ log_info(LD_REND, "Received an INTRODUCE1 request on circuit %u",
+ (unsigned)circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_warn(LD_PROTOCOL,
- "Rejecting INTRODUCE1 on non-OR or non-edge circuit %d.",
- circ->p_circ_id);
+ "Rejecting INTRODUCE1 on non-OR or non-edge circuit %u.",
+ (unsigned)circ->p_circ_id);
goto err;
}
@@ -155,9 +155,9 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
*/
if (request_len < (DIGEST_LEN+(MAX_NICKNAME_LEN+1)+REND_COOKIE_LEN+
DH_KEY_LEN+CIPHER_KEY_LEN+PKCS1_OAEP_PADDING_OVERHEAD)) {
- log_warn(LD_PROTOCOL, "Impossibly short INTRODUCE1 cell on circuit %d; "
+ log_warn(LD_PROTOCOL, "Impossibly short INTRODUCE1 cell on circuit %u; "
"responding with nack.",
- circ->p_circ_id);
+ (unsigned)circ->p_circ_id);
goto err;
}
@@ -168,17 +168,17 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
intro_circ = circuit_get_intro_point((char*)request);
if (!intro_circ) {
log_info(LD_REND,
- "No intro circ found for INTRODUCE1 cell (%s) from circuit %d; "
+ "No intro circ found for INTRODUCE1 cell (%s) from circuit %u; "
"responding with nack.",
- safe_str(serviceid), circ->p_circ_id);
+ safe_str(serviceid), (unsigned)circ->p_circ_id);
goto err;
}
log_info(LD_REND,
"Sending introduction request for service %s "
- "from circ %d to circ %d",
- safe_str(serviceid), circ->p_circ_id,
- intro_circ->p_circ_id);
+ "from circ %u to circ %u",
+ safe_str(serviceid), (unsigned)circ->p_circ_id,
+ (unsigned)intro_circ->p_circ_id);
/* Great. Now we just relay the cell down the circuit. */
if (relay_send_command_from_edge(0, TO_CIRCUIT(intro_circ),
@@ -221,8 +221,8 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request,
char hexid[9];
int reason = END_CIRC_REASON_TORPROTOCOL;
- log_info(LD_REND, "Received an ESTABLISH_RENDEZVOUS request on circuit %d",
- circ->p_circ_id);
+ log_info(LD_REND, "Received an ESTABLISH_RENDEZVOUS request on circuit %u",
+ (unsigned)circ->p_circ_id);
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_warn(LD_PROTOCOL,
@@ -256,8 +256,8 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request,
base16_encode(hexid,9,(char*)request,4);
log_info(LD_REND,
- "Established rendezvous point on circuit %d for cookie %s",
- circ->p_circ_id, hexid);
+ "Established rendezvous point on circuit %u for cookie %s",
+ (unsigned)circ->p_circ_id, hexid);
return 0;
err:
@@ -279,16 +279,16 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) {
log_info(LD_REND,
- "Tried to complete rendezvous on non-OR or non-edge circuit %d.",
- circ->p_circ_id);
+ "Tried to complete rendezvous on non-OR or non-edge circuit %u.",
+ (unsigned)circ->p_circ_id);
reason = END_CIRC_REASON_TORPROTOCOL;
goto err;
}
if (request_len != REND_COOKIE_LEN+DH_KEY_LEN+DIGEST_LEN) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
- "Rejecting RENDEZVOUS1 cell with bad length (%d) on circuit %d.",
- (int)request_len, circ->p_circ_id);
+ "Rejecting RENDEZVOUS1 cell with bad length (%d) on circuit %u.",
+ (int)request_len, (unsigned)circ->p_circ_id);
reason = END_CIRC_REASON_TORPROTOCOL;
goto err;
}
@@ -296,8 +296,8 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
base16_encode(hexid, sizeof(hexid), (const char*)request, 4);
log_info(LD_REND,
- "Got request for rendezvous from circuit %d to cookie %s.",
- circ->p_circ_id, hexid);
+ "Got request for rendezvous from circuit %u to cookie %s.",
+ (unsigned)circ->p_circ_id, hexid);
rend_circ = circuit_get_rendezvous((char*)request);
if (!rend_circ) {
@@ -314,15 +314,15 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
(char*)(request+REND_COOKIE_LEN),
request_len-REND_COOKIE_LEN, NULL)) {
log_warn(LD_GENERAL,
- "Unable to send RENDEZVOUS2 cell to client on circuit %d.",
- rend_circ->p_circ_id);
+ "Unable to send RENDEZVOUS2 cell to client on circuit %u.",
+ (unsigned)rend_circ->p_circ_id);
goto err;
}
/* Join the circuits. */
log_info(LD_REND,
- "Completing rendezvous: circuit %d joins circuit %d (cookie %s)",
- circ->p_circ_id, rend_circ->p_circ_id, hexid);
+ "Completing rendezvous: circuit %u joins circuit %u (cookie %s)",
+ (unsigned)circ->p_circ_id, (unsigned)rend_circ->p_circ_id, hexid);
circuit_change_purpose(TO_CIRCUIT(circ), CIRCUIT_PURPOSE_REND_ESTABLISHED);
circuit_change_purpose(TO_CIRCUIT(rend_circ),
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index a066e02..a8f63dd 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1126,8 +1126,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
/* Do some initial validation and logging before we parse the cell */
if (circuit->base_.purpose != CIRCUIT_PURPOSE_S_INTRO) {
log_warn(LD_PROTOCOL,
- "Got an INTRODUCE2 over a non-introduction circuit %d.",
- circuit->base_.n_circ_id);
+ "Got an INTRODUCE2 over a non-introduction circuit %u.",
+ (unsigned) circuit->base_.n_circ_id);
goto err;
}
@@ -1161,8 +1161,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
goto err;
}
- log_info(LD_REND, "Received INTRODUCE2 cell for service %s on circ %d.",
- escaped(serviceid), circuit->base_.n_circ_id);
+ log_info(LD_REND, "Received INTRODUCE2 cell for service %s on circ %u.",
+ escaped(serviceid), (unsigned)circuit->base_.n_circ_id);
/* use intro key instead of service key. */
intro_key = circuit->intro_key;
@@ -1177,7 +1177,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (!parsed_req) {
goto log_error;
} else if (err_msg) {
- log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id);
+ log_info(LD_REND, "%s on circ %u.", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
tor_free(err_msg);
}
@@ -1187,7 +1188,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) {
goto log_error;
} else if (err_msg) {
- log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id);
+ log_info(LD_REND, "%s on circ %u.", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
tor_free(err_msg);
}
@@ -1223,7 +1225,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) {
goto log_error;
} else if (err_msg) {
- log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id);
+ log_info(LD_REND, "%s on circ %u.", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
tor_free(err_msg);
}
@@ -1233,7 +1236,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) {
goto log_error;
} else if (err_msg) {
- log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id);
+ log_info(LD_REND, "%s on circ %u.", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
tor_free(err_msg);
}
@@ -1243,7 +1247,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
if (result < 0) {
goto log_error;
} else if (err_msg) {
- log_info(LD_REND, "%s on circ %d.", err_msg, circuit->base_.n_circ_id);
+ log_info(LD_REND, "%s on circ %u.", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
tor_free(err_msg);
}
stage_descr = NULL;
@@ -1393,7 +1398,8 @@ rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
}
}
- log_warn(LD_REND, "%s on circ %d", err_msg, circuit->base_.n_circ_id);
+ log_warn(LD_REND, "%s on circ %u", err_msg,
+ (unsigned)circuit->base_.n_circ_id);
err:
status = -1;
if (dh) crypto_dh_free(dh);
@@ -2417,8 +2423,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
service = rend_service_get_by_pk_digest(
circuit->rend_data->rend_pk_digest);
if (!service) {
- log_warn(LD_REND, "Unrecognized service ID %s on introduction circuit %d.",
- serviceid, circuit->base_.n_circ_id);
+ log_warn(LD_REND, "Unrecognized service ID %s on introduction circuit %u.",
+ serviceid, (unsigned)circuit->base_.n_circ_id);
reason = END_CIRC_REASON_NOSUCHSERVICE;
goto err;
}
@@ -2461,8 +2467,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
}
log_info(LD_REND,
- "Established circuit %d as introduction point for service %s",
- circuit->base_.n_circ_id, serviceid);
+ "Established circuit %u as introduction point for service %s",
+ (unsigned)circuit->base_.n_circ_id, serviceid);
/* Use the intro key instead of the service key in ESTABLISH_INTRO. */
intro_key = circuit->intro_key;
@@ -2496,8 +2502,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
RELAY_COMMAND_ESTABLISH_INTRO,
buf, len, circuit->cpath->prev)<0) {
log_info(LD_GENERAL,
- "Couldn't send introduction request for service %s on circuit %d",
- serviceid, circuit->base_.n_circ_id);
+ "Couldn't send introduction request for service %s on circuit %u",
+ serviceid, (unsigned)circuit->base_.n_circ_id);
reason = END_CIRC_REASON_INTERNAL;
goto err;
}
@@ -2539,8 +2545,8 @@ rend_service_intro_established(origin_circuit_t *circuit,
service = rend_service_get_by_pk_digest(
circuit->rend_data->rend_pk_digest);
if (!service) {
- log_warn(LD_REND, "Unknown service on introduction circuit %d.",
- circuit->base_.n_circ_id);
+ log_warn(LD_REND, "Unknown service on introduction circuit %u.",
+ (unsigned)circuit->base_.n_circ_id);
goto err;
}
service->desc_is_dirty = time(NULL);
@@ -2549,8 +2555,8 @@ rend_service_intro_established(origin_circuit_t *circuit,
base32_encode(serviceid, REND_SERVICE_ID_LEN_BASE32 + 1,
circuit->rend_data->rend_pk_digest, REND_SERVICE_ID_LEN);
log_info(LD_REND,
- "Received INTRO_ESTABLISHED cell on circuit %d for service %s",
- circuit->base_.n_circ_id, serviceid);
+ "Received INTRO_ESTABLISHED cell on circuit %u for service %s",
+ (unsigned)circuit->base_.n_circ_id, serviceid);
/* Getting a valid INTRODUCE_ESTABLISHED means we've successfully
* used the circ */
@@ -2597,9 +2603,9 @@ rend_service_rendezvous_has_opened(origin_circuit_t *circuit)
circuit->rend_data->rend_pk_digest, REND_SERVICE_ID_LEN);
log_info(LD_REND,
- "Done building circuit %d to rendezvous with "
+ "Done building circuit %u to rendezvous with "
"cookie %s for service %s",
- circuit->base_.n_circ_id, hexcookie, serviceid);
+ (unsigned)circuit->base_.n_circ_id, hexcookie, serviceid);
/* Clear the 'in-progress HS circ has timed out' flag for
* consistency with what happens on the client side; this line has
@@ -3339,8 +3345,8 @@ rend_service_set_connection_addr_port(edge_connection_t *conn,
circ->rend_data->rend_pk_digest);
if (!service) {
log_warn(LD_REND, "Couldn't find any service associated with pk %s on "
- "rendezvous circuit %d; closing.",
- serviceid, circ->base_.n_circ_id);
+ "rendezvous circuit %u; closing.",
+ serviceid, (unsigned)circ->base_.n_circ_id);
return -1;
}
matching_ports = smartlist_new();
1
0
[torbrowser/maint-2.4] update pdfjs URL for alpha bundles since Mozilla has changed it depending on the platform
by erinn@torproject.org 10 Mar '13
by erinn@torproject.org 10 Mar '13
10 Mar '13
commit 2e0acfc476d4d1c9e9f8d261030833b15248f424
Author: Erinn Clark <erinn(a)torproject.org>
Date: Sun Mar 10 21:59:17 2013 +0100
update pdfjs URL for alpha bundles since Mozilla has changed it depending on the platform
---
build-scripts/linux-alpha.mk | 1 +
build-scripts/osx-alpha.mk | 1 +
build-scripts/versions-alpha.mk | 1 -
build-scripts/windows-alpha.mk | 1 +
4 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/build-scripts/linux-alpha.mk b/build-scripts/linux-alpha.mk
index 65227e8..bccddf9 100644
--- a/build-scripts/linux-alpha.mk
+++ b/build-scripts/linux-alpha.mk
@@ -426,6 +426,7 @@ install-torbutton: torbutton.xpi
mkdir -p $(BUNDLE)/Data/profile/extensions/
cp torbutton.xpi $(BUNDLE)/Data/profile/extensions/torbutton(a)torproject.org.xpi
+PDFJS_URL=https://addons.mozilla.org/firefox/downloads/latest/352704/platform:2/$(PDFJS_PACKAGE)
install-pdfjs: pdfjs.xpi
cp pdfjs.xpi $(BUNDLE)/Data/profile/extensions/uriloader(a)pdf.js.xpi
diff --git a/build-scripts/osx-alpha.mk b/build-scripts/osx-alpha.mk
index 31f15d8..dc9b2fe 100644
--- a/build-scripts/osx-alpha.mk
+++ b/build-scripts/osx-alpha.mk
@@ -466,6 +466,7 @@ install-noscript: noscript.xpi
cp noscript.xpi $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/extensions/\{73a6fe31-595d-460b-a920-fcc0f8843232\}/noscript.zip
(cd $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/extensions/\{73a6fe31-595d-460b-a920-fcc0f8843232\} && unzip *.zip && rm *.zip)
+PDFJS_URL=https://addons.mozilla.org/firefox/downloads/latest/352704/platform:3/$(PDFJS_PACKAGE)
install-pdfjs: pdfjs.xpi
cp pdfjs.xpi $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/extensions/uriloader(a)pdf.js.xpi
diff --git a/build-scripts/versions-alpha.mk b/build-scripts/versions-alpha.mk
index 3ea071b..f9237db 100644
--- a/build-scripts/versions-alpha.mk
+++ b/build-scripts/versions-alpha.mk
@@ -54,7 +54,6 @@ MOZBUILD_URL=https://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win3…
TORBUTTON_URL=https://people.torproject.org/~mikeperry/$(TORBUTTON_PACKAGE)
NOSCRIPT_URL=https://addons.mozilla.org/firefox/downloads/latest/722/$(NOSC…
HTTPSEVERYWHERE_URL=https://eff.org/files/$(HTTPSEVERYWHERE_PACKAGE)
-PDFJS_URL=https://addons.mozilla.org/firefox/downloads/latest/352704/$(PDFJS_PACKAGE)
OBFSPROXY_URL=https://archive.torproject.org/tor-package-archive/obfsproxy/…
# Provide some mappings between lower and upper case, which means we don't need
diff --git a/build-scripts/windows-alpha.mk b/build-scripts/windows-alpha.mk
index 987200f..0cc4854 100644
--- a/build-scripts/windows-alpha.mk
+++ b/build-scripts/windows-alpha.mk
@@ -452,6 +452,7 @@ install-noscript: $(SEVENZIP) noscript.xpi
cp noscript.xpi $(BUNDLE)/FirefoxPortable/Data/profile/extensions/\{73a6fe31-595d-460b-a920-fcc0f8843232\}/noscript.zip
(cd $(BUNDLE)/FirefoxPortable/Data/profile/extensions/\{73a6fe31-595d-460b-a920-fcc0f8843232\} && $(SEVENZIP) x *.zip && rm *.zip)
+PDFJS_URL=https://addons.mozilla.org/firefox/downloads/latest/352704/platform:5/$(PDFJS_PACKAGE)
install-pdfjs: pdfjs.xpi
mkdir -p $(BUNDLE)/FirefoxPortable/Data/profile/extensions/
cp pdfjs.xpi $(BUNDLE)/FirefoxPortable/Data/profile/extensions/uriloader(a)pdf.js.xpi
1
0
[torbrowser/maint-2.4] Linux: fix langpacks so branding displays properly for non-en-US languages
by erinn@torproject.org 10 Mar '13
by erinn@torproject.org 10 Mar '13
10 Mar '13
commit 503812ba5521260e7fdb466c0329f8552ff3d4b6
Author: Erinn Clark <erinn(a)torproject.org>
Date: Sun Mar 10 18:39:46 2013 +0100
Linux: fix langpacks so branding displays properly for non-en-US languages
---
build-scripts/linux-alpha.mk | 6 +++++-
build-scripts/linux.mk | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/build-scripts/linux-alpha.mk b/build-scripts/linux-alpha.mk
index 721c943..65227e8 100644
--- a/build-scripts/linux-alpha.mk
+++ b/build-scripts/linux-alpha.mk
@@ -440,6 +440,8 @@ ifneq ($(LANGCODE), en-US)
FFDIR=$(BUNDLE)/Data/profile/extensions/; \
CHROMEDIR="$$FFDIR/chrome/"; \
mkdir -p "$$CHROMEDIR/$$LC/locale/branding"; \
+ cp $(FIREFOX_DIR)/browser/branding/official/locales/en-US/brand.dtd "$$CHROMEDIR/$$LC/locale/branding"; \
+ cp $(FIREFOX_DIR)/browser/branding/official/locales/en-US/brand.properties "$$CHROMEDIR/$$LC/locale/branding"; \
mkdir -p "$$CHROMEDIR/$$LC/locale/browser-region"; \
cp config/region.properties \
"$$CHROMEDIR/$$LC/locale/browser-region/"; \
@@ -447,7 +449,9 @@ ifneq ($(LANGCODE), en-US)
> "$$CHROMEDIR/$$LC/locale/branding/browserconfig.properties"; \
(cd "$$FFDIR"; \
zip -u "$$PFILE" "chrome/$$LC/locale/branding/browserconfig.properties" \
- "chrome/$$LC/locale/browser-region/region.properties"); \
+ "chrome/$$LC/locale/browser-region/region.properties" \
+ "chrome/$$LC/locale/branding/brand.dtd" \
+ "chrome/$$LC/locale/branding/brand.properties"); \
rm -rf "$$CHROMEDIR"
endif
diff --git a/build-scripts/linux.mk b/build-scripts/linux.mk
index f5d71e4..09faf3a 100644
--- a/build-scripts/linux.mk
+++ b/build-scripts/linux.mk
@@ -403,6 +403,8 @@ ifneq ($(LANGCODE), en-US)
FFDIR=$(BUNDLE)/Data/profile/extensions/; \
CHROMEDIR="$$FFDIR/chrome/"; \
mkdir -p "$$CHROMEDIR/$$LC/locale/branding"; \
+ cp $(FIREFOX_DIR)/browser/branding/official/locales/en-US/brand.dtd "$$CHROMEDIR/$$LC/locale/branding"; \
+ cp $(FIREFOX_DIR)/browser/branding/official/locales/en-US/brand.properties "$$CHROMEDIR/$$LC/locale/branding"; \
mkdir -p "$$CHROMEDIR/$$LC/locale/browser-region"; \
cp config/region.properties \
"$$CHROMEDIR/$$LC/locale/browser-region/"; \
@@ -410,7 +412,9 @@ ifneq ($(LANGCODE), en-US)
> "$$CHROMEDIR/$$LC/locale/branding/browserconfig.properties"; \
(cd "$$FFDIR"; \
zip -u "$$PFILE" "chrome/$$LC/locale/branding/browserconfig.properties" \
- "chrome/$$LC/locale/browser-region/region.properties"); \
+ "chrome/$$LC/locale/browser-region/region.properties" \
+ "chrome/$$LC/locale/branding/brand.dtd" \
+ "chrome/$$LC/locale/branding/brand.properties"); \
rm -rf "$$CHROMEDIR"
endif
1
0