diff options
author | mboelen <michael@cisofy.com> | 2015-12-21 14:08:47 +0300 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2015-12-21 14:08:47 +0300 |
commit | 040c2efc1c328627d9b89336d80c4ae35e6a7d17 (patch) | |
tree | 47713ea248892c184d5d1aafb06b27098aca2acc /include/data_upload | |
parent | 252f774f57c5f6a1b93b81146a6a9b87ae722dce (diff) |
Perform compressed uploads by default
Diffstat (limited to 'include/data_upload')
-rw-r--r-- | include/data_upload | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/data_upload b/include/data_upload index 79f11598..66e8f938 100644 --- a/include/data_upload +++ b/include/data_upload @@ -138,7 +138,12 @@ output "Settings file: ${SETTINGS_FILE}" # 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}" - UPLOAD=`${CURLBINARY} ${CURL_OPTIONS} -s -S --data-urlencode "data@${REPORTFILE}" --data-urlencode "licensekey=${LICENSE_KEY}" --data-urlencode "hostid=${HOSTID}" ${UPLOAD_URL} 2> /dev/null` + # Add a space + CURL_OPTIONS=" ${CURL_OPTIONS}" + if [ ${COMPRESSED_UPLOADS} -eq 1 ]; then + CURL_OPTIONS="${CURL_OPTIONS} --compressed" + fi + 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 echo "${RED}Error: ${NORMAL}Error occurred, cURL ended during the upload of the report data." |