A file transfer problem!

I built a LAN IM platform using Openfire 3.7.0 and Spark 2.6.0 RC2. It works great but with a file transfer problem. It can’t transfer files between two Spark clients. I’m confused. So I start Spark again using debug mode to test the file transferring. Finally, I find that the file transfer error occured because of the incorrect IP bound by Openfire and Spark. Here is the test result.

First,

here is the hierarchy of my IM platform.

Server: domain name (tellu.ncrl.3322.org), LAN IP (172.17.14.69), VPN for Internet access IP (12.1.3.57)

Client1: user name (test1@tellu.ncrl.3322.org), LAN IP (172.18.8.54), VPN for Internet access IP (58.192.124.132)

Client2: user name (test2@tellu.ncrl.3322.org), LAN IP (172.17.14.78), No Internet access

Second,

now I want to transfer a file Test.pdf from Client1 to Client2. When I transmit the file, I get the debug message in Client1 listed below:


Packets 1

Message: IQ Sent (class=org.jivesoftware.smackx.packet.StreamInitiation)

Id: HI323-72

Type: set

To: test2@tellu.ncrl.3322.org/spark

From: (blank)

<file xmlns="[http://jabber.org/protocol/si/profile/file-transfer](http://jabber.org/protocol/si/profile/file-transfer)" name="Test.pdf" size="496221">

Sending file

<feature xmlns="[http://jabber.org/protocol/feature-neg](http://jabber.org/protocol/feature-neg)">
        <value>[http://jabber.org/protocol/bytestreams](http://jabber.org/protocol/bytestreams)</value>
        <value>[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)</value>

Packet 2

Message: IQ Received (class=org.jivesoftware.smackx.packet.StreamInitiation)

Id: HI323-72

Type: result

To: (blank)

From: test2@tellu.ncrl.3322.org/spark

<feature xmlns="[http://jabber.org/protocol/feature-neg](http://jabber.org/protocol/feature-neg)">
      <value>[http://jabber.org/protocol/bytestreams](http://jabber.org/protocol/bytestreams)</value>

Packet 3

Message: IQ Sent (class=org.jivesoftware.smackx.packet.DiscoverInfo)

Id: HI323-73

Type: get

To: test2@tellu.ncrl.3322.org/spark

From: (blank)


Packet 4

Message: IQ Received (class=org.jivesoftware.smackx.packet.DiscoverInfo)

Id: HI323-73

Type: result

To: (blank)

From: test2@tellu.ncrl.3322.org/spark

<feature var="[http://jabber.org/protocol/xhtml-im](http://jabber.org/protocol/xhtml-im)"/>

<feature var="[http://jabber.org/protocol/muc](http://jabber.org/protocol/muc)"/>

<feature var="[http://jabber.org/protocol/bytestreams](http://jabber.org/protocol/bytestreams)"/>

<feature var="[http://jabber.org/protocol/commands](http://jabber.org/protocol/commands)"/>

<feature var="[http://jabber.org/protocol/si/profile/file-transfer](http://jabber.org/protocol/si/profile/file-transfer)"/>

<feature var="[http://jabber.org/protocol/si](http://jabber.org/protocol/si)"/>

<feature var="[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)"/>

<feature var="[http://www.xmpp.org/extensions/xep-0166.html#ns](http://www.xmpp.org/extensions/xep-0166.html#ns)"/>

Packet 5

Message: IQ Sent (class=org.jivesoftware.smackx.packet.DiscoverItems)

Id: HI323-74

Type: get

To: test2@tellu.ncrl.3322.org/spark

From: (blank)


Packet 6

**
**

Message: IQ Received(class=org.jivesoftware.smackx.packet.DiscoverItems)

Id: HI323-74

Type: result

To: (blank)

From: test2@tellu.ncrl.3322.org/spark


Packet 7

Message: IQ Sent (class=org.jivesoftware.smackx.packet.DiscoverInfo)

Id: HI323-75

Type: get

To: proxy.tellu.ncrl.3322.org

From: (blank)


Packet 8

Message: IQ Received (class=org.jivesoftware.smackx.packet.DiscoverInfo)

Id: HI323-75

Type: result

To: (blank)

From: proxy.tellu.ncrl.3322.org

<feature var="[http://jabber.org/protocol/bytestreams](http://jabber.org/protocol/bytestreams)"/>

<feature var="[http://jabber.org/protocol/disco#info](http://jabber.org/protocol/disco#info)"/>

Packet 9

Message: IQ Sent (class=org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream)

Id: HI323-76

Type: get

To: proxy.tellu.ncrl.3322.org

From: (blank)


Packet 10

Message: IQ Received (class=org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream)

Id: HI323-76

Type: result

To: (blank)

From: proxy.tellu.ncrl.3322.org


Packet 11

Message: IQ Sent (class=org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream)

Id: HI323-77

Type: set

To: test2@tellu.ncrl.3322.org/spark

From: (blank)

<streamhost jid="test1@tellu.ncrl.3322.org/spark" host="58.192.124.132" port="7777"/>

Packet 12

Message: IQ Received (class=org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream)

Id: HI323-77

Type: error

To: (blank)

From: test2@tellu.ncrl.3322.org/spark

Could not establish socket with any provided host


In the above results, I find that the IP address (with red color above) the Client1 listening should be 172.18.8.54, not 58.192.124.132. And the IP address (with blue color) the Openfire Server listening should be 172.17.14.69, not 12.1.3.57. I think this is the cause of my file transfer problem.

Anyone know how to tell spark and openfire which IP address should be listening at? Is this a bug?

PS:

  1. If I disconnect the VPN connection in Client1, that means it has only one IP address 172.18.8.54 in Client1, the file transfer problem does not occured, and the transferring speed is high (about 10M/s in LAN).

  2. English is not my mother tongue, so I do not know if I describe the problem clearly enough to understand. Any question is welcomed!

Great report, has been filed as critical bug for 2.6.1. release.

When reading through the daily build reports it appears that this bug may be resolved, is this a correct interpretation ?

Is there a dailybuild avaiable that we can try to confirm if this fix works in our envoronment ?

Many of our client PCs have multiple IP addresses due to using a SSL VPN connection.

The nightly is here: http://community.igniterealtime.org/message/212856#212856

function step2(iqq) {

var streamhost = $(iqq).find(“streamhost”).get(0);

// var serverjid = streamhost.getAttribute(“jid”);

// var serverhost = streamhost.getAttribute(“host”);

// var serverport = streamhost.getAttribute(“port”);

var iq = $iq({

to : fjid+’/Spark’,

type : ‘set’,

id :id,

from : fulljid

}).c(‘query’, {

    xmlns : "http://jabber.org/protocol/bytestreams",

mode : “tcp”,

sid : sid

}).c(‘streamhost’, {

jid : fulljid,

host : “192.168.22.43”,

port : “7777”

}).up().c(‘streamhost’, {

jid : streamhost.getAttribute(“jid”),

host : streamhost.getAttribute(“host”),

port : streamhost.getAttribute(“port”)

});

connection.sendIQ(iq, step3,error);

}

传文件的时候 会返回406 的错误 找了好久 都没发现是什么地方错了 求指教