mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Bug 26259: Don't count 0-length RELAY_COMMAND_DATA in CIRC_BW OVERHEAD
This cell should be treated as invalid for purposes of CIRC_BW.
This commit is contained in:
parent
d7bbfd0f62
commit
93ee227e18
@ -1556,7 +1556,7 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ,
|
||||
return -END_CIRC_REASON_TORPROTOCOL;
|
||||
}
|
||||
/* Total all valid application bytes delivered */
|
||||
if (CIRCUIT_IS_ORIGIN(circ)) {
|
||||
if (CIRCUIT_IS_ORIGIN(circ) && rh.length > 0) {
|
||||
circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length);
|
||||
}
|
||||
|
||||
|
@ -233,6 +233,13 @@ test_circbw_relay(void *arg)
|
||||
circ->cpath);
|
||||
ASSERT_COUNTED_BW();
|
||||
|
||||
/* Empty Data cell on open connection: not counted */
|
||||
ENTRY_TO_CONN(entryconn)->marked_for_close = 0;
|
||||
PACK_CELL(1, RELAY_COMMAND_DATA, "");
|
||||
connection_edge_process_relay_cell(&cell, TO_CIRCUIT(circ), edgeconn,
|
||||
circ->cpath);
|
||||
ASSERT_UNCOUNTED_BW();
|
||||
|
||||
/* Sendme on stream: not counted */
|
||||
ENTRY_TO_CONN(entryconn)->outbuf_flushlen = 0;
|
||||
PACK_CELL(1, RELAY_COMMAND_SENDME, "Data1234");
|
||||
|
Loading…
Reference in New Issue
Block a user