powered by Jive Software

Smack 3.2.1 - Openfire 3.7.1 File transfer problem

Hello,

I have problem with file transfers after I upgraded from Smack 3.1.0 to 3.2.1 and openfire 3.6.4 to 3.7.1.

Since the update file transfer never ends, transfer status is blocked in state “in progress” and transfer progress in state “0.0”.

The sender code :

FileTransferManagermanager = newFileTransferManager(xmppConnection);
OutgoingFileTransfertransfer = manager.createOutgoingFileTransfer(userJId); // added with smack 3.2.1 (begin)
FileTransferNegotiator.setServiceEnabled(xmppConnection,true);
InBandBytestreamManageribm=InBandBytestreamManager.getByteStreamManager( xmppConnection);
FileTransferNegotiator.IBB_ONLY= true;
// added with smack 3.2.1 (end) transfer.sendFile(tempFile,"...");
while(!transfer.isDone()){
      if(transfer.getStatus().equals(Status.error)){
           System.out.println("Send Error" + transfer.getError());
      }else{
           System.out.println("Send Status" + transfer.getStatus());
           System.out.println("Send Progress" + transfer.getProgress());
      }
      Thread.sleep(1000);
}

The receiver code :

finalFileTransferManager manager = newFileTransferManager(connection); // added with smack 3.2.1 (begin)
FileTransferNegotiator.setServiceEnabled(connection,true);
InBandBytestreamManageribm =InBandBytestreamManager.getByteStreamManager(connection);
FileTransferNegotiator.IBB_ONLY= true; // added with smack 3.2.1 (end) //Create the listener
manager.addFileTransferListener(newFileTransferListener() {
      public voidfileTransferRequest(FileTransferRequest request) {
           if(shouldAccept(request)) {
                //Accept it
                IncomingFileTransfertransfer = request.accept();
                Filefile = null;
                try{
                     Filefile = newFile(fileName);
                     transfer.recieveFile(file);
                     while(!transfer.isDone()) {
                     try{
                          if(transfer.getStatus().equals(Status.error)){
                               System.out.println("ERROR"+transfer.getError());
                          }else{
                               System.out.println("STATUS"+transfer.getStatus());
                               System.out.println("PROGRESS"+transfer.getProgress());
                          }
                          Thread.sleep(1000);
                     }
                    ...

In logs:

STATUS In Progress
PROGRESS 0.0
STATUS In Progress
PROGRESS 0.0
STATUS In Progress
PROGRESS 0.0
STATUS In Progress
PROGRESS 0.0
STATUS In Progress
PROGRESS 0.0
...

Code works with openfire 3.6.4 and smack 3.1.0.

I have no error message, does anybody know how to fix this problem?

Thanks in advance