netns: Change the argument passed to client delete requests.
Directly pass a pointer to the containing VCmd struct.
This commit is contained in:
parent
b86881aba9
commit
d40dae4e1c
1 changed files with 7 additions and 4 deletions
|
@ -433,14 +433,18 @@ static void async_newclientreq(struct ev_loop *loop, void *data)
|
|||
}
|
||||
|
||||
typedef struct {
|
||||
vnode_client_t *client;
|
||||
VCmd *vcmd;
|
||||
} vcmd_delclientreq_t;
|
||||
|
||||
static void async_delclientreq(struct ev_loop *loop, void *data)
|
||||
{
|
||||
vcmd_delclientreq_t *delclreq = data;
|
||||
|
||||
vnode_delclient(delclreq->client);
|
||||
if (delclreq->vcmd->_client)
|
||||
{
|
||||
vnode_delclient(delclreq->vcmd->_client);
|
||||
delclreq->vcmd->_client = NULL;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -483,10 +487,9 @@ static void VCmd_dealloc(VCmd *self)
|
|||
self->_client_connected = 0;
|
||||
if (self->_client)
|
||||
{
|
||||
vcmd_delclientreq_t delclreq = {.client = self->_client};
|
||||
vcmd_delclientreq_t delclreq = {.vcmd = self};
|
||||
|
||||
call_asyncfunc(async_delclientreq, &delclreq);
|
||||
self->_client = NULL;
|
||||
}
|
||||
|
||||
self->ob_type->tp_free((PyObject *)self);
|
||||
|
|
Loading…
Add table
Reference in a new issue