{
rspamd_inet_address_set_port (cbd->addr, cbd->msg->port);
unsigned http_opts = RSPAMD_HTTP_CLIENT_SIMPLE;
- struct rspamd_http_message *msg = cbd->msg;
if (cbd->msg->flags & RSPAMD_HTTP_FLAG_WANT_SSL) {
http_opts |= RSPAMD_HTTP_CLIENT_SSL;
}
if (cbd->session) {
- rspamd_session_add_event (cbd->session,
- (event_finalizer_t) lua_http_fin, cbd,
- M);
+ if (cbd->item) {
+ rspamd_session_add_event_full (cbd->session,
+ (event_finalizer_t) lua_http_fin, cbd,
+ M, rspamd_symcache_item_name (cbd->item));
+ }
+ else {
+ rspamd_session_add_event (cbd->session,
+ (event_finalizer_t) lua_http_fin, cbd,
+ M);
+ }
cbd->flags |= RSPAMD_LUA_HTTP_FLAG_RESOLVED;
}
if (cbd->session) {
event_finalizer_t fin = IS_SYNC (cbd) ? lua_tcp_void_finalyser : lua_tcp_fin;
- cbd->async_ev = rspamd_session_add_event (cbd->session, fin, cbd, M);
+ if (cbd->item) {
+ cbd->async_ev = rspamd_session_add_event_full (cbd->session, fin, cbd, M,
+ rspamd_symcache_item_name (cbd->item));
+ }
+ else {
+ cbd->async_ev = rspamd_session_add_event (cbd->session, fin, cbd, M);
+ }
if (!cbd->async_ev) {
return FALSE;
lua_udp_maybe_register_event (struct lua_udp_cbdata *cbd)
{
if (cbd->s && !cbd->async_ev) {
- cbd->async_ev = rspamd_session_add_event (cbd->s, lua_udp_cbd_fin,
- cbd, M);
+ if (cbd->item) {
+ cbd->async_ev = rspamd_session_add_event_full (cbd->s, lua_udp_cbd_fin,
+ cbd, M, rspamd_symcache_item_name (cbd->item));
+ }
+ else {
+ cbd->async_ev = rspamd_session_add_event (cbd->s, lua_udp_cbd_fin,
+ cbd, M);
+ }
if (!cbd->async_ev) {
return FALSE;