昨天试了下1.9正式版本,结果发现原先返回bytearray给flash的地方都卡死了,不会返回任何数据。
到网上搜了下,看来已经有人遇到我一样的问题了,AMF3 ByteArray serialization Bug ,修正方案见:patch for amfphp AMF3 ByteArray serialization bug
如果上面地址无法访问,请使用无忧在线代理访问。
这是转自原文:
Base on amfphp 1.9, there are bugs of AMF3 ByteArray serialization, if you want to send a ByteArray from PHP to flash, you will have to modify core/amf/io/AMFSerializer.php:writeAmf3ByteArray function.
Line 991:
Original code:
change to:function writeAmf3ByteArray($d)
{
$this->writeByte(0x0C);
$this->writeAmf3String($d, true);
$this->writeAmf3ByteArrayBody($d);
}
It fixed two issues:function writeAmf3ByteArray($d)
{
$this->writeByte(0x0C);
$this->writeAmf3ByteArrayBody($d);
}
1. writeAmf3String and writeAmf3ByteArrayBody writes ByteArray body content twice
2. writeAmf3String uses U29S-ref, ByteArray should be U29O-ref ( ref AMF3-spec)
Hope helpful。