summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2013-08-06 22:52:13 +0400
committerDmitry Kozlov <xeb@mail.ru>2013-08-06 22:52:13 +0400
commit7e56163b5b36160d51082ef6c81901aca32874b0 (patch)
tree263d25f68ed98b7c104387234793a14022c9bfab
parenta3854c8e4b75ef463f0529545c61e66172e5f1ee (diff)
downloadaccel-ppp-7e56163b5b36160d51082ef6c81901aca32874b0.tar.gz
accel-ppp-7e56163b5b36160d51082ef6c81901aca32874b0.zip
fixed compiling log_pgsql
-rw-r--r--accel-pppd/logs/log_pgsql.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/accel-pppd/logs/log_pgsql.c b/accel-pppd/logs/log_pgsql.c
index 742ee62..1a62a9a 100644
--- a/accel-pppd/logs/log_pgsql.c
+++ b/accel-pppd/logs/log_pgsql.c
@@ -8,7 +8,7 @@
#include "spinlock.h"
#include "log.h"
#include "list.h"
-#include "ppp.h"
+#include "ap_session.h"
#include "memdebug.h"
@@ -55,7 +55,7 @@ static void unpack_msg(struct log_msg_t *msg)
log_buf[0] = 0;
}
-static void set_hdr(struct log_msg_t *msg, struct ppp_t *ppp)
+static void set_hdr(struct log_msg_t *msg, struct ap_session *ses)
{
struct tm tm;
@@ -63,11 +63,11 @@ static void set_hdr(struct log_msg_t *msg, struct ppp_t *ppp)
strftime(msg->hdr->msg, LOG_CHUNK_SIZE, "%Y-%m-%d %H:%M:%S", &tm);
msg->hdr->len = strlen(msg->hdr->msg) + 1;
- if (ppp && ppp->username) {
- strcpy(msg->hdr->msg + msg->hdr->len, ppp->username);
- msg->hdr->len += strlen(ppp->username) + 1;
- strcpy(msg->hdr->msg + msg->hdr->len, ppp->sessionid);
- msg->hdr->len += strlen(ppp->sessionid) + 1;
+ if (ses && ses->username) {
+ strcpy(msg->hdr->msg + msg->hdr->len, ses->username);
+ msg->hdr->len += strlen(ses->username) + 1;
+ strcpy(msg->hdr->msg + msg->hdr->len, ses->sessionid);
+ msg->hdr->len += strlen(ses->sessionid) + 1;
} else
memset(msg->hdr->msg + msg->hdr->len, 0, 2);
@@ -194,9 +194,9 @@ static void queue_log(struct log_msg_t *msg)
}
-static void general_log(struct log_target_t *t, struct log_msg_t *msg, struct ppp_t *ppp)
+static void general_log(struct log_target_t *t, struct log_msg_t *msg, struct ap_session *ses)
{
- set_hdr(msg, ppp);
+ set_hdr(msg, ses);
queue_log(msg);
}