Skip to content
Snippets Groups Projects
Commit b58bcfed authored by Andreas Gohr's avatar Andreas Gohr
Browse files

removed setter/getter to match coding style

since we don't use setter/getters for the other options it doesn't make
sense to have them for the keep-alive function
parent a6bacf70
No related branches found
No related tags found
No related merge requests found
......@@ -252,7 +252,7 @@ class HTTPClient {
if($uri['port']) $headers['Host'].= ':'.$uri['port'];
$headers['User-Agent'] = $this->agent;
$headers['Referer'] = $this->referer;
if ($this->isKeepAlive()) {
if ($this->keep_alive) {
$headers['Connection'] = 'Keep-Alive';
} else {
$headers['Connection'] = 'Close';
......@@ -303,7 +303,7 @@ class HTTPClient {
stream_set_blocking($socket,0);
// keep alive?
if ($this->isKeepAlive()) {
if ($this->keep_alive) {
$this->connections[$connectionId] = $socket;
} else {
unset($this->connections[$connectionId]);
......@@ -493,7 +493,7 @@ class HTTPClient {
}
}
if (!$this->isKeepAlive() ||
if (!$this->keep_alive ||
(isset($this->resp_headers['connection']) && $this->resp_headers['connection'] == 'Close')) {
// close socket
$status = socket_get_status($socket);
......@@ -645,26 +645,6 @@ class HTTPClient {
return $out;
}
/**
* Returns if the keep-alive feature is enabled or not.
*
* @return bool keep-alive enabled
* @author Tobias Sarnowski <sarnowski@new-thoughts.org>
*/
function isKeepAlive() {
return $this->keep_alive;
}
/**
* Set the keep-alive feature status.
*
* @param bool $keep_alive if keep-alive should be enabled or not
* @author Tobias Sarnowski <sarnowski@new-thoughts.org>
*/
function setKeepAlive($keep_alive) {
$this->keep_alive = $keep_alive;
}
/**
* Generates a unique identifier for a connection.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment