Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-2227

Curl Max Redirects Option

XMLWordPrintable

    • Icon: Change Request Change Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.8.21, 2.2.2
    • Proxy (P), Server (S)
    • All platforms that have libcurl enabled.

      When executing a webcheck against a server, if the server gives out a "slow" 302 , the Curl will keep following it eternally, without getting out of the loop. When this happens, we verified that one proxy (version 2.0.4) got stuck on that check and never resumed other checked. Resulting that, all the webchecks had no data and stuck, until the problem of 302 redirection loop was resolved, in two production occasions we have seen the loop go on for multiple hours, and all other webchecks were "stopped" and no more data was being collected.

      After a bit of scrutiny, enabling some more debug from libcurl using CURLOPT_VERBOSE, we detected the error and thereafter we eneabled CURLOPT_MAXREDIRS setting to 5, which actually fixed the problem for good.

      ( http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTMAXREDIRS )

      So we suggest that an option for Server and Proxy conf file could be added to control the max amount of redirections that curl must follow, in order to give him an option to detect a 302 loop (like a browser is able to).

      We fix the problem adding:

      CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_MAXREDIRS, 5L)) ||

      at line 332 from httptest.c, from version 2.0.4 – I also checkd the latest 2.2.2 version, and the option is not in place, then I decided to drop this request.

            Unassigned Unassigned
            spectroman jchegedus
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: