| 392 | #define TRACE_NOTE "example-hooks-trace" |
| 393 | |
| 394 | static void trace_request(const request_rec *r, const char *note) |
| 395 | { |
| 396 | const char *trace_copy, *sofar; |
| 397 | char *addon, *where; |
| 398 | x_cfg *cfg; |
| 399 | |
| 400 | #if EXAMPLE_LOG_EACH |
| 401 | example_log_each(r->pool, r->server, note); |
| 402 | #endif |
| 403 | |
| 404 | if ((sofar = apr_table_get(r->notes, TRACE_NOTE)) == NULL) { |
| 405 | sofar = ""; |
| 406 | } |
| 407 | |
| 408 | cfg = our_dconfig(r); |
| 409 | |
| 410 | where = (cfg != NULL) ? cfg->loc : "nowhere"; |
| 411 | where = (where != NULL) ? where : ""; |
| 412 | |
| 413 | addon = apr_pstrcat(r->pool, |
| 414 | " <li>\n" |
| 415 | " <dl>\n" |
| 416 | " <dt><samp>", note, "</samp></dt>\n" |
| 417 | " <dd><samp>[", where, "]</samp></dd>\n" |
| 418 | " </dl>\n" |
| 419 | " </li>\n", |
| 420 | NULL); |
| 421 | |
| 422 | trace_copy = apr_pstrcat(r->pool, sofar, addon, NULL); |
| 423 | apr_table_set(r->notes, TRACE_NOTE, trace_copy); |
| 424 | } |
| 425 | |
| 426 | /* |
| 427 | * This utility routine traces the hooks called while processing a |
no test coverage detected