From d1287f85ce6cca7cd8b63bd5fe0d191e93b8a983 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Fri, 15 Jul 2016 15:07:22 +0200 Subject: =?UTF-8?q?Fix=20prolog=20runner=20for=20SWI-Prolog=20=E2=89=A5=20?= =?UTF-8?q?7.3.22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prolog/runner/daemon.pl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'prolog') diff --git a/prolog/runner/daemon.pl b/prolog/runner/daemon.pl index b8515b3..36ff846 100755 --- a/prolog/runner/daemon.pl +++ b/prolog/runner/daemon.pl @@ -38,6 +38,15 @@ prolog:error_message(time_limit_exceeded) --> :- set_setting(pengine_sandbox:time_limit, 5.0). :- set_setting(pengine_sandbox:thread_pool_size, 500). -% Start the server. Set fork(true) if you desire for the process to fork into background. You may also want pidfile(filename). -% See /usr/lib/swi-prolog/library/http/http_unix_daemon.pl and thread_httpd.pl for all options. -:- http_daemon([port(3030), ip(localhost), fork(false), workers(10), timeout(30), keep_alive_timeout(30), user(nobody), group(nogroup)]). +start_server :- + Common = [fork(false), workers(10), timeout(30), keep_alive_timeout(30), user(nobody), group(nogroup)], + % SWI-Prolog 7.3.22 changed the options for specifying server address + current_prolog_flag(version, Version), + (Version >= 70322 -> + Options = [http(localhost:3030) | Common] + ; + Options = [ip(localhost), port(3030) | Common] + ), + http_daemon(Options). + +:- start_server. -- cgit v1.2.1