Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
stream end events miss streams closed by the client #510
It turns out that the Tor code that emits PrivCount events only emits a PRIVCOUNT_STREAM_ENDED event in the case that the exit relay sends a relay end cell toward the client to notify it that the stream closed. This happens if the server closes the server side of the exit connection, or if the server and client close their respective connections at roughly the same time. But the exit does not send a relay end cell if the client closes the connection first, i.e., if the exit receives a relay end cell from the client before the server-side exit connection is closed.
If we want to count all stream events, we should add some code to Tor to
I think this will count all exit connections. I suggest that this counter be called