version 1.122, 2020/11/27 00:37:10 |
version 1.123, 2021/04/15 16:24:31 |
|
|
extern ServerOptions options; |
extern ServerOptions options; |
|
|
void |
void |
mm_log_handler(const char *file, const char *func, int line, |
mm_log_handler(LogLevel level, int forced, const char *msg, void *ctx) |
LogLevel level, const char *msg, void *ctx) |
|
{ |
{ |
struct sshbuf *log_msg; |
struct sshbuf *log_msg; |
struct monitor *mon = (struct monitor *)ctx; |
struct monitor *mon = (struct monitor *)ctx; |
|
|
fatal_f("sshbuf_new failed"); |
fatal_f("sshbuf_new failed"); |
|
|
if ((r = sshbuf_put_u32(log_msg, 0)) != 0 || /* length; filled below */ |
if ((r = sshbuf_put_u32(log_msg, 0)) != 0 || /* length; filled below */ |
(r = sshbuf_put_cstring(log_msg, file)) != 0 || |
|
(r = sshbuf_put_cstring(log_msg, func)) != 0 || |
|
(r = sshbuf_put_u32(log_msg, (u_int)line)) != 0 || |
|
(r = sshbuf_put_u32(log_msg, level)) != 0 || |
(r = sshbuf_put_u32(log_msg, level)) != 0 || |
|
(r = sshbuf_put_u32(log_msg, forced)) != 0 || |
(r = sshbuf_put_cstring(log_msg, msg)) != 0) |
(r = sshbuf_put_cstring(log_msg, msg)) != 0) |
fatal_fr(r, "assemble"); |
fatal_fr(r, "assemble"); |
if ((len = sshbuf_len(log_msg)) < 4 || len > 0xffffffff) |
if ((len = sshbuf_len(log_msg)) < 4 || len > 0xffffffff) |