[Mapbender-commits] r4331 - branches/2.6/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Jul 10 11:18:18 EDT 2009
Author: christoph
Date: 2009-07-10 11:18:18 -0400 (Fri, 10 Jul 2009)
New Revision: 4331
Modified:
branches/2.6/http/classes/class_connector.php
Log:
http://trac.osgeo.org/mapbender/ticket/432
Modified: branches/2.6/http/classes/class_connector.php
===================================================================
--- branches/2.6/http/classes/class_connector.php 2009-07-10 11:48:58 UTC (rev 4330)
+++ branches/2.6/http/classes/class_connector.php 2009-07-10 15:18:18 UTC (rev 4331)
@@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(dirname(__FILE__)."/../../core/globalSettings.php");
-
+session_write_close();
/**
* Establishes a connection to a given URL (and loads the content).
* Supports HTTP (GET and POST), cURL and socket connections.
@@ -174,16 +174,29 @@
return @file_get_contents($url);
}
else {
+ $errno = 0;
+ $errstr = "";
$urlComponentArray = parse_url($url);
+ $scheme = $urlComponentArray["scheme"];
$host = $urlComponentArray["host"];
$port = $urlComponentArray["port"];
if ($port == "") {
- $port = 80;
+ if ($scheme == "https") {
+ $port = 443;
+ }
+ else {
+ $port = 80;
+ }
}
$path = $urlComponentArray["path"];
$query = $urlComponentArray["query"];
$buf = '';
- $fp = fsockopen($host, $port);
+ if ($scheme == "https") {
+ $fp = fsockopen("ssl://". $host, $port, $errno, $errstr);
+ }
+ else {
+ $fp = fsockopen($host, $port);
+ }
$postStr = "";
$postPath = "POST " . $path . "?" . $query . " HTTP/".$this->httpVersion . "\r\n";
$postStr .= $postPath;
@@ -209,7 +222,7 @@
$postStr .= $this->httpPostData;
fputs($fp, $this->httpPostData);
- new mb_exception($postStr);
+ new mb_notice("connector.http.postData: ".$this->httpPostData);
$xmlstr = false;
while (!feof($fp)) {
@@ -223,6 +236,7 @@
}
}
fclose($fp);
+ new mb_notice("connector.http.response: ".$buf);
return $buf;
}
}
More information about the Mapbender_commits
mailing list