ap_mmn.inc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. {
  17. * MODULE_MAGIC_NUMBER_MAJOR
  18. * Major API changes that could cause compatibility problems for older modules
  19. * such as structure size changes. No binary compatibility is possible across
  20. * a change in the major version.
  21. *
  22. * MODULE_MAGIC_NUMBER_MINOR
  23. * Minor API changes that do not cause binary compatibility problems.
  24. * Should be reset to 0 when upgrading MODULE_MAGIC_NUMBER_MAJOR.
  25. *
  26. * See the MODULE_MAGIC_AT_LEAST macro below for an example.
  27. }
  28. {
  29. * 19950525 - original value
  30. * 19960512 (1.1b2) - updated, 1.1, version.
  31. * 19960526 (1.1b3) - get_token(), table_unset(), pstrndup()
  32. * functions added
  33. * 19960725 (1.2-dev) - HTTP/1.1 compliance
  34. * (new version of read_client_block)
  35. * 19960806 (1.2-dev) - scan_script_header_err() added
  36. * 19961007 (1.2-dev) - replace read_client_block() with get_client_block()
  37. * 19961125 (1.2b1) - change setup_client_block() to Roy's version
  38. * 19961211 (1.2b3) - rwrite() added
  39. * 19970103 (1.2b5-dev) - header parse API
  40. * 19970427 (1.2b9-dev) - port references made unsigned
  41. * 19970526 (1.2) - correct vhost walk for multiple requests on a single
  42. * connect
  43. * 19970623 (1.3-dev) - NT changes
  44. * 19970628 (1.3-dev) - ap_slack (fd fixes) added
  45. * 19970717 (1.3-dev) - child_init API hook added
  46. * 19970719 (1.3-dev) - discard_request_body() added (to clear the decks
  47. * as needed)
  48. * 19970728 (1.3a2-dev) - child_exit API hook added
  49. * 19970818 (1.3a2-dev) - post read-request phase added
  50. * 19970825 (1.3a2-dev) - r->mtime cell added
  51. * 19970831 (1.3a2-dev) - error logging changed to use aplog_error()
  52. * 19970902 (1.3a2-dev) - MD5 routines and structures renamed to ap_*
  53. * 19970912 (1.3b1-dev) - set_last_modified split into set_last_modified,
  54. * set_etag and meets_conditions
  55. * register_other_child API
  56. * piped_log API
  57. * short_score split into parent and child pieces
  58. * os_is_absolute_path
  59. * 19971026 (1.3b3-dev) - custom config hooks in place
  60. * 19980126 (1.3b4-dev) - ap_cpystrn(), table_addn(), table_setn(),
  61. * table_mergen()
  62. * 19980201 (1.3b4-dev) - construct_url()
  63. * prototype server_rec * -> request_rec *
  64. * add get_server_name() and get_server_port()
  65. * 19980207 (1.3b4-dev) - add dynamic_load_handle to module structure as part
  66. * of the STANDARD_MODULE_STUFF header
  67. * 19980304 (1.3b6-dev) - abstraction of SERVER_BUILT and SERVER_VERSION
  68. * 19980305 (1.3b6-dev) - ap_config.h added for use by external modules
  69. * 19980312 (1.3b6-dev) - parse_uri_components() and its ilk
  70. * remove r->hostlen, add r->unparsed_uri
  71. * set_string_slot_lower()
  72. * clarification: non-RAW_ARGS cmd handlers do not
  73. * need to pstrdup() their arguments
  74. * clarification: request_rec members content_type,
  75. * handler, content_encoding, content_language,
  76. * content_languages MUST all be lowercase strings,
  77. * and MAY NOT be modified in place -- modifications
  78. * require pstrdup().
  79. * 19980317 (1.3b6-dev) - CORE_EXPORTs for win32 and <Perl>
  80. * API export basic_http_header, send_header_field,
  81. * set_keepalive, srm_command_loop, check_cmd_context,
  82. * tm2sec
  83. * spacetoplus(), plustospace(), client_to_stdout()
  84. * removed
  85. * 19980324 (1.3b6-dev) - API_EXPORT(index_of_response)
  86. * 19980413 (1.3b6-dev) - The BIG SYMBOL RENAMING: general ap_ prefix
  87. * (see src/include/compat.h for more details)
  88. * ap_vformatter() API, see src/include/ap.h
  89. * 19980507 (1.3b7-dev) - addition of ap_add_version_component() and
  90. * discontinuation of -DSERVER_SUBVERSION support
  91. * 19980519 (1.3b7-dev) - add child_info * to spawn function (as passed to
  92. * ap_spawn_child_err_buff) and to ap_call_exec to make
  93. * children work correctly on Win32.
  94. * 19980527 (1.3b8-dev) - renamed some more functions to ap_ prefix which were
  95. * missed at the big renaming (they are defines):
  96. * is_default_port, default_port and http_method.
  97. * A new communication method for modules was added:
  98. * they can create customized error messages under the
  99. * "error-notes" key in the request_rec->notes table.
  100. * This string will be printed in place of the canned
  101. * error responses, and will be propagated to
  102. * ErrorDocuments or cgi scripts in the
  103. * (REDIRECT_)ERROR_NOTES variable.
  104. * 19980627 (1.3.1-dev) - More renaming that we forgot/bypassed. In particular:
  105. * table_elts --> ap_table_elts
  106. * is_table_empty --> ap_is_table_empty
  107. * 19980708 (1.3.1-dev) - ap_isalnum(), ap_isalpha(), ... "8-bit safe" ctype
  108. * macros and apctype.h added
  109. * 19980713 (1.3.1-dev) - renaming of C header files:
  110. * 1. conf.h -> ap_config.h
  111. * 2. conf_auto.h -> ap_config_auto.h - now merged
  112. * 3. ap_config.h -> ap_config_auto.h - now merged
  113. * 4. compat.h -> ap_compat.h
  114. * 5. apctype.h -> ap_ctype.h
  115. * 19980806 (1.3.2-dev) - add ap_log_rerror()
  116. * - add ap_scan_script_header_err_core()
  117. * - add ap_uuencode()
  118. * - add ap_custom_response()
  119. * 19980811 (1.3.2-dev) - added limit_req_line, limit_req_fieldsize, and
  120. * limit_req_fields to server_rec.
  121. * added limit_req_body to core_dir_config and
  122. * ap_get_limit_req_body() to get its value.
  123. * 19980812 (1.3.2-dev) - split off MODULE_MAGIC_NUMBER
  124. * 19980812.2 - add ap_overlap_tables()
  125. * 19980816 (1.3.2-dev) - change proxy to use tables for headers, change
  126. * struct cache_req to typedef cache_req.
  127. * Delete ap_proxy_get_header(), ap_proxy_add_header(),
  128. * ap_proxy_del_header(). Change interface of
  129. * ap_proxy_send_fb() and ap_proxy_cache_error().
  130. * Add ap_proxy_send_hdr_line() and ap_proxy_bputs2().
  131. * 19980825 (1.3.2-dev) - renamed is_HTTP_xxx() macros to ap_is_HTTP_xxx()
  132. * 19980825.1 - mod_proxy only (minor change): modified interface of
  133. * ap_proxy_read_headers() and rdcache() to use a
  134. * request_rec* instead of pool*
  135. * (for implementing better error reporting).
  136. * 19980906 (1.3.2-dev) - added ap_md5_binary()
  137. * 19980917 (1.3.2-dev) - bs2000: changed os_set_authfile() to os_set_account()
  138. * 19981108 (1.3.4-dev) - added ap_method_number_of()
  139. * - changed value of M_INVALID and added WebDAV methods
  140. * 19981108.1 - ap_exists_config_define() is now public (minor bump)
  141. * 19981204 - scoreboard changes -- added generation, changed
  142. * exit_generation to running_generation. Somewhere
  143. * earlier vhostrec was added, but it's only safe to use
  144. * as of this rev. See scoreboard.h for documentation.
  145. * 19981211 - DSO changes -- added ap_single_module_configure()
  146. * -- added ap_single_module_init()
  147. * 19981229 - mod_negotiation overhaul -- added ap_make_etag()
  148. * and added vlist_validator to request_rec.
  149. * 19990101 - renamed macro escape_uri() to ap_escape_uri()
  150. * - added MODULE_MAGIC_COOKIE to identify module structs
  151. * 19990103 (1.3.4-dev) - added ap_array_pstrcat()
  152. * 19990105 (1.3.4-dev) - added ap_os_is_filename_valid()
  153. * 19990106 (1.3.4-dev) - Move MODULE_MAGIC_COOKIE to the end of the
  154. * STANDARD_MODULE_STUFF macro so the version
  155. * numbers and file name remain at invariant offsets
  156. * 19990108 (1.3.4-dev) - status_drops_connection -> ap_status_drops_connection
  157. * scan_script_header -> ap_scan_script_header_err
  158. * - reordered entries in request_rec that were waiting
  159. * for a non-binary-compatible release.
  160. * (1.3.5-dev)
  161. * 19990108.1 - add ap_MD5Encode() for MD5 password handling.
  162. * 19990108.2 - add ap_validate_password() and change ap_MD5Encode()
  163. * to use a stronger algorithm.
  164. * 19990108.4 - add ap_size_list_item(), ap_get_list_item(), and
  165. * ap_find_list_item()
  166. * 19990108.5 - added ap_sub_req_method_uri() and added const to the
  167. * definition of method in request_rec.
  168. * 19990108.6 - SIGPIPE is now ignored by the core server.
  169. * 19990108.7 - ap_isxdigit added
  170. * 19990320 - METHODS and M_INVALID symbol values modified
  171. * 19990320.1 - add ap_vrprintf()
  172. * 19990320.2 - add cmd_parms.context, ap_set_config_vectors,
  173. * export ap_add_file_conf
  174. * 19990320.3 - add ap_regexec() and ap_regerror()
  175. * 19990320.4 - add ap_field_noparam()
  176. * 19990320.5 - add local_ip/host to conn_rec for mass-vhost
  177. * 19990320.6 - add ap_SHA1Final(), ap_SHA1Init(),
  178. * ap_SHA1Update_binary(), ap_SHA1Update(),
  179. * ap_base64encode(), ap_base64encode_binary(),
  180. * ap_base64encode_len(), ap_base64decode(),
  181. * ap_base64decode_binary(), ap_base64decode_len(),
  182. * ap_pbase64decode(), ap_pbase64encode()
  183. * 19990320.7 - add ap_strcasestr()
  184. * 19990320.8 - add request_rec.case_preserved_filename
  185. * 19990320.9 - renamed alloc.h to ap_alloc.h
  186. * 19990320.10 - add ap_is_rdirectory() and ap_stripprefix()
  187. * 19990320.11 - Add a couple of fields, callback_data and
  188. * filter_callback to the end of buff.h
  189. * 19990320.11 - Add some fields to the end of the core_dir_config
  190. * structure
  191. * 19990320.12 - add ap_getline(), ap_get_chunk_size()
  192. * 19990320.13 - add ap_strtol()
  193. * 19990320.14 - add ap_register_cleanup_ex(),
  194. * ap_note_cleanups_for_fd_ex(),
  195. * ap_note_cleanups_for_socket_ex(),
  196. * ap_note_cleanups_for_file_ex(),
  197. * ap_popenf_ex() and ap_psocket_ex().
  198. * 19990320.15 - ap_is_recursion_limit_exceeded()
  199. * 19990320.16 - ap_escape_errorlog_item()
  200. * 19990320.17 - ap_auth_nonce() and ap_auth_nonce added
  201. * in core_dir_config.
  202. * 19990320.18 - trace_enable member added to core server_config
  203. }
  204. const
  205. MODULE_MAGIC_COOKIE = $41503133; { "AP13" }
  206. MODULE_MAGIC_NUMBER_MAJOR = 19990320;
  207. MODULE_MAGIC_NUMBER_MINOR = 18; { 0...n }
  208. { Useful for testing for features. }
  209. {#define AP_MODULE_MAGIC_AT_LEAST(major,minor) \
  210. ((major) < MODULE_MAGIC_NUMBER_MAJOR \
  211. || ((major) == MODULE_MAGIC_NUMBER_MAJOR \
  212. && (minor) <= MODULE_MAGIC_NUMBER_MINOR))}
  213. {
  214. * For example, suppose you wish to use the ap_overlap_tables
  215. * function. You can do this:
  216. *
  217. * #if AP_MODULE_MAGIC_AT_LEAST(19980812,2)
  218. * ... use ap_overlap_tables()
  219. * #else
  220. * ... alternative code which doesn't use ap_overlap_tables()
  221. * #endif
  222. *
  223. }
  224. { deprecated. present for backwards compatibility }
  225. MODULE_MAGIC_NUMBER = MODULE_MAGIC_NUMBER_MAJOR;
  226. //#define MODULE_MAGIC_AT_LEAST old_broken_macro_we_hope_you_are_not_using