[Mapbender-commits] r9607 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Sep 28 05:23:52 PDT 2016


Author: armin11
Date: 2016-09-28 05:23:51 -0700 (Wed, 28 Sep 2016)
New Revision: 9607

Modified:
   trunk/mapbender/http/classes/class_connector.php
Log:
Fix for setting timeout public instead of private and do an exception if curl give back a timed-out signal

Modified: trunk/mapbender/http/classes/class_connector.php
===================================================================
--- trunk/mapbender/http/classes/class_connector.php	2016-09-27 13:51:31 UTC (rev 9606)
+++ trunk/mapbender/http/classes/class_connector.php	2016-09-28 12:23:51 UTC (rev 9607)
@@ -28,7 +28,7 @@
 
 	var $file;
 	private $connectionType;
-	private $timeOut = 20;
+	public $timeOut = 20;
 	private $httpType = "get";
 	private $httpVersion = "1.0";
 	private $httpPostData;
@@ -336,6 +336,10 @@
 		$error_log .= "lookup time: ".$info['namelookup_time']."\n";
 		$error_log .= "redirect_time: ".$info['redirect_time']."\n";
 		$error_log .= "redirect_count: ".$info['redirect_count']."\n";*/
+		if ($info['total_time'] == (float)0) {
+			$this->timedOut = true;
+			$e = new mb_exception("class_connector.php: Problem when connecting to external resource via curl - connection timed out: Waited more than ".$this->timeOut." seconds!");
+		}
 		if ($info['http_code'] == '401') {
 			curl_close ($ch);
 			return $info['http_code'];
@@ -354,7 +358,7 @@
 		if ($tmpHttpProxy != '') {
 			putenv("http_proxy=$tmpHttpProxy");
 		}
-		#$e = new mb_notice("class_connector.php: CURL give back: ".$file);
+		//$e = new mb_notice("class_connector.php: CURL give back: ".$file);
 		return $file;
 	}
 
@@ -411,7 +415,7 @@
 		    $postStr .= $this->httpPostData;
 			fputs($fp, $this->httpPostData);
 
-			new mb_notice("connector.http.postData: ".$this->httpPostData);
+			//new mb_notice("connector.http.postData: ".$this->httpPostData);
 
 		    $xmlstr = false;
 		    //@TODO remove possibly infinite loop



More information about the Mapbender_commits mailing list