diff options
Diffstat (limited to 'PICA_node.c')
| -rw-r--r-- | PICA_node.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/PICA_node.c b/PICA_node.c index 6977ce1..a8810d4 100644 --- a/PICA_node.c +++ b/PICA_node.c @@ -1298,13 +1298,6 @@ void cclink_list_delete(struct cclink *l) if (l->p1) { - if (l->sck_p1 != -1) - { - SHUTDOWN(l->sck_p1); - CLOSE(l->sck_p1); - PICA_debug2("closed c2c socket %i", l->sck_p1); - } - if (l->ev_read_p1) { event_del(l->ev_read_p1); @@ -1316,19 +1309,20 @@ void cclink_list_delete(struct cclink *l) event_del(l->ev_write_p1); event_free(l->ev_write_p1); } + + if (l->sck_p1 != -1) + { + SHUTDOWN(l->sck_p1); + CLOSE(l->sck_p1); + PICA_debug2("closed c2c socket %i", l->sck_p1); + } + }//caller_id is stored in p1 structure else free(l->caller_id);//caller_id was allocated by malloc if (l->p2) { - if (l->sck_p2 != -1) - { - SHUTDOWN(l->sck_p2); - CLOSE(l->sck_p2); - PICA_debug2("closed c2c socket %i", l->sck_p2); - } - if (l->ev_read_p2) { event_del(l->ev_read_p2); @@ -1340,6 +1334,13 @@ void cclink_list_delete(struct cclink *l) event_del(l->ev_write_p2); event_free(l->ev_write_p2); } + + if (l->sck_p2 != -1) + { + SHUTDOWN(l->sck_p2); + CLOSE(l->sck_p2); + PICA_debug2("closed c2c socket %i", l->sck_p2); + } } else free(l->callee_id); |
