summaryrefslogtreecommitdiff
path: root/accel-pptpd/logs/log_tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pptpd/logs/log_tcp.c')
-rw-r--r--accel-pptpd/logs/log_tcp.c6
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);