Преглед изворни кода

increased image size and for null object exception for TVIP311PI

tags/0.1.5^0
Robin Thoni пре 4 година
родитељ
комит
5f24ec73c6
Signed by: Robin THONI <robin@rthoni.com> GPG Key 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)

Loading…
Откажи
Сачувај