Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
5a230c06
Commit
5a230c06
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
started() callback is called after initialization.
All JS calls occur in a single Request block now.
parent
1f80a2ff
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/services.c
+13
-8
13 additions, 8 deletions
src/sbbs3/services.c
with
13 additions
and
8 deletions
src/sbbs3/services.c
+
13
−
8
View file @
5a230c06
...
...
@@ -72,8 +72,6 @@
#define MAX_SERVICES 128
#define TIMEOUT_THREAD_WAIT 30
/* Seconds */
#define STATUS_WFC "Listening"
static
services_startup_t
*
startup
=
NULL
;
static
scfg_t
scfg
;
static
int
active_clients
=
0
;
...
...
@@ -379,9 +377,9 @@ js_initcx(SOCKET sock, client_t* client, service_client_t* service_client, JSObj
}
while
(
0
);
JS_EndRequest
(
js_cx
);
/* Required for multi-thread support */
if
(
!
success
)
{
JS_EndRequest
(
js_cx
);
/* Required for multi-thread support */
JS_DestroyContext
(
js_cx
);
return
(
NULL
);
}
...
...
@@ -491,8 +489,6 @@ static void js_service_thread(void* arg)
args
=
p
+
1
;
}
JS_BeginRequest
(
js_cx
);
/* Required for multi-thread support */
argv
=
JS_NewArrayObject
(
js_cx
,
0
,
NULL
);
if
(
args
!=
NULL
&&
argv
!=
NULL
)
{
...
...
@@ -519,7 +515,6 @@ static void js_service_thread(void* arg)
,
NULL
,
NULL
,
JSPROP_READONLY
);
js_script
=
JS_CompileFile
(
js_cx
,
js_glob
,
spath
);
JS_EndRequest
(
js_cx
);
if
(
js_script
==
NULL
)
lprintf
(
"%04d !JavaScript FAILED to compile script (%s)"
,
socket
,
spath
);
...
...
@@ -527,6 +522,9 @@ static void js_service_thread(void* arg)
JS_ExecuteScript
(
js_cx
,
js_glob
,
js_script
,
&
rval
);
JS_DestroyScript
(
js_cx
,
js_script
);
}
close_socket
(
socket
);
JS_EndRequest
(
js_cx
);
// lprintf("%04d JavaScript: Destroying context",socket);
JS_DestroyContext
(
js_cx
);
/* Free Context */
...
...
@@ -535,7 +533,6 @@ static void js_service_thread(void* arg)
if
(
service
->
clients
)
service
->
clients
--
;
close_socket
(
socket
);
active_clients
--
;
update_clients
();
client_off
(
socket
);
...
...
@@ -795,7 +792,15 @@ void DLLCALL services_thread(void* arg)
}
service
[
i
].
socket
=
socket
;
}
/* signal caller that we've started up successfully */
if
(
startup
->
started
!=
NULL
)
startup
->
started
();
status
(
"Listening"
);
terminated
=
FALSE
;
/* Main Server Loop */
while
(
!
terminated
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment