优化http请求错误的处理

lowmem
Matthew 2 months ago
parent b5a188a5b4
commit db78ce7728

@ -1728,22 +1728,7 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
img.clear();
netCaptureResult = requestCapture(localPhotoInfo.channel, localPhotoInfo.preset, netPhotoInfo, img);
if (netCaptureResult)
{
m_ethernetFailures = 0;
}
else
{
m_ethernetFailures++;
if (m_ethernetFailures > 3)
{
time_t rebootTime = GetRebootTime();
if (ts - rebootTime > 1800)
{
Reboot(REBOOT_TYPE_DEVICE, true, "Ethernet Not Existing");
}
}
}
if (netCaptureResult && !img.empty())
{
if(img.size() <= 1000)
@ -1764,6 +1749,23 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
ethernetPowerCtrl.reset();
XYLOG(XYLOG_SEVERITY_DEBUG, "Ethernet Power OFF");
if (netCaptureResult)
{
m_ethernetFailures = 0;
}
else
{
m_ethernetFailures++;
if (m_ethernetFailures > 3)
{
time_t rebootTime = GetRebootTime();
if (ts - rebootTime > 1800)
{
Reboot(REBOOT_TYPE_DEVICE, true, "Ethernet Not Existing");
}
}
}
if (!rgb.empty())
{
time_t takingTime = ts;

Loading…
Cancel
Save