diff options
author | Sarven Capadisli <csarven@status.net> | 2009-11-02 16:44:12 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2009-11-02 16:44:12 +0000 |
commit | eeed7f54377d8a6bafacd0662c7907681b3ed0cf (patch) | |
tree | 7c17043eef8bd8e9ab9b5205ee748521e2023f4f /lib/ping.php | |
parent | 8d35831b54d6ff8f732f2e91c4153b90c3ed7a4f (diff) | |
parent | b22fc5b74aecd505d4e2df01258171fc65d312cf (diff) |
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'lib/ping.php')
-rw-r--r-- | lib/ping.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/ping.php b/lib/ping.php index 2797c1b2d..175bf8440 100644 --- a/lib/ping.php +++ b/lib/ping.php @@ -44,18 +44,20 @@ function ping_broadcast_notice($notice) { array('nickname' => $profile->nickname)), $tags)); - $request = new HTTPClient($notify_url, HTTP_Request2::METHOD_POST); - $request->setHeader('Content-Type', 'text/xml'); - $request->setBody($req); - $httpResponse = $request->send(); + $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); - if (!$httpResponse || mb_strlen($httpResponse->getBody()) == 0) { + if ($file === false || mb_strlen($file) == 0) { common_log(LOG_WARNING, "XML-RPC empty results for ping ($notify_url, $notice->id) "); continue; } - $response = xmlrpc_decode($httpResponse->getBody()); + $response = xmlrpc_decode($file); if (is_array($response) && xmlrpc_is_fault($response)) { common_log(LOG_WARNING, |