ZF-5391: Flash Media Server 3 - Zend Amf

Issue Type: Bug Created: 2009-01-02T01:23:46.000+0000 Last Updated: 2009-05-11T20:24:29.000+0000 Status: Resolved Fix version(s): - 1.8.2 (27/May/09)

Reporter: Bunal (bunal) Assignee: Wade Arnold (wadearnold) Tags: - Zend_Amf

Related issues: Attachments:


Asked Wade and he asked me to shoot it as a bug.

I've been trying to use serverside remoting in FMS3 with ZendAMF but no luck. I get "onStatus>info.code: Client.Header.BadVersion" in FMSLiveLog

But when i try to use the samegateway with Flex there is np and eveything works smooth.

Thought it might be smthing related to amf version but FMS3 should also use AMF3?


Posted by Erik Scholten (x_ile) on 2009-04-16T07:41:06.000+0000

I think this issue is indeed FMS3 related. when I checked the $HTTP_RAW_POST_DATA ( php://input ) and FMS3 reports its objectEncoding version as 0x01 not 0x00 or 0x03. It could be a bug or part of the FMS failsave for connecting to AMF0 encoded servers I don't know.

Anyways, added a check at class Zend_Amf_Request at function readMessage solved it for me.

<pre class="highlight">
     * Takes the raw AMF input stream and converts it into valid PHP objects
     * @param  Zend_Amf_Parse_InputStream
     * @return Zend_Amf_Request
    public function readMessage(Zend_Amf_Parse_InputStream $stream)
        $clientVersion = $stream->readUnsignedShort();
        if (($clientVersion != Zend_Amf_Constants::AMF0_OBJECT_ENCODING)
            // Added Check for 0x01 for FMS. Could be defined a const as well.
            && ($clientVersion != 0x01) 
            && ($clientVersion != Zend_Amf_Constants::AMF3_OBJECT_ENCODING)
        ) {
            require_once 'Zend/Amf/Exception.php';
            throw new Zend_Amf_Exception('Unknown Player Version ' . $clientVersion);

Hope this helps.

Posted by Wade Arnold (wadearnold) on 2009-05-11T20:24:26.000+0000

Thanks for the code sample. Will be added to the next mini release.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.