|
@@ -168,15 +168,26 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket
|
|
|
$request .= "$v\r\n";
|
|
$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
|
|
// Send the request
|
|
|
if (! @fwrite($this->socket, $request)) {
|
|
if (! @fwrite($this->socket, $request)) {
|
|
|
require_once 'Zend/Http/Client/Adapter/Exception.php';
|
|
require_once 'Zend/Http/Client/Adapter/Exception.php';
|
|
|
throw new Zend_Http_Client_Adapter_Exception("Error writing request to proxy server");
|
|
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;
|
|
return $request;
|
|
|
}
|
|
}
|
|
|
|
|
|