#endif
static int xlat_inst[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; /* up to 8 for regex */
-
/**
* @brief Convert the value on a VALUE_PAIR to string
*/
}
#endif /* HAVE_REGEX_H */
-
/**
* @brief Dynamically change the debugging level for the current request
*
UNUSED RADIUS_ESCAPE_STRING func)
{
int level = 0;
+
+ /*
+ * Expand to previous (or current) level
+ */
+ snprintf(out, outlen, "%d", request->options & RAD_REQUEST_OPTION_DEBUG4);
- if (*fmt) level = atoi(fmt);
-
+ /*
+ * Assume we just want to get the current value and NOT set it to 0
+ */
+ if (!*fmt)
+ goto done;
+
+ level = atoi(fmt);
if (level == 0) {
request->options = RAD_REQUEST_OPTION_NONE;
request->radlog = NULL;
request->options = level;
request->radlog = radlog_request;
}
-
- snprintf(out, outlen, "%d", level);
+
+ done:
return strlen(out);
}