You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Stas Bekman <st...@stason.org> on 2004/07/17 06:48:23 UTC

ap_meets_conditions doc: bogus return value?

/**
  * Implements condition GET rules for HTTP/1.1 specification.  This 
function
  * inspects the client headers and determines if the response fulfills
  * the requirements specified.
  * @param r The current request
  * @return 1 if the response fulfills the condition GET rules, 0 otherwise
  * @deffunc int ap_meets_conditions(request_rec *r)
  */
AP_DECLARE(int) ap_meets_conditions(request_rec *r);

The @return value seems to be totally bogus, the function returns OK (0) 
if the conditions were met (not 1), otherwise it returns either of these 
two:

#define HTTP_PRECONDITION_FAILED           412
#define HTTP_NOT_MODIFIED                  304

though since other constants may be returned later should the doc be 
something like the following:

  * @return OK if the response fulfills the condition GET rules, some 
other status code otherwise

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: ap_meets_conditions doc: bogus return value?

Posted by Stas Bekman <st...@stason.org>.
Jeff Trawick wrote:
> On Fri, 16 Jul 2004 21:48:23 -0700, Stas Bekman <st...@stason.org> wrote:
> 
> 
>>AP_DECLARE(int) ap_meets_conditions(request_rec *r);
>>
>>The @return value seems to be totally bogus, the function returns OK (0)
>>if the conditions were met (not 1), otherwise it returns either of these
>>two:
>>
>>#define HTTP_PRECONDITION_FAILED           412
>>#define HTTP_NOT_MODIFIED                  304
>>
>>though since other constants may be returned later should the doc be
>>something like the following:
>>
>>  * @return OK if the response fulfills the condition GET rules, some
>>other status code otherwise
> 
> 
> +1

Thanks Jeff, done.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: ap_meets_conditions doc: bogus return value?

Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, 16 Jul 2004 21:48:23 -0700, Stas Bekman <st...@stason.org> wrote:

> AP_DECLARE(int) ap_meets_conditions(request_rec *r);
> 
> The @return value seems to be totally bogus, the function returns OK (0)
> if the conditions were met (not 1), otherwise it returns either of these
> two:
> 
> #define HTTP_PRECONDITION_FAILED           412
> #define HTTP_NOT_MODIFIED                  304
> 
> though since other constants may be returned later should the doc be
> something like the following:
> 
>   * @return OK if the response fulfills the condition GET rules, some
> other status code otherwise

+1