mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-05-16 15:32:57 +00:00
closeConnection / closeClient changes
This commit is contained in:
parent
5a5a513b18
commit
776f93e7be
@ -195,8 +195,14 @@ NetconClient *NetconEthernetTap::getClientByPCB(struct tcp_pcb *pcb)
|
|||||||
|
|
||||||
void NetconEthernetTap::closeClient(NetconClient *client)
|
void NetconEthernetTap::closeClient(NetconClient *client)
|
||||||
{
|
{
|
||||||
// erase from clients vector
|
NetconConnection *temp_conn;
|
||||||
client->closeClient();
|
closeConnection(client->rpc);
|
||||||
|
for(size_t i=0; i<client->connections.size(); i++) {
|
||||||
|
temp_conn = client->connections[i];
|
||||||
|
closeConnection(client->connections[i]);
|
||||||
|
delete temp_conn;
|
||||||
|
}
|
||||||
|
delete client;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetconEthernetTap::closeConnection(NetconConnection *conn)
|
void NetconEthernetTap::closeConnection(NetconConnection *conn)
|
||||||
@ -434,8 +440,7 @@ void NetconEthernetTap::nc_err(void *arg, err_t err)
|
|||||||
NetconEthernetTap *tap = l->tap;
|
NetconEthernetTap *tap = l->tap;
|
||||||
NetconConnection *c = tap->getConnectionByThisFD(tap->_phy.getDescriptor(l->sock));
|
NetconConnection *c = tap->getConnectionByThisFD(tap->_phy.getDescriptor(l->sock));
|
||||||
if(c) {
|
if(c) {
|
||||||
l->tap->closeConnection(c);
|
tap->closeConnection(c);
|
||||||
//tcp_close(c->pcb);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// can't locate connection object for PCB
|
// can't locate connection object for PCB
|
||||||
|
Loading…
x
Reference in New Issue
Block a user