Commit 1e052dbb authored by sambuca's avatar sambuca

Refs #2569 fix wrong password used in case of multiple cameras. Fix receive...

Refs #2569 fix wrong password used in case of multiple cameras. Fix receive command for child for Get_Image command
parent 61681411
...@@ -306,9 +306,7 @@ bool Advanced_IP_Camera::HttpGet(string sUrl, string sUser, string sPasswd, char ...@@ -306,9 +306,7 @@ bool Advanced_IP_Camera::HttpGet(string sUrl, string sUser, string sPasswd, char
{ {
curl_easy_setopt(m_pCurl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_easy_setopt(m_pCurl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_easy_setopt(m_pCurl, CURLOPT_USERNAME, sUser.c_str()); curl_easy_setopt(m_pCurl, CURLOPT_USERNAME, sUser.c_str());
if (!sPasswd.empty()) { curl_easy_setopt(m_pCurl, CURLOPT_PASSWORD, sPasswd.c_str());
curl_easy_setopt(m_pCurl, CURLOPT_PASSWORD, sPasswd.c_str());
}
} }
CURLcode res = curl_easy_perform(m_pCurl); CURLcode res = curl_easy_perform(m_pCurl);
...@@ -328,7 +326,7 @@ bool Advanced_IP_Camera::HttpGet(string sUrl, string sUser, string sPasswd, char ...@@ -328,7 +326,7 @@ bool Advanced_IP_Camera::HttpGet(string sUrl, string sUser, string sPasswd, char
*iData_Size = data.size; *iData_Size = data.size;
return true; return true;
} else { } else {
LoggerWrapper::GetInstance ()->Write (LV_STATUS, "HttpGet: http code: %d, response:", code, data.buffer); LoggerWrapper::GetInstance ()->Write (LV_CRITICAL, "HttpGet: http code: %d, response:", code, data.buffer);
} }
} }
return false; return false;
......
...@@ -70,6 +70,7 @@ void CameraDevice::ReceiveCommandForChild(long pkDevice, string &sCMD_Result, Me ...@@ -70,6 +70,7 @@ void CameraDevice::ReceiveCommandForChild(long pkDevice, string &sCMD_Result, Me
int iData_Size=pMessage->m_mapData_Lengths[COMMANDPARAMETER_Data_CONST]; int iData_Size=pMessage->m_mapData_Lengths[COMMANDPARAMETER_Data_CONST];
if (Get_Image(iWidth, iHeight, &pData, &iData_Size, &sFormat)) { if (Get_Image(iWidth, iHeight, &pData, &iData_Size, &sFormat)) {
LoggerWrapper::GetInstance ()->Write (LV_STATUS, "CameraDevice.ReceiveCommandForChild() sending response message"); LoggerWrapper::GetInstance ()->Write (LV_STATUS, "CameraDevice.ReceiveCommandForChild() sending response message");
sCMD_Result = "OK";
pMessage->m_bRespondedToMessage=true; pMessage->m_bRespondedToMessage=true;
Message *pMessageOut=new Message(pkDevice,pMessage->m_dwPK_Device_From,PRIORITY_NORMAL,MESSAGETYPE_REPLY,0,0); Message *pMessageOut=new Message(pkDevice,pMessage->m_dwPK_Device_From,PRIORITY_NORMAL,MESSAGETYPE_REPLY,0,0);
pMessageOut->m_mapData_Parameters[COMMANDPARAMETER_Data_CONST]=pData; pMessageOut->m_mapData_Parameters[COMMANDPARAMETER_Data_CONST]=pData;
...@@ -77,7 +78,6 @@ void CameraDevice::ReceiveCommandForChild(long pkDevice, string &sCMD_Result, Me ...@@ -77,7 +78,6 @@ void CameraDevice::ReceiveCommandForChild(long pkDevice, string &sCMD_Result, Me
pMessageOut->m_mapParameters[COMMANDPARAMETER_Format_CONST]=sFormat; pMessageOut->m_mapParameters[COMMANDPARAMETER_Format_CONST]=sFormat;
pMessageOut->m_mapParameters[0]=sCMD_Result; pMessageOut->m_mapParameters[0]=sCMD_Result;
m_pAIPC->SendMessage(pMessageOut); m_pAIPC->SendMessage(pMessageOut);
sCMD_Result = "OK";
} }
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment