sendme: Always close stream if deliver window is negative
commit0e6e800c89c7cfef255491179473e13de5f72d03
authorDavid Goulet <dgoulet@torproject.org>
Wed, 9 Jan 2019 16:03:49 +0000 (9 11:03 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Mon, 29 Apr 2019 16:17:57 +0000 (29 12:17 -0400)
treeef6485687e1ef21246fb10c6266fb39b60558bc9
parent8e38791baf48ca2a4c865f3b7fc264392e63f426
sendme: Always close stream if deliver window is negative

Previously, we would only close the stream when our deliver window was
negative at the circuit-level but _not_ at the stream-level when receiving a
DATA cell.

This commit adds an helper function connection_edge_end_close() which
sends an END and then mark the stream for close for a given reason.

That function is now used both in case the deliver window goes below zero for
both circuit and stream level.

Part of #26840

Signed-off-by: David Goulet <dgoulet@torproject.org>
src/core/or/connection_edge.c
src/core/or/connection_edge.h
src/core/or/relay.c