https://bugs.kde.org/show_bug.cgi?id=387447

            Bug ID: 387447
           Summary: KDE Connect file transfers do not finish for small
                    files
           Product: kdeconnect
           Version: 1.2
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: common
          Assignee: albertv...@gmail.com
          Reporter: matthijstij...@gmail.com
  Target Milestone: ---

On current kdeconnect (1.2 from Arch linux package / master compiled) I cannot
transfer small files (< 1200 bytes, although there is no exact limit) from my
phone to the desktop. It seems to be related to the payload transfer code,
since this also happens when notifications with small icons are transferred
(but this is harder to reproduce).

I bisected the issue to d1d84bc464c5f85268a9a1229c8a46ef20367cff (Fix
DownloadJob not finishing).

To reproduce:
 - In the KDE Connect android app, select a small file to transfer (in my
example, 28 bytes).
 - On android, the notification about the transferred file appears, saying it
was transferred successfully. The logcat also says that all 28 bytes were
transferred successfully.
 - On the desktop, the below log appears (and no further entries) and the
transferring file notification appears and does not stop spinning. A
"small_file.txt.part" file appears, with size 0 bytes.
 - Killing either the android app or desktop daemon stops the transfer and
deletes the .part file, without creating the final file.

The log created by /usr/lib/kdeconnected:

kdeconnect.core: KdeConnect daemon starting
kdeconnect.core: onStart
kdeconnect.core: KdeConnect daemon started
kdeconnect.core: Broadcasting identity packet
kdeconnect.core: Starting client ssl (but I'm the server TCP socket)
kdeconnect.core: Socket succesfully stablished an SSL connection
kdeconnect.core: It is a known device "G4"
kdeconnect.core: Not loading plugin "kdeconnect_remotecommands" because device
doesn't support it
Connecting to deprecated signal
QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
kdeconnect.plugin.mpris: MPRIS service "org.mpris.MediaPlayer2.mplayer" just
came online
kdeconnect.plugin.mpris: Mpris addPlayer "org.mpris.MediaPlayer2.mplayer" ->
"Mplayer"
kdeconnect.plugin.sftp: add to dolphin
kdeconnect.plugin.sftp: Created device: "G4"
kdeconnect.plugin.share: File transfer
kdeconnect.core: FileTransferJob Downloading payload to
QUrl("file:///home/matthijs/small_file.txt") size: 28

When debugging myself, I discovered several things which may be of use:
 - When adding a Thread.sleep(500) in the android payload transfer code
(LanLink::sendPackageInternal), directly after outputStream.flush(), the
transfer is successfull. The same Thread.sleep(500) works when put after
outputStream.flush(), outputStream.close() or after
SslHelper.convertToSslSocket() when combined with
payloadSocket.sendHandshake().
 - When trying to read all bytes directly (by using m_origin->readAll() and
m_origin->waitForReadyRead() in FileTransferJob::startTransfer() directly
before the QNAM::put() call), only the first byte is reported back.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to