Anyone noticing stalled uploading? find a solution?
Dave Cragg
dave.cragg at lacscentre.co.uk
Sat Nov 10 04:39:20 EST 2007
On 10 Nov 2007, at 02:03, Josh Mellicker wrote:
>> Are you monitoring the error status with libURLSetStatusCallback.
>> This won't properly indicate a timeout.
>> (This came up on the list recently.)
>
> Ah, I do remember that! But does this mean you can't drive a
> progress bar? libURLSetStatusCallback sends a "bytes uploaded"
> number...
You can still use libURLSetStatusCallback to set a progress bar. But
to fully monitor errors, it's best to use "the result" for blocking
calls and the callback message for non-blocking calls. If you
discover a timeout there, you can dismiss or reset the progress bar.
>>
>> Depending on how you do this, there may be a problem. You should
>> avoid using "wait" while any libUrl stuff is going on.
>
>
> Even wait with messages?
Yes, unfortunately. The problem is that these waits have to be
"released" in the reverse order in which they were started. So if you
add a "wait ... with messages" after libUrl has injected its own,
yours has to be released first. But if the condition for ending your
wait is dependent of libUrl returning, you could be in trouble.
For example, the following mouseUp will complete in 5 seconds, not 50
milliseconds.
global flag1, flag2
on mouseUp
put 0 into flag1
send handler1 to me in 50 milliseconds
send handler2 to me in 5000 milliseconds
wait until flag1 = 1 with messages
answer "completed"
end mouseUp
on handler1
put 1 into flag1
put 0 into flag2
wait until flag2 = 1 with messages
end handler1
on handler2
put 1 into flag2
end handler2
Dave
More information about the use-livecode
mailing list