From 09f74be14c94c722a63371cacd7e99a2e8bd7733 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 11 Jun 2012 17:24:16 -0700 Subject: variable confusion in poller, don't allow negative page offsets --- include/onepoll.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/onepoll.php') diff --git a/include/onepoll.php b/include/onepoll.php index ba7d5ebaf..02763cf4b 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -94,8 +94,8 @@ function onepoll_run($argv, $argc){ $t = $contact['last-update']; if($contact['subhub']) { - $interval = get_config('system','pushpoll_frequency'); - $contact['priority'] = (($interval !== false) ? intval($interval) : 3); + $poll_interval = get_config('system','pushpoll_frequency'); + $contact['priority'] = (($poll_interval !== false) ? intval($poll_interval) : 3); $hub_update = false; if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day")) -- cgit v1.2.3 From be090cc8513504edcfaf368915e45308711f7e7c Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 14 Jun 2012 16:56:46 -0700 Subject: better handling of dead contacts --- include/onepoll.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/onepoll.php') diff --git a/include/onepoll.php b/include/onepoll.php index 02763cf4b..447881ab7 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -139,15 +139,18 @@ function onepoll_run($argv, $argc){ . '&perm=' . $perm ; $handshake_xml = fetch_url($url); + $html_code = $a->get_curl_code(); logger('onepoll: handshake with url ' . $url . ' returns xml: ' . $handshake_xml, LOGGER_DATA); - if(! $handshake_xml) { + if((! strlen($handshake_xml)) || ($html_code >= 400) || (! $html_code)) { logger("poller: $url appears to be dead - marking for death "); + // dead connection - might be a transient event, or this might // mean the software was uninstalled or the domain expired. // Will keep trying for one month. + mark_for_death($contact); // set the last-update so we don't keep polling -- cgit v1.2.3 From 267681844d81364afce37c86f92b803c3d8e4c48 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 14 Jun 2012 17:27:07 -0700 Subject: poll even if contact hasn't responded recently, so we can update the termination status --- include/onepoll.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include/onepoll.php') diff --git a/include/onepoll.php b/include/onepoll.php index 447881ab7..804a166c8 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -54,9 +54,7 @@ function onepoll_run($argv, $argc){ logger('onepoll: no contact'); return; } - - if(was_recently_delayed($contact_id)) - return; + $d = datetime_convert(); @@ -87,7 +85,7 @@ function onepoll_run($argv, $argc){ } $contact = $contacts[0]; - + logger('onepoll: ' . $contact['id'] . ' ' . $contact['name'], LOGGER_DEBUG); $xml = false; -- cgit v1.2.3 From 2efee75557bafc32b20be1cceac047fdeea3bb71 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 14 Jun 2012 17:38:39 -0700 Subject: also mark for death if there isn't any xml to be found --- include/onepoll.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/onepoll.php') diff --git a/include/onepoll.php b/include/onepoll.php index 804a166c8..22f29deb2 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -162,6 +162,9 @@ function onepoll_run($argv, $argc){ if(! strstr($handshake_xml,' Date: Thu, 14 Jun 2012 17:55:30 -0700 Subject: redundant log entry --- include/onepoll.php | 1 - 1 file changed, 1 deletion(-) (limited to 'include/onepoll.php') diff --git a/include/onepoll.php b/include/onepoll.php index 22f29deb2..700498efc 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -85,7 +85,6 @@ function onepoll_run($argv, $argc){ } $contact = $contacts[0]; - logger('onepoll: ' . $contact['id'] . ' ' . $contact['name'], LOGGER_DEBUG); $xml = false; -- cgit v1.2.3 From 4faf0e609fe03095069c7a4bcdfc3496e4a28627 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 16 Jun 2012 03:35:45 -0700 Subject: rev update --- include/onepoll.php | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include/onepoll.php') diff --git a/include/onepoll.php b/include/onepoll.php index 700498efc..d68f26883 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -36,11 +36,6 @@ function onepoll_run($argv, $argc){ logger('onepoll: start'); - $abandon_days = intval(get_config('system','account_abandon_days')); - if($abandon_days < 1) - $abandon_days = 0; - - $manual_id = 0; $generation = 0; $hub_update = false; @@ -62,11 +57,6 @@ function onepoll_run($argv, $argc){ // and which have a polling address and ignore Diaspora since // we are unable to match those posts with a Diaspora GUID and prevent duplicates. - $abandon_sql = (($abandon_days) - ? sprintf(" AND `user`.`login_date` > UTC_TIMESTAMP() - INTERVAL %d DAY ", intval($abandon_days)) - : '' - ); - $contacts = q("SELECT `contact`.* FROM `contact` WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != '' AND NOT `network` IN ( '%s', '%s' ) -- cgit v1.2.3