Source
xxxxxxxxxx
/* CURLOPT_PROTOCOLS was deprecated in favor of CURLOPT_PROTOCOLS_STR starting with version 7.85.0 (0x075500) */
/*
** Zabbix
** 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 General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
extern int CONFIG_HTTPPOLLER_FORKS;
typedef struct
{
long rspcode;
double total_time;
ZBX_CURLINFO_SPEED_DOWNLOAD_TYPE speed_download;
}
zbx_httpstat_t;
/* HAVE_LIBCURL */
/******************************************************************************
* *
* Purpose: remove all macro variables cached during http test execution *
* *
* Parameters: httptest - [IN] the http test data *
* *
******************************************************************************/
static void httptest_remove_macros(zbx_httptest_t *httptest)
{
int i;
for (i = 0; i < httptest->macros.values_num; i++)
{
zbx_ptr_pair_t *pair = &httptest->macros.values[i];
zbx_free(pair->first);
zbx_free(pair->second);
}
zbx_vector_ptr_pair_clear(&httptest->macros);
}
static void process_test_data(zbx_uint64_t httptestid, int lastfailedstep, double speed_download,
const char *err_str, zbx_timespec_t *ts)
{
DB_RESULT result;
DB_ROW row;
unsigned char types[3];
DC_ITEM items[3];
zbx_uint64_t itemids[3];
int errcodes[3];
size_t i, num = 0;
AGENT_RESULT value;
zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __func__);
result = DBselect("select type,itemid from httptestitem where httptestid=" ZBX_FS_UI64, httptestid);
while (NULL != (row = DBfetch(result)))
{
if (3 == num)
{
THIS_SHOULD_NEVER_HAPPEN;
break;
}
switch (types[num] = (unsigned char)atoi(row[0]))