*/
public function ensureHub($rediscovered=false)
{
+ common_debug('Now inside ensureHub again, $rediscovered=='._ve($rediscovered));
if ($this->sub_state !== 'inactive') {
common_log(LOG_INFO, sprintf(__METHOD__ . ': Running hub discovery a possibly active feed in %s state for URI %s', _ve($this->sub_state), _ve($this->uri)));
}
common_debug('Database update failed for FeedSub id=='._ve($this->id).' with new huburi: '._ve($this->huburi));
throw new ServerException('Database update failed for FeedSub.');
}
- if ($rediscovered) {
+ if (!$rediscovered) {
$this->renew();
}
return $result;
// we avoid running this part over and over and over and over):
common_debug('Running ensureHub again due to 422 status, $rediscovered=='._ve($rediscovered));
- $this->ensureHub(true);
+ $discoveryResult = $this->ensureHub(true);
+ common_debug('ensureHub is now done and its result was: '._ve($discoveryResult));
} else {
common_log(LOG_ERR, __METHOD__ . ": sub req failed with HTTP $status: " . $response->getBody());
}
} catch(NoResultException $e) {
common_log(LOG_INFO, "Discarding POST to unknown feed subscription id {$feedsub_id}");
} catch(Exception $e) {
- common_log(LOG_ERR, "Exception "._ve(get_class($e))." during WebSub push input processing for {$feedsub->getUri()}: " . $e->getMessage());
+ if (is_null($feedsub)) {
+ common_log(LOG_ERR, "Exception "._ve(get_class($e))." during WebSub push input processing where FeedSub->receive returned null!" . _ve($e->getMessage()));
+ } else {
+ common_log(LOG_ERR, "Exception "._ve(get_class($e))." during WebSub push input processing for {$feedsub->getUri()}: " . _ve($e->getMessage()));
+ }
}
return true;
}