New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream end events miss streams closed by the client #510

Open
robgjansen opened this Issue Jun 19, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@robgjansen
Collaborator

robgjansen commented Jun 19, 2018

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 connection.c, near the same place that control_event_privcount_connection() is currently called. We could add something like:

  if (conn->type == CONN_TYPE_EXIT) {
    control_event_privcount_stream_closed(TO_EXIT_CONN(conn));
  }

I think this will count all exit connections. I suggest that this counter be called PRIVCOUNT_STREAM_CLOSED.

@robgjansen robgjansen added the bug label Jun 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment