[762] in Zephyr_Bugs
Re: ZUnsubscribeTo removing ALL subscriptions
daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Sun Mar 24 18:19:57 1996
From: ghudson@MIT.EDU
Date: Sun, 24 Mar 1996 18:19:54 -0500
To: "W. Scott Meeks" <meeks@osf.org>
Cc: bug-zephyr@MIT.EDU
In-Reply-To: "[755] in Zephyr_Bugs"
> I've been experimenting with subscriptions in Zephyr. I have a case
> where I add several subscriptions using ZSubscribeTo and then I
> remove one of these subscriptions with ZUnsubscribeTo. When I use
> ZRetrieveSubscriptions to look at my current subscriptions, I have
> no subscriptions. I can reproduce this in zctl using subscribe,
> unsubscribe and retrieve so that's why I think it's a bug in Zephyr.
> I will appreciate any help you can give me.
There is a known bug in Zephyr 2.0.2 which causes this problem. A
patch to fix it is:
*** server/subscr.c.old Sun Mar 24 18:19:06 1996
--- server/subscr.c Sun Mar 24 18:18:50 1996
***************
*** 297,303 ****
ZNotice_t *notice;
{
Client *who;
! Destlist *cancel_subs, *subs, *client_subs, *next;
Code_t retval;
int found = 0;
int relation;
--- 297,303 ----
ZNotice_t *notice;
{
Client *who;
! Destlist *cancel_subs, *subs, *client_subs, *next, *next2;
Code_t retval;
int found = 0;
int relation;
***************
*** 318,325 ****
for (subs = cancel_subs; subs; subs = next) {
next = subs->next;
! for (client_subs = who->subs; client_subs; client_subs = next) {
! next = client_subs->next;
if (ZDest_eq(&client_subs->dest, &subs->dest)) {
LIST_DELETE(client_subs);
triplet_deregister(who, &client_subs->dest);
--- 318,325 ----
for (subs = cancel_subs; subs; subs = next) {
next = subs->next;
! for (client_subs = who->subs; client_subs; client_subs = next2) {
! next2 = client_subs->next;
if (ZDest_eq(&client_subs->dest, &subs->dest)) {
LIST_DELETE(client_subs);
triplet_deregister(who, &client_subs->dest);