}
else {
msg_info_dkim ("dkim parse failed: unknown error when parsing %c tag",
- *tag);
+ tag ? *tag : '?');
return NULL;
}
break;
}
- if (ctx->common.type != RSPAMD_DKIM_ARC_SEAL) {
+ /* Use cached BH for all but arc seal, if it is not NULL we are not in arc seal mode */
+ if (cached_bh != NULL) {
if (!cached_bh->digest_normal) {
/* Copy md_ctx to deal with broken CRLF at the end */
cpy_ctx = EVP_MD_CTX_create ();
if (r->cfg) {
serv = rdns_resolver_add_server (r->r, rspamd_inet_address_to_string (addr),
rspamd_inet_address_get_port (addr), 0, r->cfg->dns_io_per_server);
+
+ elt = rspamd_mempool_alloc0 (r->cfg->cfg_pool, sizeof (*elt));
+ elt->server = serv;
+ elt->lib_data = up;
+
+ rspamd_upstream_set_data (up, elt);
}
else {
serv = rdns_resolver_add_server (r->r, rspamd_inet_address_to_string (addr),
}
g_assert (serv != NULL);
-
- elt = rspamd_mempool_alloc0 (r->cfg->cfg_pool, sizeof (*elt));
- elt->server = serv;
- elt->lib_data = up;
-
- rspamd_upstream_set_data (up, elt);
}
static void
*/
if (hc->all_tags.empty()) {
- auto &&vtag = std::make_unique<html_tag>();
+ hc->all_tags.emplace_back();
+ auto *vtag = hc->all_tags.back().get();
vtag->id = Tag_HTML;
vtag->flags = FL_VIRTUAL;
vtag->tag_start = 0;
vtag->content_offset = 0;
- calculate_content_length(vtag.get());
+ calculate_content_length(vtag);
if (!hc->root_tag) {
- hc->root_tag = vtag.get();
+ hc->root_tag = vtag;
}
else {
vtag->parent = hc->root_tag;
}
- hc->all_tags.emplace_back(std::move(vtag));
- tag->parent = vtag.get();
+ tag->parent = vtag;
/* Recursively call with a virtual <html> tag inserted */
return html_check_balance(hc, tag, tag_start_offset, tag_end_offset);
* In general, don't use it for anything but ping checks
*/
memset (&http_callbacks, 0, sizeof (http_callbacks));
- http_parser_init (&http_parser, HTTP_REQUEST);
http_parser.data = url;
+ http_parser_init (&http_parser, HTTP_REQUEST);
http_callbacks.on_url = rspamd_milter_http_on_url;
http_parser_execute (&http_parser, &http_callbacks,
priv->parser.buf->str, priv->parser.buf->len);