From c12a4403aad9fe89d8d9eaf0cace3d769a614445 Mon Sep 17 00:00:00 2001 From: mboelen Date: Mon, 21 Dec 2015 15:15:51 +0100 Subject: Preparations for compressed uploads --- include/data_upload | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/data_upload') diff --git a/include/data_upload b/include/data_upload index 66e8f938..b8e7b88c 100644 --- a/include/data_upload +++ b/include/data_upload @@ -137,12 +137,13 @@ output "Settings file: ${SETTINGS_FILE}" output "${WHITE}Found hostid: ${HOSTID}${NORMAL}" # Try to connect output "Uploading data.." - logtext "Command used: ${CURLBINARY} ${CURL_OPTIONS} -s -S --data-urlencode \"data@${REPORTFILE}\" --data-urlencode \"licensekey=${LICENSE_KEY}\" --data-urlencode \"hostid=${HOSTID}\" ${UPLOAD_URL}" # Add a space CURL_OPTIONS=" ${CURL_OPTIONS}" + # Currently compressed uploads are not supported yet on central node. Therefore default value is set to 0. if [ ${COMPRESSED_UPLOADS} -eq 1 ]; then - CURL_OPTIONS="${CURL_OPTIONS} --compressed" + CURL_OPTIONS="${CURL_OPTIONS} --compressed -H 'Content-Encoding: gzip'" fi + logtext "Command used: ${CURLBINARY}${CURL_OPTIONS} -s -S --data-urlencode \"data@${REPORTFILE}\" --data-urlencode \"licensekey=${LICENSE_KEY}\" --data-urlencode \"hostid=${HOSTID}\" ${UPLOAD_URL}" UPLOAD=`${CURLBINARY}${CURL_OPTIONS} -s -S --data-urlencode "data@${REPORTFILE}" --data-urlencode "licensekey=${LICENSE_KEY}" --data-urlencode "hostid=${HOSTID}" ${UPLOAD_URL} 2> /dev/null` EXITCODE=$? if [ ${EXITCODE} -gt 0 ]; then -- cgit v1.2.3