callbackSecureCommCpp
Definition
-- @/lua/ge/extensions/core/online.lua:148
-- do not remove, called by c++
local function callbackSecureCommCpp(id, responseCode, responseBuffer, responseHeaders, responseData, postData, curlCode, curlErrorStr, effectiveURL)
local r = requests[id]
if not r then
log('E', 'online', 'unknown request completed: '..tostring(id))
log('E', 'online', 'curlCode= '..dumps(curlCode))
log('E', 'online', 'curlErrorStr= '..dumps(curlErrorStr))
log('E', 'online', 'effectiveURL= '..dumps(effectiveURL))
return
end
if curlCode ~= 0 then
r.pub.error = curlErrorStr
r.pub.errorCode = curlCode
end
r.pub.effectiveURL = effectiveURL
r.pub.responseCode = responseCode
if type(responseresponseHeadersBuffer) == 'string' and string.len(responseHeaders) > 0 then
r.pub.responseHeaders = responseHeaders
end
if type(responseBuffer) == 'string' and string.len(responseBuffer) > 0 then
r.pub.responseBuffer = responseBuffer
end
if type(responseData) == 'table' and not tableIsEmpty(responseData) then
r.pub.responseData = responseData
end
-- set to 100% as we might have missed the last progress update
if r.pub.dlnow and r.pub.dltotal then
r.pub.dlnow = r.pub.dltotal
end
if r.pub.ulnow and r.pub.ultotal then
r.pub.ulnow = r.pub.ultotal
end
r.pub.state = 'finished'
--if responseCode ~= 200 then
-- log('E', 'online', 'unable to communicate with API: ' .. dumps(r, responseCode, responseBuffer, responseHeaders, responseData))
--end
-- all done, call the callback
if r.priv.callback_finish_lua then
r.priv.callback_finish_lua(r.pub)
end
-- do not remove the request, see clearFinishedRequests
end
Callers