diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-07-31 10:28:45 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-07-31 10:28:45 +0000 |
| commit | bc60456f87ecdf3aa650d0a989e1d5e657a94eb9 (patch) | |
| tree | f107bc56b70c7ff62221aefc9bec6cca7caa74ea /src | |
| parent | e8c797686a09548e906b723199deec22f112af1f (diff) | |
- added timeout handler for http monitoring (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@4490 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src')
| -rw-r--r-- | src/zabbix_server/httppoller/httptest.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/zabbix_server/httppoller/httptest.c b/src/zabbix_server/httppoller/httptest.c index eab2adfa..72f88963 100644 --- a/src/zabbix_server/httppoller/httptest.c +++ b/src/zabbix_server/httppoller/httptest.c @@ -325,6 +325,9 @@ static void process_httptest(DB_HTTPTEST *httptest) now=time(NULL); while((row=DBfetch(result)) && !err_str) { + /* NOTE: do not use break or return for this block! + * process_step_data calling required! + */ ZBX_STR2UINT64(httpstep.httpstepid, row[0]); ZBX_STR2UINT64(httpstep.httptestid, row[1]); httpstep.no=atoi(row[2]); @@ -369,12 +372,26 @@ static void process_httptest(DB_HTTPTEST *httptest) lastfailedstep = httpstep.no; } } -/* if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_TIMEOUT, httpstep.timeout))) + if( !err_str ) { - zabbix_log(LOG_LEVEL_ERR, "Cannot set URL [%s]", curl_easy_strerror(err)); - ret = FAIL; - break; - }*/ + if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_TIMEOUT, httpstep.timeout))) + { + zabbix_log(LOG_LEVEL_ERR, "Cannot set TIMEOUT [%s]", + curl_easy_strerror(err)); + err_str = strdup(curl_easy_strerror(err)); + lastfailedstep = httpstep.no; + } + } + if( !err_str ) + { + if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_CONNECTTIMEOUT, httpstep.timeout))) + { + zabbix_log(LOG_LEVEL_ERR, "Cannot set CONNECTTIMEOUT [%s]", + curl_easy_strerror(err)); + err_str = strdup(curl_easy_strerror(err)); + lastfailedstep = httpstep.no; + } + } if( !err_str ) { |
