Merge branch 'develop' into monitor_refactoring

This commit is contained in:
Markus Makela
2015-03-11 07:13:01 +02:00
13 changed files with 256 additions and 161 deletions

View File

@ -1338,6 +1338,10 @@ int i;
{
feedback.feedback_connect_timeout = atoi(value);
}
if (strcmp(name, "feedback_frequency") == 0)
{
feedback.feedback_frequency = atoi(value);
}
return 1;
}
@ -1389,6 +1393,7 @@ feedback_defaults()
feedback.feedback_timeout = _NOTIFICATION_OPERATION_TIMEOUT;
feedback.feedback_connect_timeout = _NOTIFICATION_CONNECT_TIMEOUT;
feedback.feedback_url = NULL;
feedback.feedback_frequency = 1800;
feedback.release_info = gateway.release_string;
feedback.sysname = gateway.sysname;
feedback.mac_sha1 = gateway.mac_sha1;
@ -2138,7 +2143,7 @@ config_get_release_string(char* release)
*end = 0;
to = strcpy(distribution, "lsb: ");
memmove(to, found, end - found + 1);
memmove(to, found, end - found + 1 < INT_MAX ? end - found + 1 : INT_MAX);
strncpy(release, to, _RELEASE_STR_LENGTH);
@ -2175,7 +2180,7 @@ config_get_release_string(char* release)
+5 and -8 below cut the file name part out of the
full pathname that corresponds to the mask as above.
*/
new_to = strcpy(distribution, found.gl_pathv[0] + 5);
new_to = strncpy(distribution, found.gl_pathv[0] + 5,_RELEASE_STR_LENGTH - 1);
new_to += 8;
*new_to++ = ':';
*new_to++ = ' ';
@ -2221,14 +2226,14 @@ config_enable_feedback_task(void) {
if (enable_set && url_set && user_info_set) {
/* Add the task to the tasl list */
if (hktask_add("send_feedback", module_feedback_send, cfg, 1800)) {
if (hktask_add("send_feedback", module_feedback_send, cfg, cfg->feedback_frequency)) {
LOGIF(LM, (skygw_log_write_flush(
LOGFILE_MESSAGE,
"Notification service feedback task started: URL=%s, User-Info=%s, Frequency %u seconds",
cfg->feedback_url,
cfg->feedback_user_info,
1800)));
cfg->feedback_frequency)));
}
} else {
if (enable_set) {