nplexity / xmpp-file-transfer-demo

iOS demo application using XMPPFramework for file transfer.
43 stars 24 forks source link

Weird bug. If user have received a file he can't send a file in reply. #20

Open Studiosus opened 9 years ago

Studiosus commented 9 years ago

when user1 sends a file to user2 the transfer succeeds if after that user2 sends a file to user1 the transfer fails with "Timeout waiting for recipient disco#info response" error. tested with two servers (xmpp.jp and is-a-furry.org)

logs: https://www.dropbox.com/sh/yvl0unuft31rntk/AAABytNyobwULb1peqn0ysbBa?dl=0

judges commented 9 years ago

I have the same problem.

Studiosus commented 9 years ago

Hi! In the XMPPIncomingFileTransfer try to add the following if condition in xmppStream:didReceiveIQ: method

if ([iq.type isEqualToString:@"get"]) {
    _transferState = XMPPIFTStateWaitingForSIOffer;
}

instead of _transferState = XMPPIFTStateWaitingForSIOffer;

zinnuree commented 9 years ago

Hi everyone, Also take this line within the if block -

[self sendIdentity:iq];

like-

if ([iq.type isEqualToString:@"get"]) { [self sendIdentity:iq]; _transferState = XMPPIFTStateWaitingForSIOffer; }

in place of -

[self sendIdentity:iq]; _transferState = XMPPIFTStateWaitingForSIOffer;

Otherwise the sender will keep sending identity forever.