diff options
Diffstat (limited to 'src/libventi/conn.c')
-rw-r--r-- | src/libventi/conn.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libventi/conn.c b/src/libventi/conn.c index 990e7db2..5b6d5436 100644 --- a/src/libventi/conn.c +++ b/src/libventi/conn.c @@ -32,15 +32,19 @@ vtfreeconn(VtConn *z) { vthangup(z); qlock(&z->lk); - for(;;){ + /* + * Wait for send and recv procs to notice + * the hangup and clear out the queues. + */ + while(z->readq || z->writeq){ if(z->readq) _vtqhangup(z->readq); - else if(z->writeq) + if(z->writeq) _vtqhangup(z->writeq); - else - break; rsleep(&z->rpcfork); } packetfree(z->part); + vtfree(z->version); + vtfree(z->sid); vtfree(z); } |