【问题标题】:Openfire http prebinding with JAXL使用 JAXL 的 Openfire http 预绑定
【发布时间】:2014-12-26 13:50:33
【问题描述】:

我正在尝试在我的项目中实现 converse.js 以使用 Openfire 聊天并使用 JAXL 预绑定用户。它在我的云(VPS)服务器上运行良好。当我尝试在我的客户端服务器上发布相同的代码时它不起作用。从我的本地主机执行相同的操作时遇到相同的问题。不工作意味着预绑定请求保持(待处理)一段时间并以 500 内部服务器错误结束。

我们已经检查了服务器配置。似乎很好。任何人都可以建议我如何调试这个吗?

这是我的 jaxl 配置代码。

$client = new JAXL(array(
  'jid'=>$un,
  'pass'=>$pwd,
  'bosh_url' => 'http://xx.xx.xx.xx/http-bind',
  'log_path' => __DIR__ . '/logs',
  'log_level' => JAXL_INFO,
  'strict' => false
));

提前致谢
-josan

更新

这是来自我的客户端服务器的 jaxl 日志。

1.jaxl:180 - 2014-11-05 10:47:47 - dns srv lookup for iz25pkf9c7hz
2.jaxl:189 - 2014-11-05 10:47:47 - including bosh xep
3.jaxl_fsm:61 - 2014-11-05 10:47:47 - calling state handler 'setup' for incoming event 'start_cb'
4.jaxl_fsm:71 - 2014-11-05 10:47:47 - current state 'wait_for_stream_features'
5.xep_0206:109 - 2014-11-05 10:47:47 - posting to http://182.92.156.24/http-bind body 
6.<body xmlns="http://jabber.org/protocol/httpbind" content="text/xml; charset=utf-8" 
 to="iz25pkf9c7hz" route="xmpp:iz25pkf9c7hz:5222" secure="true" xml:lang="en" 
 xmpp:version="1.0" xmlns:xmpp="urn:xmpp:xbosh" hold="1" wait="30" rid="2280" 
 ver="1.10" from="bala101@iz25pkf9c7hz">  
</body>
7.xep_0206:132 - 2014-11-05 10:47:47 - recving for 2280
8.xep_0206:132 - 2014-11-05 10:47:48 - recving for 2280
9.xep_0206:132 - 2014-11-05 10:47:48 - recving for 2280
10.xep_0206:132 - 2014-11-05 10:47:48 - recving for 2280
.
.
.
.
58854.xep_0206:132 - 2014-11-05 10:47:48 - recving for 2280
.
.
(Its just kept on adding for 5 or 3 mins)

【问题讨论】:

  • 我看到不同主机之间的区别是PHP版本和apache版本。具有 PHP v5.3.3/Apache/2.2.15 (CentOS) 的工作服务器。我的本地系统上有 PHP v5.4.7。所以我已将我的 xampp 降级为 1.7.4(PHPv5.3.5/Apache(2.2.17))。如果我尝试从 localhost 访问它,我得到的响应为 200 OK,内容长度为 0。知道为什么会这样吗?

标签: openfire jaxl prebinding


【解决方案1】:

我们终于找到了解决这个问题的办法。
正如我在评论中已经提到的,问题是由 PHP 版本引起的

在 JAXL 中

 #135 $changed = curl_multi_select($this->mch, 0.1);
        
 #137 if($changed == 0 && $running == 0) {  

https://github.com/jaxl/JAXL/blob/v3.x/xep/xep_0206.php#L135

当 PHP 版本高于 5.3.18 时,在第 #135 行使用的 curl_multi_select() 函数返回 (-1) 而不是 (0) 作为响应

所以我将 #1​​37 更改如下

#137 if(($changed == 0 || $changed == -1) && $running == 0) {

这个东西解决了我的问题。

参考https://bugs.php.net/bug.php?id=63411

注意:对于大于 5.3.x 的 PHP 版本,请在将 JAXL 用于您的项目之前进行迁移检查。 下面的链接有一个 shell 脚本来发现不便
http://blog.waja.info/2013/09/15/migrating-from-php-5-dot-3-x-to-5-dot-4-x-and-finding-problematic-application-code/

希望这可以在某个时候对某人有所帮助。

快乐编码

【讨论】:

    猜你喜欢
    • 2011-02-13
    • 1970-01-01
    • 2016-09-01
    • 1970-01-01
    • 2015-05-29
    • 1970-01-01
    • 2013-07-17
    • 1970-01-01
    • 2012-11-20
    相关资源
    最近更新 更多