zend MDL-22103 update Zend library to 1.10
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
* @package Zend_Http
|
||||
* @subpackage Client_Adapter
|
||||
* @version $Id$
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@ require_once 'Zend/Http/Client/Adapter/Socket.php';
|
||||
* @category Zend
|
||||
* @package Zend_Http
|
||||
* @subpackage Client_Adapter
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
|
||||
@@ -60,6 +60,7 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
|
||||
'ssltransport' => 'ssl',
|
||||
'sslcert' => null,
|
||||
'sslpassphrase' => null,
|
||||
'sslusecontext' => false,
|
||||
'proxy_host' => '',
|
||||
'proxy_port' => 8080,
|
||||
'proxy_user' => '',
|
||||
@@ -91,6 +92,11 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
|
||||
if (! $this->config['proxy_host']) {
|
||||
return parent::connect($host, $port, $secure);
|
||||
}
|
||||
|
||||
/* Url might require stream context even if proxy connection doesn't */
|
||||
if ($secure) {
|
||||
$this->config['sslusecontext'] = true;
|
||||
}
|
||||
|
||||
// Connect (a non-secure connection) to the proxy server
|
||||
return parent::connect(
|
||||
@@ -162,15 +168,26 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
|
||||
$request .= "$v\r\n";
|
||||
}
|
||||
|
||||
// Add the request body
|
||||
$request .= "\r\n" . $body;
|
||||
|
||||
if(is_resource($body)) {
|
||||
$request .= "\r\n";
|
||||
} else {
|
||||
// Add the request body
|
||||
$request .= "\r\n" . $body;
|
||||
}
|
||||
|
||||
// Send the request
|
||||
if (! @fwrite($this->socket, $request)) {
|
||||
require_once 'Zend/Http/Client/Adapter/Exception.php';
|
||||
throw new Zend_Http_Client_Adapter_Exception("Error writing request to proxy server");
|
||||
}
|
||||
|
||||
|
||||
if(is_resource($body)) {
|
||||
if(stream_copy_to_stream($body, $this->socket) == 0) {
|
||||
require_once 'Zend/Http/Client/Adapter/Exception.php';
|
||||
throw new Zend_Http_Client_Adapter_Exception('Error writing request to server');
|
||||
}
|
||||
}
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user