diff options
author | Vladislavs Sokurenko <vladislavs.sokurenko@zabbix.com> | 2022-04-21 11:54:55 +0300 |
---|---|---|
committer | Vladislavs Sokurenko <vladislavs.sokurenko@zabbix.com> | 2022-04-21 11:54:55 +0300 |
commit | 3302cfda444c36a780394ce6488fcb7362cfc6e0 (patch) | |
tree | 88f94a90b22d9c40169a31cdff8649fe939c6c45 /src | |
parent | 625b678956434f14219ee2f002e0a0ce9da0c9b1 (diff) |
.......PS. [ZBXNEXT-7616] fixed http request functions to support binary data
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/zbxembed/httprequest.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/zbxembed/httprequest.c b/src/libs/zbxembed/httprequest.c index 18892e800c7..9a56a0952ef 100644 --- a/src/libs/zbxembed/httprequest.c +++ b/src/libs/zbxembed/httprequest.c @@ -71,7 +71,7 @@ static size_t curl_write_cb(void *ptr, size_t size, size_t nmemb, void *userdata size_t r_size = size * nmemb; zbx_es_httprequest_t *request = (zbx_es_httprequest_t *)userdata; - zbx_strncpy_alloc(&request->data, &request->data_alloc, &request->data_offset, (const char *)ptr, r_size); + zbx_str_memcpy_alloc(&request->data, &request->data_alloc, &request->data_offset, (const char *)ptr, r_size); return r_size; } @@ -331,7 +331,7 @@ out: if (-1 != err_index) return duk_throw(ctx); - duk_push_string(ctx, request->data); + duk_push_lstring(ctx, request->data, request->data_offset); return 1; } |