]> git.mxchange.org Git - friendica.git/blobdiff - include/onepoll.php
redundant log entry
[friendica.git] / include / onepoll.php
index a64922aa323e808576df96416335eaec910622ca..700498efc8b17f480e27d443b58c351a2f900ace 100644 (file)
@@ -54,9 +54,7 @@ function onepoll_run($argv, $argc){
                logger('onepoll: no contact');
                return;
        }
-
-       if(was_recently_delayed($contact_id))
-               return;
+       
 
        $d = datetime_convert();
 
@@ -88,14 +86,13 @@ function onepoll_run($argv, $argc){
 
        $contact = $contacts[0];
 
-
        $xml = false;
 
        $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"))
@@ -139,15 +136,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
@@ -161,6 +161,9 @@ function onepoll_run($argv, $argc){
 
                if(! strstr($handshake_xml,'<?xml')) {
                        logger('poller: response from ' . $url . ' did not contain XML.');
+
+                       mark_for_death($contact);
+
                        $r = q("UPDATE `contact` SET `last-update` = '%s' WHERE `id` = %d LIMIT 1",
                                dbesc(datetime_convert()),
                                intval($contact['id'])
@@ -477,6 +480,9 @@ function onepoll_run($argv, $argc){
                if($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly'])
                        $hubmode = 'unsubscribe';
 
+               if($contact['network'] === NETWORK_OSTATUS && (! $contact['hub-verify']))
+                       $hub_update = true;
+
                if((strlen($hub)) && ($hub_update) && ($contact['rel'] != CONTACT_IS_FOLLOWER)) {
                        logger('poller: hub ' . $hubmode . ' : ' . $hub . ' contact name : ' . $contact['name'] . ' local user : ' . $importer['name']);
                        $hubs = explode(',', $hub);