- 論壇徽章:
- 0
|
最近正在重新研究MSNP15協(xié)議的MSN報(bào)警-phpmsnclass,并完善一下之前用的采用MSNP9協(xié)議的MSN報(bào)警。采用了MSNP15協(xié)議框架的phpmsnclass,增加了離線消息(OIM)的支持,修正 MSNP15 密碼使用特殊字符的編碼問(wèn)題,修正了密碼長(zhǎng)度問(wèn)題,在 msnbot.php 中新增定時(shí)通知的功能,新增 addContact() 函數(shù), 主動(dòng)詢問(wèn)使用者是否允許加入他的聯(lián)絡(luò)清單中等功能.
目前phpmsnclass在google code發(fā)布的最新版本是1.9.7,源碼版本號(hào)r30.在使用此版本發(fā)送OIM的時(shí)候,我發(fā)現(xiàn)發(fā)送的OIM過(guò)長(zhǎng),就會(huì)報(bào)錯(cuò):
---------------------------------------------------------------------------
*** OIM failed for
XXXXXX@hotmail.com
*** OIM Error code: q0:MessageTooLarge
*** OIM Error Message: Exception of
type 'System.Web.Services.Protocols.SoapException' was thrown.
*** can't send OIM, but we already re-login again, so ignore this OIM
NS: >>> OUT
---------------------------------------------------------------------------
通過(guò)與phpmsnclass的開發(fā)者wu.tommy(一個(gè)臺(tái)灣人)溝通,確定這是MS在MSNP15協(xié)議框架的WML(Windows Live Messenger)8.5以后版本中新增加的一個(gè)限制。
// for WLM: 1664 bytes
// for YIM: 518 bytes
// for OIM: 314 bytes
因此在r32版本中針對(duì)此限制對(duì)phpmsnclass做了修改,當(dāng)捕獲到這個(gè)錯(cuò)誤的時(shí)候,把信息分片,分成多條OIM發(fā)送;窘鉀Q了這個(gè)問(wèn)題,不過(guò)挺不爽的,不知MS用意何在。
使用MSNP9協(xié)議,PHP要支持:curl pcre
使用MSNP15協(xié)議,PHP要支持以下模塊:curl,pcre,mhash,mcrypt,bcmath。為了大家測(cè)試使用方便,把我的php編譯參數(shù)貼出來(lái)供大家參考。
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/ --with-curl=/usr/local/curl --with-libxml-dir=/usr/local/libxml2 --with-xsl=/usr/local/libxslt --enable-xslt --with-gd=/usr/local/gd2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-zlib-dir=/usr/local/lib/ --with-png=/usr/local/lib/ --with-freetype-dir=/usr/local/freetype/ --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini (別忘記了呵呵)
wget
ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz
wget
http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz
wget
ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/mcrypt-2.5.12.tar.gz
本文來(lái)自ChinaUnix博客,如果查看原文請(qǐng)點(diǎn):http://blog.chinaunix.net/u2/78491/showart_1773908.html |
|