summaryrefslogtreecommitdiff
path: root/lib/ping.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-07 13:03:52 -0500
committerEvan Prodromou <evan@status.net>2009-11-07 13:03:52 -0500
commitd9cde0ef80ee838a99035d44f0286b3cc902e332 (patch)
treeac9d74d52a06890db71f61ac934e75b937c19753 /lib/ping.php
parentf2b642ce822c480cfc418c38106cc18c3a428cf4 (diff)
parent2d8ad0409d8e78ec35a65156bc375eacbe561963 (diff)
Merge branch '0.9.x' into userflag
Diffstat (limited to 'lib/ping.php')
-rw-r--r--lib/ping.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/ping.php b/lib/ping.php
index 175bf8440..5698c4038 100644
--- a/lib/ping.php
+++ b/lib/ping.php
@@ -44,20 +44,16 @@ function ping_broadcast_notice($notice) {
array('nickname' => $profile->nickname)),
$tags));
- $context = stream_context_create(array('http' => array('method' => "POST",
- 'header' =>
- "Content-Type: text/xml\r\n".
- "User-Agent: StatusNet/".STATUSNET_VERSION."\r\n",
- 'content' => $req)));
- $file = file_get_contents($notify_url, false, $context);
+ $request = HTTPClient::start();
+ $httpResponse = $request->post($notify_url, array('Content-Type: text/xml'), $req);
- if ($file === false || mb_strlen($file) == 0) {
+ if (!$httpResponse || mb_strlen($httpResponse->getBody()) == 0) {
common_log(LOG_WARNING,
"XML-RPC empty results for ping ($notify_url, $notice->id) ");
continue;
}
- $response = xmlrpc_decode($file);
+ $response = xmlrpc_decode($httpResponse->getBody());
if (is_array($response) && xmlrpc_is_fault($response)) {
common_log(LOG_WARNING,