[Mapbender-commits] r2030 - branches/2.5/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jan 28 09:42:30 EST 2008


Author: christoph
Date: 2008-01-28 09:42:30 -0500 (Mon, 28 Jan 2008)
New Revision: 2030

Modified:
   branches/2.5/http/classes/class_connector.php
Log:
added http version

Modified: branches/2.5/http/classes/class_connector.php
===================================================================
--- branches/2.5/http/classes/class_connector.php	2008-01-28 12:47:20 UTC (rev 2029)
+++ branches/2.5/http/classes/class_connector.php	2008-01-28 14:42:30 UTC (rev 2030)
@@ -33,6 +33,7 @@
 	var $file;	
 	private $connectionType;
 	private $httpType = "get";
+	private $httpVersion = "1.0";
 	private $httpPostData;
 	private $httpContentType;
 		
@@ -83,6 +84,15 @@
 				}
 				break;
 				
+			case "httpVersion":
+				if (in_array($value, array("1.0", "1.1"))) {
+					$this->httpVersion = $value;
+				}
+				else {
+					$e = new mb_exception("class_connector.php: invalid http type '" . $value . "'");
+				}
+				break;
+			
 			case "httpType":
 				if (in_array(mb_strtoupper($value), array("POST", "GET"))) {
 					$this->httpType = $value;
@@ -162,7 +172,7 @@
 			
 			$buf = '';
 		    $fp = fsockopen($host, $port);
-		    fputs($fp, "POST $path HTTP/1.1\r\n");
+		    fputs($fp, "POST $path HTTP/".$this->httpVersion . "\r\n");
 		    fputs($fp, "Host: $host\r\n");
 		    if ($this->isValidHttpContentType($this->httpContentType)) {
 		    	fputs($fp,"Content-type: " . $this->httpContentType . "\r\n");



More information about the Mapbender_commits mailing list