mf = rspamd_mmaped_file_is_open (ctx, stcf);
- if (mf == NULL && learn) {
+ if (mf == NULL) {
/* Create file here */
filenameo = ucl_object_find_key (stcf->opts, "filename");
}
}
+ if (learn) {
+ filename = ucl_object_tostring (filenameo);
- filename = ucl_object_tostring (filenameo);
+ sizeo = ucl_object_find_key (stcf->opts, "size");
+ if (sizeo == NULL || ucl_object_type (sizeo) != UCL_INT) {
+ msg_err ("statfile %s has no size defined", stcf->symbol);
+ return NULL;
+ }
- sizeo = ucl_object_find_key (stcf->opts, "size");
- if (sizeo == NULL || ucl_object_type (sizeo) != UCL_INT) {
- msg_err ("statfile %s has no size defined", stcf->symbol);
- return NULL;
+ size = ucl_object_toint (sizeo);
+ rspamd_mmaped_file_create (ctx, filename, size, stcf);
}
- size = ucl_object_toint (sizeo);
- rspamd_mmaped_file_create (ctx, filename, size, stcf);
-
mf = rspamd_mmaped_file_open (ctx, filename, size, stcf);
}