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

Re: actually receive multiple different kinds of events



On Fri, Mar 25, 2005 at 12:50:51AM -0500, Nick Mathewson wrote:
> On Thu, Mar 24, 2005 at 09:03:22PM -0500, Geoffrey Goodell wrote:
> > see attached
> 
> This patch is incorrect.  It will break in two ways:
> 
> > --- control.c.orig	2005-03-24 20:58:17.000000000 -0500
> > +++ control.c	2005-03-24 20:59:16.000000000 -0500
> > @@ -174,7 +174,6 @@
> >    connection_t **conns;
> >    int n_conns, i;
> >  
> > -  global_event_mask = 0;
> >    get_connection_array(&conns, &n_conns);
> >    for (i = 0; i < n_conns; ++i) {
> >      if (conns[i]->type == CONN_TYPE_CONTROL &&
> 
> This will make global_event_mask contain every event that every
> controller was ever interested in: no good!
> 
> > @@ -267,7 +266,7 @@
> >    for (i = 0; i < n_conns; ++i) {
> >      if (conns[i]->type == CONN_TYPE_CONTROL &&
> >          conns[i]->state == CONTROL_CONN_STATE_OPEN &&
> > -        conns[i]->event_mask & (1<<event)) {
> > +        global_event_mask & (1<<event)) {
> 
> This will make every controller receive every event that any
> controller is interested in.
> 
> I think you might be confused about the semantics of SETEVENTS: it
> takes a list of all the events that the controller is currently
> interested in: events not listed are cleared.  I've updated
> control-spec.txt to reflect this.

Hm, you are right.  I had no idea about the clearing, though I suppose
that that would explain the alarming lack of unsubscription messages!

Thanks,

Geoff

Attachment: signature.asc
Description: Digital signature