When many downloads are taking place one after another it was possible
that uninitialized memory used for state value has a 5,6,7 status, which
caused that web api interpreted it as not valid state change, when the
'DOWNLOADING' state comes. Now this should not occur as the state is
initialized before starting a download.
Change-Id: I8c0ed0d375e512c1dcc17255f2387df70f3ddcb3
(cherry picked from commit
722a53ccbd76726cb84f65f60c3ba98b0cbb2208)
}
void DownloadInstance::OnStateChanged(int download_id, download_state_e state, void* user_data) {
- ScopeLogger();
+ ScopeLogger("State changed for callbackId: %d to: %d", download_id, state);
CallbackPtr down_cb_ptr = static_cast<CallbackPtr>(user_data);
// Prevent to call finished, cancelled or failed function more than once
down_cb_ptr->download_id = di_ptr->download_id;
down_cb_ptr->instance = this;
+ down_cb_ptr->state = DOWNLOAD_STATE_NONE;
download_callbacks[down_cb_ptr->download_id] = down_cb_ptr;