perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Förtsch <torsten.foert...@gmx.net>
Subject Re: what appeared to be a small typo
Date Tue, 06 Apr 2010 15:44:13 GMT
On Tuesday 06 April 2010 12:51:11 Torsten Förtsch wrote:
> Any objections against this patch?
> 
I have separated the previous patch into 2
1) to address the problem. It calls now modperl_mgv_resolve instead of 
modperl_code_attrs.

Index: src/modules/perl/modperl_filter.c
===================================================================
--- src/modules/perl/modperl_filter.c	(revision 930668)
+++ src/modules/perl/modperl_filter.c	(working copy)
@@ -404,10 +404,12 @@
         FREETMPS;LEAVE;
 
         if (init_handler) {
+            modperl_mgv_resolve(aTHX_ init_handler, p, init_handler->name, 
1);
+
             MP_TRACE_h(MP_FUNC, "found init handler %s",
                        modperl_handler_name(init_handler));
 
-            if (!init_handler->attrs & MP_FILTER_INIT_HANDLER) {
+            if (!(init_handler->attrs & MP_FILTER_INIT_HANDLER)) {
                 Perl_croak(aTHX_ "handler %s doesn't have "
                            "the FilterInitHandler attribute set",
                            modperl_handler_name(init_handler));
@@ -656,6 +658,10 @@
     (void)SvUPGRADE(buffer, SVt_PV);
     SvPOK_only(buffer);
     SvCUR(buffer) = 0;
+    SvGROW(buffer, 1);		/* make PERL_ARGS_ASSERT_SV_CATPVN_FLAGS
+				 * happy, see Perl_sv_catpvn_flags() in sv.c
+				 * of perl 5.10.1
+				 */
 
     /* sometimes the EOS bucket arrives in the same brigade with other
      * buckets, so that particular read() will not return 0 and will


2) to remove the superfluous apr_strdup.

Index: src/modules/perl/modperl_handler.c
===================================================================
--- src/modules/perl/modperl_handler.c	(revision 930668)
+++ src/modules/perl/modperl_handler.c	(working copy)
@@ -36,7 +36,8 @@
         break;
     }
 
-    handler->cv = NULL;
+    /* not necessary due to apr_pcalloc */
+    /* handler->cv = NULL; */
     handler->name = name;
     MP_TRACE_h(MP_FUNC, "[%s] new handler %s",
                modperl_pid_tid(p), handler->name);
@@ -515,7 +516,7 @@
             Perl_croak(aTHX_ "can't resolve the code reference");
         }
         name = apr_pstrcat(p, HvNAME(GvSTASH(gv)), "::", GvNAME(gv), NULL);
-        return modperl_handler_new(p, apr_pstrdup(p, name));
+        return modperl_handler_new(p, name);
       default:
         break;
     };


Torsten Förtsch

-- 
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net

Mime
View raw message