From 74dda392261e52e80a4ff24ea08f042e02154ed7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 26 May 2005 03:22:38 +0000 Subject: r6989: - added support for esp style includes (which include a esp file, instead of a ejs file) - added a test of esp style includes to the esptest html (This used to be commit af3de9468ee5ba490c991901b7a4aa260c839876) --- source4/web_server/http.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source4/web_server/http.c') diff --git a/source4/web_server/http.c b/source4/web_server/http.c index fa03830295..25595a8ad7 100644 --- a/source4/web_server/http.c +++ b/source4/web_server/http.c @@ -157,6 +157,16 @@ failed: return -1; } +/* + called when esp wants to find the real path of a file +*/ +static int http_mapToStorage(EspHandle handle, char *path, int len, const char *uri, int flags) +{ + if (uri == NULL || strlen(uri) >= len) return -1; + strncpy(path, uri, len); + return 0; +} + /* called when esp wants to output something */ @@ -253,7 +263,8 @@ static const struct Esp esp_control = { .setHeader = http_setHeader, .redirect = http_redirect, .setResponseCode = http_setResponseCode, - .readFile = http_readFile + .readFile = http_readFile, + .mapToStorage = http_mapToStorage }; -- cgit