文章标题

openfire 发送文件出现error code=406,经过半天仔细查找发现是SI少了一个ID导致的,

SEND: <iq to="vms3@www.ntcipvmssystem.com/Spark" type="set" from="oliver@www.ntcipvmssystem.com/agsXMPP" id="Int32"><open xmlns="http://jabber.org/protocol/ibb" block-size="4096" sid="jsi_8075487451974523534" stanza="iq" /></iq>


RECV: <iq xmlns="jabber:client" from="vms3@www.ntcipvmssystem.com/Spark" to="oliver@www.ntcipvmssystem.com/agsXMPP" type="error" id="Int32"><open xmlns="http://jabber.org/protocol/ibb" block-size="4096" stanza="iq" id="jsi_8075487451974523534" />
<error code="406" type="MODIFY"><not-acceptable
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>

原本发送的是

SEND: 
<iq id="agsXMPP_9" to="vms3@www.ntcipvmssystem.com/Spark" type="set"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" ><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" 
name="MAIN.lst" size="6288"><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/ibb</value>
</option>
</field>
</x>
</feature>
</si>
/iq>

改变为

SEND: 
<iq id="agsXMPP_9" to="vms3@www.ntcipvmssystem.com/Spark" type="set"><si xmlns="http://jabber.org/protocol/si" profile="http://jabber.org/protocol/si/profile/file-transfer" 
**id="09f9ef97-e408-49d7-b7e1-638ea340d26f"**><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" 
name="MAIN.lst" size="6288"><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/ibb</value>
</option>
</field>
</x>
</feature>
</si>
/iq>

注意 SI里多了个id=”09f9ef97-e408-49d7-b7e1-638ea340d26f”*
这个是文件ID,贯彻发送过程保存不变

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值