[ 
https://issues.apache.org/jira/browse/THRIFT-2351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13896090#comment-13896090
 ] 

Roger Meier commented on THRIFT-2351:
-------------------------------------

please create a patch for this and if possible add a compact protocol test to 
test/test.sh
we already have this:
{noformat}
do_test "php-cpp"  "binary" "buffered-ip" \
        "make -C php/ client" \
        "cpp/TestServer" \
        "10" "10"
{noformat}
java might be a compact protocol test partner

thanks!
;-r


> PHP TCompactProtocol has fails to decode messages
> -------------------------------------------------
>
>                 Key: THRIFT-2351
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2351
>             Project: Thrift
>          Issue Type: Bug
>          Components: PHP - Library
>    Affects Versions: 0.9.1
>         Environment: Tested under PHP 5.3 and HHVM latest.
>            Reporter: Paul Banks
>              Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> There are two typos in TCompactProtocol::readMessageBegin that prevent 
> correct decoding of any message. They are on consecutive lines:
> https://github.com/apache/thrift/blob/master/lib/php/lib/Thrift/Protocol/TCompactProtocol.php#L390-L391
> First $seqId does not match case of argument $seqid so this is not set PHP is 
> not case sensitive for class names but IS for variable names.
> Second and more importantly, on the following line $name has the decoded 
> length assigned to it instead of $result. This means the method name "hello" 
> ends up being decoded as "6" (the length of the string plus length prefix) 
> and hence any processor trying to dispatch the event will fail.
> I can submit a patch/pull request but its only 6 chars to change and clearly 
> there are no automated tests for this protocol implementation as that should 
> have been caught before.
> I guess not many other people are using PHP as a thrift service processor 
> with this protocol.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to