Source
zbx_async_poller_add_task(base, dnsbase, agent_context->item.interface.addr, agent_context, item->timeout + 1,
/*
** Copyright (C) 2001-2024 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/>.
**/
static const char *get_agent_step_string(zbx_zabbix_agent_step_t step)
{
switch (step)
{
case ZABBIX_AGENT_STEP_CONNECT_INIT:
return "init";
case ZABBIX_AGENT_STEP_CONNECT_WAIT:
return "connect";
case ZABBIX_AGENT_STEP_TLS_WAIT:
return "tls";
case ZABBIX_AGENT_STEP_SEND:
return "send";
case ZABBIX_AGENT_STEP_RECV:
return "receive";
default:
return "unknown";
}
}
static int agent_task_process(short event, void *data, int *fd, const char *addr, char *dnserr,
struct event *timeout_event)
{
zbx_agent_context *agent_context = (zbx_agent_context *)data;
ssize_t received_len;
short event_new;
zbx_async_task_state_t state = ZBX_ASYNC_TASK_STOP;
zbx_poller_config_t *poller_config = (zbx_poller_config_t *)agent_context->arg_action;
int errnum = 0;
socklen_t optlen = sizeof(int);
ZBX_UNUSED(fd);
ZBX_UNUSED(timeout_event);