Skip to content

proto: Make StreamTarget::close() misuse less likely.

Nick Mathewson requested to merge nickm/arti:terminate_pending_stream into main

It turns out that we can make IncomingStream::reject() consume self, thus making it impossible to hit the double-close error from outside the tor-proto crate.

Also, we rename StreamTarget::close() to close_pending() to better reflect its limited applicability.


While working on this, I found #1065 (closed), which isn't so great; it may be that this is not the right approach. I'm sharing this branch anyway since:

  1. At least it isn't a step backwards.
  2. It demonstrates an API direction in IncomingStream that might help us solve #1065 (closed).
Edited by Nick Mathewson

Merge request reports