diff options
author | mboelen <michael@cisofy.com> | 2015-12-21 17:15:51 +0300 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2015-12-21 17:15:51 +0300 |
commit | c12a4403aad9fe89d8d9eaf0cace3d769a614445 (patch) | |
tree | 860723ea7bbef37b62dec0d1b809fd608c0abce4 /include/data_upload | |
parent | 040c2efc1c328627d9b89336d80c4ae35e6a7d17 (diff) |
Preparations for compressed uploads
Diffstat (limited to 'include/data_upload')
-rw-r--r-- | include/data_upload | 5 |
1 files changed, 3 insertions, 2 deletions
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 |