diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-05-26 20:44:02 +0200 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-05-26 20:44:02 +0200 |
commit | e5e6f447ba17ba51957a1228e55fe53d8087776a (patch) | |
tree | f59213d66fcb910725f8fd34def06e89d88e5241 /inc/HTTPClient.php | |
parent | b66e5840006078112b8da741b2c612e446afd452 (diff) | |
parent | 8f2758f6b53b11db38d83ea9ad838ed802a6e635 (diff) | |
download | rpg-e5e6f447ba17ba51957a1228e55fe53d8087776a.tar.gz rpg-e5e6f447ba17ba51957a1228e55fe53d8087776a.tar.bz2 |
Merge remote-tracking branch 'origin/master' into trailingcolons
Conflicts:
inc/lang/cs/lang.php
inc/lang/hu/lang.php
Diffstat (limited to 'inc/HTTPClient.php')
-rw-r--r-- | inc/HTTPClient.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index f8b836753..4352bcb97 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -61,6 +61,9 @@ class DokuHTTPClient extends HTTPClient { } +/** + * Class HTTPClientException + */ class HTTPClientException extends Exception { } /** @@ -249,7 +252,6 @@ class HTTPClient { if (empty($port)) $port = 8080; }else{ $request_url = $path; - $server = $server; if (!isset($port)) $port = ($uri['scheme'] == 'https') ? 443 : 80; } @@ -280,7 +282,6 @@ class HTTPClient { } } $headers['Content-Length'] = strlen($data); - $rmethod = 'POST'; }elseif($method == 'GET'){ $data = ''; //no data allowed on GET requests } @@ -343,7 +344,7 @@ class HTTPClient { try { //set non-blocking - stream_set_blocking($socket, false); + stream_set_blocking($socket, 0); // build request $request = "$method $request_url HTTP/".$this->http.HTTP_NL; @@ -458,7 +459,7 @@ class HTTPClient { if ($chunk_size > 0) { $r_body .= $this->_readData($socket, $chunk_size, 'chunk'); - $byte = $this->_readData($socket, 2, 'chunk'); // read trailing \r\n + $this->_readData($socket, 2, 'chunk'); // read trailing \r\n } } while ($chunk_size && !$abort); }elseif(isset($this->resp_headers['content-length']) && !isset($this->resp_headers['transfer-encoding'])){ @@ -480,7 +481,6 @@ class HTTPClient { $r_body = $this->_readData($socket, $this->max_bodysize, 'response (content-length limited)', true); }else{ // read entire socket - $r_size = 0; while (!feof($socket)) { $r_body .= $this->_readData($socket, 4096, 'response (unlimited)', true); } @@ -509,7 +509,6 @@ class HTTPClient { if (!$this->keep_alive || (isset($this->resp_headers['connection']) && $this->resp_headers['connection'] == 'Close')) { // close socket - $status = socket_get_status($socket); fclose($socket); unset(self::$connections[$connectionId]); } |