perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r209866 - in /perl/modperl/branches/clone-skip-unstable: src/modules/perl/ xs/APR/Socket/ xs/ModPerl/Util/
Date Fri, 08 Jul 2005 19:19:33 GMT
Author: stas
Date: Fri Jul  8 12:19:31 2005
New Revision: 209866

URL: http://svn.apache.org/viewcvs?rev=209866&view=rev
Log:
merging from trunk from r209127 to r209863


Modified:
    perl/modperl/branches/clone-skip-unstable/src/modules/perl/mod_perl.c
    perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_cmd.c
    perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_common_util.c
    perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_interp.h
    perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_io.c
    perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_mgv.c
    perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_util.c
    perl/modperl/branches/clone-skip-unstable/xs/APR/Socket/APR__Socket.h
    perl/modperl/branches/clone-skip-unstable/xs/ModPerl/Util/ModPerl__Util.h

Modified: perl/modperl/branches/clone-skip-unstable/src/modules/perl/mod_perl.c
URL: http://svn.apache.org/viewcvs/perl/modperl/branches/clone-skip-unstable/src/modules/perl/mod_perl.c?rev=209866&r1=209865&r2=209866&view=diff
==============================================================================
--- perl/modperl/branches/clone-skip-unstable/src/modules/perl/mod_perl.c (original)
+++ perl/modperl/branches/clone-skip-unstable/src/modules/perl/mod_perl.c Fri Jul  8 12:19:31
2005
@@ -532,6 +532,9 @@
     modperl_global_init_server_rec(pconf, s);
 
     modperl_tls_create_request_rec(pconf);
+
+    /* init the counter to 0 */
+    modperl_global_anon_cnt_init(pconf);
 }
 
 /*
@@ -692,9 +695,17 @@
     }
 #endif
 
+#if PERL_REVISION == 5 && PERL_VERSION < 9
+#define MP_PERL_VERSION_STAMP "Perl/v%vd"
+#else
+#define MP_PERL_VERSION_STAMP "Perl/%" SVf
+#endif
+    
     ap_add_version_component(pconf, MP_VERSION_STRING);
     ap_add_version_component(pconf,
-                             Perl_form(aTHX_ "Perl/v%vd", PL_patchlevel));
+                             Perl_form(aTHX_ MP_PERL_VERSION_STAMP,
+                                       PL_patchlevel));
+
     modperl_mgv_hash_handlers(pconf, s);
     modperl_modglobal_hash_keys(aTHX);
     modperl_env_hash_keys(aTHX);

Modified: perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_cmd.c
URL: http://svn.apache.org/viewcvs/perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_cmd.c?rev=209866&r1=209865&r2=209866&view=diff
==============================================================================
--- perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_cmd.c (original)
+++ perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_cmd.c Fri Jul  8 12:19:31
2005
@@ -554,6 +554,9 @@
         GV *gv = gv_fetchpv("0", TRUE, SVt_PV);
         ENTER;SAVETMPS;
         save_scalar(gv); /* local $0 */
+#if PERL_REVISION == 5 && PERL_VERSION >= 9
+        TAINT_NOT; /* XXX: temp workaround, see my p5p post */
+#endif
         sv_setpv_mg(GvSV(gv), directive->filename);
         eval_sv(code, G_SCALAR|G_KEEPERR);
         SvREFCNT_dec(code);

Modified: perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_common_util.c
URL: http://svn.apache.org/viewcvs/perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_common_util.c?rev=209866&r1=209865&r2=209866&view=diff
==============================================================================
--- perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_common_util.c (original)
+++ perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_common_util.c Fri Jul
 8 12:19:31 2005
@@ -95,7 +95,7 @@
                     return mg->mg_obj;
                 }
                 else {
-                    Perl_warn(aTHX_ "Not a tied hash: (magic=%c)", mg);
+                    Perl_warn(aTHX_ "Not a tied hash: (magic=%c)", mg->mg_type);
                 }
             }
             else {

Modified: perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_interp.h
URL: http://svn.apache.org/viewcvs/perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_interp.h?rev=209866&r1=209865&r2=209866&view=diff
==============================================================================
--- perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_interp.h (original)
+++ perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_interp.h Fri Jul  8
12:19:31 2005
@@ -27,12 +27,28 @@
  * HvPMROOT will never be used by Perl with PL_modglobal.
  * so we have stolen it as a quick way to stash the interp
  * pointer.
+ *
+ * However in 5.9.3 HvPMROOT was completely removed, so we have moved
+ * to use another struct member that's hopefully won't be used by
+ * anybody else. But if we can find a better place to store the
+ * pointer to the current mod_perl interpreter object it'd be a much
+ * cleaner solution. of course it must be really fast.
  */
+#ifndef HvPMROOT
+#define MP_THX_INTERP_GET(thx)                                  \
+    (modperl_interp_t *) ((XPVMG*)SvANY(*Perl_Imodglobal_ptr(thx)))->xmg_magic
+#else
 #define MP_THX_INTERP_GET(thx) \
     (modperl_interp_t *)HvPMROOT(*Perl_Imodglobal_ptr(thx))
+#endif
 
-#define MP_THX_INTERP_SET(thx, interp) \
+#ifndef HvPMROOT
+#define MP_THX_INTERP_SET(thx, interp)                          \
+    ((XPVMG*)SvANY(*Perl_Imodglobal_ptr(thx)))->xmg_magic = (MAGIC*)interp
+#else
+#define MP_THX_INTERP_SET(thx, interp)                          \
     HvPMROOT(*Perl_Imodglobal_ptr(thx)) = (PMOP*)interp
+#endif
 
 const char *modperl_interp_scope_desc(modperl_interp_scope_e scope);
 

Modified: perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_io.c
URL: http://svn.apache.org/viewcvs/perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_io.c?rev=209866&r1=209865&r2=209866&view=diff
==============================================================================
--- perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_io.c (original)
+++ perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_io.c Fri Jul  8 12:19:31
2005
@@ -124,7 +124,7 @@
         status = Perl_do_open(aTHX_ handle_save, "<&STDIN", 7, FALSE,
                               O_RDONLY, 0, Nullfp);
         if (status == 0) {
-            Perl_croak(aTHX_ "Failed to dup STDIN: %_", get_sv("!", TRUE));
+            Perl_croak(aTHX_ "Failed to dup STDIN: %" SVf, get_sv("!", TRUE));
         }
 
         /* similar to PerlIO::scalar, the PerlIO::Apache layer doesn't
@@ -137,7 +137,7 @@
     status = Perl_do_open9(aTHX_ handle, "<:Apache2", 9, FALSE, O_RDONLY,
                            0, Nullfp, sv, 1);
     if (status == 0) {
-        Perl_croak(aTHX_ "Failed to open STDIN: %_", get_sv("!", TRUE));
+        Perl_croak(aTHX_ "Failed to open STDIN: %" SVf, get_sv("!", TRUE));
     }
 
     MP_TRACE_o(MP_FUNC, "end\n");
@@ -167,7 +167,7 @@
         status = Perl_do_open(aTHX_ handle_save, ">&STDOUT", 8, FALSE,
                               O_WRONLY, 0, Nullfp);
         if (status == 0) {
-            Perl_croak(aTHX_ "Failed to dup STDOUT: %_", get_sv("!", TRUE));
+            Perl_croak(aTHX_ "Failed to dup STDOUT: %" SVf, get_sv("!", TRUE));
         }
 
         /* similar to PerlIO::scalar, the PerlIO::Apache layer doesn't
@@ -180,7 +180,7 @@
     status = Perl_do_open9(aTHX_ handle, ">:Apache2", 9, FALSE, O_WRONLY,
                            0, Nullfp, sv, 1);
     if (status == 0) {
-        Perl_croak(aTHX_ "Failed to open STDOUT: %_", get_sv("!", TRUE));
+        Perl_croak(aTHX_ "Failed to open STDOUT: %" SVf, get_sv("!", TRUE));
     }
 
     MP_TRACE_o(MP_FUNC, "end\n");
@@ -221,7 +221,7 @@
                         GvNAME(handle), GvNAMELEN(handle), G_DISCARD);
 
         if (err != Nullsv) {
-            Perl_croak(aTHX_ "Failed to restore STDIN: %_", err);
+            Perl_croak(aTHX_ "Failed to restore STDIN: %" SVf, err);
         }
     }
 
@@ -243,7 +243,7 @@
      */
     if (GvIOn(handle_orig) && IoOFP(GvIOn(handle_orig)) &&
         (PerlIO_flush(IoOFP(GvIOn(handle_orig))) == -1)) {
-        Perl_croak(aTHX_ "Failed to flush STDOUT: %_", get_sv("!", TRUE));
+        Perl_croak(aTHX_ "Failed to flush STDOUT: %" SVf, get_sv("!", TRUE));
     }
 
     /* close the overriding filehandle */
@@ -268,7 +268,7 @@
                         GvNAME(handle), GvNAMELEN(handle), G_DISCARD);
 
         if (err != Nullsv) {
-            Perl_croak(aTHX_ "Failed to restore STDOUT: %_", err);
+            Perl_croak(aTHX_ "Failed to restore STDOUT: %" SVf, err);
         }
     }
 

Modified: perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_mgv.c
URL: http://svn.apache.org/viewcvs/perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_mgv.c?rev=209866&r1=209865&r2=209866&view=diff
==============================================================================
--- perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_mgv.c (original)
+++ perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_mgv.c Fri Jul  8 12:19:31
2005
@@ -320,8 +320,17 @@
             MpHandlerMETHOD_On(handler);
         }
 
+        if (!stash) {
+            return 0;
+        }
+        
+        
         if (MpHandlerMETHOD(handler) && !handler->mgv_obj) {
-            modperl_mgv_new_name(handler->mgv_obj, p, HvNAME(stash));
+            char *name = HvNAME(stash);
+            if (!name) {
+                name = "";
+            }
+            modperl_mgv_new_name(handler->mgv_obj, p, name);
         }
 
         handler->attrs = (U32)MP_CODE_ATTRS(cv);

Modified: perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_util.c
URL: http://svn.apache.org/viewcvs/perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_util.c?rev=209866&r1=209865&r2=209866&view=diff
==============================================================================
--- perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_util.c (original)
+++ perl/modperl/branches/clone-skip-unstable/src/modules/perl/modperl_util.c Fri Jul  8 12:19:31
2005
@@ -136,7 +136,7 @@
             break;
           default:
             Perl_croak(aTHX_ "panic: unsupported request_rec type %d",
-                       SvTYPE(rv));
+                       (int)SvTYPE(rv));
         }
     }
 
@@ -408,7 +408,7 @@
     register HE *entry;
 
     xhv = (XPVHV *)SvANY(hv);
-    if (!xhv->xhv_array) {
+    if (!HvARRAY(hv)) {
         return 0;
     }
 
@@ -422,7 +422,7 @@
 	PERL_HASH(hash, key, klen);
     }
 
-    entry = ((HE**)xhv->xhv_array)[hash & (I32)xhv->xhv_max];
+    entry = ((HE**)HvARRAY(hv))[hash & (I32)xhv->xhv_max];
 
     for (; entry; entry = HeNEXT(entry)) {
         if (HeHASH(entry) != hash) {
@@ -633,7 +633,7 @@
     if (r->finfo.size != size) {
         SvREFCNT_dec(sv); 
         Perl_croak(aTHX_ "Error: read %d bytes, expected %d ('%s')",
-                   size, r->finfo.size, r->filename);
+                   size, (apr_size_t)r->finfo.size, r->filename);
     }
 
     rc = apr_file_close(file);

Modified: perl/modperl/branches/clone-skip-unstable/xs/APR/Socket/APR__Socket.h
URL: http://svn.apache.org/viewcvs/perl/modperl/branches/clone-skip-unstable/xs/APR/Socket/APR__Socket.h?rev=209866&r1=209865&r2=209866&view=diff
==============================================================================
--- perl/modperl/branches/clone-skip-unstable/xs/APR/Socket/APR__Socket.h (original)
+++ perl/modperl/branches/clone-skip-unstable/xs/APR/Socket/APR__Socket.h Fri Jul  8 12:19:31
2005
@@ -43,7 +43,7 @@
         if (buf_len < SvIV(sv_len)) {
             Perl_croak(aTHX_ "the 3rd arg (%d) is bigger than the "
                        "length (%d) of the 2nd argument",
-                       SvIV(sv_len), buf_len);
+                       (int)SvIV(sv_len), buf_len);
         }
         buf_len = SvIV(sv_len);
     }

Modified: perl/modperl/branches/clone-skip-unstable/xs/ModPerl/Util/ModPerl__Util.h
URL: http://svn.apache.org/viewcvs/perl/modperl/branches/clone-skip-unstable/xs/ModPerl/Util/ModPerl__Util.h?rev=209866&r1=209865&r2=209866&view=diff
==============================================================================
--- perl/modperl/branches/clone-skip-unstable/xs/ModPerl/Util/ModPerl__Util.h (original)
+++ perl/modperl/branches/clone-skip-unstable/xs/ModPerl/Util/ModPerl__Util.h Fri Jul  8 12:19:31
2005
@@ -18,7 +18,7 @@
     Perl_newSVpvf(aTHX_ "0x%lx", (unsigned long)aTHX)
 #else
 #define mpxs_ModPerl__Util_current_perl_id() \
-    Perl_newSVpvf(aTHX_ "0x%lx", 0)
+    Perl_newSVpvf(aTHX_ "0x%lx", (unsigned long)0)
 #endif
 
 static MP_INLINE void mpxs_ModPerl__Util_untaint(pTHX_ I32 items,



Mime
View raw message