aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-06-11 09:24:16 -0400
committerNick Mathewson <nickm@torproject.org>2014-06-11 09:24:16 -0400
commite8dd34f1655e376942af2792f7d605898166b631 (patch)
treef0f52d9326a9ed1a60708786a1d3ef059aaaa50a
parenta5036d20cee159689f06cd9832bb0a21dcff888e (diff)
parent7581014a86de8a5e1f76cf29a988b4df0c6e6316 (diff)
downloadtor-e8dd34f1655e376942af2792f7d605898166b631.tar
tor-e8dd34f1655e376942af2792f7d605898166b631.tar.gz
Merge remote-tracking branch 'public/not_bug8093'
-rw-r--r--changes/not_bug_80934
-rw-r--r--src/or/relay.c10
2 files changed, 12 insertions, 2 deletions
diff --git a/changes/not_bug_8093 b/changes/not_bug_8093
new file mode 100644
index 000000000..98b421926
--- /dev/null
+++ b/changes/not_bug_8093
@@ -0,0 +1,4 @@
+ o Minor bugfixes:
+ - When rejecting DATA cells for stream_id zero, still count them against
+ the circuit's deliver window so that we don't get fail to send a
+ SENDME. Fix for bug 11246; bugfix on 0.2.4.10-alpha.
diff --git a/src/or/relay.c b/src/or/relay.c
index 509d7ced0..66d1251eb 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1437,7 +1437,6 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ,
switch (rh.command) {
case RELAY_COMMAND_BEGIN:
case RELAY_COMMAND_CONNECTED:
- case RELAY_COMMAND_DATA:
case RELAY_COMMAND_END:
case RELAY_COMMAND_RESOLVE:
case RELAY_COMMAND_RESOLVED:
@@ -1462,6 +1461,9 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ,
* EXIT_CONN_STATE_CONNECTING or EXIT_CONN_STATE_RESOLVING.
* This speeds up HTTP, for example. */
optimistic_data = 1;
+ } else if (rh.stream_id == 0 && rh.command == RELAY_COMMAND_DATA) {
+ log_warn(LD_BUG, "Somehow I had a connection that matched a "
+ "data cell with stream ID 0.");
} else {
return connection_edge_process_relay_cell_not_open(
&rh, cell, circ, conn, layer_hint);
@@ -1522,7 +1524,11 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ,
circuit_consider_sending_sendme(circ, layer_hint);
- if (!conn) {
+ if (rh.stream_id == 0) {
+ log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Relay data cell with zero "
+ "stream_id. Dropping.");
+ return 0;
+ } else if (!conn) {
log_info(domain,"data cell dropped, unknown stream (streamid %d).",
rh.stream_id);
return 0;