Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63000

FTP uploading through proxy is closed too soon resulting in incomplete file

    XMLWordPrintable

Details

    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            poikelin Joni Poikelin
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes