Merge in changes about legal marks
authorNeal Gompa <neal@enanocms.org>
Fri, 02 Apr 2010 14:48:15 -0500
changeset 1237 446f1fad8dd4
parent 1235 25e13d35cd76 (diff)
parent 1236 f76cf260e9fa (current diff)
child 1238 56b94bd46968
Merge in changes about legal marks
--- a/includes/http.php	Fri Apr 02 14:43:37 2010 -0500
+++ b/includes/http.php	Fri Apr 02 14:48:15 2010 -0500
@@ -370,10 +370,8 @@
 		$newline = "\r\n";
 		
 		if ( $this->debug )
+		{
 			echo '<p>Connection opened. Writing main request to socket. Raw socket data follows.</p><pre>';
-		
-		if ( $this->debug )
-		{
 			echo '<hr /><div style="white-space: nowrap;">';
 			echo '<p><b>' . __CLASS__ . ': Sending request</b></p><p>Request parameters:</p>';
 			echo "<p><b>Headers:</b></p><pre>$headers</pre>";
@@ -386,7 +384,7 @@
 		$portline = ( $this->port == 80 ) ? '' : ":$this->port";
 		
 		$this->_fputs($connection, "{$this->method} {$this->uri}{$get} HTTP/1.1{$newline}");
-		$this->_fputs($connection, "Host: {$this->host}$portline{$newline}");
+		$this->_fputs($connection, "Host: {$this->host}{$portline}{$newline}");
 		$this->_fputs($connection, $headers);
 		$this->_fputs($connection, $cookies);
 		
@@ -528,7 +526,17 @@
 				{
 					echo "Pulling response using fread(), size $size\n";
 				}
-				$this->response .= fread($this->socket, $size);
+				$basesize = strlen($this->response);
+				while ( strlen($this->response) - $basesize < $size )
+				{
+					$remaining_bytes = $size - (strlen($this->response) - $basesize);
+					$this->response .= fread($this->socket, $remaining_bytes);
+					if ( $this->debug )
+					{
+						$remaining_bytes = $size - (strlen($this->response) - $basesize);
+						echo "<br />Received " . (strlen($this->response) - $basesize) . " of $size bytes ($remaining_bytes remaining)...\n";
+					}
+				}
 			}
 			else
 			{
--- a/plugins/SpecialUserPrefs.php	Fri Apr 02 14:43:37 2010 -0500
+++ b/plugins/SpecialUserPrefs.php	Fri Apr 02 14:48:15 2010 -0500
@@ -1157,6 +1157,7 @@
 				$db->_die('Avatar CP switching user avatar off');
 				
 			$has_avi = 1;
+			$avi_type = 'grv';
 			$quiet || print '<div class="info-box">' . $lang->get('usercp_avatar_gravatar_success') . '</div>';
 			$had_a_boo_boo = false;
 			break;