Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
hexin #1
User title: to search knowledge
Member since Mar 2007 · 34 posts · Location: China
Group memberships: Members
Show profile · Link to this post
Subject: file transfer problem
I am implementing the file transfer mecahnism from MiniClient sample.I use proxy for file transfer. when i transfer file to the other user,but he does not accept file as soon as he get the invitation message. After a long time(for example,half an hour later),when  he clicked acept button, the file can't transfer. The problem happens during the process of Target Establishes SOCKS5 Connection with StreamHost.

after  send SOCKS request as follow:

        +----+-----+-------+------+----------+----------+
        |VER | REP |  RSV  | ATYP | BND.ADDR | BND.PORT |
        +----+-----+-------+------+----------+----------+
        | 1  |  1  | X'00' |  1   | Variable |    2     |
        +----+-----+-------+------+----------+----------+
where:

          o  VER : X'05'
          o  CMD:  X'01'
          o  RSV :  X'00'
          o  ATYP: X'03
          ...
         
the The server  returns a reply in which  the value of Reply field is X'02' (connection not allowed by ruleset)

why this happens?The server software i use is openfire. when the file transfer fails,the error log of server is as follow:

2007.07.16 14:40:36 [org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager$1$1.run(ProxyConnectionManager.java:110)
] Error processing file transfer proxy connection
java.io.IOException: Illegal proxy transfer
at org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager.processConnection(ProxyConnectionManager.java:187)
at org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager.access$100(ProxyConnectionManager.java:39)
at org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager$1$1.run(ProxyConnectionManager.java:107)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2007.07.16 14:41:25 [org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager$2.run(ProxyConnectionManager.java:296)
] Error during file transfer
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at org.jivesoftware.openfire.filetransfer.proxy.DefaultProxyTransfer.doTransfer(DefaultProxyTransfer.java:129)
at org.jivesoftware.openfire.filetransfer.proxy.ProxyConnectionManager$2.run(ProxyConnectionManager.java:293)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Avatar
Jabberer #2
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
The server is only involved with the file transfer if you can make no direct P2P connection (eg. firewall issues).
Its possble that Openfire has a timeout here and kicks your Socks5 connection.
You can ask the Jive developers in their forums or study the source of openfire. We never made such kind of tests where we did not accept the file for 20 minutes.
Software Developer
AG-Software
Avatar
Jabberer #3
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
Does Openfire notify you that the Socks5 session was closed?
Software Developer
AG-Software
Avatar
hexin #4
User title: to search knowledge
Member since Mar 2007 · 34 posts · Location: China
Group memberships: Members
Show profile · Link to this post
No,Openfire dose not notify me that the Socks5 session was closed.Sometimes,this also happen when i receive the file immediately when i receive the file transfering invitation.Is this related to network circumstance or server configuration.
Avatar
Alex #5
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

can you post or attach XML logs of sender and receiver?

Alex
Avatar
hexin #6
User title: to search knowledge
Member since Mar 2007 · 34 posts · Location: China
Group memberships: Members
Show profile · Link to this post
The sender’s debug information is as follow:
Send:
"<iq id=\"agsXMPPzhangw_7\" to=\"hx@storytree/agsXMPP\" from=\"zhangw@storytree/agsXMPP\" type=\"set\">
<si xmlns=\"http://jabber.org/protocol/si\" id=\"jsi_2007527171124\" mime-type=\"text/plain\" profile=\"http://jabber.org/protocol/si/profile/file-transfer\">
<file xmlns=\"http://jabber.org/protocol/si/profile/file-transfer\" name=\"jpskb.rar\" size=\"641342\">
<desc>Sending file</desc>
</file>
<feature xmlns=\"http://jabber.org/protocol/feature-neg\">
<x xmlns=\"jabber:x:data\" type=\"form\">
<field var=\"stream-method\" type=\"list-multi\">
<option>
<value>http://jabber.org/protocol/bytestreams</value>
</option>
<option>
<value>http://jabber.org/protocol/ibb</value>
</option>
</field>
</x>
</feature>
</si>
</iq>"

Receive:
"<iq xmlns=\"jabber:client\" from=\"hx@storytree/agsXMPP\" to=\"zhangw@storytree/agsXMPP\" type=\"result\" id=\"agsXMPPzhangw_8\">
<si xmlns=\"http://jabber.org/protocol/si\">
<feature xmlns=\"http://jabber.org/protocol/feature-neg\">
<x xmlns=\"jabber:x:data\" type=\"submit\">
<field var=\"stream-method\">
<value>http://jabber.org/protocol/bytestreams</value>
<value>http://jabber.org/protocol/ibb</value>
</field>
</x>
</feature>
</si>
</iq>"

Send:
"<iq id=\"agsXMPPzhangw_9\" to=\"storytree\" type=\"get\">
<query xmlns=\"http://jabber.org/protocol/disco#items\" />
</iq>"

Receive:
"<iq xmlns=\"jabber:client\" from=\"storytree\" to=\"zhangw@storytree/agsXMPP\" type=\"result\" id=\"agsXMPPzhangw_9\">
<query xmlns=\"http://jabber.org/protocol/disco#items\">
<item name=\"????\" jid=\"conference.storytree\" />
<item name=\"Publish-Subscribe service\" jid=\"pubsub.storytree\" />
<item name=\"Socks 5 Bytestreams Proxy\" jid=\"proxy.storytree\" />
<item name=\"Broadcast service\" jid=\"broadcast.storytree\" />
<item name=\"User Search\" jid=\"search.storytree\" />
</query>
</iq>"

Send:
"<iq id=\"agsXMPPzhangw_10\" to=\"proxy.storytree\" type=\"get\">
<query xmlns=\"http://jabber.org/protocol/disco#info\" />
</iq>"

Receive:
"<iq xmlns=\"jabber:client\" from=\"proxy.storytree\" to=\"zhangw@storytree/agsXMPP\" type=\"result\" id=\"agsXMPPzhangw_10\">
<query xmlns=\"http://jabber.org/protocol/disco#info\"><identity name=\"SOCKS5 Bytestreams Service\" category=\"proxy\" type=\"bytestreams\" />
<feature var=\"http://jabber.org/protocol/bytestreams\" />
<feature var=\"http://jabber.org/protocol/disco#info\" />
</query>
</iq>"

Send:
"<iq id=\"agsXMPPzhangw_11\" from=\"zhangw@storytree/agsXMPP\" to=\"proxy.storytree\" type=\"get\">
<query xmlns=\"http://jabber.org/protocol/bytestreams\" />
</iq>"

Receive:
"<iq xmlns=\"jabber:client\" from=\"proxy.storytree\" to=\"zhangw@storytree/agsXMPP\" type=\"result\" id=\"agsXMPPzhangw_11\">
<query xmlns=\"http://jabber.org/protocol/bytestreams\"><streamhost port=\"7777\" jid=\"proxy.storytree\" host=\"127.0.0.1\" />
</query>
</iq>"


Send:
"<iq id=\"agsXMPPzhangw_12\" from=\"zhangw@storytree/agsXMPP\" to=\"hx@storytree/agsXMPP\" type=\"set\">
<query xmlns=\"http://jabber.org/protocol/bytestreams\" sid=\"jsi_2007527171309\" mode=\"tcp\">
<streamhost port=\"7777\" jid=\"proxy.storytree\" host=\"127.0.0.1\" />
</query>
</iq>"

Then  sender  will wait  for the receiver’s response. If receiver successfully establish SOCKS5 Connection, the sender will continue the following process.

Receive:
"<iq xmlns=\"jabber:client\" from=\"hx@storytree/agsXMPP\" to=\"zhangw@storytree/agsXMPP\" type=\"result\" id=\"agsXMPPzhangw_12\">
<query xmlns=\"http://jabber.org/protocol/bytestreams\">
<streamhost-used jid=\"proxy.storytree\" />
</query>
</iq>"

Send:
"<iq id=\"agsXMPPzhangw_13\" from=\"zhangw@storytree/agsXMPP\" to=\"proxy.storytree\" type=\"set\">
<query xmlns=\"http://jabber.org/protocol/bytestreams\" sid=\"jsi_2007527171309\">
<activate>hx@storytree/agsXMPP</activate>
</query>
</iq>"

receive:
"<iq xmlns=\"jabber:client\" from=\"proxy.storytree\" to=\"zhangw@storytree/agsXMPP\" type=\"result\" id=\"agsXMPPzhangw_13\" />"


If I was receiver, debug info is as follow:
Receive:
"<iq xmlns=\"jabber:client\" from=\"hx@storytree/agsXMPP\" to=\"zhangw@storytree/agsXMPP\" type=\"set\" id=\"agsXMPPhx_7\">
<si xmlns=\"http://jabber.org/protocol/si\" profile=\"http://jabber.org/protocol/si/profile/file-transfer\" mime-type=\"text/plain\" id=\"jsi_2007527171807\">
<file xmlns=\"http://jabber.org/protocol/si/profile/file-transfer\" size=\"641342\" name=\"jpskb.rar\">
<desc>Sending file</desc>
</file>
<feature xmlns=\"http://jabber.org/protocol/feature-neg\">
<x xmlns=\"jabber:x:data\" type=\"form\">
<field type=\"list-multi\" var=\"stream-method\">
<option>
<value>http://jabber.org/protocol/bytestreams</value>
</option>
<option>
<value>http://jabber.org/protocol/ibb</value>
</option>
</field>
</x>
</feature>
</si>
</iq>"

Send:
"<iq id=\"agsXMPPhx_8\" from=\"zhangw@storytree/agsXMPP\" to=\"hx@storytree/agsXMPP\" type=\"result\">
<si xmlns=\"http://jabber.org/protocol/si\">
<feature xmlns=\"http://jabber.org/protocol/feature-neg\">
<x xmlns=\"jabber:x:data\" type=\"submit\">
<field var=\"stream-method\">
<value>http://jabber.org/protocol/bytestreams</value>
<value>http://jabber.org/protocol/ibb</value>
</field>
</x>
</feature>
</si>
</iq>"

Receive:
"<iq xmlns=\"jabber:client\" from=\"hx@storytree/agsXMPP\" to=\"zhangw@storytree/agsXMPP\" type=\"set\" id=\"agsXMPPhx_12\">
<query xmlns=\"http://jabber.org/protocol/bytestreams\" mode=\"tcp\" sid=\"jsi_2007527171931\">
<streamhost port=\"7777\" jid=\"proxy.storytree\" host=\"127.0.0.1\" />
</query>
</iq>"

After  receiving this information,I start establishing SOCKS5 Connection, and in this process, the phenomena I described above happened. So the following xml can’t be sent to sender.

Send:
"<iq id=\"agsXMPPhx_12\" from=\"zhangw@storytree/agsXMPP\" to=\"hx@storytree/agsXMPP\" type=\"result\">
<query xmlns=\"http://jabber.org/protocol/bytestreams\">
<streamhost-used jid=\"proxy.storytree\" />
</query>
</iq>"
Avatar
Alex #7
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
all this XML looks Ok. You should ask the Openfire developers what can cause this exceptions.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS