summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/HTTPClient.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php
index 7474e1fd8..3d843c912 100644
--- a/inc/HTTPClient.php
+++ b/inc/HTTPClient.php
@@ -231,7 +231,19 @@ class HTTPClient {
$this->_debug('request',$request);
// send request
- fputs($socket, $request);
+ $towrite = strlen($request);
+ $written = 0;
+ while($written < $towrite){
+ $ret = fwrite($socket, substr($request,$written));
+ if($ret === false){
+ $this->status = -100;
+ $this->error = 'Failed writing to socket';
+ return false;
+ }
+ $written += $ret;
+ }
+
+
// read headers from socket
$r_headers = '';
do{