From 3fedf16f353f2b4ce37f279cb44f254bf7ef3c5b Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 11 Jan 2017 17:57:12 -0800 Subject: . --- service/SoftwareUpdater.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/service/SoftwareUpdater.cpp b/service/SoftwareUpdater.cpp index 6269042e..56315f48 100644 --- a/service/SoftwareUpdater.cpp +++ b/service/SoftwareUpdater.cpp @@ -370,13 +370,13 @@ void SoftwareUpdater::handleSoftwareUpdateUserMessage(uint64_t origin,const void case VERB_GET_DATA: if ((len >= 21)&&(_dist.size() > 0)) { - printf("<< GET_DATA from %.10llx for %s\n",origin,Utils::hex(reinterpret_cast(data) + 1,16).c_str()); + unsigned long idx = (unsigned long)*(reinterpret_cast(data) + 17) << 24; + idx |= (unsigned long)*(reinterpret_cast(data) + 18) << 16; + idx |= (unsigned long)*(reinterpret_cast(data) + 19) << 8; + idx |= (unsigned long)*(reinterpret_cast(data) + 20); + printf("<< GET_DATA @%u from %.10llx for %s\n",(unsigned int)idx,origin,Utils::hex(reinterpret_cast(data) + 1,16).c_str()); std::map< Array,_D >::iterator d(_dist.find(Array(reinterpret_cast(data) + 1))); if (d != _dist.end()) { - unsigned long idx = (unsigned long)*(reinterpret_cast(data) + 17) << 24; - idx |= (unsigned long)*(reinterpret_cast(data) + 18) << 16; - idx |= (unsigned long)*(reinterpret_cast(data) + 19) << 8; - idx |= (unsigned long)*(reinterpret_cast(data) + 20); if (idx < d->second.bin.length()) { Buffer buf; buf.append((uint8_t)VERB_DATA); -- cgit v1.2.3