From 701a7504158ca4b7b3803ec25c72772326ed71c3 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Sat, 15 Feb 2003 05:27:04 +0000 Subject: [PATCH] viced-consistent-val-and-len-cleanup-20030215 just so we don't leave things inconsistent ever --- src/viced/afsfileprocs.c | 1 + src/viced/host.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 227909bfe..5cc2e116a 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -6002,6 +6002,7 @@ afs_int32 SRXAFS_FlushCPS(struct rx_call *acall, if ((client->ViceId != ANONYMOUSID) && client->CPS.prlist_val) { free(client->CPS.prlist_val); client->CPS.prlist_val = NULL; + client->CPS.prlist_len = 0; } ReleaseWriteLock(&client->lock); } diff --git a/src/viced/host.c b/src/viced/host.c index 209a0067e..7d5f0b9bc 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -582,7 +582,6 @@ struct host *h_Alloc_r(register struct rx_connection *r_con) host->hostFlags = 0; host->hcps.prlist_val = NULL; host->hcps.prlist_len = 0; - host->hcps.prlist_val = NULL; host->interface = 0; #ifdef undef host->hcpsfailed = 0; /* save cycles */ @@ -706,13 +705,14 @@ int h_TossStuff_r(register struct host *host) h_Unlock_r(host); } - /* ASSUMPTION: r_FreeConnection() does not yield */ + /* ASSUMPTION: rxi_FreeConnection() does not yield */ for (cp = &host->FirstClient; (client = *cp); ) { if ((host->hostFlags & HOSTDELETED) || client->deleted) { if ((client->ViceId != ANONYMOUSID) && client->CPS.prlist_val) { free(client->CPS.prlist_val); client->CPS.prlist_val = NULL; } + client->CPS.prlist_len = 0; if (client->tcon) { rx_SetSpecific(client->tcon, rxcon_client_key, (void *)0); } @@ -1388,6 +1388,7 @@ ticket name length != 64 client->sid = rxr_CidOf(tcon); client->VenusEpoch = rxr_GetEpoch(tcon); client->CPS.prlist_val = 0; + client->CPS.prlist_len = 0; client->refCount = 1; CurrentConnections++; /* increment number of connections */ } @@ -1399,6 +1400,7 @@ ticket name length != 64 free(client->CPS.prlist_val); } client->CPS.prlist_val = NULL; + client->CPS.prlist_len = 0; client->ViceId = viceid; client->expTime = expTime; -- 2.39.5