DocFiles

### SREhttp/2: Pre-Loading ADDONS, EXECS, etc.

The `PRELOADS.CFG` file (in the SREHTTP2\CFG directory) is used to specify:

- addons to be pre-loaded into macrospace
- selector-specific procedures to be pre-loaded into macrospace
- a pre-response procedures that may be called before every response
- a post-response procedures to be called after every response
- a custom username lookup procedure

Note: These are not host-specific. Procedures, etc. defined in PRELOADS.CFG may be used for all requests, regardless of host.

LOAD_ADDON | List of REXX addons to load into macrospace. You can have zero, one, or many `LOAD_ADDON` lines in `PRELOADS.CFG`. LOAD_ADDON is used speed up the execution of SREhttp/2 addons. Syntax: `load_addon= load_addon addon_file` where: `load_addon` : the selector that invokes the addon. Do not include a ? and what may follow a ? `addon_file` : file containing the addon (fully qualified, or relative to the default addon direcotry, which is typically SREHTTP2\ADDON directory) Notes: addons, once loaded to macrospace, are not automatically updated when the underlying file changes. They will be updated when SREhttp/2 is restarted. loaded addons are used for all hosts. That is, a preloaded addon (perhaps one located in the default addon directory) will be used even if a host-specific addon of the same name is available in a host-specific addon directory. Thus, you should not use LOAD_ADDONS to refer to addons that may have host-specific versions. You can have several `load_addon` selectors point to the same file name -- the same procedure will be used for each of them. Note that SREhttp/2 Utility package is supported this way -- with several entries (in the default PRELOADS.CFG file) pointing to the same file (to SRE_UTIL.CMD). Examples: load_addon= status status.cmd load_addon= status0 status.cmd load_addon= system/optscfg system/optscfg.cmd load_addon= the_score f:\games\state2.cmd
LOAD_EXEC | List of REXX "exec" mid-filter scripts to load into macrospace. You can specify zero, one, or many LOAD_EXECs Syntax: `load_exec= exec_name exec_file` where: `exec_name`: a macrospace procedure name. This `exec_name` is used in `EXEC` options in ATTRIBS.CFG `exec_file` : file containing the EXEC procedure (fully qualified, or relative to the `SREHTTP2` directory) If a selector-specific `EXEC` procedure starts with a `!`, then the name is assumed to refer to an `exec_name` that has been loaded with `LOAD_EXEC`. Otherwise, a file will be loaded into macrospace (under a temporary name), called, and removed. Hence, use of `LOAD_EXEC` is a time saver. Examples: `load_exec=procs\show_info procs\exec_smp.rex` If an ATTRIBS.CFG realm contains: `EXEC !SHOW_INFO Hello world` then the `pre-loaded version of PROCS\EXEC_SMP.REX` will be used.
POST_RESPONSE | Optional post-response procedures to run after responding to request. You can have up to five `POST_RESPONSE` lines in the `PRELOADS.CFG` file. If you just have a `POST_RESPONSE=0` , then no post-response procedure will be run. Otherwise, POST_RESPONSE should contain the name of an external procedure file. If a relative file name, then it will be relative to the SREHTTP2 directory POST_RESPONSE procedures (if specified) are run after every response has been sent. If you specify more then one, they will be run in the order listed. For details on how to use post-response procedures, see POSTRESP.HTM Examples `post_response=0 post_response=PROCS\POSTRESP.RX1`
PRE_RESPONSE | Optional pre-response procedures that are called just before responding to request. You can specify zero, one, or many `PRE_RESPONSE`s Each PRE_RESPONSE entry should contain: an identifying name, the filename of an external procedure file. optionally, an argument string (to send to the pre-response procedure) One of the PRE_RESPONSE procedures will be called run before most requests (by default, the first one specified). For details on how to use pre-response procedures, see PRE_RESP.HTM Examples `pre_response=0 pre_response=ENCRYPT PROCS\ENCRYPT.REX SRE_A pre_response=ADD_DATE PRE_RESP.RXX`
CUSTOM_USERNAME | A customized procedure used to lookup a username. If specified, this will be used instead of (or in addition to) the built in username lookup procedure. If `CUSTOM_USERNAME=0` , then no custom username procedure will be called. Otherwise, CUSTOM_USERNAME should contain the name of an external procedure file. If a relative file name, then it will be relative to the SREHTTP2 directory The custom username procedure should return a list of privileges. Privileges are used to control access to your server's resources. For details on how to create and use custom username procedures, see USERS.htm. Examples `custom_username=0 custom_username=CFG\USERNAME.RXX`

Last updated 26 September 2002.