joes        2004/07/14 10:58:19

  Modified:    glue/perl/t/response/TestApReq request.pm
               glue/perl/xsbuilder apreq_xs_tables.h
  Log:
  Fix bug in table set/add: SvPV will convert numeric types to strings, so 
those are safe to set/add.  Just test SvOK now instead of SvPOK to admit them.
  
  Revision  Changes    Path
  1.32      +2 -2      httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm
  
  Index: request.pm
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- request.pm        13 Jul 2004 17:00:08 -0000      1.31
  +++ request.pm        14 Jul 2004 17:58:18 -0000      1.32
  @@ -39,8 +39,8 @@
           my $table = $req->args();
           $table->add("new_arg" => "new");
           die "Can't find new_arg" unless $table->{new_arg} eq "new";
  -        $table->{new_arg} = "newer";
  -        die "Can't find newer arg" unless $table->get("new_arg") eq "newer";
  +        $table->{new_arg} = 1;
  +        die "Can't find newer arg" unless $table->get("new_arg") == 1;
           delete $table->{new_arg};
           die "New arg still exists after deletion" if exists 
$table->{new_arg};
           my $value = $req->param('value');
  
  
  
  1.22      +2 -2      httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_tables.h
  
  Index: apreq_xs_tables.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/apreq_xs_tables.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- apreq_xs_tables.h 13 Jul 2004 19:35:37 -0000      1.21
  +++ apreq_xs_tables.h 14 Jul 2004 17:58:19 -0000      1.22
  @@ -151,14 +151,14 @@
       if (SvROK(ST(2))) {                                                 \
           RETVAL = (apreq_##attr##_t *) SvIVX(SvRV(ST(2)));               \
       }                                                                   \
  -    else if (SvPOK(ST(2))) {                                            \
  +    else if (SvOK(ST(2))) {                                             \
           val = SvPV(ST(2), vlen);                                        \
           RETVAL = apreq_make_##attr(apreq_env_pool(env), key, klen,      \
                                                        val, vlen);        \
       }                                                                   \
       else                                                                \
           Perl_croak(aTHX_ "Usage: $table->" #method "($key, $val): "     \
  -                   "unrecognized SV type for $val");                    \
  +                   "cannot store an undefined $val in the table");      \
                                                                           \
       apr_table_##method##n(t, RETVAL->v.name, RETVAL->v.data);           \
       XSRETURN_EMPTY;                                                     \
  
  
  

Reply via email to