richter     01/11/25 11:48:11

  Modified:    .        Tag: Embperl2c Changes.pod epcache.c
               Embperl/Recipe Tag: Embperl2c Embperl.pm EmbperlXSLT.pm
                        XSLT.pm
               driver   Tag: Embperl2c eplibxslt.c
               test/conf Tag: Embperl2c httpd.conf.src
  Log:
  fix file reload
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.129.4.40 +2 -0      embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.129.4.39
  retrieving revision 1.129.4.40
  diff -u -r1.129.4.39 -r1.129.4.40
  --- Changes.pod       2001/11/23 14:54:12     1.129.4.39
  +++ Changes.pod       2001/11/25 19:48:10     1.129.4.40
  @@ -15,6 +15,8 @@
      - Fixed path problem with Execute ({sub => foo,... }) on win32.
      - Fixed a problem with duplicate subroutine names when running
        multiple pages in the same package.
  +   - Fixed problem with reloading when file changed, which sometimes
  +     didn't reload correctly in 2.0b4
   
   =head1 2.0b4 (BETA) 20. Nov. 2001
   
  
  
  
  1.1.2.15  +30 -8     embperl/Attic/epcache.c
  
  Index: epcache.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcache.c,v
  retrieving revision 1.1.2.14
  retrieving revision 1.1.2.15
  diff -u -r1.1.2.14 -r1.1.2.15
  --- epcache.c 2001/11/16 08:08:07     1.1.2.14
  +++ epcache.c 2001/11/25 19:48:10     1.1.2.15
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epcache.c,v 1.1.2.14 2001/11/16 08:08:07 richter Exp $
  +#   $Id: epcache.c,v 1.1.2.15 2001/11/25 19:48:10 richter Exp $
   #
   
###################################################################################*/
   
  @@ -212,15 +212,26 @@
           sKey = SvPV(pKey, len) ;
           if (pNew = Cache_GetByKey (r, sKey))
               {
  +         char * exfn ;
   
               pNew -> nExpiresInTime      = GetHashValueInt (pParam, "expires_in", 0) 
;
               if (pNew -> pExpiresCV)
                   SvREFCNT_dec (pNew -> pExpiresCV) ;
               if ((rc = GetHashValueCREF  (r, pParam, "expires_func", &pNew -> 
pExpiresCV)) != ok)
                   return rc ;
  -            if (pNew -> sExpiresFilename)
  -                free ((void *)pNew -> sExpiresFilename) ;
  -            pNew -> sExpiresFilename    = GetHashValueStrDup  (pParam, 
"expires_filename", NULL) ;
  +            exfn = GetHashValueStrDup  (pParam, "expires_filename", NULL) ;
  +         if (pNew -> sExpiresFilename)
  +             {
  +             if (exfn)
  +                 {
  +                 lprintf (r, "exfn=%s\n", exfn) ;
  +                 free ((void *)pNew -> sExpiresFilename) ;
  +                 pNew -> sExpiresFilename    = exfn ;
  +                 }
  +             }
  +         else
  +             pNew -> sExpiresFilename    = exfn ;
  +
               pNew -> bCache              = GetHashValueInt   (pParam, "cache", 1) ;
   
               if (r -> bDebug & dbgCache)
  @@ -371,16 +382,25 @@
           if (pItem = Cache_GetByKey (r, SvPV(pKey, len)))
               {
               int bCache = pItem -> bCache ;
  +         char * exfn ;
   
               pItem -> nExpiresInTime      = GetHashValueInt (pSubProvider, 
"expires_in", 0) ;
               if (pItem -> pExpiresCV)
                   SvREFCNT_dec (pItem -> pExpiresCV) ;
               if ((rc = GetHashValueCREF  (r, pSubProvider, "expires_func", &pItem -> 
pExpiresCV)) != ok)
                   return rc ;
  -            if (pItem -> sExpiresFilename)
  -                free ((void *)pItem -> sExpiresFilename) ;
  -            pItem -> sExpiresFilename    = GetHashValueStrDup  (pSubProvider, 
"expires_filename", NULL) ;
  -            
  +            exfn = GetHashValueStrDup  (pSubProvider, "expires_filename", NULL) ;
  +         if (pItem -> sExpiresFilename)
  +             {
  +             if (exfn)
  +                 {
  +                 free ((void *)pItem -> sExpiresFilename) ;
  +                 pItem -> sExpiresFilename    = exfn ;
  +                 }
  +             }
  +         else
  +             pItem -> sExpiresFilename    = exfn ;
  +
               pItem -> bCache              = GetHashValueInt   (pSubProvider, 
"cache", 1) ;
               if (!pItem -> bCache && bCache)
                   Cache_FreeContent (r, pItem) ;
  @@ -628,6 +648,8 @@
            return pItem -> bExpired = TRUE ;
               }
   
  +        if (r -> bDebug & dbgCache)
  +            lprintf (r, "[%d]CACHE: %s stat file %s mtime=%d size=%d\n", r -> nPid, 
pItem -> sKey, pItem -> sExpiresFilename, pItem -> FileStat.st_mtime, pItem -> 
FileStat.st_size) ; 
           if (pItem -> nFileModified != pItem -> FileStat.st_mtime)
               {
               if (r -> bDebug & dbgCache)
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.7   +2 -2      embperl/Embperl/Recipe/Attic/Embperl.pm
  
  Index: Embperl.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Recipe/Attic/Embperl.pm,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- Embperl.pm        2001/11/23 11:43:55     1.1.2.6
  +++ Embperl.pm        2001/11/25 19:48:11     1.1.2.7
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: Embperl.pm,v 1.1.2.6 2001/11/23 11:43:55 richter Exp $
  +#   $Id: Embperl.pm,v 1.1.2.7 2001/11/25 19:48:11 richter Exp $
   #
   ###################################################################################
    
  @@ -106,7 +106,7 @@
               {
               $run -> {$_} = $param -> {$_} if (exists $param -> {$_}) ;
               }
  -        $run -> {'cache'} = $run -> {expires_in} || $run -> {expires_func} || $run 
-> {expires_filename}?1:0 ;
  +        $run -> {'cache'} = $run -> {expires_in} || $run -> {expires_func} || 
exists ($run -> {expires_filename})?1:0 ;
           $self = $run ;
           }
       else
  
  
  
  1.1.2.3   +3 -1      embperl/Embperl/Recipe/Attic/EmbperlXSLT.pm
  
  Index: EmbperlXSLT.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Recipe/Attic/EmbperlXSLT.pm,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- EmbperlXSLT.pm    2001/11/16 08:08:08     1.1.2.2
  +++ EmbperlXSLT.pm    2001/11/25 19:48:11     1.1.2.3
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: EmbperlXSLT.pm,v 1.1.2.2 2001/11/16 08:08:08 richter Exp $
  +#   $Id: EmbperlXSLT.pm,v 1.1.2.3 2001/11/25 19:48:11 richter Exp $
   #
   ###################################################################################
    
  @@ -39,12 +39,14 @@
   
       my $ep = HTML::Embperl::Recipe::Embperl -> new ($r, $recipe, $param) ;
       my $xsltproc = $param -> {xsltproc} ;
  +    my $xsltparam= $param -> {xsltparam} || \%HTML::Embperl::fdat ;
   
       my $self =
           {
           'provider' => 
               {
               'type' => $xsltproc,
  +            'param'  => $xsltparam,
               'source' => 
                   {
                   'cache'    => 0,
  
  
  
  1.1.2.3   +6 -4      embperl/Embperl/Recipe/Attic/XSLT.pm
  
  Index: XSLT.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Recipe/Attic/XSLT.pm,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- XSLT.pm   2001/11/23 07:51:00     1.1.2.2
  +++ XSLT.pm   2001/11/25 19:48:11     1.1.2.3
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: XSLT.pm,v 1.1.2.2 2001/11/23 07:51:00 richter Exp $
  +#   $Id: XSLT.pm,v 1.1.2.3 2001/11/25 19:48:11 richter Exp $
   #
   ###################################################################################
    
  @@ -41,6 +41,7 @@
       my $src ;
       my $file ;
       my $xsltproc = $param -> {xsltproc} ;
  +    my $xsltparam= $param -> {xsltparam} || \%HTML::Embperl::fdat ;
   
       if (!$param -> {inputfile} && $param->{sub}) 
           {
  @@ -72,11 +73,12 @@
           }
   
   
  -    my $self =
  +    $self =
           {
           'provider' => 
               {
  -            'type' => $xsltproc,
  +            'type'   => $xsltproc,
  +            'param'  => $xsltparam,
               'source' => 
                   {
                   'cache'    => 0,
  @@ -114,7 +116,7 @@
           {
           $self -> {$_} = $param -> {$_} if (exists $param -> {$_}) ;
           }
  -    $self -> {'cache'} = $self -> {expires_in} || $self -> {expires_func} || $self 
-> {expires_filename}?1:0 ;
  +    $self -> {'cache'} = $self -> {expires_in} || $self -> {expires_func} || exists 
($self -> {expires_filename})?1:0 ;
   
   
       return $self ;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.9   +89 -3     embperl/driver/Attic/eplibxslt.c
  
  Index: eplibxslt.c
  ===================================================================
  RCS file: /home/cvs/embperl/driver/Attic/eplibxslt.c,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- eplibxslt.c       2001/11/21 05:18:07     1.1.2.8
  +++ eplibxslt.c       2001/11/25 19:48:11     1.1.2.9
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: eplibxslt.c,v 1.1.2.8 2001/11/21 05:18:07 richter Exp $
  +#   $Id: eplibxslt.c,v 1.1.2.9 2001/11/25 19:48:11 richter Exp $
   #
   
###################################################################################*/
   
  @@ -264,6 +264,7 @@
       }
   
   
  +
   /* ------------------------------------------------------------------------ */
   /*                                                                          */
   /* ProviderLibXSLTXSL_GetContentPtr                                              */
  @@ -631,6 +632,7 @@
       {
       tProvider           Provider ;
       SV *                pOutputSV ;
  +    const char * *      pParamArray ;
       } tProviderLibXSLT ;
   
   /* ------------------------------------------------------------------------ */
  @@ -753,7 +755,91 @@
       }
   
   
  +/* ------------------------------------------------------------------------ */
  +/*                                                                          */
  +/* ProviderLibXSLT_UpdateParam                                           */
  +/*                                                                          */
  +/*! 
  +*   \_en
  +*   Update the parameter of the provider
  +*   
  +*   @param  r               Embperl request record
  +*   @param  pProvider       Provider record
  +*   @param  pParam          Parameter Hash
  +*                               param        hash with parameter 
  +*   @param  pKey            Key to which string should be appended
  +*   @return                 error code
  +*   \endif                                                                       
  +*
  +*   \_de                                                                        
  +*   Aktualisiert die Parameter des Providers
  +*   
  +*   @param  r               Embperl request record
  +*   @param  pProvider       Provider record
  +*   @param  pParam          Parameter Hash
  +*                               param        hash mit parametern 
  +*   @param  pKey            Schl�ssel zu welchem hinzugef�gt wird
  +*   @return                 Fehlercode
  +*   \endif                                                                       
  +*                                                                          
  +* ------------------------------------------------------------------------ */
   
  +static int ProviderLibXSLT_UpdateParam(/*in*/ req *              r,
  +                                   /*in*/ tProvider *        pProvider,
  +                                   /*in*/ HV *               pParam)
  +    {
  +    int                  rc ;
  +    SV           *  pSrc ;
  +    HV *         pParamHV ;
  +    HE *         pEntry ;
  +    char *       pKey ;
  +    SV *            pValue ;
  +    STRLEN          len ;
  +    IV                   l ;
  +    int                  n ;
  +    const char * *  pParamArray ;
  +    
  +    if ((rc = GetHashValueHREF  (r, pParam, "param", &pParamHV)) != ok)
  +        {
  +        if (!r->errdat1[0])
  +            strncpy (r -> errdat1, pProvider -> pCache -> sKey, sizeof (r -> 
errdat1) -1 ) ;
  +        return rc ;
  +        }
  +
  +    if (((tProviderLibXSLT *)pProvider) -> pParamArray)
  +     {
  +     free (((tProviderLibXSLT *)pProvider) -> pParamArray) ;
  +     ((tProviderLibXSLT *)pProvider) -> pParamArray = NULL ;
  +     }
  +
  +    if (pParamHV)
  +     {
  +     n = 0 ;
  +     hv_iterinit (pParamHV) ;
  +     while ((pEntry = hv_iternext (pParamHV)))
  +         {
  +         n++ ;
  +         }
  +        
  +     if (!(pParamArray = malloc(sizeof (const char *) * (n + 1) * 2)))
  +         return rcOutOfMemory ;
  +
  +     n = 0 ;
  +     hv_iterinit (pParamHV) ;
  +     while ((pEntry = hv_iternext (pParamHV)))
  +         {
  +         pKey     = hv_iterkey (pEntry, &l) ;
  +         pValue   = hv_iterval (pParamHV, pEntry) ;
  +         pParamArray[n++] = pKey ;
  +         pParamArray[n++] = SvPV (pValue, len) ;
  +         }
  +     pParamArray[n++] = NULL ;
  +     ((tProviderLibXSLT *)pProvider) -> pParamArray = pParamArray ;
  +     }
  +    return ok ;
  +    }
  +
  +
   /* ------------------------------------------------------------------------ */
   /*                                                                          */
   /* ProviderLibXSLT_GetContentSV                                                  */
  @@ -809,7 +895,7 @@
   
       ((tProviderLibXSLT *)pProvider) -> pOutputSV = newSV(1024) ;
   
  -    res = xsltApplyStylesheet(cur, doc, NULL) ; /*pParamArray);*/
  +    res = xsltApplyStylesheet(cur, doc, ((tProviderLibXSLT *)pProvider) -> 
pParamArray);
       if(res == NULL)
        {
        strncpy (r -> errdat1, "XSLT", sizeof (r -> errdat1)) ;
  @@ -872,7 +958,7 @@
       "text/*", 
       &ProviderLibXSLT_New, 
       &ProviderLibXSLT_AppendKey, 
  -    NULL,
  +    &ProviderLibXSLT_UpdateParam, 
       &ProviderLibXSLT_GetContentSV,
       NULL,
       NULL,
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.24.4.26 +28 -2     embperl/test/conf/httpd.conf.src
  
  Index: httpd.conf.src
  ===================================================================
  RCS file: /home/cvs/embperl/test/conf/httpd.conf.src,v
  retrieving revision 1.24.4.25
  retrieving revision 1.24.4.26
  diff -u -r1.24.4.25 -r1.24.4.26
  --- httpd.conf.src    2001/11/16 11:29:04     1.24.4.25
  +++ httpd.conf.src    2001/11/25 19:48:11     1.24.4.26
  @@ -466,12 +466,33 @@
   
   
   
  -<Location /eg>
  +<Location /eg/x>
   SetHandler perl-script
   PerlHandler HTML::Embperl
   Options ExecCGI
   </Location>
  -
  +
  +<Location /eg/xml>
  +SetHandler perl-script
  +PerlHandler HTML::Embperl
  +Options ExecCGI
  +SetEnv EMBPERL_XSLTSTYLESHEET \"$EPPATH/eg/xml/pod.xsl\"
  +SetEnv EMBPERL_XSLTPROC libxslt
  +SetEnv EMBPERL_RECIPE XSLT
  +</Location>
  +
  +<Files NEWS.xml>
  +SetEnv EMBPERL_XSLTSTYLESHEET \"$EPPATH/eg/xml/NEWS.xsl\"
  +</Files>
  +
  +<LocationMatch \"xalan\$\">
  +SetEnv EMBPERL_RECIPE XalanXSLT
  +</LocationMatch>
  +
  +<LocationMatch \"libxslt\$\">
  +SetEnv EMBPERL_RECIPE LibXSLT
  +</LocationMatch>
  +
   <Location /mp>
   SetHandler perl-script
   PerlHandler "sub { print 'Hello' }"
  @@ -486,6 +507,8 @@
   #TransferLog $EPNULL
   #ScoreBoardFile $EPNULL
   LockFile tmp/httpd.lock
  +LogFormat \"%h %l %u %t \\"%r\\" %s %b %{connection}o pid=%P %Tsec\" std
  +CustomLog tmp/httpd.acc.log std
   
   <IfModule apache_ssl.c>
   SSLDisable
  @@ -606,3 +629,6 @@
   
   EOD
   
  +
  +
  +
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to