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
22dc9b9f
Commit
22dc9b9f
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Eliminated next_event (unused).
Added JavaScript lprintf statements.
parent
674c7eaa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/main.cpp
+19
-1
19 additions, 1 deletion
src/sbbs3/main.cpp
with
19 additions
and
1 deletion
src/sbbs3/main.cpp
+
19
−
1
View file @
22dc9b9f
...
...
@@ -300,6 +300,15 @@ js_sys_status_set(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
bool
sbbs_t
::
js_initcx
()
{
char
node
[
128
];
if
(
cfg
.
node_num
)
sprintf
(
node
,
"Node %d"
,
cfg
.
node_num
);
else
strcpy
(
node
,
client_name
);
lprintf
(
"%s JavaScript: Initializing context"
,
node
);
if
((
js_cx
=
JS_NewContext
(
js_runtime
,
JAVASCRIPT_CONTEXT_STACK
))
==
NULL
)
return
(
false
);
...
...
@@ -657,7 +666,9 @@ void input_thread(void *arg)
thread_up
();
#ifdef _DEBUG
lprintf
(
"Node %d input thread started"
,
sbbs
->
cfg
.
node_num
);
#endif
pthread_mutex_init
(
&
sbbs
->
input_thread_mutex
,
NULL
);
sbbs
->
input_thread_running
=
true
;
...
...
@@ -800,7 +811,9 @@ void output_thread(void* arg)
sprintf
(
node
,
"Node %d"
,
sbbs
->
cfg
.
node_num
);
else
strcpy
(
node
,
sbbs
->
client_name
);
#ifdef _DEBUG
lprintf
(
"%s output thread started"
,
node
);
#endif
sbbs
->
output_thread_running
=
true
;
sbbs
->
console
|=
CON_R_ECHO
;
...
...
@@ -1484,7 +1497,6 @@ sbbs_t::sbbs_t(ushort node_num, DWORD addr, char* name, SOCKET sd,
curatr
=
LIGHTGRAY
;
errorlevel
=
0
;
logcol
=
1
;
next_event
=
0
;
logfile_fp
=
NULL
;
nodefile
=-
1
;
node_ext
=-
1
;
...
...
@@ -1954,6 +1966,7 @@ sbbs_t::~sbbs_t()
#ifdef JAVASCRIPT
/* Free Context */
if
(
js_cx
!=
NULL
)
{
lprintf
(
"%s JavaScript: Destorying context"
,
node
);
JS_DestroyContext
(
js_cx
);
js_cx
=
NULL
;
}
...
...
@@ -2895,6 +2908,7 @@ static void cleanup(int code)
#ifdef JAVASCRIPT
if
(
js_runtime
!=
NULL
)
{
lprintf
(
"JavaScript: Destroying runtime"
);
JS_DestroyRuntime
(
js_runtime
);
js_runtime
=
NULL
;
}
...
...
@@ -3047,9 +3061,11 @@ void DLLCALL bbs_thread(void* arg)
}
/* Create missing directories */
lprintf
(
"Verifying/creating data directories"
);
make_data_dirs
(
&
scfg
);
/* Create missing node directories and dsts.dab files */
lprintf
(
"Verifying/creating node directories"
);
for
(
i
=
0
;
i
<=
scfg
.
sys_nodes
;
i
++
)
{
if
(
i
)
md
(
scfg
.
node_path
[
i
-
1
]);
...
...
@@ -3077,11 +3093,13 @@ void DLLCALL bbs_thread(void* arg)
startup
->
node_inbuf
=
node_inbuf
;
#ifdef JAVASCRIPT
lprintf
(
"JavaScript: Creating runtime: %lu bytes"
,
JAVASCRIPT_RUNTIME_MEMORY
);
if
((
js_runtime
=
JS_NewRuntime
(
JAVASCRIPT_RUNTIME_MEMORY
))
==
NULL
)
{
lprintf
(
"!JS_NewRuntime failed"
);
cleanup
(
1
);
return
;
}
lprintf
(
"JavaScript: Context stack: %lu bytes"
,
JAVASCRIPT_CONTEXT_STACK
);
#endif
/* open a socket and wait for a client */
...
...
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