First of all, thanks for this great and very useful module.
We use this module in our DEV enviroment as our Proxy and network prevent drupal_http_request() from working properly. We set the $conf variables un the local settings file and activate this module only on the enviroments that need it (LOCAL, DEV, not PROD).
Instructions in README explain how to set the $conf variable to override drupal_http_request_function.

You can set Drupal to use this function as the default request method by setting the following in your settings.php file

$conf['drupal_http_request_function'] = 'chr_curl_http_request';
The problem i see (and i might be wrong here) is that this setting is not reflected in the UI admin page at "admin/config/services/chr". The settings form in chr.admin.inc is built with:

$form['chr_override_drupal_http_request'] = array(
    '#type' => 'checkbox',
    '#title' => t('Override Drupal HTTP Request'),
    '#description' => t('Set all HTTP requests to use cURL instead. Requires Drupal 7.21 or higher.'),
    '#disabled' => !(VERSION >= 7.21),
    '#default_value' => variable_get('chr_override_drupal_http_request', FALSE),
  );

And then sets the appropiate variables when enabled.

// Check if override is enabled
  if ($values['chr_override_drupal_http_request'] == TRUE) {
    variable_set('chr_original_http_request_function_value', variable_get('drupal_http_request_function', FALSE));
    variable_set('drupal_http_request_function', 'chr_curl_http_request');
  }

The thing is even if you set "$conf['drupal_http_request_function'] = 'chr_curl_http_request';" in your settings.php the variable "chr_override_drupal_http_request" is still FALSE, so the check is not activated in the UI leading to think the override is not activated. With the current code you´d have to set both vars in settings.php for these settings to reflect in the admin UI.

$conf['chr_override_drupal_http_request'] = TRUE;
$conf['drupal_http_request_function'] = 'chr_curl_http_request';

I beleive either the "chr_override_drupal_http_request" form element should check for 'drupal_http_request_function' value being 'chr_curl_http_request' or the README should instruct to set both vars.

Comments

tahiche created an issue.