You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/03/20 09:30:37 UTC

[PATCH] add is_initial_req() function

This is from Doug MacEachern's fix to mod_auth_kerb.  It only adds the
function and doesn't actually make anything use it... it's just for module
authors that want to take advantage of it.

Dean

Index: http_request.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_request.c,v
retrieving revision 1.46
diff -c -3 -r1.46 http_request.c
*** http_request.c	1997/02/21 00:22:29	1.46
--- http_request.c	1997/03/20 08:24:48
***************
*** 738,743 ****
--- 738,757 ----
      destroy_pool (r->pool);
  }
  
+ int is_initial_req (request_rec *r)
+ {
+     request_rec *r;
+ 
+     if (r->main != NULL) /* this is a sub-request */
+         return 0;
+     else if (r->prev != NULL) /* this is an internal redirect */
+         return 0;
+    /* this is the initial main request, we only get here *once* per
+ 	HTTP request */
+     return 1;
+ }
+ 
+ 
  /*****************************************************************
   *
   * Mainline request processing...
Index: http_request.h
===================================================================
RCS file: /export/home/cvs/apache/src/http_request.h,v
retrieving revision 1.10
diff -c -3 -r1.10 http_request.h
*** http_request.h	1997/01/01 18:10:22	1.10
--- http_request.h	1997/03/20 08:24:48
***************
*** 74,79 ****
--- 74,80 ----
  request_rec *sub_req_lookup_file (const char *new_file, const request_rec *r);
  int run_sub_req (request_rec *r);
  void destroy_sub_req (request_rec *r);
+ int is_initial_req (request_rec *r);
       
  /*
   * Then there's the case that you want some other request to be served