throws exception on empty response and increases retry number
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 6 Aug 2014 08:38:53 +0000 (10:38 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 4 Sep 2014 09:26:38 +0000 (11:26 +0200)
Change-Id: I6ae760e6d75fa1b374bd1ad7c1a46c1e05050476
Reviewed-on: http://gerrit.tine20.com/customers/934
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Import/CalDav/Client.php

index b1bfb15..194e642 100644 (file)
@@ -138,7 +138,8 @@ class Tinebase_Import_CalDav_Client extends \Sabre\DAV\Client
     public function calDavRequest($method, $uri, $body, $depth = 0)
     {
         $redo = 0;
     public function calDavRequest($method, $uri, $body, $depth = 0)
     {
         $redo = 0;
-        while (++$redo < 4)
+        $response = null;
+        while (++$redo < 10)
         {
             try {
                 $response = $this->request($method, $uri, $body, array(
         {
             try {
                 $response = $this->request($method, $uri, $body, array(
@@ -155,6 +156,10 @@ class Tinebase_Import_CalDav_Client extends \Sabre\DAV\Client
             break;
         }
         
             break;
         }
         
+        if (! $response) {
+            throw new Tinebase_Exception("no response after several retries");
+        }
+        
         $result = $this->parseMultiStatus($response['body']);
         
         //fputs($this->requestLogFH, $method.' '.$uri."\n".$body."\n".$depth."\n".$response['body']."\n\n\n\n\n\n\n", 10000000);
         $result = $this->parseMultiStatus($response['body']);
         
         //fputs($this->requestLogFH, $method.' '.$uri."\n".$body."\n".$depth."\n".$response['body']."\n\n\n\n\n\n\n", 10000000);