Skip to content

Commit

Permalink
add some more debug
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Feb 8, 2019
1 parent 1018c9b commit 01f7f12
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bin/calaos_server/IPCam/SynoSurveillanceStation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,15 @@ void SynoSurveillanceStation::doGetSnapshot()
snapUrl.clear();
}
lastSnapshot = data;
cInfo() << "new snapshot: " << lastSnapshot.length();
isRunning = false;
downloadDataCb(lastSnapshot);
});
}

void SynoSurveillanceStation::getSnapshot(std::function<void(const string &data)> cb)
{
cDebugDom("syno.ss") << "Getting new Snapshot...";
string url = snapUrl;
url += "&id=" + Utils::url_encode(get_param("camera_id"));
url += "&_sid=" + Utils::url_encode(apiSid);
Expand All @@ -174,9 +176,12 @@ void SynoSurveillanceStation::getSnapshot(std::function<void(const string &data)

dl->m_signalCompleteData.connect([=](const string &data, int status)
{
cDebugDom("syno.ss") << "getSnapshot done, status: " << status;

if (status == 200)
{
{
auto headers = dl->getResponseHeaders();
cDebugDom("syno.ss") << "Headers Content-Type: " << headers["Content-Type"];
if (headers["Content-Type"] != "image/jpeg")
{
cWarning() << "GetSnapshot failed: " << data;
Expand Down

0 comments on commit 01f7f12

Please sign in to comment.