diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2014-05-12 13:50:15 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-05-12 13:50:15 +0400 |
commit | 0c0bdd363b63319c7484f5cfbe6dd74a15b884be (patch) | |
tree | 1e5e4f596347cd80a57af5ca68b37eb27fcd91d5 /accel-pppd/ctrl | |
parent | 7466e7f10fb4813a6112682dff13de5fbdd981a7 (diff) | |
download | accel-ppp-0c0bdd363b63319c7484f5cfbe6dd74a15b884be.tar.gz accel-ppp-0c0bdd363b63319c7484f5cfbe6dd74a15b884be.zip |
triton: improved epoll events handling
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r-- | accel-pppd/ctrl/ipoe/arp.c | 3 | ||||
-rw-r--r-- | accel-pppd/ctrl/ipoe/dhcpv4.c | 6 | ||||
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe_netlink.c | 2 | ||||
-rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 12 | ||||
-rw-r--r-- | accel-pppd/ctrl/pppoe/pppoe.c | 3 | ||||
-rw-r--r-- | accel-pppd/ctrl/pptp/pptp.c | 6 |
6 files changed, 14 insertions, 18 deletions
diff --git a/accel-pppd/ctrl/ipoe/arp.c b/accel-pppd/ctrl/ipoe/arp.c index ee4ccde..e019d88 100644 --- a/accel-pppd/ctrl/ipoe/arp.c +++ b/accel-pppd/ctrl/ipoe/arp.c @@ -183,8 +183,7 @@ struct arp_serv *arpd_start(struct ipoe_serv *ipoe) void arpd_stop(struct arp_serv *arp) { - triton_md_unregister_handler(&arp->h); - close(arp->h.fd); + triton_md_unregister_handler(&arp->h, 1); _free(arp); } diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c index c603c5f..35fc468 100644 --- a/accel-pppd/ctrl/ipoe/dhcpv4.c +++ b/accel-pppd/ctrl/ipoe/dhcpv4.c @@ -229,8 +229,7 @@ out_err: void dhcpv4_free(struct dhcpv4_serv *serv) { - triton_md_unregister_handler(&serv->hnd); - close(serv->hnd.fd); + triton_md_unregister_handler(&serv->hnd, 1); if (serv->range) _free(serv->range); _free(serv); @@ -911,8 +910,7 @@ out_err_unlock: static void __dhcpv4_relay_free(struct dhcpv4_relay *r) { - triton_md_unregister_handler(&r->hnd); - close(r->hnd.fd); + triton_md_unregister_handler(&r->hnd, 1); triton_context_unregister(&r->ctx); _free(r); } diff --git a/accel-pppd/ctrl/ipoe/ipoe_netlink.c b/accel-pppd/ctrl/ipoe/ipoe_netlink.c index 68e533c..e4d1d02 100644 --- a/accel-pppd/ctrl/ipoe/ipoe_netlink.c +++ b/accel-pppd/ctrl/ipoe/ipoe_netlink.c @@ -638,7 +638,7 @@ static int ipoe_mc_read(struct triton_md_handler_t *h) static void ipoe_mc_close(struct triton_context_t *ctx) { - triton_md_unregister_handler(&mc_hnd); + triton_md_unregister_handler(&mc_hnd, 0); triton_context_unregister(ctx); } diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index b41a48b..2a52d69 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -1135,7 +1135,7 @@ static void l2tp_tunnel_free(struct l2tp_conn_t *conn) pthread_mutex_unlock(&l2tp_lock); if (conn->hnd.tpd) - triton_md_unregister_handler(&conn->hnd); + triton_md_unregister_handler(&conn->hnd, 0); if (conn->timeout_timer.tpd) triton_timer_del(&conn->timeout_timer); if (conn->rtimeout_timer.tpd) @@ -1533,7 +1533,7 @@ static int l2tp_tunnel_start(struct l2tp_conn_t *conn, err_ctx_md_timer: triton_timer_del(&conn->timeout_timer); err_ctx_md: - triton_md_unregister_handler(&conn->hnd); + triton_md_unregister_handler(&conn->hnd, 0); err_ctx: triton_context_unregister(&conn->ctx); err: @@ -4428,8 +4428,7 @@ skip: static void l2tp_udp_close(struct triton_context_t *ctx) { struct l2tp_serv_t *serv = container_of(ctx, typeof(*serv), ctx); - triton_md_unregister_handler(&serv->hnd); - close(serv->hnd.fd); + triton_md_unregister_handler(&serv->hnd, 1); triton_context_unregister(&serv->ctx); } @@ -4551,8 +4550,11 @@ static int start_udp_server(void) return 0; err_hnd: - triton_md_unregister_handler(&udp_serv.hnd); + triton_md_unregister_handler(&udp_serv.hnd, 1); triton_context_unregister(&udp_serv.ctx); + + return -1; + err_fd: close(udp_serv.hnd.fd); udp_serv.hnd.fd = -1; diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c index 22ddf43..1dc21a3 100644 --- a/accel-pppd/ctrl/pppoe/pppoe.c +++ b/accel-pppd/ctrl/pppoe/pppoe.c @@ -1399,8 +1399,7 @@ void pppoe_server_free(struct pppoe_serv_t *serv) free_delayed_pado(pado); } - triton_md_unregister_handler(&serv->hnd); - close(serv->hnd.fd); + triton_md_unregister_handler(&serv->hnd, 1); triton_context_unregister(&serv->ctx); _free(serv->ifname); _free(serv); diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c index 46e980e..92770bf 100644 --- a/accel-pppd/ctrl/pptp/pptp.c +++ b/accel-pppd/ctrl/pptp/pptp.c @@ -77,8 +77,7 @@ static void disconnect(struct pptp_conn_t *conn) { log_ppp_debug("pptp: disconnect\n"); - triton_md_unregister_handler(&conn->hnd); - close(conn->hnd.fd); + triton_md_unregister_handler(&conn->hnd, 1); if (conn->timeout_timer.tpd) triton_timer_del(&conn->timeout_timer); @@ -704,8 +703,7 @@ static int pptp_connect(struct triton_md_handler_t *h) static void pptp_serv_close(struct triton_context_t *ctx) { struct pptp_serv_t *s=container_of(ctx,typeof(*s),ctx); - triton_md_unregister_handler(&s->hnd); - close(s->hnd.fd); + triton_md_unregister_handler(&s->hnd, 1); triton_context_unregister(ctx); } |