#include "smbd/service_task.h"
#include "web_server/web_server.h"
#include "smbd/service_stream.h"
-#include "smbd/proto.h"
+#include "smbd/service.h"
#include "lib/events/events.h"
#include "system/time.h"
#include "lib/appweb/esp/esp.h"
char *p = strrchr(web->input.url, '/');
if (p == web->input.url) {
url = talloc_asprintf(web, "http%s://%s/%s",
- tls_enabled(web->tls)?"s":"",
+ tls_enabled(web->conn->socket)?"s":"",
host, url);
} else {
int dirlen = p - web->input.url;
url = talloc_asprintf(web, "http%s://%s%*.*s/%s",
- tls_enabled(web->tls)?"s":"",
+ tls_enabled(web->conn->socket)?"s":"",
host,
dirlen, dirlen, web->input.url,
url);
}
SETVAR(ESP_SERVER_OBJ, "DOCUMENT_ROOT", lp_swat_directory());
- SETVAR(ESP_SERVER_OBJ, "SERVER_PROTOCOL", tls_enabled(web->tls)?"https":"http");
+ SETVAR(ESP_SERVER_OBJ, "SERVER_PROTOCOL", tls_enabled(web->conn->socket)?"https":"http");
SETVAR(ESP_SERVER_OBJ, "SERVER_SOFTWARE", "SWAT");
SETVAR(ESP_SERVER_OBJ, "GATEWAY_INTERFACE", "CGI/1.1");
SETVAR(ESP_SERVER_OBJ, "TLS_SUPPORT", tls_support(edata->tls_params)?"True":"False");
static jmp_buf ejs_exception_buf;
static const char *exception_reason;
-void ejs_exception(const char *reason)
+static void web_server_ejs_exception(const char *reason)
{
Ejs *ep = ejsPtr(0);
if (ep) {
longjmp(ejs_exception_buf, -1);
}
#else
-void ejs_exception(const char *reason)
+static void web_server_ejs_exception(const char *reason)
{
DEBUG(0,("%s", reason));
smb_panic(reason);
edata->application_data, MPR_DEEP_COPY);
}
- smb_setup_ejs_functions();
+ smb_setup_ejs_functions(web_server_ejs_exception);
if (web->input.url == NULL) {
http_error(web, 400, "You must specify a GET or POST request");