aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/delivery.php11
-rw-r--r--include/diaspora.php18
-rw-r--r--include/onepoll.php6
-rw-r--r--include/poller.php4
-rw-r--r--include/queue_fn.php11
5 files changed, 40 insertions, 10 deletions
diff --git a/include/delivery.php b/include/delivery.php
index 28d81226a..5f84a548a 100644
--- a/include/delivery.php
+++ b/include/delivery.php
@@ -347,7 +347,10 @@ function delivery_run($argv, $argc){
}
}
- $deliver_status = dfrn_deliver($owner,$contact,$atom);
+ if(! was_recently_delayed($contact['id']))
+ $deliver_status = dfrn_deliver($owner,$contact,$atom);
+ else
+ $deliver_status = (-1);
logger('notifier: dfrn_delivery returns ' . $deliver_status);
@@ -390,7 +393,11 @@ function delivery_run($argv, $argc){
logger('notifier: slapdelivery: ' . $contact['name']);
foreach($slaps as $slappy) {
if($contact['notify']) {
- $deliver_status = slapper($owner,$contact['notify'],$slappy);
+ if(! was_recently_delayed($contact['id']))
+ $deliver_status = slapper($owner,$contact['notify'],$slappy);
+ else
+ $deliver_status = (-1);
+
if($deliver_status == (-1)) {
// queue message for redelivery
add_to_queue($contact['id'],NETWORK_OSTATUS,$slappy);
diff --git a/include/diaspora.php b/include/diaspora.php
index 5069c1127..2051de5fc 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -2298,14 +2298,20 @@ function diaspora_transmit($owner,$contact,$slap,$public_batch) {
logger('diaspora_transmit: ' . $logid . ' ' . $dest_url);
- if(! intval(get_config('system','diaspora_test')))
- post_url($dest_url . '/', $slap);
+ if(was_recently_delayed($contact['id'])) {
+ $return_code = 0;
+ }
else {
- logger('diaspora_transmit: test_mode');
- return 200;
+ if(! intval(get_config('system','diaspora_test'))) {
+ post_url($dest_url . '/', $slap);
+ $return_code = $a->get_curl_code();
+ }
+ else {
+ logger('diaspora_transmit: test_mode');
+ return 200;
+ }
}
-
- $return_code = $a->get_curl_code();
+
logger('diaspora_transmit: ' . $logid . ' returns: ' . $return_code);
if((! $return_code) || (($return_code == 503) && (stristr($a->get_curl_headers(),'retry-after')))) {
diff --git a/include/onepoll.php b/include/onepoll.php
index 42bce0f68..a64922aa3 100644
--- a/include/onepoll.php
+++ b/include/onepoll.php
@@ -25,6 +25,7 @@ function onepoll_run($argv, $argc){
require_once('include/email.php');
require_once('include/socgraph.php');
require_once('include/pidfile.php');
+ require_once('include/queue_fn.php');
load_config('config');
load_config('system');
@@ -54,6 +55,9 @@ function onepoll_run($argv, $argc){
return;
}
+ if(was_recently_delayed($contact_id))
+ return;
+
$d = datetime_convert();
// Only poll from those with suitable relationships,
@@ -452,7 +456,7 @@ function onepoll_run($argv, $argc){
if($xml) {
logger('poller: received xml : ' . $xml, LOGGER_DATA);
- if(! strstr($xml,'<?xml')) {
+ if((! strstr($xml,'<?xml')) && (! strstr($xml,'<rss'))) {
logger('poller: post_handshake: response from ' . $url . ' did not contain XML.');
$r = q("UPDATE `contact` SET `last-update` = '%s' WHERE `id` = %d LIMIT 1",
dbesc(datetime_convert()),
diff --git a/include/poller.php b/include/poller.php
index f6553c846..6b12445d1 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -126,7 +126,9 @@ function poller_run($argv, $argc){
$force = true;
}
- $interval = ((get_config('system','delivery_interval') === false) ? 3 : intval(get_config('system','delivery_interval')));
+ $interval = intval(get_config('system','poll_interval'));
+ if(! $interval)
+ $interval = ((get_config('system','delivery_interval') === false) ? 3 : intval(get_config('system','delivery_interval')));
$sql_extra = (($manual_id) ? " AND `id` = $manual_id " : "");
diff --git a/include/queue_fn.php b/include/queue_fn.php
index 3c1087f4e..2aca338f5 100644
--- a/include/queue_fn.php
+++ b/include/queue_fn.php
@@ -15,6 +15,17 @@ function remove_queue_item($id) {
);
}
+function was_recently_delayed($cid) {
+
+ $r = q("SELECT `id` FROM `queue` WHERE `cid` = %d
+ and last > UTC_TIMESTAMP() - interval 15 minute limit 1",
+ intval($cid)
+ );
+ if(count($r))
+ return true;
+ return false;
+}
+
function add_to_queue($cid,$network,$msg,$batch = false) {