解决openfire中发送某些特殊字符会断开xmpp连接的问题
来源:互联网 发布:免费矢量绘图软件 编辑:程序博客网 时间:2024/06/11 14:27
protected char more() throws IOException, XmlPullParserException { final char codePoint = super.more(); // note - this does NOT return a codepoint now, but simply a (single byte) character!if ((codePoint == 0x0) || // 0x0 is not allowed, but flash clients insist on sending this as the very first character of a stream. We should stop allowing this codepoint after the first byte has been parsed.(codePoint == 0x9) || (codePoint == 0xA) ||(codePoint == 0xD) ||((codePoint >= 0x20) && (codePoint <= 0xD7FF)) ||((codePoint >= 0xE000) && (codePoint <= 0xFFFD)) ||((codePoint >= 0x10000) && (codePoint <= 0x10FFFF))) {return codePoint;}throw new XmlPullParserException("Illegal XML character: " + Integer.parseInt(codePoint+"", 16)); }
由于openfire 对emoj表情的过滤导致,链接断开;因此稍微对源码做修改
@Override protected char more() throws IOException, XmlPullParserException { final char codePoint = super.more(); // note - this does NOT return a codepoint now, but simply a (single byte) character!if ((codePoint == 0x0) || // 0x0 is not allowed, but flash clients insist on sending this as the very first character of a stream. We should stop allowing this codepoint after the first byte has been parsed.(codePoint == 0x9) || (codePoint == 0xA) ||(codePoint == 0xD) ||//fix some emotion((codePoint >= 0x20) && (codePoint <= 0xFFFD)) ||((codePoint >= 0x10000) && (codePoint <= 0x10FFFF))) {return codePoint;}throw new XmlPullParserException("Illegal XML character: " + Integer.parseInt(codePoint+"", 16)); }
文章来源于http://blog.csdn.net/newjueqi/article/details/18260197,感谢作者的分享
0 0
- 解决openfire中发送某些特殊字符会断开xmpp连接的问题
- 解决openfire中发送某些特殊字符会断开xmpp连接的问题
- Xmpp遇到的问题:openfire中发送某些特殊字符会断开xmpp连接的问题(3)
- Openfire连接断开的原因
- 关于XMPP协议android客户端和openfire的连接问题
- 关于将XMPP server部署到Tomcat上的一些问题及断开连接不上解决
- 解决ssh超时断开连接的问题
- 解决ssh超时断开连接的问题
- 解决mysql自动断开连接的问题
- 解决secureCRT超时连接断开的问题
- 解决mysql自动断开连接的问题
- perl的expect发送特殊字符问题
- GET请求中参数含有某些特殊字符的处理
- 数据库会自动清除掉超时的空闲连接造成中间件连接池中连接断开的问题
- 问题:解决Android中socket自动断开连接
- 今天解决了某些网页中字符重叠的问题,高兴!
- Android基于XMPP Smack Openfire下学习开发IM(五)连接断开重连
- Android基于XMPP Smack Openfire下学习开发IM(五)连接断开重连
- function与感叹号
- Java中getResourceAsStream的用法
- Dex文件内的数据类型
- cache + db 性能
- JSP禁用缓存的方式 response.setHeader( "Pragma", "no-cache" ); setDateHeader("Expires", 0);的用法和什么意思
- 解决openfire中发送某些特殊字符会断开xmpp连接的问题
- 现在我这样编程,你呢?
- myeclipse->project->clean…到底有什么用?
- AXIS2:如何发布webservice .
- 工作中文件丢了怎么办
- Unity3D使用小技巧
- Robot Jacobian expressed in end effector frame
- 【htc法:IE-CSS3】CSS3支持IE6、IE7、IE8
- CTU Open 2008(未完工)