Changeset a33aa52dc08eb296a042f396243bde78cf840b99 for src
- Timestamp:
- 09/14/11 15:59:49 (2 years ago)
- git-parent:
- Files:
-
- src/noit_check.h (modified) (1 diff)
- src/noit_check_rest.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/noit_check.h
r1f3d77e ra33aa52 76 76 #define NP_TRY_OTHER_RESOLVE 0x00008000 77 77 78 #define NP_PREFER_IPV4 "prefer-ipv4" 79 #define NP_PREFER_IPV6 "prefer-ipv6" 80 #define NP_FORCE_IPV4 "force-ipv4" 81 #define NP_FORCE_IPV6 "force-ipv6" 82 78 83 #define NP_UNKNOWN '0' /* stats_t.{available,state} */ 79 84 #define NP_AVAILABLE 'A' /* stats_t.available */ src/noit_check_rest.c
r09ecd28 ra33aa52 197 197 SHOW_ATTR(attr,node,module); 198 198 SHOW_ATTR(attr,node,target); 199 SHOW_ATTR(attr,node,resolve_rtype); 199 200 SHOW_ATTR(attr,node,period); 200 201 SHOW_ATTR(attr,node,timeout); … … 246 247 const char **error) { 247 248 xmlNodePtr root, tl, an; 248 int name=0, module=0, target=0, period=0, timeout=0, filterset=0;249 int name=0, module=0, target=0, resolve_rtype=0, period=0, timeout=0, filterset=0; 249 250 *a = *c = NULL; 250 251 root = xmlDocGetRootElement(doc); … … 283 284 } 284 285 target = 1; 286 } 287 else CHECK_N_SET(resolve_rtype) { 288 xmlChar *tmp; 289 noit_boolean invalid; 290 tmp = xmlNodeGetContent(an); 291 invalid = strcmp((char *)tmp, NP_PREFER_IPV4) && strcmp((char *)tmp, NP_PREFER_IPV6) && strcmp((char *)tmp, NP_FORCE_IPV4) && strcmp((char *)tmp, NP_FORCE_IPV6); 292 xmlFree(tmp); 293 if(invalid) { 294 *error = "invalid reslove_rtype"; 295 return 0; 296 } 297 resolve_rtype = 1; 285 298 } 286 299 else CHECK_N_SET(period) { … … 356 369 ATTR2PROP(name); 357 370 ATTR2PROP(target); 371 ATTR2PROP(resolve_rtype); 358 372 ATTR2PROP(module); 359 373 ATTR2PROP(period);
