aboutsummaryrefslogtreecommitdiffstats
path: root/mod/pubsub.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-15 04:20:42 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-15 04:20:42 -0700
commit35a9b49ed06c58b53f81cf5ef476191807157925 (patch)
tree506f0008b23ee46b30b719084dbc0bf42b3b84cf /mod/pubsub.php
parente9aa6eb0c7c9c027cbd13138ae5247bbd007e180 (diff)
downloadvolse-hubzilla-35a9b49ed06c58b53f81cf5ef476191807157925.tar.gz
volse-hubzilla-35a9b49ed06c58b53f81cf5ef476191807157925.tar.bz2
volse-hubzilla-35a9b49ed06c58b53f81cf5ef476191807157925.zip
allow for multiple pubsub hubs so everything can still work when/if one goes flaky
(Google's hub has been particularly unreliable recently and the symptoms are that you just stop receiving updates, and/or updates you send are silently dropped and never delivered). Also add more instrumentation to help debug pubsub issues.
Diffstat (limited to 'mod/pubsub.php')
-rw-r--r--mod/pubsub.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/mod/pubsub.php b/mod/pubsub.php
index 7dea2afb1..693fcbf81 100644
--- a/mod/pubsub.php
+++ b/mod/pubsub.php
@@ -39,7 +39,10 @@ function pubsub_init(&$a) {
$hub_lease = notags(trim($_GET['hub_lease_seconds']));
$hub_verify = notags(trim($_GET['hub_verify_token']));
-
+ $debugging = get_config('system','debugging');
+ if($debugging) {
+ file_put_contents('pubsub.out', 'Pubsubhubbub subscription called from ' . $_SERVER['REMOTE_ADDR'] . ' at ' . datetime_convert() . "\n" . print_r($_GET,true), FILE_APPEND);
+ }
$subscribe = (($hub_mode === 'subscribe') ? 1 : 0);
@@ -86,8 +89,9 @@ function pubsub_post(&$a) {
$xml = file_get_contents('php://input');
$debugging = get_config('system','debugging');
+ $remote_host = 'Pubsub feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' at ' . datetime_convert() . "\n\n";
if($debugging)
- file_put_contents('pubsub.out',$xml,FILE_APPEND);
+ file_put_contents('pubsub.out', $remote_host . $xml, FILE_APPEND);
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);