Source
if (SYSINFO_RET_OK == (ret = get_http_page(hostname, path_str, port_str, request->timeout, &buffer, &error)))
/*
** 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 int detect_url(const char *host)
{
char *p;
int ret = FAIL;
if (NULL != strpbrk(host, "/@#?[]"))
return SUCCEED;
if (NULL != (p = strchr(host, ':')) && NULL == strchr(++p, ':'))
ret = SUCCEED;
return ret;
}
static int process_url(const char *host, const char *port, const char *path, char **url, char **error)
{
char *p, *delim;
int scheme_found = 0;
/* port and path parameters must be empty */
if ((NULL != port && '\0' != *port) || (NULL != path && '\0' != *path))
{
*error = zbx_strdup(*error,
"Parameters \"path\" and \"port\" must be empty if URL is specified in \"host\".");
return FAIL;