richter     2004/11/07 11:36:42

  Modified:    .        Changes.pod MANIFEST Makefile.PL epio.c test.pl
               eg/web   menuleft.epl
               test/conf httpd.conf.src
  Added:       .        embpfastcgi.test.pl.templ
  Log:
  CGI Tests, FastCGI POST fix
  
  Revision  Changes    Path
  1.255     +5 -1      embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.254
  retrieving revision 1.255
  diff -u -r1.254 -r1.255
  --- Changes.pod       4 Nov 2004 06:19:14 -0000       1.254
  +++ Changes.pod       7 Nov 2004 19:36:42 -0000       1.255
  @@ -1,11 +1,15 @@
   =pod
   
  -=head1 2.0rc2  04. November 2004
  +=head1 2.0rc2  06. November 2004
   
      - Flush output to client and send final chuck, before cleanup runs.
      - Fix compiler error when compiling with Perl 5.005.
      - Fix html input tag value set, when %fdat value is 0. Reported
        by Torsten Luettgert.
  +   - Fix test, for Apache 1.3 with static mod_perl and other dynamic
  +     modules, but loading Embperl first. Reported by Christophe Le Bars.
  +   - Fix FastCGI read of POST data, reported by Doug Rayner.
  +   - Readded tests for CGI mode.
   
   =head1 2.0rc1  24. August 2004
   
  
  
  
  1.97      +1 -0      embperl/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /home/cvs/embperl/MANIFEST,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- MANIFEST  17 Aug 2004 06:17:58 -0000      1.96
  +++ MANIFEST  7 Nov 2004 19:36:42 -0000       1.97
  @@ -162,6 +162,7 @@
   embpexec.bat.templ
   embpexec.pl.templ
   embpfastcgi.pl.templ
  +embpfastcgi.test.pl.templ
   embpmsgid.pl.templ
   ep.h
   ep2.h
  
  
  
  1.74      +2 -2      embperl/Makefile.PL
  
  Index: Makefile.PL
  ===================================================================
  RCS file: /home/cvs/embperl/Makefile.PL,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- Makefile.PL       17 Aug 2004 06:17:58 -0000      1.73
  +++ Makefile.PL       7 Nov 2004 19:36:42 -0000       1.74
  @@ -1311,7 +1311,7 @@
   
   @bins = ('embpexec.pl','embpexec.bat', 
            'embpcgi.pl', 'embpcgi.test.pl', 'embpcgi.bat',
  -      'embpfastcgi.pl', 'embpmsgid.pl',
  +      'embpfastcgi.pl', 'embpfastcgi.test.pl','embpmsgid.pl',
            'epocgi.pl', 'epocgi.test.pl', 'epocgi.bat') ;
   
   
  
  
  
  1.30      +2 -1      embperl/epio.c
  
  Index: epio.c
  ===================================================================
  RCS file: /home/cvs/embperl/epio.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- epio.c    31 Oct 2004 14:17:25 -0000      1.29
  +++ epio.c    7 Nov 2004 19:36:42 -0000       1.30
  @@ -485,6 +485,7 @@
        PUSHMARK(sp);
        XPUSHs(r -> Component.ifdobj);
        XPUSHs(sv_2mortal(pBufSV = NEWSV(0, 0)));
  +     XPUSHs(sv_2mortal(newSViv (size)));
        PUTBACK;
        num = perl_call_method ("READ", G_SCALAR) ; 
        SPAGAIN;
  
  
  
  1.147     +37 -15    embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.146
  retrieving revision 1.147
  diff -u -r1.146 -r1.147
  --- test.pl   4 Nov 2004 06:19:14 -0000       1.146
  +++ test.pl   7 Nov 2004 19:36:42 -0000       1.147
  @@ -68,6 +68,13 @@
           'repeat'     => 3,
           'errors'     => 5,
           'version'    => 2,
  +        'cgi'        => 0,
  +        },
  +    'error.htm' => { 
  +        'repeat'     => 3,
  +        'errors'     => 6,
  +        'version'    => 2,
  +        'cgi'        => 1,
           },
       'errormismatch.htm' => { 
           'errors'     => '1',
  @@ -699,10 +706,12 @@
           },
       'EmbperlObject/epoincdiv.htm' => { 
           'offline'    => 0,
  +        'cgi'        => 0, # input_escmode is not passed automaticly to 
included script in cgi mode
           },
       'EmbperlObject/epofdat.htm' => {
           'offline'    => 0,
           'query_info' => 'a=1&b=2',
  +        'cgi'        => 0, # input_escmode is not passed automaticly to 
included script in cgi mode
           },
       'EmbperlObject/epodiv.htm' => { 
           'offline'    => 0,
  @@ -1039,6 +1048,7 @@
       'app/i18n.htm' => { 
           'version'    => 2,
           'app_handler_class' => 'Embperl::TEST::App',
  +        'cgi'        => 0,
           },
       'xhtml.htm' => { 
           'version'    => 2,
  @@ -1202,8 +1212,9 @@
   
   #### setup path in URL ####
   
  -$embploc = 'embperl' ;
  -$cgiloc  = 'cgi-bin' ; 
  +$embploc     = 'embperl' ;
  +$cgiloc      = 'cgi-bin' ; 
  +$fastcgiloc  = 'fastcgi-bin' ; 
   
   $port    = $EPPORT ;
   $host    = 'localhost' ;
  @@ -1763,7 +1774,7 @@
        $opt_modperl = 1 ;      
        }
       elsif ($EPAPACHEVERSION)
  -        { $opt_cache = $opt_modperl =  $opt_offline = $opt_execute = 1 }
  +        { $opt_cache = $opt_modperl = $opt_cgi =  $opt_offline = 
$opt_execute = 1 }
       else
           { $opt_cache = $opt_offline = $opt_execute = 1 }
       #$opt_ep1 = 1 ;
  @@ -2664,8 +2675,10 @@
        {
        if ($loc eq $embploc)
            { print "\nTesting mod_perl mode...\n\n" ; }
  -     else
  +     elsif ($loc eq $cgiloc)
            { print "\nTesting cgi mode...\n\n" ; }
  +     else
  +         { print "\nTesting FastCGI mode...\n\n" ; }
   
        $cookie = undef ;
           $t_req = 0 ;
  @@ -2680,14 +2693,14 @@
               $testnum++ ;
               $testversion = $version == 2 && !$ep1compat?2:1 ;
   
  -            last if ($testnum > 8 && $loc ne $embploc) ; 
  +            #last if ($testnum > 8 && $loc ne $embploc) ; 
               next if ($test->{noloop} && $loopcnt > 0) ;
               next if ($test->{version} && $testversion != $test->{version}) ;
               next if ($loc eq $embploc && 
                         ((defined ($test -> {modperl}) && $test -> {modperl} 
== 0) ||
                           (!$test -> {modperl} && ($test -> {offline} || $test 
-> {cgi})))) ;
   
  -            next if ($loc eq $cgiloc && 
  +            next if (($loc eq $cgiloc || $loc eq $fastcgiloc) && 
                         ((defined ($test -> {cgi}) && $test -> {cgi} == 0) ||
                           (!$test -> {cgi} && ($test -> {offline} || $test -> 
{modperl})))) ;
               
  @@ -2700,11 +2713,11 @@
                   
    
            #next if ($file eq 'chdir.htm' && $EPWIN32) ;
  -         next if ($file eq 'notfound.htm' && $loc eq $cgiloc && $EPWIN32) ;
  +         next if ($file eq 'notfound.htm' && ($loc eq $cgiloc || $loc eq 
$fastcgiloc) && $EPWIN32) ;
            next if ($file =~ /opmask/ && $EPSTARTUP =~ /_dso/) ;
            if ($file =~ /sess\.htm/)
                   { 
  -                next if ($loc eq $cgiloc && $EPSESSIONCLASS ne 'Embperl') ;
  +                next if (($loc eq $cgiloc || $loc eq $fastcgiloc) && 
$EPSESSIONCLASS ne 'Embperl') ;
                   if (!$EPSESSIONXVERSION)
                       {
                    $txt2 = "$file...";
  @@ -2715,7 +2728,7 @@
                   }
        
               $errcnt = $test -> {errors} || 0 ;
  -         $errcnt = -1 if ($EPWIN32 && $loc eq $cgiloc) ;
  +         $errcnt = -1 if ($EPWIN32 && ($loc eq $cgiloc || $loc eq 
$fastcgiloc)) ;
   
            $debug = $test -> {debug} || $defaultdebug ;  
            $page = "$inpath/$file" ;
  @@ -2804,8 +2817,9 @@
                last ;
                }
   
  -         #$errcnt++ if ($loc eq $cgiloc && $file eq 'notallow.xhtm') ;   
  +         #$errcnt++ if (($loc eq $cgiloc || $loc eq $fastcgiloc) && $file eq 
'notallow.xhtm') ;   
            sleep ($test->{sleep4err}) if ($test->{sleep4err}) ;
  +            sleep (1) if (($loc eq $cgiloc || $loc eq $fastcgiloc) && 
$errcnt) ;
               $err = CheckError ($errcnt) if (($err == 0 || $file eq 
'notfound.htm' || $file eq 'notallow.xhtm')) ;
            if ($err == 0 && $file ne 'notfound.htm' && $file ne 
'notallow.xhtm' && !defined ($opt_ab))
                {
  @@ -2835,11 +2849,19 @@
            $n_cgi = $n_req ;
            }
   
  -     if ($opt_cgi && $err == 0 && $loc ne $cgiloc && $loopcnt == 0)   
  +     if ($opt_cgi && $err == 0 && $loc eq $embploc && $loopcnt == 0)   
            { 
  -         #$loc = $EP2?'':$cgiloc ; # currently disable cgi mode at all for 
Embperl 2.x
  -         $loc = $cgiloc ; 
  -         }
  +            $loc = $cgiloc ; 
  +            }
  +     #elsif ($opt_cgi && $err == 0 && $loc eq $cgiloc && $loopcnt == 0)   
  +     #    { 
  +        #    eval "require FCGI" ;
  +        #    $loc = [EMAIL PROTECTED]'':$fastcgiloc ; 
  +        #    if (!$loc)
  +        #        {
  +        #        print "\nSkip FastCGI Tests, FCGI.pm not installed\n" ;
  +        #        }
  +        #    }
        else
            {
            $loc = '' ;
  
  
  
  1.1                  embperl/embpfastcgi.test.pl.templ
  
  Index: embpfastcgi.test.pl.templ
  ===================================================================
  #!/opt/perlt5.8.3/bin/perl5.8.3 
  
###################################################################################
  #
  #   Embperl - Copyright (c) 1997-2004 Gerald Richter / ECOS
  #
  #   You may distribute under the terms of either the GNU General Public
  #   License or the Artistic License, as specified in the Perl README file.
  #   For use with Apache httpd and mod_perl, see also Apache copyright.
  #
  #   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
  #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  #
  #   $Id: embpfastcgi.test.pl.templ,v 1.1 2004/11/07 19:36:42 richter Exp $
  #
  
###################################################################################
  
  
  BEGIN 
      {
      use ExtUtils::testlib ;
  
      my $cwd       = $ENV{EMBPERL_SRC} ;
      my $i = 0 ;
      foreach (@INC)
          {
          $INC[$i] = "$cwd/$_" if (/^\.?\/?blib/) ;

          $INC[$i] =~ s#//#/#g ;

          $i++ ;
          }
      %Embperl::initparam = (use_env => 1, use_redirect_env => 1) ;
      } 
  
  use FCGI ;
  use Embperl;
  
  my $request = FCGI::Request ;
  while ($request -> Accept() >= 0)
      {
      my $rc = Embperl::Execute ({use_env => 1, use_redirect_env => 1}) ;
  
      if ($rc)
          {
          $time = localtime ;
  
          print <<EOT;
      Status: $rc
      Content-Type: text/html
  
      <HTML><HEAD><TITLE>Embperl Error</TITLE></HEAD>
      <BODY bgcolor=\"#FFFFFF\">
      <H1>embpcgi Server Error: $rc</H1>
      Please contact the server administrator, $ENV{SERVER_ADMIN} and inform 
them of the time the error occurred, and anything you might have done that may 
have caused the error.<P><P>
      $ENV{SERVER_SOFTWARE} Embperl $Embperl::VERSION [$time]<P>
      </BODY></HTML>
  
  EOT
          }
      }
  
  
  
  
  
  
  1.12      +1 -1      embperl/eg/web/menuleft.epl
  
  Index: menuleft.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/menuleft.epl,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- menuleft.epl      24 Aug 2004 05:15:51 -0000      1.11
  +++ menuleft.epl      7 Nov 2004 19:36:42 -0000       1.12
  @@ -80,7 +80,7 @@
       <tr> 
           <td><img src="[+ $r -> {imageuri} +]linie-nav.gif" width="152" 
height="1"></td>
       </tr>
  -    [- menuitem ($r -> {baseuri} . 'pod/doc/Embperl.-page-13-.htm', 'Beta 
2.0rc1', 0, 1) -]
  +    [- menuitem ($r -> {baseuri} . 'pod/doc/Embperl.-page-13-.htm', 'Beta 
2.0rc2', 0, 1) -]
       <tr>
           <td><img src="[+ $r -> {imageuri} +]linie-nav.gif" width="152" 
height="1"></td>
       </tr>
  
  
  
  1.54      +119 -7    embperl/test/conf/httpd.conf.src
  
  Index: httpd.conf.src
  ===================================================================
  RCS file: /home/cvs/embperl/test/conf/httpd.conf.src,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- httpd.conf.src    6 Nov 2004 13:33:07 -0000       1.53
  +++ httpd.conf.src    7 Nov 2004 19:36:42 -0000       1.54
  @@ -77,7 +77,8 @@
   EMBPERL_LOG \"$EPPATH/test/tmp/test.log\"
   EMBPERL_INPUT_ESCMODE 7
   
  -ErrorLog tmp/httpd.err.log
  +ErrorLog tmp/httpd.err.log

  +ScriptLog \"$EPPATH/test/tmp/httpd.script.log\"
   PidFile tmp/httpd.pid
   EOD
   
  @@ -224,11 +225,6 @@
   EMBPERL_INPUT_ESCMODE 0
   </Location>
   
  -<Location /cgi-bin/rawinput>
  -SetEnv EMBPERL_OPTIONS 16
  -SetEnv EMBPERL_INPUT_ESCMODE 0
  -</Location>
  -
   <Location /embperl/nochdir>
   SetHandler perl-script
   PerlHandler Embperl
  @@ -431,6 +427,12 @@
   <Location /cgi-bin>
   Action text/html /cgi/embpcgi.test.pl
   Options ExecCGI
  +SetEnv EMBPERL_DEBUG $EPDEBUG

  +SetEnv EMBPERL_LOG \"$EPPATH/test/tmp/test.log\"

  +SetEnv EMBPERL_INPUT_ESCMODE 7

  +SetEnv Embperl_Cookie_Path /

  +SetEnv EMBPERL_ALLOW (asc|\\.xml\$|\\.htm\$)

  +

   EOD
   
   if ($EPSESSIONXVERSION)
  @@ -484,12 +486,18 @@
   
   </Location>
   
  +<Location /cgi-bin/rawinput>

  +SetEnv EMBPERL_OPTIONS 16

  +SetEnv EMBPERL_INPUT_ESCMODE 0

  +</Location>

  +

   
   <Location /cgi-bin/EmbperlObject>
   Action text/html /cgi/epocgi.test.pl
   Options ExecCGI
   SetEnv EMBPERL_OBJECT_BASE epobase.htm
   SetEnv EMBPERL_OBJECT_FALLBACK epofallback.htm
  +SetEnv EMBPERL_INPUT_ESCMODE 7

   </Location>
   
   
  @@ -512,6 +520,110 @@
   </Location>
   
   
  +### fastcgi setup ###

  +

  +Alias /fastcgi-bin/uidurl/ \"$EPPATH/test/html/sidurl/\"

  +Alias /fastcgi-bin/suidurl/ \"$EPPATH/test/html/sidurl/\"

  +Alias /fastcgi-bin/ \"$EPPATH/test/html/\"

  +Alias /fastcgi-bin2/ \"$EPPATH/test/html2/\"

  +Alias /fastcgi-bin-32/ \"$EPPATH/test/html/\"

  +ScriptAlias /cgi/ \"$EPPATH/\"

  +

  +<Location /fastcgi-bin>

  +Action text/html /cgi/embpfastcgi.test.pl

  +Options ExecCGI

  +SetEnv EMBPERL_DEBUG $EPDEBUG

  +SetEnv EMBPERL_LOG \"$EPPATH/test/tmp/test.log\"

  +SetEnv EMBPERL_INPUT_ESCMODE 7

  +SetEnv Embperl_Cookie_Path /

  +SetEnv EMBPERL_ALLOW (asc|\\.xml\$|\\.htm\$)

  +

  +EOD

  +

  +if ($EPSESSIONXVERSION)

  +    {

  +print OFH <<EOD ;

  +

  +SetEnv EMBPERL_SESSION_CLASSES "File Null"

  +SetEnv EMBPERL_SESSION_ARGS "'Directory=$EPPATH/test/tmp'"

  +EOD

  +    }

  +else

  +    {

  +print OFH <<EOD ;

  +

  +SetEnv EMBPERL_SESSION_HANDLER_CLASS no

  +EOD

  +    }

  +

  +

  +print OFH <<EOD ;

  +

  +SetEnv EMBPERL_ALLOW (asc|\\.xml\$|\\.htm\$)

  +

  +</Location>

  +

  +<Location /fastcgi-bin2>

  +Action text/html /cgi/embpfastcgi.test.pl

  +Options ExecCGI

  +EOD

  +

  +if ($EPSESSIONVERSION && ($EPSESSIONVERSION > 1))

  +    {

  +print OFH <<EOD ;

  +

  +SetEnv EMBPERL_SESSION_CLASSES "File Null"

  +SetEnv EMBPERL_SESSION_ARGS "'Directory=$EPPATH/test/tmp'"

  +EOD

  +    }

  +else

  +    {

  +print OFH <<EOD ;

  +

  +SetEnv EMBPERL_SESSION_HANDLER_CLASS no

  +EOD

  +    }

  +

  +

  +print OFH <<EOD ;

  +

  +SetEnv EMBPERL_ALLOW (asc|\\.xml\$|\\.htm\$)

  +

  +</Location>

  +

  +<Location /fastcgi-bin/rawinput>

  +SetEnv EMBPERL_OPTIONS 16

  +SetEnv EMBPERL_INPUT_ESCMODE 0

  +</Location>

  +

  +

  +<Location /fastcgi-bin/EmbperlObject>

  +Action text/html /cgi/epofastcgi.test.pl

  +Options ExecCGI

  +SetEnv EMBPERL_OBJECT_BASE epobase.htm

  +SetEnv EMBPERL_OBJECT_FALLBACK epofallback.htm

  +</Location>

  +

  +

  +<Location /fastcgi-bin-32>

  +Action text/html /cgi/embpfastcgi.test.bat

  +Options ExecCGI

  +</Location>

  +

  +

  +<Location /fastcgi-bin/SSI/>

  +SetEnv EMBPERL_SYNTAX SSI

  +</Location>

  +

  +<Location /fastcgi-bin/SSIEP/>

  +SetEnv EMBPERL_SYNTAX "Embperl SSI"

  +</Location>

  +

  +<Location /fastcgi-bin/pod/>

  +SetEnv EMBPERL_SYNTAX POD

  +</Location>

  +

  +

   ### Status ###
   
   <Location /perl-status>
  
  
  

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

Reply via email to