Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
ea2e36bd
Commit
ea2e36bd
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2002-11-10 04:37:17 by cvscast] Empty log message
Original author: cvscast Date: 2002-11-10 04:37:17+00:00
parent
fdd444dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
driver/webiface.ml
View file @
ea2e36bd
(* TODO:
- correct error messages, not failwith "..."
- HTML design, logo
- dump
*)
open
Netcgi
(* Configuration *)
let
session_dir
=
"/home/frisch/sessions"
let
timeout
=
60
(* seconds *)
let
max_sess
=
5
let
timeout
=
60
*
5
(* seconds *)
let
max_sess
=
10
(*****************)
let
persistant
=
ref
false
let
session_id
=
ref
""
...
...
@@ -93,7 +104,11 @@ let main (cgi : Netcgi.std_activation) =
|
`Open
->
if
(
nb_sessions
>=
max_sess
)
then
failwith
"Too many open sessions ..."
;
gen_session_id
()
let
sid
=
gen_session_id
()
in
(* touch the session file ... *)
let
chan
=
open_out_bin
(
session_file
sid
)
in
close_out
chan
;
sid
|
`Close
->
close_session
(
cgi
#
argument_value
"session"
);
""
|
`New
->
""
|
_
->
cgi
#
argument_value
"session"
...
...
@@ -114,10 +129,12 @@ let main (cgi : Netcgi.std_activation) =
if
!
persistant
then
(
try
let
chan
=
open_in_bin
(
session_file
!
session_id
)
in
let
s
=
Marshal
.
from_channel
chan
in
if
in_channel_length
chan
>
0
then
(
let
s
=
Marshal
.
from_channel
chan
in
State
.
set
s
);
close_in
chan
;
State
.
set
s
;
with
Sys_error
_
->
()
with
Sys_error
_
->
failwith
"This session has expired ..."
);
let
ok
=
Cduce
.
run
ppf
input
in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment