powered by Jive Software

Bug and correction found in org.jivesoftware.openfire.filetransfer.DefaultF

There’'s a bug in org.jivesoftware.openfire.filetransfer.DefaultFileTransferManager.java

In method

public void fireFileTransferIntercept(FileTransferProgress transfer, boolean isReady)


fireFileTransferIntercept(fileTransferMap.get(transfer.getSessionID()), isReady);


the fileTransferMap field saves the map from transfer digest to the FileTransfer object, so here should not use the session id instead of the digest.

I test this code and the return value of this get() method is really null .

I have made a correction of this line to

fireFileTransferIntercept(fileTransferMap.get(((DefaultProxyTransfer)transfer).getTransferDigest()), isReady);

Though it is not so good to make a violent type convertion from FileTransferProgress to DefaultProxyTransfer, but I don’'t want to make too much modifications on the source code such as adding a getTransferDigest() method to the FileTransferProgress interface or something else.

I have also tested the second period of code, and it works correctly, my transfer interceptor can receive the transfer object.

It is not a question.

Thanks for the bug report! I passed this thread along to Alex, who wrote the file transfer code. He should be able to make a reply shortly.