if (sym->len > max_len) {
rspamd_snprintf(sym_buf, sizeof(sym_buf), "%*s...",
- (max_len - 3), ucl_object_tostring(sym));
+ (int) (max_len - 3), ucl_object_tostring(sym));
sym_name = sym_buf;
}
else {
}
}
- msg_debug_lang_det("fasttext: got %z word tokens from %ud words", words_vec.size(), words_count);
+ msg_debug_lang_det("fasttext: got %z word tokens from %z words", words_vec.size(), words_count);
auto *res = real_model->detect_language(words_vec, k);
else {
/* Load lua code and ensure that we have function ref returned */
if (!content || content->len == 0) {
- msg_err_config("lua variable needs content: %T", &tok);
+ msg_err_config("lua variable needs content: %*s", (int) tok.size(), tok.data());
return FALSE;
}
if (re == nullptr) {
msg_err_pool("cannot create regexp from string %*s: %e",
- opt_len, opt_start, re_err);
+ (int) opt_len, opt_start, re_err);
g_error_free(re_err);
}
memcpy(*data, t->start, t->len);
}
if (len) *len = t->len;
- msg_debug_hyperscan("load_sync: loaded %uz bytes for %s", t->len, cache_key);
+ msg_debug_hyperscan("load_sync: loaded %ud bytes for %s", t->len, cache_key);
}
else {
if (error) *error = g_strdup("Empty or invalid data returned");
}
if (task->cfg && in->len > task->cfg->max_html_len) {
- msg_notice_task("html input is too big: %z, limit is %z",
+ msg_notice_task("html input is too big: %ud, limit is %z",
in->len,
task->cfg->max_html_len);
process_size = task->cfg->max_html_len;
else {
/* Finalising by timeout */
ev_timer_stop(EV_A_ w);
- msg_debug_rpool("final removal of connection %p, refcount: %d",
+ msg_debug_rpool("final removal of connection %p",
conn->ctx);
/* Erasure of shared pointer will cause it to be removed */
/* Look up request by ID */
k = kh_get(rspamd_control_requests, h, rep.id);
if (k == kh_end(h)) {
- msg_warn_main("received control reply for unknown request id %" G_GUINT64_FORMAT
- " from worker %P",
+ msg_warn_main("received control reply for unknown request id %uL from worker %P",
rep.id, wrk->pid);
if (rfd != -1) {
close(rfd);
elt = kh_val(h, k);
kh_del(rspamd_control_requests, h, k);
- msg_debug_control("received reply for command %d id %" G_GUINT64_FORMAT " from worker %P(%s)",
+ msg_debug_control("received reply for command %d id %uL from worker %P(%s)",
(int) rep.type, rep.id, wrk->pid, g_quark_to_string(wrk->type));
if (rfd != -1) {
}
if (ret == 0) {
/* Key already exists - ID collision (extremely unlikely with 64-bit random) */
- msg_warn_main("control command ID collision for %" G_GUINT64_FORMAT
- ", previous request will be orphaned",
+ msg_warn_main("control command ID collision for %uL, previous request will be orphaned",
cmd->id);
/* Free the old entry to prevent memory leak */
struct rspamd_control_reply_elt *old_elt = kh_val(h, kh);
}
DL_APPEND(res, rep_elt);
- msg_debug_control("sent command %d id %" G_GUINT64_FORMAT " to worker %P(%s), fd: %d",
+ msg_debug_control("sent command %d id %uL to worker %P(%s), fd: %d",
(int) cmd->type, cmd->id,
wrk->pid,
g_quark_to_string(wrk->type),
/* Look up request by ID */
k = kh_get(rspamd_srv_requests, ctx->requests, rep.id);
if (k == kh_end(ctx->requests)) {
- msg_warn("received reply for unknown request id %" G_GUINT64_FORMAT,
+ msg_warn("received reply for unknown request id %uL",
rep.id);
continue;
}
real_dyn_item->async_events, subsystem, loc);
if (G_UNLIKELY(real_dyn_item->async_events == 0)) {
- msg_err_cache_task("INTERNAL ERROR: trying decrease async events counter for %s(%d) that is already zero; "
+ msg_err_cache_task("INTERNAL ERROR: trying decrease async events counter for %s(%d) that is already zero (events: %ud); "
"subsystem %s (%s)",
static_item->symbol.c_str(), static_item->id,
real_dyn_item->async_events, subsystem, loc);
if (cached_map->get_size() < (int) sizeof(symcache_header)) {
- msg_info_cache("cannot use file %s, truncated: %z", cfg->cache_filename,
- errno, strerror(errno));
+ msg_info_cache("cannot use file %s, error: %s", cfg->cache_filename,
+ strerror(errno));
return false;
}
memcpy(hdr.magic, symcache_magic, sizeof(symcache_magic));
if (write(file_sink->get_fd(), &hdr, sizeof(hdr)) == -1) {
- msg_err_cache("cannot write to file %s, error %d, %s", cfg->cache_filename,
- errno, strerror(errno));
+ msg_err_cache("cannot write to file %s, error %d, %s", cfg->cache_filename, errno,
+ strerror(errno));
return false;
}
*/
total_hits = 0;
auto used_items = ord->d.size();
- msg_debug_cache("topologically sort %d filters", used_items);
+ msg_debug_cache("topologically sort %z filters", used_items);
for (const auto &it: ord->d) {
if (it->order == 0) {
}
}
else {
- msg_debug_cache("added unknown augmentation %s for symbol %s",
- "unknown", augmentation.data(), symbol.data());
+ msg_debug_cache("added augmentation %s for symbol %s",
+ augmentation.data(), symbol.data());
return augmentations.try_emplace(augmentation, 0).second;
}
g_assert(tokens != NULL);
/* Check if this is a multi-class classifier */
- msg_debug_bayes("classification check: class_names=%p, len=%uz",
+ msg_debug_bayes("classification check: class_names=%p, len=%ud",
ctx->cfg->class_names,
ctx->cfg->class_names ? ctx->cfg->class_names->len : 0);
}
else {
/* Different class learned, unlearn flag */
- msg_debug_task("<%s> cached value %ld != expected %lu for class %s, will unlearn",
+ msg_debug_task("<%s> cached value %L != expected %uL for class %s, will unlearn",
MESSAGE_FIELD(task, message_id),
val, expected_id, autolearn_class);
task->flags |= RSPAMD_TASK_FLAG_UNLEARN;
*psig = sig;
}
else {
- msg_err("size of %s mismatches: %d while %d is expected",
- filename, (int) st.st_size,
+ msg_err("size of %s mismatches: %z while %z is expected",
+ filename, (size_t) st.st_size,
crypto_sign_bytes());
lua_pushnil(L);
}
thread_entry->task = NULL;
thread_entry->cfg = NULL;
- msg_debug_lua_threads("%s: returned thread to the threads pool %ud items",
+ msg_debug_lua_threads("%s: returned thread to the threads pool %z items",
loc,
available_items.size());
available_items.push_back(thread_entry);
}
else {
- msg_debug_lua_threads("%s: removed thread as thread pool has %ud items",
+ msg_debug_lua_threads("%s: removed thread as thread pool has %z items",
loc,
available_items.size());
thread_entry_free(L, thread_entry);
pk = rspamd_pubkey_from_base32(map, flen, RSPAMD_KEYPAIR_SIGN);
if (pk == NULL) {
- rspamd_fprintf(stderr, "bad size %s: %ud, %ud expected\n",
+ rspamd_fprintf(stderr, "bad size %s: %z, %z expected\n",
pubkey_file,
- (unsigned int) flen,
+ flen,
crypto_sign_publickeybytes());
exit(EXIT_FAILURE);
}
RSPAMD_KEYPAIR_SIGN);
if (pk == NULL) {
- rspamd_fprintf(stderr, "bad size %s: %ud, %ud expected\n",
+ rspamd_fprintf(stderr, "bad size %s: %z, %z expected\n",
pubkey_file,
- (unsigned int) strlen(pubkey),
+ strlen(pubkey),
crypto_sign_publickeybytes());
exit(EXIT_FAILURE);
}