Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions library/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,11 @@
}

void ziti_logger(int level, const char *module, const char *file, unsigned int line, const char *func, FORMAT_STRING(const char *fmt), ...) {
#ifdef ZITI_DEBUG
static size_t loglinelen = 32768;
#else
static size_t loglinelen = 1024;
#endif

log_writer logfunc = logger;
if (logfunc == NULL) { return; }
Expand Down Expand Up @@ -405,7 +409,7 @@
time_t t = ts.tv_sec;
struct tm *tm = gmtime(&t);

snprintf(log_timestamp, sizeof(log_timestamp), "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ",

Check warning on line 412 in library/utils.c

View workflow job for this annotation

GitHub Actions / Linux ARM

':' directive output may be truncated writing 1 byte into a region of size between 0 and 16 [-Wformat-truncation=]

Check warning on line 412 in library/utils.c

View workflow job for this annotation

GitHub Actions / Linux ARM64

':' directive output may be truncated writing 1 byte into a region of size between 0 and 16 [-Wformat-truncation=]

Check warning on line 412 in library/utils.c

View workflow job for this annotation

GitHub Actions / Linux x86_64

':' directive output may be truncated writing 1 byte into a region of size between 0 and 16 [-Wformat-truncation=]
1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec, ts.tv_usec / 1000
);
Expand Down
3 changes: 3 additions & 0 deletions library/ziti_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ static void ctrl_body_cb(tlsuv_http_req_t *req, char *b, ssize_t len) {
if (len > 0) {
if (resp->resp_content == ctrl_content_json) {
if (resp->content == NULL) {
#ifdef ZITI_DEBUG
CTRL_LOG(DEBUG, "HTTP RESPONSE: %s", b);
#endif
resp->content = json_tokener_parse_ex(resp->content_proc, b, (int) len);
if (resp->content == NULL && json_tokener_get_error(resp->content_proc) != json_tokener_continue) {
CTRL_LOG(WARN, "parsing error: %s",
Expand Down
Loading