richter     01/05/10 21:06:58

  Modified:    .        ep.h epmain.c test.pl
               test/cmp http.htm
               test/html http.htm
  Log:
  multiple headers in CGI mode
  
  Revision  Changes    Path
  1.36      +1 -0      embperl/ep.h
  
  Index: ep.h
  ===================================================================
  RCS file: /home/cvs/embperl/ep.h,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- ep.h      2001/04/27 06:37:57     1.35
  +++ ep.h      2001/05/11 04:06:49     1.36
  @@ -453,6 +453,7 @@
   
   #ifndef WIN32
   #define strnicmp strncasecmp
  +#define stricmp strcasecmp
   #endif
   
   void Dirname (/*in*/ const char * filename,
  
  
  
  1.100     +34 -13    embperl/epmain.c
  
  Index: epmain.c
  ===================================================================
  RCS file: /home/cvs/embperl/epmain.c,v
  retrieving revision 1.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- epmain.c  2001/05/10 19:08:15     1.99
  +++ epmain.c  2001/05/11 04:06:51     1.100
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epmain.c,v 1.99 2001/05/10 19:08:15 richter Exp $
  +#   $Id: epmain.c,v 1.100 2001/05/11 04:06:51 richter Exp $
   #
   
###################################################################################*/
   
  @@ -2711,9 +2711,9 @@
                    if (pHeader && pKey)
                        {                           
   
  -                     if (strnicmp (pKey, "location", 8) == 0)
  +                     if (stricmp (pKey, "location") == 0)
                            loc = 1;
  -                     if (strnicmp (pKey, "content-type", 12) == 0)  
  +                     if (stricmp (pKey, "content-type") == 0)  
                            {
                            p = NULL;
                            if ( SvROK(pHeader) && SvTYPE(SvRV(pHeader)) == SVt_PVAV ) 
  @@ -2814,18 +2814,39 @@
   
                        if (pHeader && pKey)
                            {                       
  -                         p = SvPV (pHeader, na) ;
  -                         if (strnicmp (pKey, "content-type", 12) == 0)
  -                             pContentType = p ;
  +                         if (SvROK(pHeader)  && SvTYPE(SvRV(pHeader)) == SVt_PVAV ) 
  +                             {
  +                             AV * arr = (AV *)SvRV(pHeader);
  +                             I32 len = av_len(arr);
  +                             int i ;
  +
  +                             for (i = 0; i <= len; i++) 
  +                                 {
  +                                 SV ** svp = av_fetch(arr, i, 0);
  +                                 p = SvPV(*svp, ldummy);
  +                                 oputs (r, pKey) ;
  +                                 oputs (r, ": ") ;
  +                                 oputs (r, p) ;
  +                                 oputs (r, "\n") ;
  +                                 if (r -> bDebug & dbgHeadersIn)
  +                                     lprintf (r,  "[%d]HDR:  %s: %s\n", r -> nPid, 
pKey, p) ; 
  +                                 }
  +                             } 
                            else
  -                             {
  -                             oputs (r, pKey) ;
  -                             oputs (r, ": ") ;
  -                             oputs (r, p) ;
  -                             oputs (r, "\n") ;
  +                             {                                   
  +                             p = SvPV (pHeader, na) ;
  +                             if (stricmp (pKey, "content-type") == 0)
  +                                 pContentType = p ;
  +                             else
  +                                 {
  +                                 oputs (r, pKey) ;
  +                                 oputs (r, ": ") ;
  +                                 oputs (r, p) ;
  +                                 oputs (r, "\n") ;
  +                                 }
  +                             if (r -> bDebug & dbgHeadersIn)
  +                                 lprintf (r,  "[%d]HDR:  %s: %s\n", r -> nPid, 
pKey, p) ; 
                                }
  -                         if (r -> bDebug & dbgHeadersIn)
  -                             lprintf (r,  "[%d]HDR:  %s: %s\n", r -> nPid, pKey, p) 
; 
                            }
                        }
                    
  
  
  
  1.103     +2 -2      embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.102
  retrieving revision 1.103
  diff -u -r1.102 -r1.103
  --- test.pl   2001/05/10 19:08:18     1.102
  +++ test.pl   2001/05/11 04:06:51     1.103
  @@ -11,7 +11,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: test.pl,v 1.102 2001/05/10 19:08:18 richter Exp $
  +#   $Id: test.pl,v 1.103 2001/05/11 04:06:51 richter Exp $
   #
   ###################################################################################
   
  @@ -329,7 +329,7 @@
           'offline'    => 0,
           'version'    => 1,
           'reqbody'    => "a=b",  # Force POST, so no redirect happens
  -        'respheader' => { 'location' => 'http://www.ecos.de/embperl/', 'h1' => 
'v0', h2 => [ 'v1', 'v2'] },
  +        'respheader' => { 'locationx' => 'http://www.ecos.de/embperl/', 'h1' => 
'v0', h2 => [ 'v1', 'v2'] },
           },
       'div.htm' => { 
           'repeat'    => 2,
  
  
  
  1.7       +1 -1      embperl/test/cmp/http.htm
  
  Index: http.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/cmp/http.htm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- http.htm  2001/05/10 19:08:36     1.6
  +++ http.htm  2001/05/11 04:06:55     1.7
  @@ -15,7 +15,7 @@
        </tr>
   
        <tr>
  -             <td>Location</td><td>http://www.ecos.de/embperl/</td>
  +             <td>Locationx</td><td>http://www.ecos.de/embperl/</td>
        </tr>
   
        <tr>
  
  
  
  1.6       +1 -1      embperl/test/html/http.htm
  
  Index: http.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/http.htm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- http.htm  2001/05/10 19:08:38     1.5
  +++ http.htm  2001/05/11 04:06:57     1.6
  @@ -10,7 +10,7 @@
   <meta http-equiv="Formatter" content="Embperl">
   
   [- 
  -$http_headers_out{'Location'} = "http://www.ecos.de/embperl/"; ;
  +$http_headers_out{'Locationx'} = "http://www.ecos.de/embperl/"; ;
   $http_headers_out{'h1'} = "v0" ;
   $http_headers_out{'h2'} = ['v1', 'v2'] ;
   -]
  
  
  

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

Reply via email to