Zend Framework

Flash Media Server 3 - Zend Amf

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.0
  • Fix Version/s: 1.8.2
  • Component/s: Zend_Amf
  • Labels:
    None

Description

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?

Activity

Hide
Erik Scholten added a comment -

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.

Zend_Amf_Request.php
/**
     * 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.

Show
Erik Scholten added a comment - 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.
Zend_Amf_Request.php
/**
     * 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.
Hide
Wade Arnold added a comment -

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

Show
Wade Arnold added a comment - Thanks for the code sample. Will be added to the next mini release.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: