summaryrefslogtreecommitdiff
path: root/lib/ping.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-02 18:13:04 -0500
committerEvan Prodromou <evan@status.net>2009-11-02 18:13:04 -0500
commita2b830392597d88c435baf54ad0df4ecda02dc41 (patch)
tree08f8ddcbcab63de9117ccf82e5477fa0d565bdc6 /lib/ping.php
parent61419038e5747886357964a7eb3f814761482891 (diff)
parent15d0055c6f2e3b7007a82df40502e15cf5c32a13 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Conflicts: classes/User.php
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,