Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
lynnjeans #1
Member since Oct 2015 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: File transfer problem(Spark to MiniClient)
Dear sirs (madams ;-) ),
I meet a problem when i send file from Spark to MiniClient,
File transfer request is accepted in MiniClient side, but the transfer is no progress(still 0%).

I tested for :
1, MiniClient to MiniClient file transfer WORKS FINE.
2, MiniClient to Spark file transfer WORKS FINE.

ONLY Spark to MiniClient DOES NOT WORK.


This is the debug info below:

m31@mym3.org(Spark)  SEND FILE TO  robot@mym3.org(MiniClient)   DOES NOT WORK
RECV: <iq xmlns="jabber:client" type="set" from="m31@mym3.org/Spark" to="robot@mym3.org/MiniClient" id="5E6vG-29"><si xmlns="http://jabber.org/protocol/si" mime-type="image/jpeg" profile="http://jabber.org/protocol/si/profile/file-transfer" id="jsi_6135981304854517468"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" size="712676" name="4antongorlin-lavacreeksportstephensnswaustralia.jpg"><desc>Sending file</desc></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form"><field type="list-single" 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="5E6vG-29" to="m31@mym3.org/Spark" type="result"><si xmlns="http://jabber.org/protocol/si" id="jsi_6135981304854517468"><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></field></x></feature></si></iq>

RECV: <iq xmlns="jabber:client" type="get" from="m31@mym3.org/Spark" to="robot@mym3.org/MiniClient" id="5E6vG-30"><query xmlns="http://jabber.org/protocol/disco#info" /></iq>

SEND: <iq to="m31@mym3.org/Spark" id="5E6vG-30" type="result"><query xmlns="http://jabber.org/protocol/disco#info"><identity type="pc" name="MiniClient" category="client" /><feature var="http://jabber.org/protocol/disco#info" /><feature var="http://jabber.org/protocol/disco#items" /><feature var="http://jabber.org/protocol/muc" /></query></iq>

m31@mym3.org(MiniClient) SEND FILE TO robot@mym3.org(MiniClient) THIS WORKS FINE
RECV: <iq xmlns="jabber:client" type="set" from="m31@mym3.org/MiniClient" to="robot@mym3.org/MiniClient" id="agsXMPP_10"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" id="85a5052f-9dcf-43dc-b196-ab4e31dd388c"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" size="712676" name="4antongorlin-lavacreeksportstephensnswaustralia.jpg"><range /></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form"><field type="list-single" var="stream-method"><option><value>http://jabber.org/protocol/bytestreams</value></option></field></x></feature></si></iq>

SEND: <iq id="agsXMPP_10" to="m31@mym3.org/MiniClient" type="result"><si xmlns="http://jabber.org/protocol/si" id="85a5052f-9dcf-43dc-b196-ab4e31dd388c"><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></field></x></feature></si></iq>

RECV: <iq xmlns="jabber:client" type="set" from="m31@mym3.org/MiniClient" to="robot@mym3.org/MiniClient" id="agsXMPP_11"><query xmlns="http://jabber.org/protocol/bytestreams" sid="85a5052f-9dcf-43dc-b196-ab4e31dd388c"><streamhost host="proxy.mym3.org" port="7777" jid="proxy.mym3.org" /></query></iq>


robot@mym3.org(MiniClient) SEND FILE TO  m31@mym3.org(Spark) THIS WORKS FINE
SEND: <iq id="agsXMPP_13" to="m31@mym3.org/Spark" type="set"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" id="a790a9d1-a7af-410d-9ea1-022d9744ed6a"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="2_louisenadeau-orangepoppy.jpg" size="524170"><range /></file><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="form"><field type="list-single" var="stream-method"><option><value>http://jabber.org/protocol/bytestreams</value></option></field></x></feature></si></iq>

RECV: <iq xmlns="jabber:client" type="result" from="m31@mym3.org/Spark" to="robot@mym3.org/MiniClient" id="agsXMPP_13"><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></field></x></feature></si></iq>

SEND: <iq id="agsXMPP_14" to="m31@mym3.org/Spark" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="a790a9d1-a7af-410d-9ea1-022d9744ed6a"><streamhost jid="proxy.mym3.org" host="proxy.mym3.org" port="7777" /></query></iq>

RECV: <iq xmlns="jabber:client" type="result" from="m31@mym3.org/Spark" to="robot@mym3.org/MiniClient" id="agsXMPP_14"><query xmlns="http://jabber.org/protocol/bytestreams"><streamhost-used jid="proxy.mym3.org" /></query></iq>

SEND: <iq id="agsXMPP_15" to="proxy.mym3.org" type="set"><query xmlns="http://jabber.org/protocol/bytestreams" sid="a790a9d1-a7af-410d-9ea1-022d9744ed6a"><activate>m31@mym3.org/Spark</activate></query></iq>

RECV: <iq xmlns="jabber:client" type="result" from="proxy.mym3.org" to="robot@mym3.org/MiniClient" id="agsXMPP_15" />

I'm confused with this problem whole days, can anyone point me?   :-)  
It's will be much appreciated if someone helps.  :nuts:
Thanks,
Lynn
This post was edited on 2016-04-26, 10:39 by lynnjeans.
Avatar
lynnjeans #2
Member since Oct 2015 · 6 posts
Group memberships: Members
Show profile · Link to this post
can somebody help? :'(
Avatar
Alex #3
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Don't see error message in your XML. I don't see why it fails or where it stops.
I would suggest that you debug the file transfer code to get more information.

Alex
Avatar
lynnjeans #4
Member since Oct 2015 · 6 posts
Group memberships: Members
Show profile · Link to this post
thanks you for reply, Alex,

Yes, like you saw, no error occured,
I have  debug the file transfer code, found nothing about this problem, and I did't modify any source code of the MiniClient Project,
I just download the sample, run it.

Here is the Spark latest version download link:
http://www.igniterealtime.org/downloads/download…?file=s…

Could you please have a little test on this issue?  :huh:
Thanks in advance.

Lynn
Avatar
Alex #5
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by lynnjeans:
Could you please have a little test on this issue?  :huh:

I am extremely busy right now and have no time in the next days for debugging this.
Please compare the logs with a transfer which works and with a transfer which does not work. I assume that one client does not send an expected packet which forces it to stop.

Alex
Avatar
lynnjeans #6
Member since Oct 2015 · 6 posts
Group memberships: Members
Show profile · Link to this post
Hello  Alex sir, good day!

After I compared the debug xml,
I found the difference:
Spark send file to MiniClient: Accept -> MiniClient Send "stream-method" Iq ->  Spark reply  "disco#info" query (this is different to MiniClient, MiniClient do not query this, but Spark do) -> MiniClient Send DISCO_INFO, DISCO_ITEMS, MUC features -> Spark stopped response.

I guess Spark did't receive a respected disco info,
so, I try add an xtra disco info response to Spark,
In the SetDiscoInfo Method(frmLogin.cs),  I add feature : agsXMPP.Uri.BYTESTREAMS:

        private void SetDiscoInfo()
        {
            _connection.DiscoInfo.AddIdentity(new DiscoIdentity("pc", "M3Client", "client"));

            _connection.DiscoInfo.AddFeature(new DiscoFeature(agsXMPP.Uri.DISCO_INFO));
            _connection.DiscoInfo.AddFeature(new DiscoFeature(agsXMPP.Uri.DISCO_ITEMS));
            _connection.DiscoInfo.AddFeature(new DiscoFeature(agsXMPP.Uri.MUC));
            _connection.DiscoInfo.AddFeature(new DiscoFeature(agsXMPP.Uri.BYTESTREAMS));// code added
        }

final xml:
<iq to="m31@mym3.org/Android" id="9m5PT-110" type="result">
    <query xmlns="http://jabber.org/protocol/disco#info">
        <identity type="pc" name="M3Client" category="client" />
        <feature var="http://jabber.org/protocol/disco#info" />
        <feature var="http://jabber.org/protocol/disco#items" />
        <feature var="http://jabber.org/protocol/muc" />
        <feature var="http://jabber.org/protocol/bytestreams" />
    </query>
</iq>

The file transfer works properly, but i do not understand the mechanism,
why Spark need to query the disco info, and why we have to add BYTESTREAMS Feature, Please hint.   :-)

Thanks in advance.

Lynn
Avatar
Alex #7
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by lynnjeans:
The file transfer works properly, but i do not understand the mechanism,
why Spark need to query the disco info, and why we have to add BYTESTREAMS Feature, Please hint.   :-)

Service discovery is a protocol to automatically discover features of other entities. So when you don't run in a closed environment where you know that everyone is running the same software and what its feature are, you can send disco request to other client and ask which features they support.

So Spark is asking which features you support, if you don't tell Spark that you support XEP-0065: SOCKS5 Bytestreams, which is used for this file-transfer, then Spark does not try to send you the file. Because it assumes you don't support it.

But when Spark knows that you don't support it, then Spark should not allow you to start a file transfer at all. It should notify you that the software is not compatible.

To find more about Service Discovery yo can read the extension protocol here:
XEP-0030: Service Discovery

Alex
Avatar
lynnjeans #8
Member since Oct 2015 · 6 posts
Group memberships: Members
Show profile · Link to this post
Understood,

Thank you, Alex.

But when Spark knows that you don't support it, then Spark should not allow you to start a file transfer at all. It should notify you that the software is not compatible.

Yes, Spark should notify me don't sopport, or i don't know what's going wrong.  :-)

Lynn
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