diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-21 09:20:03 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-21 09:20:03 -0400 |
commit | 2ad062ee601bc30594b81a33404662fbd59ef8b1 (patch) | |
tree | 95b8a086f37938c09cebacc9ffa1ae06bb230682 /src/test/test_relaycell.c | |
parent | d46969e8208394640d9fe84edbc428329d4ec642 (diff) | |
parent | 46b06cd6999439608f4a8a34bb68f6fe6a6311e9 (diff) | |
download | tor-2ad062ee601bc30594b81a33404662fbd59ef8b1.tar.gz tor-2ad062ee601bc30594b81a33404662fbd59ef8b1.zip |
Merge branch 'mikeperry_bug26214-rebased_squashed'
Diffstat (limited to 'src/test/test_relaycell.c')
-rw-r--r-- | src/test/test_relaycell.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c index 770692440d..64b0664292 100644 --- a/src/test/test_relaycell.c +++ b/src/test/test_relaycell.c @@ -246,11 +246,26 @@ test_circbw_relay(void *arg) circ->cpath); ASSERT_UNCOUNTED_BW(); - /* Sendme on stream: not counted */ + /* Sendme on valid stream: counted */ ENTRY_TO_CONN(entryconn)->outbuf_flushlen = 0; PACK_CELL(1, RELAY_COMMAND_SENDME, "Data1234"); connection_edge_process_relay_cell(&cell, TO_CIRCUIT(circ), edgeconn, circ->cpath); + ASSERT_COUNTED_BW(); + + /* Sendme on valid stream with full window: not counted */ + ENTRY_TO_CONN(entryconn)->outbuf_flushlen = 0; + PACK_CELL(1, RELAY_COMMAND_SENDME, "Data1234"); + edgeconn->package_window = 500; + connection_edge_process_relay_cell(&cell, TO_CIRCUIT(circ), edgeconn, + circ->cpath); + ASSERT_UNCOUNTED_BW(); + + /* Sendme on unknown stream: not counted */ + ENTRY_TO_CONN(entryconn)->outbuf_flushlen = 0; + PACK_CELL(1, RELAY_COMMAND_SENDME, "Data1234"); + connection_edge_process_relay_cell(&cell, TO_CIRCUIT(circ), NULL, + circ->cpath); ASSERT_UNCOUNTED_BW(); /* Sendme on circuit with full window: not counted */ |