perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ___cliff rayman___ <cl...@rayman.com>
Subject Re: Need to send "404 Not Found" instead of "ERR: 12 open error
Date Tue, 04 Oct 2005 01:26:08 GMT
Gerald Richter wrote:

>Hi,
>  
>
>>>We are receiving "ERR 12" open errors from Embperl instead of
>>> "404 Not Found" errors.
>>> Is anyone having the same problem?  Does anyone know what is wrong 
>>>with our configuration?
>>>
>>>      
>>>
>
>The attached patch should solve the problem
>  
>
Hi Gerald,

I finally got around to patching Embperl2.0rc1 and make test returns the 
following:

Testing offline mode...

#0 ascii...                   ok
#1 pure.htm...                ok
#2 nooutput.htm...            ok
#3 nooutput.htm...            ok
#4 plain.htm...               ok
#5 plain.htm...               ok
#6 plain.htm...               ok
#7 plainblock.htm...          ok
#8 plainblock.htm...          ok
#12 error.htm...              make: *** [test_dynamic] Segmentation
fault




>------------------------------------------------------------------------
>
>Index: embperl.h
>===================================================================
>RCS file: /home/cvs/embperl/embperl.h,v
>retrieving revision 1.36
>diff -r1.36 embperl.h
>98a99
>  
>
>>    rcTokenNotFound,  
>>    
>>
>Index: epio.c
>===================================================================
>RCS file: /home/cvs/embperl/epio.c,v
>retrieving revision 1.31
>diff -r1.31 epio.c
>603a604,607
>  
>
>>        if (errno == EACCES)
>>            return rcForbidden ;
>>        else if (errno == ENOENT)
>>            return rcNotFound ;
>>    
>>
>Index: epmain.c
>===================================================================
>RCS file: /home/cvs/embperl/epmain.c,v
>retrieving revision 1.141
>diff -r1.141 epmain.c
>749c750,751
>< static int GenerateErrorPage (/*i/o*/ register req * r)
>---
>  
>
>>static int GenerateErrorPage (/*i/o*/ register req * r,
>>               		      /*in*/  int    rc)
>>    
>>
>755a758,763
>  
>
>>#ifdef APACHE
>>	if (r -> pApacheReq && rc >= 400)
>>	    r -> pApacheReq -> status = rc ;
>>        else
>>            r -> pApacheReq -> status = 500 ;
>>#endif
>>    
>>
>804,807d811
>< #ifdef APACHE
>< 	if (r -> pApacheReq)
>< 	    r -> pApacheReq -> status = 500 ;
>< #endif
>1152c1156
><         GenerateErrorPage (r) ;
>---
>  
>
>>        GenerateErrorPage (r, rc) ;
>>    
>>
>Index: Embperl/App.pm
>===================================================================
>RCS file: /home/cvs/embperl/Embperl/App.pm,v
>retrieving revision 1.6
>diff -r1.6 App.pm
>83a84
>  
>
>>    my $status      = $req_rec?$req_rec -> status:0 ;
>>    
>>
>94c95,106
><     Embperl::Req::output ($r,"<H1>Internal Server Error</H1>\r\n") ;
>---
>  
>
>>    if ($status == 403)
>>        {
>>        Embperl::Req::output ($r,"<H1>Forbidden</H1>\r\n") ;
>>        }
>>    elsif ($status == 404)
>>        {
>>        Embperl::Req::output ($r,"<H1>Not Found</H1>\r\n") ;
>>        }
>>    else
>>        {
>>        Embperl::Req::output ($r,"<H1>Internal Server Error</H1>\r\n")
;
>>        }
>>    
>>
>
>
> 
>** Virus checked by BB-5000 Mailfilter ** 
>  
>

-- 
_____cliff_rayman_____________________________________
Business Consulting and Turnaround Management
[web] http://www.rayman.com/
[web] http://all-clear-turnaround-management.com/
[eml] cliff __at__ rayman.com
[phn] 888-736-3802 x701
[fax] 818-743-7404
______________________________________________________


Mime
View raw message