Skip to content

Commit

Permalink
Merge pull request #2 from fpoirotte/whitespace_and_notifications
Browse files Browse the repository at this point in the history
Make all adapters send a disconnect notification
  • Loading branch information
saltybeagle committed Jul 30, 2011
2 parents 0cecd74 + 4675309 commit 1992243
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/HTTP/Request/Adapter/Curl.php
Expand Up @@ -93,6 +93,7 @@ protected function _setupRequest()
protected function _sendRequest()
{
$body = curl_exec($this->curl);
$this->_notify('disconnect');

if (false === $body) {
throw new Request\Exception(
Expand Down
3 changes: 2 additions & 1 deletion src/HTTP/Request/Adapter/Filesystem.php
Expand Up @@ -54,6 +54,7 @@ public function sendRequest()
$body = file_get_contents($actualfile);
$details['code'] = '200';
}
$this->_notify('disconnect');
// $this->verb is GET/POST/etc.
// $this->uri is PEAR2\HTTP\Request\Uri
// $this->headers is array of headers
Expand Down Expand Up @@ -82,4 +83,4 @@ public function sendRequest()

return new Request\Response($details, $body, $headers, $cookies);
}
}
}
1 change: 1 addition & 0 deletions src/HTTP/Request/Adapter/Http.php
Expand Up @@ -53,6 +53,7 @@ public function sendRequest()
}

$request->send();
$this->_notify('disconnect');
$response = $request->getResponseMessage();
$body = $response->getBody();

Expand Down
1 change: 1 addition & 0 deletions src/HTTP/Request/Adapter/Phpsocket.php
Expand Up @@ -89,6 +89,7 @@ public function sendRequest()
$this->_stream->write($payload);

$this->parse();
$this->_notify('disconnect');

$details['code'] = $this->code;
$details['httpVersion'] = $this->httpVersion;
Expand Down
1 change: 0 additions & 1 deletion src/HTTP/Request/Listener.php
Expand Up @@ -113,4 +113,3 @@ public function update($subject, $event, $data = null)
}
}
?>

2 changes: 1 addition & 1 deletion tests/headers.002.phpt
@@ -1,5 +1,5 @@
--TEST--
Test of arrau access for PEAR2\HTTP\Request\Headers
Test of array access for PEAR2\HTTP\Request\Headers
--FILE--
<?php
require_once dirname(__FILE__).'/_setup.php';
Expand Down

0 comments on commit 1992243

Please sign in to comment.