[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: : Export END_CIRC_REASON_* to controler



Thus spake Mike Perry (mikepery@xxxxxxxxxx):

> Thus spake Roger Dingledine (arma@xxxxxxx):
> 
> > On Fri, Oct 13, 2006 at 02:57:02AM -0500, Mike Perry wrote:
> > > > Probably, we should define more reasons; see some of the comments I
> > > > did for the patch in r8672 for other reasons that don't match up with
> > > > what the spec seems to say.


> Index: src/or/command.c
> ===================================================================
> --- src/or/command.c	(revision 8701)
> +++ src/or/command.c	(working copy)
> @@ -379,18 +379,12 @@
>      circuit_set_n_circid_orconn(circ, 0, NULL);
>      if (CIRCUIT_IS_ORIGIN(circ)) {
>        /* Prevent arbitrary destroys from going unnoticed by controller */
> -      /* XXXX Not quite right; what we want is to tell the controller the
> -       *      exact reason that we were asked to close, but tell it that we
> -       *      closed because we were asked. Anything else is not accurate.
> -       *      OR_CONN_CLOSED is certainly wrong, since a destroy doesn't mean
> -       *      that the underlying OR connection got closed. -NM */
> -#if 0
>        if (reason == END_CIRC_AT_ORIGIN ||
>            reason == END_CIRC_REASON_NONE ||
> +          reason == END_CIRC_REASON_FINISHED ||
>            reason == END_CIRC_REASON_REQUESTED) {
> -        reason = END_CIRC_REASON_OR_CONN_CLOSED;
> +        reason = END_CIRC_REASON_DESTROYED;
>        }
> -#endif
>        circuit_mark_for_close(circ, reason);
>      } else {
>        char payload[1];

Actually, maybe the if should be removed entirely from this block, and
we should always report ENC_CIRC_REASON_DESTROYED if we get a destroy
and we are the origin. That way destroys can't be disguised as other
invalid reasons either.

-- 
Mike Perry
Mad Computer Scientist
fscked.org evil labs