Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
4a099183
Commit
4a099183
authored
Jul 21, 2003
by
rswindell
Browse files
Recompiles and destroys script for each static JS service loop.
parent
78ade3c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
src/sbbs3/services.c
src/sbbs3/services.c
+14
-11
No files found.
src/sbbs3/services.c
View file @
4a099183
...
...
@@ -1014,22 +1014,25 @@ static void js_static_service_thread(void* arg)
val
=
BOOLEAN_TO_JSVAL
(
JS_FALSE
);
JS_SetProperty
(
js_cx
,
js_glob
,
"logged_in"
,
&
val
);
JS_ClearPendingException
(
js_cx
);
js_script
=
JS_CompileFile
(
js_cx
,
js_glob
,
spath
);
JS_SetBranchCallback
(
js_cx
,
js_BranchCallback
);
do
{
JS_ClearPendingException
(
js_cx
);
if
(
js_script
==
NULL
)
lprintf
(
"%04d !JavaScript FAILED to compile script (%s)"
,
service
->
socket
,
spath
);
else
{
JS_SetBranchCallback
(
js_cx
,
js_BranchCallback
);
js_script
=
JS_CompileFile
(
js_cx
,
js_glob
,
spath
);
do
{
JS_ExecuteScript
(
js_cx
,
js_glob
,
js_script
,
&
rval
);
JS_GC
(
js_cx
)
;
}
while
(
!
service
->
terminated
&&
service
->
options
&
SERVICE_OPT_STATIC_LOOP
);
if
(
js_script
==
NULL
)
{
lprintf
(
"%04d !JavaScript FAILED to compile script (%s)"
,
service
->
socket
,
spath
);
break
;
}
JS_ExecuteScript
(
js_cx
,
js_glob
,
js_script
,
&
rval
);
JS_DestroyScript
(
js_cx
,
js_script
);
}
JS_GC
(
js_cx
);
}
while
(
!
service
->
terminated
&&
service
->
options
&
SERVICE_OPT_STATIC_LOOP
);
JS_DestroyContext
(
js_cx
);
/* Free Context */
JS_DestroyRuntime
(
js_runtime
);
...
...
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