Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.1
-
bcd81a9e2d59bb90567fbc8dec85fc51fd5befa0
Description
When uploading something, close() for a socket is called too early when there is still data being transfered. There is an odd 2 second timer in disconnectFromHost() (qabstractsocket.cpp, line 2756) that is started right after last bytes have been written to socket. Once this timer runs out, it will close the socket and current transfer is aborted. This results in an incomplete file on the FTP server.
It can be seen that after disconnectFromHost is called, data is still being transferred and it suddenly ends. If I remove the timer, upload eventually finishes successfully and it is successfully disconnected (did not try if this is still an issue on macOS tough). However, there are probably better methods
To reproduce, modify proxy settings and ftp server address in the attached example. At least CCProxy can be used as a proxy to reproduce this. And pyftpdlib works as a simple server: python -m pyftpdlib -w.
Attachments
For Gerrit Dashboard: QTBUG-63000 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
204744,4 | QAbstractSocket: remove disconnect timer | 5.9 | qt/qtbase | Status: MERGED | +2 | 0 |