diff options
author | Kozlov Dmitry <dima@server> | 2010-11-16 17:19:33 +0300 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2010-11-16 17:19:33 +0300 |
commit | e95fc28b08669e329916e1cf1eb52fa462ad655a (patch) | |
tree | b584a8719fc5950ae9f683c6ce865ee074e3e450 /accel-pptpd/logs | |
parent | 50881d86b036e3b658c45e56b57b12a60e1562ef (diff) | |
download | accel-ppp-e95fc28b08669e329916e1cf1eb52fa462ad655a.tar.gz accel-ppp-e95fc28b08669e329916e1cf1eb52fa462ad655a.zip |
log-tcp: fixed incorrect queue overflow handling
ppp: fixed memory leak when ipcp raises error at ConfReq
Diffstat (limited to 'accel-pptpd/logs')
-rw-r--r-- | accel-pptpd/logs/log_tcp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/accel-pptpd/logs/log_tcp.c b/accel-pptpd/logs/log_tcp.c index 2579ac2..fdef63e 100644 --- a/accel-pptpd/logs/log_tcp.c +++ b/accel-pptpd/logs/log_tcp.c @@ -111,6 +111,7 @@ static void queue_log(struct tcp_target_t *t, struct log_msg_t *msg) if (t->queue_len == conf_queue_len) { spin_unlock(&t->lock); log_free_msg(msg); + return; } list_add_tail(&msg->entry, &t->queue); t->queue_len++; @@ -182,7 +183,8 @@ static int log_tcp_connect(struct triton_md_handler_t *h) t->wait = 1; spin_unlock(&t->lock); - send_log(t); + if (send_log(t)) + triton_md_enable_handler(&t->hnd, MD_MODE_WRITE); return 0; } @@ -258,6 +260,8 @@ static int start_log(const char *_opt) INIT_LIST_HEAD(&t->queue); + spinlock_init(&t->lock); + start_connect(t); log_register_target(&t->target); |