diff options
author | Vladislav Grishenko <themiron@mail.ru> | 2018-06-01 03:05:16 +0500 |
---|---|---|
committer | Vladislav Grishenko <themiron@mail.ru> | 2018-06-01 03:05:16 +0500 |
commit | 7ebaae6a58b8cd0f20f9c6bda22f3521dbc0a377 (patch) | |
tree | 1c1d9b0d64048e8dc8e31d33816c5723c6e94282 /accel-pppd/ctrl/sstp | |
parent | d6a798fe417525581677e227d312fd851e511f7e (diff) | |
download | accel-ppp-7ebaae6a58b8cd0f20f9c6bda22f3521dbc0a377.tar.gz accel-ppp-7ebaae6a58b8cd0f20f9c6bda22f3521dbc0a377.zip |
sstp: http: add verbose response logging
Diffstat (limited to 'accel-pppd/ctrl/sstp')
-rw-r--r-- | accel-pppd/ctrl/sstp/sstp.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c index 0206b69d..c7cbfea2 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); } |