Jump to content

_FTP_ProgressUpload blocks app with bigger files


Synapse
 Share

Recommended Posts

Hello...I wanted to ask if anyone had this problem before using _FTP_ProgressUpload. I have a script that update or download files from a private FTP server and when I try to upload or download files bigger then 10MB i noticed a huge script freeze (I can't move the window, can't cancel the process...almoust nothing until it's finished).

Is there a workaround or a trick to not make it freeze while it's uploading? Or is there another way to get the progress to upload/download files from FTP.

PS. I tryed using curl and read the STDOUT but I can't get a continuous stream of info from stdout to process the progress..

This is the function I call to show the progress...If i leave the call progress function empty it's still the same

Func _UpdateProgress($percent)
      GUICtrlSetData($Progress, $percent)
      GUICtrlSetData($ProgressLabel, $percent &" %")
      Switch GUIGetMsg()
        Case $ButtonCancel
           Return 0 ; Just Cancel
      EndSwitch
      Return 1 ; Otherwise contine Upload
Endfunc
Link to comment
Share on other sites

Might be interesting to look at the part size and # of parts that the UDF is breaking the transfer into... If you open FTPEx.au3 and add this line for debugging:

MsgBox(0,"PartSize/Parts",$x&"/"&$parts)
on line 1219, then try calling the function...what does it say?

The MsgBox returned: 323917/101
Link to comment
Share on other sites

That's a decent sized chunk... There are similar issues reported with larger files for FTP:

http://www.autoitscript.com/forum/index.php?showtopic=113542

http://www.autoitscript.com/forum/index.php?showtopic=111480

In the 2nd post, jchd posts a modified function that uses smaller chunk sizes, which may be part of the problem depending on the environment...

My only other advice would be trying to debug a little bit where the 'freeze' is happening. Using msgbox or console writes for example. If the latency is coming from the DLLCall()s, there isn't much we can do about it... Decreasing the chunk size or maybe looking a a co-processes or multi-thread like UDF to make the calls non-blocking to your GUI.

Link to comment
Share on other sites

Assuming it is the DLLCall for InternetWriteFile that blocks'(although that remains to be proven I'm highly suspicious), there is an interesting discussion here: http://www.mombu.com/microsoft/win32-programmer-networks/t-internetwritefile-performance-question-265835.html where they seem to recommend keeping the chunk sizes below or near the 64k mark. Which for the context of this UDF, would start to manifest itself in files > than about 6MB.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...