if (data->cur_data == NULL) {
jb = g_malloc0 (sizeof (*jb));
jb->cfg = pd->cfg;
- jb->buf = pd->buf;
data->cur_data = jb;
}
else {
if (jb->buf == NULL) {
/* Allocate memory for buffer */
- jb->buf = g_string_sized_new (BUFSIZ);
+ jb->buf = g_string_sized_new (MAX (len, BUFSIZ));
}
g_string_append_len (jb->buf, chunk, len);
if (data->prev_data) {
jb = data->prev_data;
/* Clean prev data */
+ if (jb->buf) {
+ g_string_free (jb->buf, TRUE);
+ }
+
g_free (jb);
}
msg_err ("no data read");
return;
}
+
if (jb->buf == NULL) {
msg_err ("no data read");
return;
return add
end
-if redis_params then
- rspamd_plugins["dynamic_conf"] = {
- add_symbol = add_dynamic_symbol,
- add_action = add_dynamic_action,
- }
- lua_util.disable_module(N, "redis")
-end
+if section then
+ if redis_params then
+ rspamd_plugins["dynamic_conf"] = {
+ add_symbol = add_dynamic_symbol,
+ add_action = add_dynamic_action,
+ }
+ else
+ lua_util.disable_module(N, "redis")
+ end
+else
+ lua_util.disable_module(N, "config")
+end
\ No newline at end of file