Source
zabbix_log(LOG_LEVEL_DEBUG, "In %s() result:%d type:%d count:%d ttl:%d", __func__, err, type, count, ttl);
/*
** 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/>.
**/
typedef struct
{
void *data;
zbx_async_task_process_cb_t process_cb;
zbx_async_task_clear_cb_t free_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;
char *address;
}
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_remove(zbx_async_task_t *task)
{
task->free_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);
zbx_free(task->address);
zbx_free(task->error);
zbx_free(task);
}
const char *zbx_task_state_to_str(zbx_async_task_state_t task_state)