On Thu, May 15, 2014, at 01:09 AM, Ted Felix wrote:
> Chris, the ftp bug is in isAvailable() and should affect Sonic
> Visualiser. Here's my fixed version (minus the debug output).
>
> bool
> FileSource::isAvailable()
> {
> waitForStatus();
>
> bool available = m_ok;
>
> // If everything's ok and we have a status code
> if (m_ok && m_lastStatus) {
> // We have success for any 2xx status code.
> available = (m_lastStatus / 100 == 2);
> }
>
> return available;
> }
>
> An alternative would be to make sure successful ftp transfers set
> m_lastStatus to 200. This might be a better solution.
Hi Ted -- thanks for looking into this. It's true, I don't think I ever
tested ftp transfers after the Qt5 update...
I do think the alternative solution might be better, in this case -- I
spent a while looking at that function and thinking "that doesn't look
right, it shouldn't be defaulting to returning m_ok, the default should
be that the file is *not* available unless we've actually discovered
that it is". Having worked through the logic, I now think in practice
this will work because the last status is always set non-zero when
initialising a remote transfer, but I'd prefer if this function made the
dependency clearer.
I can't remember at what point we can first determine that an ftp
transfer is successful -- the http status I think is set to 2xx as soon
as the successful headers come back, before the content transfer
happens, which is what we want here. If you're in a position to test
this with ftp easily and get the status set in the appropriate place,
that'd be great.
Chris
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel