From 11a9937e6af18fb570c5e38a97f0ccdbe39e4be2 Mon Sep 17 00:00:00 2001 From: Olivier van Helden Date: Wed, 8 Jan 2025 11:14:59 -0400 Subject: [PATCH] deprecated forwarding register to SEARCH_REGISTRARS --- includes/config.example.php | 4 ++-- register.php | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/includes/config.example.php b/includes/config.example.php index 17b242c..9e1d760 100644 --- a/includes/config.example.php +++ b/includes/config.example.php @@ -59,9 +59,9 @@ define( 'SEARCH_DB_USER', OPENSIM_DB_USER ); define( 'SEARCH_DB_PASS', OPENSIM_DB_PASS ); /** - * Other registrars to forward hosts registrations. + * Other registrars to forward hosts registrations (deprecated) * - * This method is not needed as with current OpenSim server (0.9.x) which allow + * This method is not needed since OpenSim server (0.9.x) which allow * specifying multiple registrars, but could be used in the future to implement * peer to peer information sharing. * diff --git a/register.php b/register.php index 014801f..32637f7 100644 --- a/register.php +++ b/register.php @@ -78,10 +78,19 @@ switch ( $service ) { break; } -if ( is_array( SEARCH_REGISTRARS ) & ! empty( $hostname ) & ! empty( $port ) & ! empty( $service ) ) { - $querystring = getenv( 'QUERY_STRING' ); - foreach ( SEARCH_REGISTRARS as $registrar ) { - $result = file_get_contents( "$registrar?$querystring" ); - } -} +/** + * Deprecated since 0.9.0. Multiple registrars can be set directly from OpenSim config. + * This would create duplicate registration requests, and worst, an infinite loop + * if this service url is included in the array. + * + * Could be re-enabled with a specific option like FORWARD_TO_REGISTRARS, but only + * with a strict test to ensure we don't call ourselves again and no registrar is + * called both from robust and this script. + */ +// if ( is_array( SEARCH_REGISTRARS ) & ! empty( $hostname ) & ! empty( $port ) & ! empty( $service ) ) { +// $querystring = getenv( 'QUERY_STRING' ); +// foreach ( SEARCH_REGISTRARS as $registrar ) { +// $result = file_get_contents( "$registrar?$querystring" ); +// } +// } die;