You are here

function httprl_install_try_different_settings_checker in HTTP Parallel Request & Threading Library 6

Same name and namespace in other branches
  1. 7 httprl.install \httprl_install_try_different_settings_checker()
1 call to httprl_install_try_different_settings_checker()
httprl_install_http_test in ./httprl.install
Issue a HTTP request to admin/httprl-test, verifying that the server got it.

File

./httprl.install, line 360
Handle HTTP Parallel Request Library installation and upgrade tasks.

Code

function httprl_install_try_different_settings_checker($mode, $blocking, $depth) {
  $t = get_t();
  list($success, $msg) = httprl_install_fclose_delay_check($mode, $blocking, $depth);
  if ($success) {
    return array(
      $success,
      $msg,
    );
  }
  $msg = '';
  $ip = httprl_variable_get('httprl_server_addr', FALSE);

  // Try with it empty.
  $GLOBALS['conf']['httprl_server_addr'] = FALSE;
  httprl_build_url_self('', FALSE, TRUE);
  list($success, $msg) = httprl_install_http_test($mode, $blocking, $depth);
  if ($success) {
    $msg = $t('The "IP Address to send all self server requests to" setting needs to be empty on the <a href="@url">configuration page</a>,', array(
      '@url' => url('admin/config/development/httprl'),
    ));
  }
  else {
    list($success, $msg) = httprl_install_fclose_delay_check($mode, $blocking, $depth);
    if ($success) {
      $msg .= ' ' . $t('The "IP Address to send all self server requests to" setting needs to be empty on the <a href="@url">configuration page</a>,', array(
        '@url' => url('admin/config/development/httprl'),
      ));
    }

    // Try again with -1.
    $GLOBALS['conf']['httprl_server_addr'] = -1;
    httprl_build_url_self('', FALSE, TRUE);
    list($success, $msg) = httprl_install_http_test($mode, $blocking, $depth);
    if ($success) {
      $msg = $t('The "IP Address to send all self server requests to" setting needs to be changed to -1 on the <a href="@url">configuration page</a>,', array(
        '@url' => url('admin/config/development/httprl'),
      ));
    }
    else {
      list($success, $msg) = httprl_install_fclose_delay_check($mode, $blocking, $depth);
      if ($success) {
        $msg .= ' ' . $t('The "IP Address to send all self server requests to" setting needs to be changed to -1 on the <a href="@url">configuration page</a>,', array(
          '@url' => url('admin/config/development/httprl'),
        ));
      }
    }
  }
  $GLOBALS['conf']['httprl_server_addr'] = $ip;
  httprl_build_url_self('', FALSE, TRUE);
  return array(
    $success,
    $msg,
  );
}