#include "async_poller.h"
#include "async_manager.h"
#include "async_httpagent.h"
#include "zbxasynchttppoller.h"
#include "zbx_item_constants.h"
#include "zbx_rtc_constants.h"
#include "zbx_availability_constants.h"
#include "zbxcacheconfig.h"
#include "zbxipcservice.h"
#include "zbxasyncpoller.h"
#ifndef EVDNS_BASE_INITIALIZE_NAMESERVERS
# define EVDNS_BASE_INITIALIZE_NAMESERVERS 1
static void process_async_result(zbx_dc_item_context_t *item, zbx_poller_config_t *poller_config)
zbx_interface_status_t *interface_status;
zabbix_log(LOG_LEVEL_DEBUG, "In %s() key:'%s' host:'%s' addr:'%s'", __func__, item->key, item->host,
if (SUCCEED != item->ret || ZBX_INTERFACE_AVAILABLE_TRUE != item->interface.available ||
0 != item->interface.errors_from || item->version != item->interface.version)
if (NULL == (interface_status = zbx_hashset_search(&poller_config->interfaces,
&item->interface.interfaceid)))
zbx_interface_status_t interface_status_local = {.interface = item->interface};
interface_status_local.interface.addr = NULL;
interface_status = zbx_hashset_insert(&poller_config->interfaces,
&interface_status_local, sizeof(interface_status_local));
zabbix_log(LOG_LEVEL_DEBUG, "updating existing interface");
zbx_free(interface_status->error);
interface_status->errcode = item->ret;
interface_status->itemid = item->itemid;
zbx_strlcpy(interface_status->host, item->host, sizeof(interface_status->host));
zbx_free(interface_status->key_orig);
interface_status->key_orig = item->key_orig;
interface_status->version = item->version;
if (SUCCEED == item->ret)
zbx_preprocess_item_value(item->itemid,
item->hostid,item->value_type,item->flags,
&item->result, ×pec, ITEM_STATE_NORMAL, NULL);