diff options
| author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-01-30 13:32:48 +0000 |
|---|---|---|
| committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-01-30 13:32:48 +0000 |
| commit | 1befd8a039fbf1004abad8f12da0e9b83a71356f (patch) | |
| tree | fee054c5c22fececdda509070496673c003aec7c /src/zabbix_server/trapper | |
| parent | 823e9f3c18b4c024918b1df0e727b1ea8b0560f8 (diff) | |
| download | zabbix-1befd8a039fbf1004abad8f12da0e9b83a71356f.tar.gz zabbix-1befd8a039fbf1004abad8f12da0e9b83a71356f.tar.xz zabbix-1befd8a039fbf1004abad8f12da0e9b83a71356f.zip | |
- [DEV-106] Synchronizing of configuration tables (server side)
[Proxy]
git-svn-id: svn://svn.zabbix.com/trunk@5294 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_server/trapper')
| -rw-r--r-- | src/zabbix_server/trapper/trapper.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/zabbix_server/trapper/trapper.c b/src/zabbix_server/trapper/trapper.c index e8135004..68ce7e3a 100644 --- a/src/zabbix_server/trapper/trapper.c +++ b/src/zabbix_server/trapper/trapper.c @@ -61,25 +61,14 @@ static int process_trap(zbx_sock_t *sock,char *s, int max_len) const char *p; char value[MAX_STRING_LEN]; -/* zbx_rtrim(s, " \r\n\0"); datalen = strlen(s); zabbix_log( LOG_LEVEL_DEBUG, "Trapper got [%s] len %zd", s, datalen); -*/ - if (SUCCEED == zbx_json_open(s, &jp)) { - if (NULL != (p = zbx_json_pair_by_name(&jp, "request")) - && NULL != zbx_json_decodevalue(p, value, sizeof(value))) { - if (0 == strcmp(value, "ZBX_PROXY_CONFIG")) - send_proxyconfig(sock, &jp); - } /* Request for list of active checks */ - } - return ret; - if (strncmp(s,"ZBX_GET_ACTIVE_CHECKS", 21) == 0) { line=strtok(s,"\n"); host=strtok(NULL,"\n"); @@ -143,6 +132,16 @@ static int process_trap(zbx_sock_t *sock,char *s, int max_len) } return ret; } + /* JSON protocol? */ + else if (SUCCEED == zbx_json_open(s, &jp)) + { + if (NULL != (p = zbx_json_pair_by_name(&jp, "request")) + && NULL != zbx_json_decodevalue(p, value, sizeof(value))) { + if (0 == strcmp(value, "ZBX_PROXY_CONFIG")) + send_proxyconfig(sock, &jp); + } + return ret; + } /* New XML protocol? */ else if(s[0]=='<') { |
