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/l2tp | |
parent | 7466e7f10fb4813a6112682dff13de5fbdd981a7 (diff) | |
download | accel-ppp-0c0bdd363b63319c7484f5cfbe6dd74a15b884be.tar.gz accel-ppp-0c0bdd363b63319c7484f5cfbe6dd74a15b884be.zip |
triton: improved epoll events handling
Diffstat (limited to 'accel-pppd/ctrl/l2tp')
-rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 12 |
1 files changed, 7 insertions, 5 deletions
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; |