浏览代码

increased image size and for null object exception for TVIP311PI

tags/0.1.5^0
Robin Thoni 4 年前
父节点
当前提交
5f24ec73c6
签署人:: Robin THONI <robin@rthoni.com> GPG 密钥 ID: 4E09DEF46B99E61E
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6
    2
      app/Http/Business/Cameras/Trendnet/TVIP311PI.php

+ 6
- 2
app/Http/Business/Cameras/Trendnet/TVIP311PI.php 查看文件

@@ -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)

正在加载...
取消
保存