Source
ret = task->async_task_process_task_cb(what, task->data, &fd, &task->addresses, task->reverse_dns, task->error,
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
ZBX_VECTOR_IMPL(address, zbx_address_t)
typedef struct
{
void *data;
zbx_async_task_process_task_cb_t async_task_process_task_cb;
zbx_async_task_process_result_cb_t async_task_process_result_cb;
struct event *tx_event;
struct event *rx_event;
struct event *timeout_event;
int timeout;
char *error;
struct evdns_base *dnsbase;
struct evutil_addrinfo *ai;
zbx_vector_address_t addresses;
char *reverse_dns;
}
zbx_async_task_t;
static void async_reverse_dns_event(int err, char type, int count, int ttl, void *addresses, void *arg);
static void async_task_process_result_and_remove(zbx_async_task_t *task)
{
task->async_task_process_result_cb(task->data);
if (NULL != task->rx_event)
event_free(task->rx_event);
if (NULL != task->tx_event)
event_free(task->tx_event);
if (NULL != task->timeout_event)
event_free(task->timeout_event);
if (NULL != task->ai)
evutil_freeaddrinfo(task->ai);