Commit b77756fd authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(isc_insert): Changed return type to void. Don't manipulate the

	useless nlinks field.
(isc_remove): Don't manipulate the useless nlinks field.
(isc_create): Ditto.
(isc_destroy): Ditto.
parent 2b67695c
......@@ -64,7 +64,7 @@ static oop_call_time stale_cb;
/*
** Insert a session into a master control structure
*/
int
void
isc_insert(struct isc_mcb *mcb,
struct isc_scb_internal *scb)
{
......@@ -89,8 +89,6 @@ isc_insert(struct isc_mcb *mcb,
}
mcb->sessions = isl;
return ++((struct isc_scb_internal*)scb)->nlinks;
}
......@@ -160,7 +158,7 @@ isc_remove(struct isc_mcb *mcb,
isc_free(isl);
return --((struct isc_scb_internal*)scb)->nlinks;
return 0;
}
......@@ -177,7 +175,6 @@ isc_create(struct isc_mcb *mcb,
ISC_XNEW(scb);
scb->nlinks = 0;
scb->pub.fd = -1;
scb->state = initial_state;
scb->wr_msg_q = NULL;
......@@ -417,41 +414,34 @@ isc_destroy(struct isc_mcb *mcb,
assert(sci->accept_cb == NULL);
/*
** Only close and deallocate storage if last reference has been
** removed.
*/
if (sci->nlinks <= 0)
if (scb->raddr)
{
if (scb->raddr)
{
isc_freeaddress(scb->raddr);
scb->raddr = NULL;
}
isc_freeaddress(scb->raddr);
scb->raddr = NULL;
}
if (scb->laddr)
{
isc_freeaddress(scb->laddr);
scb->laddr = NULL;
}
if (scb->fd != -1)
{
close(scb->fd);
scb->fd = -1;
}
if (sci->wr_msg_q)
{
size = isc_killqueue(sci->wr_msg_q);
if (mcb->write_change_cb)
mcb->write_change_cb(-size);
}
if (scb->laddr)
{
isc_freeaddress(scb->laddr);
scb->laddr = NULL;
}
if (scb->fd != -1)
{
close(scb->fd);
scb->fd = -1;
}
isc_free(scb);
if (sci->wr_msg_q)
{
size = isc_killqueue(sci->wr_msg_q);
if (mcb->write_change_cb)
mcb->write_change_cb(-size);
}
return code;
isc_free(scb);
return 0;
}
int isc_disable(struct isc_scb *scb)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment