2
0

mod_spelling.pp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  1. {* Copyright 1999-2005 The Apache Software Foundation or its licensors, as
  2. * applicable.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * 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. library mod_spelling;
  17. {$i define.inc}
  18. uses SysUtils, Classes, httpd, apr;
  19. var
  20. speling_module: module; {$ifdef Unix} cvar; public; {$endif}
  21. default_module_ptr: Pmodule;
  22. const
  23. MODULE_NAME = 'mod_speling.so';
  24. {*******************************************************************
  25. * Free Pascal only supports exporting variables on Windows
  26. *******************************************************************}
  27. {$ifdef WINDOWS}
  28. exports
  29. speling_module name 'spelling_module';
  30. {$endif}
  31. {#include "apr.h"
  32. #include "apr_file_io.h"
  33. #include "apr_strings.h"
  34. #include "apr_lib.h"
  35. #define APR_WANT_STRFUNC
  36. #include "apr_want.h"
  37. #define WANT_BASENAME_MATCH
  38. #include "httpd.h"
  39. #include "http_core.h"
  40. #include "http_config.h"
  41. #include "http_request.h"
  42. #include "http_log.h" }
  43. {* mod_speling.c - by Alexei Kosut <[email protected]> June, 1996
  44. *
  45. * Translated to pascal by Felipe Monteiro de Carvalho - July, 2006
  46. *
  47. * This module is transparent, and simple. It attempts to correct
  48. * misspellings of URLs that users might have entered, namely by checking
  49. * capitalizations. If it finds a match, it sends a redirect.
  50. *
  51. * 08-Aug-1997 <[email protected]>
  52. * o Upgraded module interface to apache_1.3a2-dev API (more NULL's in
  53. * speling_module).
  54. * o Integrated tcsh's "spelling correction" routine which allows one
  55. * misspelling (character insertion/omission/typo/transposition).
  56. * Rewrote it to ignore case as well. This ought to catch the majority
  57. * of misspelled requests.
  58. * o Commented out the second pass where files' suffixes are stripped.
  59. * Given the better hit rate of the first pass, this rather ugly
  60. * (request index.html, receive index.db ?!?!) solution can be
  61. * omitted.
  62. * o wrote a "kind of" html page for mod_speling
  63. *
  64. * Activate it with "CheckSpelling On"
  65. }
  66. type
  67. spconfig = record
  68. enabled: Integer;
  69. end;
  70. Pspconfig = ^spconfig;
  71. {
  72. * Create a configuration specific to this module for a server or directory
  73. * location, and fill it with the default settings.
  74. *
  75. * The API says that in the absence of a merge function, the record for the
  76. * closest ancestor is used exclusively. That's what we want, so we don't
  77. * bother to have such a function.
  78. }
  79. function mkconfig(p: Papr_pool_t): Pointer;
  80. var
  81. cfg: Pspconfig;
  82. begin
  83. cfg := apr_pcalloc(p, sizeof(spconfig));
  84. cfg^.enabled := 0;
  85. Result := cfg;
  86. end;
  87. {
  88. * Respond to a callback to create configuration record for a server or
  89. * vhost environment.
  90. }
  91. function create_mconfig_for_server(p: Papr_pool_t; s: Pserver_rec): Pointer; cdecl;
  92. begin
  93. Result := mkconfig(p);
  94. end;
  95. {
  96. * Respond to a callback to create a config record for a specific directory.
  97. }
  98. function create_mconfig_for_directory(p: Papr_pool_t; dir: PChar): Pointer; cdecl;
  99. begin
  100. Result := mkconfig(p);
  101. end;
  102. {
  103. * Handler for the CheckSpelling directive, which is FLAG.
  104. }
  105. function set_speling(cmd: Pcmd_parms; mconfig: Pointer; arg: Integer): PChar; cdecl;
  106. var
  107. cfg: Pspconfig;
  108. begin
  109. cfg := Pspconfig(mconfig);
  110. cfg^.enabled := arg;
  111. Result := nil;
  112. end;
  113. {* Define the directives specific to this module. This structure is referenced
  114. * later by the 'module' structure. }
  115. var
  116. speling_cmds: command_rec;
  117. type
  118. sp_reason = (
  119. SP_IDENTICAL = 0,
  120. SP_MISCAPITALIZED = 1,
  121. SP_TRANSPOSITION = 2,
  122. SP_MISSINGCHAR = 3,
  123. SP_EXTRACHAR = 4,
  124. SP_SIMPLETYPO = 5,
  125. SP_VERYDIFFERENT = 6
  126. );
  127. const
  128. sp_reason_str: array [0..7] of PChar =
  129. (
  130. 'identical',
  131. 'miscapitalized',
  132. 'transposed characters',
  133. 'character missing',
  134. 'extra character',
  135. 'mistyped character',
  136. 'common basename',
  137. nil
  138. );
  139. type
  140. misspelled_file = record
  141. name: PChar;
  142. quality: sp_reason;
  143. end;
  144. Pmisspelled_file = ^misspelled_file;
  145. {
  146. * spdist() is taken from Kernighan & Pike,
  147. * _The_UNIX_Programming_Environment_
  148. * and adapted somewhat to correspond better to psychological reality.
  149. * (Note the changes to the return values)
  150. *
  151. * According to Pollock and Zamora, CACM April 1984 (V. 27, No. 4),
  152. * page 363, the correct order for this is:
  153. * OMISSION = TRANSPOSITION > INSERTION > SUBSTITUTION
  154. * thus, it was exactly backwards in the old version. -- PWP
  155. *
  156. * This routine was taken out of tcsh's spelling correction code
  157. * (tcsh-6.07.04) and re-converted to apache data types ("char" type
  158. * instead of tcsh's NLS'ed "Char"). Plus it now ignores the case
  159. * during comparisons, so is a "approximate strcasecmp()".
  160. * NOTE that is still allows only _one_ real "typo",
  161. * it does NOT try to correct multiple errors.
  162. }
  163. {
  164. Extra notes about how this function works:
  165. * s and t are supposed different
  166. * s
  167. }
  168. function spdist(const cs, ct: PChar): sp_reason;
  169. var
  170. s, t, i, j: PChar;
  171. begin
  172. s := cs;
  173. t := ct;
  174. while apr_tolower(s^) = apr_tolower(t^) do
  175. begin
  176. if t^ = #0 then
  177. begin
  178. Result := SP_MISCAPITALIZED; { exact match (sans case) }
  179. Exit;
  180. end;
  181. Inc(s);
  182. Inc(t);
  183. end;
  184. if s^ <> #0 then
  185. begin
  186. if t^ <> #0 then
  187. begin
  188. i := s;
  189. Inc(i);
  190. j := t;
  191. Inc(j);
  192. if Integer(i^) and Integer(j^) <> 0 then
  193. if (apr_tolower(s^) = apr_tolower(j^)) and (apr_tolower(t^) = apr_tolower(i^)) then
  194. begin
  195. Inc(i);
  196. Inc(j);
  197. if stricomp(i, j) = 0 then
  198. begin
  199. Result := SP_TRANSPOSITION; { transposition }
  200. Exit;
  201. end;
  202. end;
  203. Dec(i);
  204. Dec(j);
  205. if (stricomp(i, j) = 0) then
  206. begin
  207. Result := SP_SIMPLETYPO; { 1 char mismatch }
  208. Exit;
  209. end;
  210. end;
  211. if (stricomp(i, t) = 0) then
  212. begin
  213. Result := SP_EXTRACHAR; { extra character }
  214. Exit;
  215. end;
  216. end;
  217. if (t^ <> #0) and (stricomp(s, t + 1) = 0) then
  218. begin
  219. Result := SP_MISSINGCHAR; { missing character }
  220. Exit;
  221. end;
  222. Result := SP_VERYDIFFERENT; { distance too large to fix. }
  223. end;
  224. function sort_by_quality(left, rite: Pointer): Integer;
  225. begin
  226. Result := Integer(Pmisspelled_file(left)^.quality) - Integer(Pmisspelled_file(rite)^.quality);
  227. end;
  228. function check_speling(r: Prequest_rec): Integer; cdecl;
  229. var
  230. cfg: Pspconfig;
  231. good, bad, postgood, url: PChar;
  232. dirent: apr_finfo_t;
  233. filoc, dotloc, urlen, pglen: Integer;
  234. candidates: Papr_array_header_t = nil;
  235. dir: Papr_dir_t;
  236. q: sp_reason;
  237. sp_new, variant_, nvariant_: Pmisspelled_file;
  238. nuri, ref, vuri, reason: PChar;
  239. i, entloc: Integer;
  240. p, sub_pool: Papr_pool_t;
  241. notes: Papr_table_t;
  242. t, v: Papr_array_header_t;
  243. List: TList;
  244. plist: Pointer;
  245. begin
  246. cfg := Pspconfig(ap_get_module_config(r^.per_dir_config, @speling_module));
  247. if (cfg^ .enabled = 0) then
  248. begin
  249. Result := DECLINED;
  250. Exit;
  251. end;
  252. { We only want to worry about GETs }
  253. if (r^.method_number <> M_GET) then
  254. begin
  255. Result := DECLINED;
  256. Exit;
  257. end;
  258. { We've already got a file of some kind or another }
  259. if (Integer(r^.finfo.filetype) <> 0) then
  260. begin
  261. Result := DECLINED;
  262. Exit;
  263. end;
  264. { Not a file request }
  265. if (r^.proxyreq>0) or not assigned(r^.filename) then
  266. begin
  267. Result := DECLINED;
  268. Exit;
  269. end;
  270. { This is a sub request - don't mess with it }
  271. if (r^.main <> nil) then
  272. begin
  273. Result := DECLINED;
  274. Exit;
  275. end;
  276. {
  277. * The request should end up looking like this:
  278. * r->uri: /correct-url/mispelling/more
  279. * r->filename: /correct-file/mispelling r->path_info: /more
  280. *
  281. * So we do this in steps. First break r->filename into two pieces
  282. }
  283. filoc := ap_rind(r^.filename, '/');
  284. {
  285. * Don't do anything if the request doesn't contain a slash, or
  286. * requests "/"
  287. }
  288. if (filoc = -1) or (strcomp(r^.uri, '/') = 0) then
  289. begin
  290. Result := DECLINED;
  291. Exit;
  292. end;
  293. { good = /correct-file }
  294. good := apr_pstrndup(r^.pool, r^.filename, filoc);
  295. { bad = mispelling }
  296. bad := apr_pstrdup(r^.pool, r^.filename + filoc + 1);
  297. { postgood = mispelling/more }
  298. postgood := apr_pstrcat(r^.pool, [bad, r^.path_info, nil]);
  299. urlen := strlen(r^.uri);
  300. pglen := strlen(postgood);
  301. { Check to see if the URL pieces add up }
  302. if (strcomp(postgood, r^.uri + (urlen - pglen))) <> 0 then
  303. begin
  304. Result := DECLINED;
  305. Exit;
  306. end;
  307. { url = /correct-url }
  308. url := apr_pstrndup(r^.pool, r^.uri, (urlen - pglen));
  309. { Now open the directory and do ourselves a check... }
  310. if (apr_dir_open(@dir, good, r^.pool) <> APR_SUCCESS) then
  311. { Oops, not a directory... }
  312. begin
  313. Result := DECLINED;
  314. Exit;
  315. end;
  316. candidates := apr_array_make(r^.pool, 2, sizeof(misspelled_file));
  317. dotloc := ap_ind(bad, '.');
  318. if (dotloc = -1) then dotloc := strlen(bad);
  319. while (apr_dir_read(@dirent, APR_FINFO_DIRENT, dir) = APR_SUCCESS) do
  320. begin
  321. {
  322. * If we end up with a "fixed" URL which is identical to the
  323. * requested one, we must have found a broken symlink or some such.
  324. * Do _not_ try to redirect this, it causes a loop!
  325. }
  326. if (strcomp(bad, dirent.name) = 0) then
  327. begin
  328. apr_dir_close(dir);
  329. Result := OK;
  330. end
  331. {
  332. * miscapitalization errors are checked first (like, e.g., lower case
  333. * file, upper case request)
  334. }
  335. else if (stricomp(bad, dirent.name) = 0) then
  336. begin
  337. sp_new := Pmisspelled_file(apr_array_push(candidates));
  338. sp_new^.name := apr_pstrdup(r^.pool, dirent.name);
  339. sp_new^.quality := SP_MISCAPITALIZED;
  340. end
  341. {
  342. * simple typing errors are checked next (like, e.g.,
  343. * missing/extra/transposed char)
  344. }
  345. else if (spdist(bad, dirent.name) <> SP_VERYDIFFERENT) then
  346. begin
  347. q := spdist(bad, dirent.name);
  348. sp_new := Pmisspelled_file(apr_array_push(candidates));
  349. sp_new^.name := apr_pstrdup(r^.pool, dirent.name);
  350. sp_new^.quality := q;
  351. end
  352. {
  353. * The spdist() should have found the majority of the misspelled
  354. * requests. It is of questionable use to continue looking for
  355. * files with the same base name, but potentially of totally wrong
  356. * type (index.html <-> index.db).
  357. * I would propose to not set the WANT_BASENAME_MATCH define.
  358. * 08-Aug-1997 <[email protected]>
  359. *
  360. * However, Alexei replied giving some reasons to add it anyway:
  361. * > Oh, by the way, I remembered why having the
  362. * > extension-stripping-and-matching stuff is a good idea:
  363. * >
  364. * > If you're using MultiViews, and have a file named foobar.html,
  365. * > which you refer to as "foobar", and someone tried to access
  366. * > "Foobar", mod_speling won't find it, because it won't find
  367. * > anything matching that spelling. With the extension-munging,
  368. * > it would locate "foobar.html". Not perfect, but I ran into
  369. * > that problem when I first wrote the module.
  370. }
  371. else
  372. begin
  373. {$ifdef WANT_BASENAME_MATCH}
  374. {
  375. * Okay... we didn't find anything. Now we take out the hard-core
  376. * power tools. There are several cases here. Someone might have
  377. * entered a wrong extension (.htm instead of .html or vice
  378. * versa) or the document could be negotiated. At any rate, now
  379. * we just compare stuff before the first dot. If it matches, we
  380. * figure we got us a match. This can result in wrong things if
  381. * there are files of different content types but the same prefix
  382. * (e.g. foo.gif and foo.html) This code will pick the first one
  383. * it finds. Better than a Not Found, though.
  384. }
  385. entloc := ap_ind(dirent.name, '.');
  386. if (entloc = -1) then entloc := strlen(dirent.name);
  387. if ((dotloc = entloc) and not strncasecmp(bad, dirent.name, dotloc)) then
  388. begin
  389. sp_new := Pmisspelled_file(apr_array_push(candidates));
  390. sp_new^.name := apr_pstrdup(r^.pool, dirent.name);
  391. sp_new^.quality := SP_VERYDIFFERENT;
  392. end;
  393. {$endif}
  394. end;
  395. end;
  396. apr_dir_close(dir);
  397. if (candidates^.nelts <> 0) then
  398. begin
  399. { Wow... we found us a mispelling. Construct a fixed url }
  400. variant_ := Pmisspelled_file(candidates^.elts);
  401. ref := apr_table_get(r^.headers_in, 'Referer');
  402. List := TList.Create;
  403. try
  404. for i := 0 to candidates^.nelts - 1 do
  405. begin
  406. plist := Pointer(candidates^.elts);
  407. Inc(plist, sizeof(misspelled_file));
  408. List.Add(plist);
  409. end;
  410. List.Sort(@sort_by_quality);
  411. finally
  412. List.Free;
  413. end;
  414. {
  415. * Conditions for immediate redirection:
  416. * a) the first candidate was not found by stripping the suffix
  417. * AND b) there exists only one candidate OR the best match is not
  418. * ambiguous
  419. * then return a redirection right away.
  420. }
  421. nvariant_ := variant_;
  422. Inc(nvariant_, sizeof(misspelled_file));
  423. if (variant_^.quality <> SP_VERYDIFFERENT) and ( (candidates^.nelts = 1)
  424. or (Integer(variant_^.quality) <> Integer(nvariant_^.quality))) then
  425. begin
  426. nuri := ap_escape_uri(r^.pool, apr_pstrcat(r^.pool, [url,
  427. variant_^.name,
  428. r^.path_info, nil]));
  429. if (r^.parsed_uri.query^ <> #0) then
  430. nuri := apr_pstrcat(r^.pool, [nuri, PChar('?'), r^.parsed_uri.query, nil]);
  431. apr_table_setn(r^.headers_out, 'Location',
  432. ap_construct_url(r^.pool, nuri, r));
  433. if ref^ <> #0 then
  434. ap_log_rerror(MODULE_NAME, 506, APLOG_INFO, APR_SUCCESS,
  435. r, 'Fixed spelling: %s to %s from %s', [r^.uri, nuri, ref])
  436. else
  437. ap_log_rerror(MODULE_NAME, 506, APLOG_INFO, APR_SUCCESS,
  438. r, 'Fixed spelling: %s to %s', [r^.uri, nuri, ref]);
  439. Result := HTTP_MOVED_PERMANENTLY;
  440. Exit;
  441. end
  442. {
  443. * Otherwise, a "[300] Multiple Choices" list with the variants is
  444. * returned.
  445. }
  446. else
  447. begin
  448. if (r^.main = nil) then
  449. begin
  450. p := r^.pool;
  451. notes := r^.notes;
  452. end
  453. else
  454. begin
  455. p := r^.main^.pool;
  456. notes := r^.main^.notes;
  457. end;
  458. if (apr_pool_create(@sub_pool, p) <> APR_SUCCESS) then
  459. begin
  460. Result := DECLINED;
  461. Exit;
  462. end;
  463. t := apr_array_make(sub_pool, candidates^.nelts * 8 + 8, sizeof(PChar));
  464. v := apr_array_make(sub_pool, candidates^.nelts * 5, sizeof(PChar));
  465. { Generate the response text. }
  466. PPChar(apr_array_push(t))^ := 'The document name you requested (<code>';
  467. PPChar(apr_array_push(t))^ := ap_escape_html(sub_pool, r^.uri);
  468. PPChar(apr_array_push(t))^ :=
  469. '</code>) could not be found on this server.' + LineEnding +
  470. 'However, we found documents with names similar ' +
  471. 'to the one you requested.<p>' +
  472. 'Available documents:' + LineEnding + '<ul>' + LineEnding;
  473. for i := 0 to candidates^.nelts -1 do
  474. begin
  475. reason := sp_reason_str[Integer(variant_[i].quality)];
  476. { The format isn't very neat... }
  477. if r^.parsed_uri.query <> nil then
  478. vuri := apr_pstrcat(sub_pool, [url, variant_[i].name, r^.path_info,
  479. '?', r^.parsed_uri.query, nil])
  480. else vuri := apr_pstrcat(sub_pool, [url, variant_[i].name, r^.path_info,
  481. PChar(''), PChar(''), nil]);
  482. PPChar(apr_array_push(v))^ := '"';
  483. PPChar(apr_array_push(v))^ := ap_escape_uri(sub_pool, vuri);
  484. PPChar(apr_array_push(v))^ := '";"';
  485. PPChar(apr_array_push(v))^ := reason;
  486. PPChar(apr_array_push(v))^ := '"';
  487. PPChar(apr_array_push(t))^ := '<li><a href="';
  488. PPChar(apr_array_push(t))^ := ap_escape_uri(sub_pool, vuri);
  489. PPChar(apr_array_push(t))^ := '">';
  490. PPChar(apr_array_push(t))^ := ap_escape_html(sub_pool, vuri);
  491. PPChar(apr_array_push(t))^ := '</a> (';
  492. PPChar(apr_array_push(t))^ := reason;
  493. PPChar(apr_array_push(t))^ := ')' + LineEnding;
  494. {
  495. * when we have printed the "close matches" and there are
  496. * more "distant matches" (matched by stripping the suffix),
  497. * then we insert an additional separator text to suggest
  498. * that the user LOOK CLOSELY whether these are really the
  499. * files she wanted.
  500. }
  501. if (i > 0) and (i < candidates^.nelts - 1)
  502. and (variant_[i].quality <> SP_VERYDIFFERENT)
  503. and (variant_[i + 1].quality = SP_VERYDIFFERENT) then
  504. PPChar(apr_array_push(t))^ :=
  505. '</ul>' + LineEnding + 'Furthermore, the following related ' +
  506. 'documents were found:' + LineEnding + '<ul>' + LineEnding;
  507. end;
  508. PPChar(apr_array_push(t))^ := '</ul>' + LineEnding;
  509. { If we know there was a referring page, add a note: }
  510. if (ref <> nil) then
  511. begin
  512. PPChar(apr_array_push(t))^ :=
  513. 'Please consider informing the owner of the <a href="';
  514. PPChar(apr_array_push(t))^ := ap_escape_uri(sub_pool, ref);
  515. PPChar(apr_array_push(t))^ := '">referring page</a> about the broken link.' + LineEnding;
  516. end;
  517. { Pass our apr_table_t to http_protocol.c (see mod_negotiation): }
  518. apr_table_setn(notes, 'variant-list', apr_array_pstrcat(p, t, #0));
  519. apr_table_mergen(r^.subprocess_env, 'VARIANTS', apr_array_pstrcat(p, v, ','));
  520. apr_pool_destroy(sub_pool);
  521. if ref <> '' then
  522. ap_log_rerror(MODULE_NAME, 609, APLOG_INFO, 0, r,
  523. 'Spelling fix: %s: %d candidates from %s', [r^.uri, candidates^.nelts, ref])
  524. else ap_log_rerror(MODULE_NAME, 609, APLOG_INFO, 0, r,
  525. 'Spelling fix: %s: %d candidates', [r^.uri, candidates^.nelts, ref]);
  526. Result := HTTP_MULTIPLE_CHOICES;
  527. end;
  528. end;
  529. Result := OK;
  530. end;
  531. procedure register_hooks_(p: Papr_pool_t); cdecl;
  532. begin
  533. ap_hook_fixups(@check_speling, nil, nil, APR_HOOK_LAST);
  534. end;
  535. begin
  536. default_module_ptr := @speling_module;
  537. FillChar(default_module_ptr^, SizeOf(default_module_ptr^), 0);
  538. STANDARD20_MODULE_STUFF(default_module_ptr^);
  539. {* Define the directives specific to this module. This structure is referenced
  540. * later by the 'module' structure. }
  541. with speling_cmds do
  542. begin
  543. name := 'CheckSpelling';
  544. func := cmd_func(@set_speling);
  545. cmd_data := nil;
  546. req_override := OR_OPTIONS;
  547. args_how := FLAG;
  548. errmsg := 'whether or not to fix miscapitalized/misspelled requests';
  549. end;
  550. with speling_module do
  551. begin
  552. name := MODULE_NAME;
  553. magic := MODULE_MAGIC_COOKIE;
  554. create_dir_config := @create_mconfig_for_directory; { per-directory config creator }
  555. merge_dir_config := nil; { dir config merger }
  556. create_server_config := @create_mconfig_for_server; { server config creator }
  557. merge_server_config := nil; { server config merger }
  558. cmds := @speling_cmds; { command table }
  559. register_hooks := @register_hooks_; { set up other request processing hooks }
  560. end;
  561. end.