Hi Brian, 

I found the "instant releases" link, and downloaded r915499.  The problem looks 
like it's been fixed in struct.rb, Struct.write:

        value = instance_variable_get("@#{name}")
        unless value.nil?

which used to be 

        if (value = instance_variable_get("@#{name}")) 

I tested the same fix yesterday in my code after looking at the equivalent PHP 
lib function. 

I'll file the bug with test cases as suggested, thanks.

Larry





________________________________
From: Bryan Duxbury <[email protected]>
To: [email protected]
Sent: Wed, February 24, 2010 9:32:16 AM
Subject: Re: thrift server bug - return value of zero not sent by server

Hey Larry,

This sounds like a fairly serious bug, and while I was not specifically
familiar with it's manifestation, I think I may have incidentally fixed it
in a recent commit. I would absolutely love you to create a ticket and
attach a test case that exercises the problem, based on the current trunk.
If there's still a problem, I'll fix it immediately, and in any case, we'll
gain a useful regression test.

Thanks!

-Bryan

On Tue, Feb 23, 2010 at 11:13 PM, Larry Kang <[email protected]> wrote:

> Hi all,
>
> I found a bug in the thrift ruby libs such that a server won't send a
> handler return value of 0 or false.
>
> For service.thrift:
>
> service SimonSays {
>  bool registerClient(1:string email);
> }
>
> On the server side, here's the ruby handler class:
>
> def class SimonSaysServiceHandler
>  def registerClient ( email )
>    return false # works for 'return true'
>  end
> end
>
> The problem is no value returned to the client if the return value is 0 or
> false.
>
> The problem appears in both thrift-instant-r760184.tar.gz (from
> facebook.com) and thrift-0.2.0-incubating.tar.gz from Apache.
>
> I checked jira but no similar problem seems to be listed.  I wasnt able to
> find the mailing list archive to check.  I've identified the offending line
> of code and would like to fix it if nobody else has already.  I'm not
> familiar with how to contribute the fix, any advice? Thanks,

Reply via email to