|
@@ -44,11 +44,15 @@ class TVIP311PI extends AbstractCamera
|
44
|
44
|
$this->_client->request('GET', $this->_url);
|
45
|
45
|
} catch (RequestException $e) {
|
46
|
46
|
$response = $e->getResponse();
|
47
|
|
- if ($response->getStatusCode() == 401) {
|
|
47
|
+ if ($response != null && $response->getStatusCode() == 401) {
|
48
|
48
|
$nonce = array();
|
49
|
49
|
preg_match("/nonce=\"([a-f0-9]+)\"/", $response->getHeader("WWW-Authenticate")[0], $nonce);
|
50
|
50
|
$nonce = $nonce[1];
|
51
|
51
|
}
|
|
52
|
+ else {
|
|
53
|
+ LuLog::log($e);
|
|
54
|
+ }
|
|
55
|
+
|
52
|
56
|
} catch (\Exception $e) {
|
53
|
57
|
LuLog::log($e);
|
54
|
58
|
}
|
|
@@ -65,7 +69,7 @@ class TVIP311PI extends AbstractCamera
|
65
|
69
|
"Connection: close\r\n".
|
66
|
70
|
"Accept: */*\r\n\r\n");
|
67
|
71
|
$data = "";
|
68
|
|
- while(substr_count($data, "--boundarySample") < 2 && socket_recv($sock, $buf, 1024, 0) && strlen($data) < 35000)
|
|
72
|
+ while(substr_count($data, "--boundarySample") < 2 && socket_recv($sock, $buf, 1024, 0) && strlen($data) < 50000)
|
69
|
73
|
$data .= $buf;
|
70
|
74
|
socket_close($sock);
|
71
|
75
|
if(substr_count($data, "--boundarySample") >= 2)
|