http_request.inc 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. { Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. }
  16. { http_request.c is the code which handles the main line of request
  17. * processing, once a request has been read in (finding the right per-
  18. * directory configuration, building it if necessary, and calling all
  19. * the module dispatch functions in the right order).
  20. *
  21. * The pieces here which are public to the modules, allow them to learn
  22. * how the server would handle some other file or URI, or perhaps even
  23. * direct the server to serve that other file instead of the one the
  24. * client requested directly.
  25. *
  26. * There are two ways to do that. The first is the sub_request mechanism,
  27. * which handles looking up files and URIs as adjuncts to some other
  28. * request (e.g., directory entries for multiviews and directory listings);
  29. * the lookup functions stop short of actually running the request, but
  30. * (e.g., for includes), a module may call for the request to be run
  31. * by calling run_sub_req. The space allocated to create sub_reqs can be
  32. * reclaimed by calling destroy_sub_req --- be sure to copy anything you care
  33. * about which was allocated in its pool elsewhere before doing this.
  34. }
  35. function ap_sub_req_lookup_uri(const new_file: PChar;
  36. const r: Prequest_rec): Prequest_rec;
  37. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} external LibHTTPD;
  38. function ap_sub_req_lookup_file(const new_file: PChar;
  39. const r: Prequest_rec): Prequest_rec;
  40. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} external LibHTTPD;
  41. function ap_sub_req_method_uri(const method, new_file: PChar;
  42. const r: Prequest_rec): Prequest_rec;
  43. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} external LibHTTPD;
  44. function ap_run_sub_req(r: Prequest_rec): cint;
  45. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} external LibHTTPD;
  46. procedure ap_destroy_sub_req(r: Prequest_rec);
  47. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} external LibHTTPD;
  48. {
  49. * Then there's the case that you want some other request to be served
  50. * as the top-level request INSTEAD of what the client requested directly.
  51. * If so, call this from a handler, and then immediately return OK.
  52. }
  53. procedure ap_internal_redirect(const new_uri: PChar; param2: Prequest_rec);
  54. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} external LibHTTPD;
  55. procedure ap_internal_redirect_handler(const new_uri: PChar; param2: Prequest_rec);
  56. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} external LibHTTPD;
  57. function ap_some_auth_required(r: Prequest_rec): cint;
  58. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} external LibHTTPD;
  59. function ap_is_initial_req(r: Prequest_rec): cint;
  60. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} external LibHTTPD;
  61. function ap_update_mtime(r: Prequest_rec; dependency_mtime: time_t): time_t;
  62. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} external LibHTTPD;
  63. {$ifdef CORE_PRIVATE}
  64. { Function called by main.c to handle first-level request }
  65. API_EXPORT(void) ap_process_request(request_rec *);
  66. API_EXPORT(void) ap_die(int type, request_rec *r);
  67. {$endif}