|
From: Luiz A. D. de L. <lui...@gm...> - 2011-07-18 00:29:02
|
2011/7/17 Chris Frey <cd...@fo...> > On Sun, Jul 17, 2011 at 09:06:15PM -0300, Luiz Angelo Daros de Luca wrote: > > I don't know it the bug tracker at the site is still valid so I'm writing > > about the bug I found to the list. > > I like bug reports to the mailing list, actually. > > > > Correct me if I'm wrong. > > > > File-sync/src/file-sync.c at osync_filesync_initialize: > > > > "OSyncFileEnv *env" is initialized with no problem. It contains only a > list > > of "GList *directories". However, this list is never filled. > > At the end of each sink loop, it should add dir to env->directories. The > > result is that free_env never frees dirs as > > it has no reference for them. > > I'm not sure, but it looks like a leftover from earlier designs. > It seems that the directories are recursed in the get_changes stage, > with a call to osync_filesync_report_dir(). > > osync_filesync_report_dir and the get_changes are sink stuff and receives the sink data, not the plugin data. The env (plugindata) is only referenced in initialize and finalize. However, as the first does not fill it, it is useless for finalize. > > > > File-sync/src/file.c at conv_plain_to_file: > > > > file->path = osync_rand_str(g_random_int_range(1, 100), error); > > > > the g_random_int_range(1, 100) returns a random number between 1 and 100. > > However, the osync_rand_str already does this. Its first argument is "int > > maxlength", which is used in: > > > > length = g_random_int_range(1, maxlength + 1); > > > > Seems to be a double random :-). It should be enough to call: > > > > file->path = osync_rand_str(100, error); > > That's pretty funky. :-) Yes, your assessment looks correct to me. > > I'm not sure why a random length filename is desired here though. > And if it is, I'm not sure why a maxlength of 1 is desirable. > > If this is an attempt to avoid filename clashes, it seems a little weak, > no? > > Thanks for catching these... want to cook up some patches? :-) > I'll try to do it in my next free time hour. > > - Chris > > > > ------------------------------------------------------------------------------ > AppSumo Presents a FREE Video for the SourceForge Community by Eric > Ries, the creator of the Lean Startup Methodology on "Lean Startup > Secrets Revealed." This video shows you how to validate your ideas, > optimize your ideas and identify your business strategy. > http://p.sf.net/sfu/appsumosfdev2dev > _______________________________________________ > Opensync-devel mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensync-devel > --- Luiz Angelo Daros de Luca, Me. lui...@gm... |