summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-05-05 17:11:23 -0700
committerBrion Vibber <brion@pobox.com>2010-05-05 17:11:23 -0700
commit173778eab145cfd73f597cd75db195e4d47fe323 (patch)
tree78034559817d04f7fd6531f270e857b3bd55bf72 /lib
parentddc7811a7b412c9c3c4b6bfb9350dd18a62fdf51 (diff)
parente05415f621890bbaf42752577249ecdc22c161fc (diff)
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 1.0.x
Conflicts: lib/xmppmanager.php (resolved: code has moved to XmppPlugin.php)
Diffstat (limited to 'lib')
-rw-r--r--lib/default.php3
-rw-r--r--lib/mailhandler.php4
-rw-r--r--lib/ping.php10
3 files changed, 15 insertions, 2 deletions
diff --git a/lib/default.php b/lib/default.php
index dec08fc06..449d2b3bb 100644
--- a/lib/default.php
+++ b/lib/default.php
@@ -188,7 +188,8 @@ $default =
'cache' =>
array('base' => null),
'ping' =>
- array('notify' => array()),
+ array('notify' => array(),
+ 'timeout' => 2),
'inboxes' =>
array('enabled' => true), # ignored after 0.9.x
'newuser' =>
diff --git a/lib/mailhandler.php b/lib/mailhandler.php
index 890f6d5b4..e9ba41839 100644
--- a/lib/mailhandler.php
+++ b/lib/mailhandler.php
@@ -265,6 +265,10 @@ class MailHandler
if (preg_match('/^\s*Begin\s+forward/', $line)) {
break;
}
+ // skip everything after a blank line if we already have content
+ if ($output !== '' && $line === '') {
+ break;
+ }
$output .= ' ' . $line;
}
diff --git a/lib/ping.php b/lib/ping.php
index 735af9ef1..be2933ae3 100644
--- a/lib/ping.php
+++ b/lib/ping.php
@@ -45,7 +45,15 @@ function ping_broadcast_notice($notice) {
$tags));
$request = HTTPClient::start();
- $httpResponse = $request->post($notify_url, array('Content-Type: text/xml'), $req);
+ $request->setConfig('connect_timeout', common_config('ping', 'timeout'));
+ $request->setConfig('timeout', common_config('ping', 'timeout'));
+ try {
+ $httpResponse = $request->post($notify_url, array('Content-Type: text/xml'), $req);
+ } catch (Exception $e) {
+ common_log(LOG_ERR,
+ "Exception pinging $notify_url: " . $e->getMessage());
+ continue;
+ }
if (!$httpResponse || mb_strlen($httpResponse->getBody()) == 0) {
common_log(LOG_WARNING,