The difficulty I see is that the underlying socket isn't connected until
we get the reply from the provider and we can set the socket fd.

I don't think it is possible to write to a QIODevice before it enters
the valid state. The doc says:

"Before accessing the device, open() must be called to set the correct
OpenMode (such as ReadOnly or ReadWrite)."

We don't call open(), but call setSocketDescriptor() instead (which is
the moral equivalent of open()).

Unless I'm misreading the doc, any writes to the socket will fail until
after it is connected, so we'd have to buffer up all the data that was
written, as well as queuing the close() call.

It seems it would be rather complex to provide this functionality. It's
also problematic to make it symmetric with downloads. There, I can't
call close() either before the socket is ready (for obvious reasons).

I have a sneaking suspicion that doing this may be a bit too clever? As
is, the rules are simple:

for both download and upload, wait until the socket is ready before you
do anything else with it.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1644669

Title:
  Uploader.close() fails if in Loading state

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/storage-framework/+bug/1644669/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to