Hi Smack Community,
I would like to configure my FileTransferManager to remove the IBB transfer option from the stream negotiation. Is this possible? In our scenario, we only have need for Socks5 BS transfer and the fact that the negotiation is sending back both socks5 and ibb is causing a problem with some clients.
That’s strange. IBB should always be only the fallback for S5B transfers if both are announced. Are you sure that the S5B transfers just don’t work and the fallback kicks in? If it isn’t the fallback, ask the developers of the clients to fix their clients, so that if S5B if possible it’s used, even if IBB is announced.
Smack has currently only the IBB_ONLY boolean in FileTransferNegotiator. But you could easily add an S5B_ONLY flag.
I’m trying to avoid modifying/building the source. I was looking at sub-classing the FileTransferManager and FileTransferNegotiator, so I could extend SMACK in my codebase without having to modify the smackx code.
Based on an initial look, the FileTransferManager declares it’s internal FileTransferNegotiator as “private final”, so I can’t override it in my derived FileTransferManager class. Can you confirm this?
Also, if this is the case, is there another way to externally extend this logic (i.e. another class(es) to implement/override, some callback hook where I can intercept the stanza, etc.)
Thanks again, Flow
You can use a PacketInterceptor to alter the packet before it is sent. No need to extend the code to accomplish what you want. Flow is correct though, Socks is the default for file transfer and IBB is typically the backup case. The spec says that Socks is the preferred mechanism so any client should default to this case.
What client are you using that is defaulting to IBB?
Great, thanks for the recommendation. As for the client, it’s our own custom app, but it’s using the 3rd party gloox c++ library. Apparently, that has a bug in it because it’s using the first one in the list, but it’s much easier for us to intercept it.
On a related note, is it possible to get a hook into the file transfer accept/reject result IQ(s)? We’ve added some additional logic on top of the XMPP stanzas - using the available elements, but need to be able to set the Text node of the result element. The existing smack file transfer API doesn’t appear to support passing in a message on the reject call.