You are here

function httprl_install_fclose_delay_check in HTTP Parallel Request & Threading Library 7

Same name and namespace in other branches
  1. 6 httprl.install \httprl_install_fclose_delay_check()
1 call to httprl_install_fclose_delay_check()
httprl_install_try_different_settings_checker in ./httprl.install

File

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

Code

function httprl_install_fclose_delay_check($mode, $blocking, $depth) {
  $t = get_t();
  $msg = '';
  if (httprl_variable_get('httprl_non_blocking_fclose_delay', HTTPRL_NON_BLOCKING_FCLOSE_DELAY) != 0 || $blocking != FALSE) {
    return;
  }

  // Try again with a fclose_delay of 25ms.
  $GLOBALS['conf']['httprl_non_blocking_fclose_delay'] = 25;
  list($success, $msg) = httprl_install_http_test($mode, $blocking, $depth);
  if ($success) {

    // Try again with a fclose_delay of 5ms.
    $GLOBALS['conf']['httprl_non_blocking_fclose_delay'] = 5;
    list($success, $msg) = httprl_install_http_test($mode, $blocking, $depth);
    if ($success) {
      $msg = $t('The Millisecond Delay For Non-Blocking Requests setting needs to be changed to 5 on the <a href="@url">configuration page</a>,', array(
        '@url' => url('admin/config/development/httprl'),
      ));
    }
    else {
      $msg = $t('The Millisecond Delay For Non-Blocking Requests setting needs to be changed to 25 on the <a href="@url">configuration page</a>,', array(
        '@url' => url('admin/config/development/httprl'),
      ));
    }
  }
  $GLOBALS['conf']['httprl_non_blocking_fclose_delay'] = 0;
  return array(
    $success,
    $msg,
  );
}