diff options
-rw-r--r-- | mod/admin.php | 26 | ||||
-rw-r--r-- | mod/post.php | 3 |
2 files changed, 20 insertions, 9 deletions
diff --git a/mod/admin.php b/mod/admin.php index 950c7e5ce..1a284c42f 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -468,6 +468,7 @@ function admin_page_site(&$a) { } function admin_page_hubloc_post(&$a){ check_form_security_token_redirectOnErr('/admin/hubloc', 'admin_hubloc'); + require_once('include/zot.php'); //prepare for ping @@ -477,18 +478,25 @@ function admin_page_hubloc_post(&$a){ intval($hublocid) ); $hublocurl = $arrhublocurl[0]['hubloc_url'] . '/post'; - logger('hubloc_url : ' . $hublocurl , LOGGER_DEBUG); - } + + //perform ping + $m = zot_build_packet($a->get_channel(),'ping'); + logger('ping message : ' . print_r($m,true), LOGGER_DEBUG); + $r = zot_zot($hubloc_url,$m); + logger('ping answer: ' . print_r($r,true), LOGGER_DEBUG); + + //unfotunatly zping wont work, I guess return format is not correct + //require_once('mod/zping.php'); + //$r = zping_content($hublocurl); + //logger('zping answer: ' . $r, LOGGER_DEBUG); + + //handle results and set the hubloc flags in db to make results visible - //if ( $_POST'' == "check" ) { - // //todo - //} + //in case of repair store new pub key for tested hubloc (all channel with this hubloc) in db + //after repair set hubloc flags to 0 - //perform ping - //handle results and set the hubloc flags in db to make results visible + } - //in case of repair store new pub key for tested hubloc (all channel with this hubloc) in db - //after repair set hubloc flags to 0 goaway($a->get_baseurl(true) . '/admin/hubloc' ); return; diff --git a/mod/post.php b/mod/post.php index 965ba09a3..cce183e46 100644 --- a/mod/post.php +++ b/mod/post.php @@ -9,6 +9,8 @@ require_once('include/zot.php'); function post_init(&$a) { + logger('POST inside',LOGGER_DEBUG); + logger('POST given parameter: ' . print_r($_REQUEST,true), LOGGER_DEBUG); // Most access to this endpoint is via the post method. // Here we will pick out the magic auth params which arrive @@ -490,6 +492,7 @@ function post_post(&$a) { // Useful to get a health check on a remote site. // This will let us know if any important communication details // that we may have stored are no longer valid, regardless of xchan details. + logger('POST: got ping send pong now back: ' . z_root() , LOGGER_DEBUG ); $ret['success'] = true; $ret['site'] = array(); |