aboutsummaryrefslogtreecommitdiff
path: root/src/or/relay.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-04-11 01:46:28 -0400
committerNick Mathewson <nickm@torproject.org>2013-04-11 01:46:28 -0400
commit922ab0883d2f037d18cfc02083c68777e4dfb349 (patch)
tree4902a8910dcdbf608cc4a1a5ed5e0db4435481b1 /src/or/relay.c
parentee3cc44f27b6620ad25a20bb16fcffe23ca66663 (diff)
parent7d1ade251bad76c82b3f1288097587e0fbd1c4ae (diff)
downloadtor-922ab0883d2f037d18cfc02083c68777e4dfb349.tar
tor-922ab0883d2f037d18cfc02083c68777e4dfb349.tar.gz
Merge remote-tracking branch 'public/bug8185_diagnostic' into maint-0.2.4
Diffstat (limited to 'src/or/relay.c')
-rw-r--r--src/or/relay.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 0ca3e56fd..52ff32f0c 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -379,15 +379,22 @@ relay_crypt(circuit_t *circ, cell_t *cell, cell_direction_t cell_direction,
static int
circuit_package_relay_cell(cell_t *cell, circuit_t *circ,
cell_direction_t cell_direction,
- crypt_path_t *layer_hint, streamid_t on_stream)
+ crypt_path_t *layer_hint, streamid_t on_stream,
+ const char *filename, int lineno)
{
channel_t *chan; /* where to send the cell */
if (cell_direction == CELL_DIRECTION_OUT) {
crypt_path_t *thishop; /* counter for repeated crypts */
chan = circ->n_chan;
- if (!CIRCUIT_IS_ORIGIN(circ) || !chan) {
- log_warn(LD_BUG,"outgoing relay cell has n_chan==NULL. Dropping.");
+ if (!chan) {
+ log_warn(LD_BUG,"outgoing relay cell sent from %s:%d has n_chan==NULL."
+ " Dropping.", filename, lineno);
+ return 0; /* just drop it */
+ }
+ if (!CIRCUIT_IS_ORIGIN(circ)) {
+ log_warn(LD_BUG,"outgoing relay cell sent from %s:%d on non-origin "
+ "circ. Dropping.", filename, lineno);
return 0; /* just drop it */
}
@@ -548,9 +555,10 @@ relay_command_to_string(uint8_t command)
* return 0.
*/
int
-relay_send_command_from_edge(streamid_t stream_id, circuit_t *circ,
- uint8_t relay_command, const char *payload,
- size_t payload_len, crypt_path_t *cpath_layer)
+relay_send_command_from_edge_(streamid_t stream_id, circuit_t *circ,
+ uint8_t relay_command, const char *payload,
+ size_t payload_len, crypt_path_t *cpath_layer,
+ const char *filename, int lineno)
{
cell_t cell;
relay_header_t rh;
@@ -633,7 +641,7 @@ relay_send_command_from_edge(streamid_t stream_id, circuit_t *circ,
}
if (circuit_package_relay_cell(&cell, circ, cell_direction, cpath_layer,
- stream_id) < 0) {
+ stream_id, filename, lineno) < 0) {
log_warn(LD_BUG,"circuit_package_relay_cell failed. Closing.");
circuit_mark_for_close(circ, END_CIRC_REASON_INTERNAL);
return -1;