Perl API: missing active check in get?

Brad Fitzpatrick brad@danga.com
Mon, 6 Oct 2003 09:26:23 -0700 (PDT)


Good find!  Yes, that's a bug.  LJ only checks whether that function
returns a defined value, so we haven't been bitten by it yet.

Releasing a new version of the Perl API shortly....

- Brad


On Mon, 6 Oct 2003, Ryan T. Dean wrote:

> On Mon, Oct 06, 2003 at 01:38:26AM -0400, Ryan T. Dean wrote:
> > I've been pouring over the perl API tonight.  In all of the functions
> > that actually do anything with the memcache server (get_multi, delete,
> > _set, _incrdect) except get include a check to make sure the client has
> > active servers to talk to (return undef unless $self->{'active'};).
> >
> > Just a heads up.
> >
> > 		-Ryan T. Dean
>
> Looking farther, in _incrdecr, at the very end...
>
> shouldn't
>
> return undef unless $line =~ /^(\d)/;
>
> be
>
> return undef unless $line =~ /^(\d+)/;
>
> Other places where you expect a multiple-digit number (ie, _load_items
> in the VALUE regex) you check for (\d+).  If it works, well, then,
> ignore me... :)
>
> 	-Ryan T. Dean
>
>