Working version of the async pub/sub notifier for callbacks

This commit is contained in:
kexkey
2019-05-20 14:33:37 -04:00
committed by kexkey
parent ed71a2ed8f
commit ac2b031bf0
12 changed files with 124 additions and 75 deletions

View File

@@ -113,23 +113,11 @@ build_callback_txid() {
curl_callback_txid() {
trace "Entering curl_callback_txid()..."
local url=${1}
local data=${2}
local returncode
trace "[curl_callback_txid] curl -w \"%{http_code}\" -H \"Content-Type: application/json\" -H \"X-Forwarded-Proto: https\" -d \"${data}\" ${url}"
rc=$(curl -w "%{http_code}" -H "Content-Type: application/json" -H "X-Forwarded-Proto: https" -d "${data}" ${url})
notify_web "${1}" "${2}"
returncode=$?
trace "[curl_callback_txid] HTTP return code=${rc}"
trace_rc ${returncode}
if [ "${returncode}" -eq "0" ]; then
if [ "${rc}" -lt "400" ]; then
return 0
else
return ${rc}
fi
else
return ${returncode}
fi
return ${returncode}
}