使用JAXL进行Openfire HTTP预绑定 [英] Openfire http prebinding with JAXL

查看:141
本文介绍了使用JAXL进行Openfire HTTP预绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to implement converse.js in my project to use Openfire chat and am prebinding the user using JAXL. Its working fine on my cloud(VPS) server. when am try to publish the same code on my client server its not working. and getting the same problem when execute the same from my localhost. not working means prebind request remains (pending) for a while and ends with 500 internal server error.

我们已经检查了服务器配置.似乎很好.有人可以建议我调试一下吗?

we have checked the server configuration. seems to be fine. Can any one suggest me something to how to debug this one?

这是我的jaxl配置代码.

here is my jaxl config code.

$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

Thanks in advance
-josan

更新

这是我的客户端服务器上的jaxl日志.

here is my jaxl log from my client server.

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版本引起的

At last we found the solution for this issue.
As i already mentioned in my comment the problem was caused of PHP versions

在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

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

The curl_multi_select() function used there on line no #135 returning (-1) instead of (0) as the response when PHP versions are higher than 5.3.18

所以我将#137更改如下

So i have changed the #137 as follows

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

这东西解决了我的问题.

This thing fixes my problem.

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

注:对于大于5.3.x的PHP版本,请在将JAXL用于您的项目之前进行迁移检查. 下面的链接具有一个shell脚本,可用于查找不便之处

Note: for PHP versions Greater than 5.3.x Do the migration check before using the JAXL in-to your project. The below link having a shell script to found inconveniences
http://blog.waja.info/2013/09/15/migrating-from-php-5-dot-3-x-to-5-dot-4-x-and-finding-problematic-application-code/

希望这可以在某个时候帮助某人.

Hope this could help someone on sometime.

这篇关于使用JAXL进行Openfire HTTP预绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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