[fpc-devel] Strange behaviour with Synapse

Ludo Brands ludo.brands at free.fr
Sat Mar 16 19:55:50 CET 2013


On 03/16/2013 07:29 PM, Geoffray Levasseur-Brandin wrote:

> Hum maybe you have Synapse installed in your Lazarus as I'm briging
> it with the application (and it's appearing in project manage).

Synapse is not in my default path. So that is not the problem. It
complained about a duplicate resource in one of the qt dirs. Haven't
investigated any further.

> You're right this could have been a problem if download parameters
> are different, thank you. Unfortunately, even if this is now
> corrected, the original problem is not solved. Anyway the changes
> are commited.
Well it can always cause a problem because FHttp.Clear clears the
Header and Document. If that happens while you are executing the HEAD,
strange results can happen.

> 
> This is somewhat complex, I know it, but this have been created
> keeping in mind that I would like to allow parallelization of
> downloads in the future, as you was supposing it. But I'm agree and
> if someone have an idea on how simplifying it and almost in a more
> secure way, allowing parallelization in future I would very
> appreciate it.

Instead of re-using TDownloader.FHttp: THTTPSend  for all threads,
create a THTTPSend per TDownloadDaemon. You have to use multiple
THTTPSend instances in any case if you want to do parallel downloads.
Actually, get rid of TDownloader and do everything in TDownloadDaemon.
Even the HEAD.

> 
> I've made some more test: the bug appaer only if either the
> application or Lazarus (if started from Lazarus) is focussed...
> 

That is probably linked to the GUI code that takes more time painting
when focused. So again indication that you still have some race
conditions.

Ludo




More information about the fpc-devel mailing list