Strophe attach和Ejabberd的会话恢复问题 [英] Session resume problem with Strophe attach and Ejabberd

查看:178
本文介绍了Strophe attach和Ejabberd的会话恢复问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使strophe的'attach()'功能正常工作时遇到了很多困难。

I'm having a lot of difficulty getting strophe's 'attach()' function working.

我正在建立一个社交网络,用户可以浏览网页,同时保持聊天连接。根据此链接,我不想在每个页面上重新连接/重新授权, http://groups.google.com/group/strophe/browse_thread/thread/430da5e788278f3a/93c48c88164f382f?show_docid=93c48c88164f382f&fwc=1 ,我正在存储SID和RID进入cookie onunload。

I am working on a social network where users will be surfing pages and at the same time keep their chat connection on. I don't want to reconnect/reauthorize on every page so as per this link, http://groups.google.com/group/strophe/browse_thread/thread/430da5e788278f3a/93c48c88164f382f?show_docid=93c48c88164f382f&fwc=1, i am storing the SID and RID into a cookie onunload.

在下一页上,当我尝试使用新的SID和RID(将它递增1之后)后,我的会话已被破坏。 Ejabberd报告HTTP放错误。原因:bad_key

On the next page when i try to use the new SID and RID (after incrementing it by 1) my session is already destroyed. Ejabberd reports "Error on HTTP put. Reason: bad_key"

WTF正在发生?

推荐答案

我设法解决了这个问题。

I managed to solve the problem.

在页面加载之间,rid是双倍递增的。只有在会话附加开始工作时才增加它。

The rid was being double incremented between the page loads. By incrementing it only once the session attach started working.

我不知道为什么会话被取消了,但是发生了什么:

I don't know why the session got cancelled, but here's what happened :


  1. 由于RID比之前的RID高+2,因此ejabberd将请求存储在缓冲区中并且不会将其转发给客户

  2. 接下来的2个请求也会被存储

  3. 之后的那个导致ejabberd取消会话

任何线索?

这篇关于Strophe attach和Ejabberd的会话恢复问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆