Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/zabbix_server/preprocessor/preproc_worker.c')
-rw-r--r--src/zabbix_server/preprocessor/preproc_worker.c76
1 files changed, 1 insertions, 75 deletions
diff --git a/src/zabbix_server/preprocessor/preproc_worker.c b/src/zabbix_server/preprocessor/preproc_worker.c
index bf9397d0b71..64ef91e0234 100644
--- a/src/zabbix_server/preprocessor/preproc_worker.c
+++ b/src/zabbix_server/preprocessor/preproc_worker.c
@@ -358,80 +358,6 @@ static void worker_preprocess_value(zbx_ipc_socket_t *socket, zbx_ipc_message_t
/******************************************************************************
* *
- * Function: worker_item_preproc_test *
- * *
- * Purpose: test preprocessing steps *
- * *
- * Parameters: value_type - [IN] the item value type *
- * value - [IN/OUT] the value to process *
- * ts - [IN] the value timestamp *
- * steps - [IN] the preprocessing steps to execute *
- * steps_num - [IN] the number of preprocessing steps *
- * history_in - [IN] the preprocessing history *
- * history_out - [OUT] the new preprocessing history *
- * results - [OUT] the preprocessing step results *
- * results_num - [OUT] the number of step results *
- * error - [OUT] error message *
- * *
- * Return value: SUCCEED - the preprocessing steps finished successfully *
- * FAIL - otherwise, error contains the error message *
- * *
- ******************************************************************************/
-static int worker_item_preproc_test(unsigned char value_type, zbx_variant_t *value, const zbx_timespec_t *ts,
- zbx_preproc_op_t *steps, int steps_num, zbx_vector_ptr_t *history_in, zbx_vector_ptr_t *history_out,
- zbx_preproc_result_t *results, int *results_num, char **error)
-{
- int i, ret = SUCCEED;
-
- for (i = 0; i < steps_num; i++)
- {
- zbx_preproc_op_t *op = &steps[i];
- zbx_variant_t history_value;
- zbx_timespec_t history_ts;
-
- zbx_preproc_history_pop_value(history_in, i, &history_value, &history_ts);
-
- if (FAIL == (ret = zbx_item_preproc(value_type, value, ts, op, &history_value, &history_ts, error)))
- {
- results[i].action = op->error_handler;
- ret = zbx_item_preproc_handle_error(value, op, error);
- }
- else
- results[i].action = ZBX_PREPROC_FAIL_DEFAULT;
-
- if (NULL != *error)
- {
- results[i].error = zbx_strdup(NULL, *error);
- ret = FAIL;
- }
-
- if (SUCCEED != ret)
- {
- zbx_variant_set_none(&results[i].value);
- zbx_variant_clear(&history_value);
- break;
- }
-
- zbx_variant_set_variant(&results[i].value, value);
- results[i].error = NULL;
-
- if (ZBX_VARIANT_NONE != history_value.type)
- {
- /* the value is byte copied to history_out vector and doesn't have to be cleared */
- zbx_preproc_history_add_value(history_out, i, &history_value, &history_ts);
- }
-
- if (ZBX_VARIANT_NONE == value->type)
- break;
- }
-
- *results_num = (i == steps_num ? i : i + 1);
-
- return ret;
-}
-
-/******************************************************************************
- * *
* Function: worker_test_value *
* *
* Purpose: handle item value test preprocessing task *
@@ -464,7 +390,7 @@ static void worker_test_value(zbx_ipc_socket_t *socket, zbx_ipc_message_t *messa
results = (zbx_preproc_result_t *)zbx_malloc(NULL, sizeof(zbx_preproc_result_t) * steps_num);
memset(results, 0, sizeof(zbx_preproc_result_t) * steps_num);
- worker_item_preproc_test(value_type, &value, &ts, steps, steps_num, &history_in, &history_out, results,
+ zbx_item_preproc_test(value_type, &value, &ts, steps, steps_num, &history_in, &history_out, results,
&results_num, &error);
size = zbx_preprocessor_pack_test_result(&data, results, results_num, &history_out, error);