summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@mail.ru>2018-06-01 03:05:16 +0500
committerVladislav Grishenko <themiron@mail.ru>2018-06-01 03:05:16 +0500
commit7ebaae6a58b8cd0f20f9c6bda22f3521dbc0a377 (patch)
tree1c1d9b0d64048e8dc8e31d33816c5723c6e94282 /accel-pppd
parentd6a798fe417525581677e227d312fd851e511f7e (diff)
downloadaccel-ppp-xebd-7ebaae6a58b8cd0f20f9c6bda22f3521dbc0a377.tar.gz
accel-ppp-xebd-7ebaae6a58b8cd0f20f9c6bda22f3521dbc0a377.zip
sstp: http: add verbose response logging
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ctrl/sstp/sstp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c
index 0206b69..c7cbfea 100644
--- a/accel-pppd/ctrl/sstp/sstp.c
+++ b/accel-pppd/ctrl/sstp/sstp.c
@@ -810,12 +810,10 @@ static char *http_getvalue(char *line, const char *name, int len)
static int http_send_response(struct sstp_conn_t *conn, char *proto, char *status, char *headers)
{
char datetime[sizeof("aaa, dd bbb yyyy HH:MM:SS GMT")];
- struct buffer_t *buf;
+ char linebuf[1024], *line;
+ struct buffer_t *buf, tmp;
time_t now = time(NULL);
- if (conf_verbose)
- log_ppp_info2("send [HTTP <%s %s>]\n", proto, status);
-
strftime(datetime, sizeof(datetime), "%a, %d %b %Y %H:%M:%S GMT", gmtime(&now));
buf = alloc_buf_printf(
"%s %s\r\n"
@@ -828,6 +826,15 @@ static int http_send_response(struct sstp_conn_t *conn, char *proto, char *statu
return -1;
}
+ if (conf_verbose) {
+ tmp = *buf;
+ while ((line = http_getline(&tmp, linebuf, sizeof(linebuf))) != NULL) {
+ if (*line == '\0')
+ break;
+ log_ppp_info2("send [HTTP <%s>]\n", line);
+ }
+ }
+
return sstp_send(conn, buf);
}