wrong candidate choosen when doing Jingle FT
Here are some XML logs:
\<!-- Out -->
\<iq xmlns="jabber:client" to="JID1/RES1" from="JID2/RES2" id="28" type="set">
\<jingle xmlns="urn:xmpp:jingle:1" action="session-initiate" initiator="JID2/RES2" sid="25">
\<content name="fileVS036JL4GBPK1XHW" creator="initiator">
\<security xmlns="urn:xmpp:jingle:security:xtls:0">
\<method name="x509" />
\</security>
\<description xmlns="urn:xmpp:jingle:apps:file-transfer:3">
\<offer>
\<file xmlns="http://jabber.org/protocol/si/profile/file-transfer">
\<name>FILE\</name>
\<date>2013-02-28T12:11:34\</date>
\<size>676458\</size>
\<hash xmlns="urn:xmpp:hashes:1" algo="md5">ec732d5d48a401229ba6f5dbbe81eafb\</hash>
\<desc />
\</file>
\</offer>
\</description>
\<transport xmlns="urn:xmpp:jingle:transports:s5b:1" sid="26">
\<candidate jid="proxy.jabber.lagaule.org" cid="27" priority="655360" host="88.190.223.150" type="proxy" port="5000" />
\</transport>
\</content>
\</jingle>
\</iq>
\<!-- In -->
\<iq id='28' type='result' to='JID2/RES2' from='JID1/RES1'/>
\<!-- In -->
\<iq id='2450' type='get' to='JID2/RES2' from='JID1/RES1'>
\<pubkeys xmlns='urn:xmpp:pubkey:2'/>
\</iq>
\<!-- Out -->
\<iq xmlns="jabber:client" to="JID1/RES1" type="result" id="2450">
\<pubkeys xmlns="urn:xmpp:pubkey:2">
\<keyinfo>
\<name>CertificateHash\</name>
\<x509cert>MIIBjjCB+AIBADANBgkqhkiG9w0BAQQFADAQMQ4wDAYDVQQDEwVnYWppbTAeFw0x
MDA4MTEwNjM1NThaFw0xNTA4MTAwNjM1NThaMBAxDjAMBgNVBAMTBWdhamltMIGf
MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMy3D+PPls+jZSv664zTAUOKfIjXGT
809CzseiOTWMF9qNOYiqB1Y19UPu2dqTCb8Mmgj4Py+9D7vYw/gDJfd7j5tx3X8J
vCjsi5jbZqMja1Bvi3l8nvtTSla3GB0256bG1+jOoOpFHlei10VuDPOaCtfaxRSm
EFWRi2EJdqLiIQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAKAJvAxWu1TvN7c1rmIv
v1c3uBo+54/4iATeJmmVdrulkjZpFHJo+yXkpBFEBAZDlhnRalTbJ8g14GslJiu4
h4Gcn7CD6HVBpAgrYPdcbAl7FkG+1se4Ahp2fnZ74+hQlT5YiR7cAWApWJCVVi4N
5jIE9/LbgjflC1MAU87fRxEd
\</x509cert>
\</keyinfo>
\</pubkeys>
\</iq>
\<!-- In -->
\<iq id='2455' type='set' to='JID2/RES2' from='JID1/RES1'>
\<jingle xmlns='urn:xmpp:jingle:1' sid='25' action='session-accept' initiator='JID2/RES2'>
\<content name='fileVS036JL4GBPK1XHW' creator='initiator'>
\<security xmlns='urn:xmpp:jingle:security:xtls:0'>
\<method name='x509'/>
\</security>
\<description xmlns='urn:xmpp:jingle:apps:file-transfer:3'>
\<offer>
\<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'>
\<name>FILE\</name>
\<date>2013-02-28T12:11:34\</date>
\<size>676458\</size>
\<hash xmlns='urn:xmpp:hashes:1' algo='md5'>ec732d5d48a401229ba6f5dbbe81eafb\</hash>
\<desc/>
\</file>
\</offer>
\</description>
\<transport xmlns='urn:xmpp:jingle:transports:s5b:1' sid='26'>
\<candidate host='192.168.1.2' type='direct' jid='JID1/RES1' priority='8257536' port='28013' cid='2451'/>
\<candidate host='82.246.25.239' type='direct' jid='JID1/RES1' priority='8257536' port='28013' cid='2452'/>
\<candidate host='88.86.102.53' type='proxy' jid='proxy.jabbim.cz' priority='655360' port='7777' cid='2454'/>
\</transport>
\</content>
\</jingle>
\</iq>
\<!-- Out -->
\<iq xmlns="jabber:client" to="JID1/RES1" from="JID2/RES2" id="2455" type="result" />
\<!-- Out -->
\<iq xmlns="jabber:client" to="JID1/RES1" from="JID2/RES2" id="2455" type="result" />
\<!-- Out -->
\<iq xmlns="jabber:client" to="JID1/RES1" from="JID2/RES2" id="29" type="set">
\<jingle xmlns="urn:xmpp:jingle:1" action="transport-info" initiator="JID2/RES2" sid="25">
\<content name="fileVS036JL4GBPK1XHW" creator="initiator">
\<transport xmlns="urn:xmpp:jingle:transports:s5b:1" sid="26">
\<candidate-used cid="2451" />
\</transport>
\</content>
\</jingle>
\</iq>
\<!-- In -->
\<iq id='2456' type='set' to='JID2/RES2' from='JID1/RES1'>
\<jingle xmlns='urn:xmpp:jingle:1' sid='25' action='transport-info' initiator='JID2/RES2'>
\<content name='fileVS036JL4GBPK1XHW' creator='initiator'>
\<transport xmlns='urn:xmpp:jingle:transports:s5b:1' sid='26'>
\<candidate-used cid='27'/>
\</transport>
\</content>
\</jingle>
\</iq>
\<!-- Out -->
\<iq xmlns="jabber:client" to="JID1/RES1" from="JID2/RES2" id="2456" type="result" />
\<!-- Out -->
\<iq xmlns="jabber:client" to="JID1/RES1" from="JID2/RES2" id="2456" type="result" />
\<!-- In -->
\<iq id='29' type='result' to='JID2/RES2' from='JID1/RES1'/>
\<iq id='29' type='result' to='JID2/RES2' from='JID1/RES1'/>
Bug description
JID1 sends a file to JID2, offering a proxy JID2 accepts, offers some candidates JID1 choose JID2 local's IP JID2 choose JID1's proxy
and the problem is here: JID1 connect to JID2 local's IP and JID2 connects to JID1's proxy
so both parties don't use the same candidate ...