Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
sbbs
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
Deucе
sbbs
Commits
fc04380f
Commit
fc04380f
authored
4 years ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
Start of js_msg_area.cpp
parent
613453e0
No related branches found
No related tags found
No related merge requests found
Pipeline
#5508
failed
1 year ago
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/js_msg_area.cpp
+63
-86
63 additions, 86 deletions
src/sbbs3/js_msg_area.cpp
src/sbbs3/objects.mk
+2
-2
2 additions, 2 deletions
src/sbbs3/objects.mk
with
65 additions
and
88 deletions
src/sbbs3/js_msg_area.cpp
+
63
−
86
View file @
fc04380f
...
...
@@ -106,11 +106,11 @@ struct js_msg_area_priv {
subscan_t
*
subscan
;
};
BOOL
DLLCALL
js_CreateMsgAreaProperties
(
JSContext
*
cx
,
scfg_t
*
cfg
,
JSObject
*
subobj
,
uint
subnum
)
BOOL
DLLCALL
js_CreateMsgAreaProperties
(
JSContext
*
cx
,
scfg_t
*
cfg
,
JS
::
Handle
Object
subobj
,
uint
subnum
)
{
char
str
[
128
];
JSString
*
js_str
;
JS
::
Value
val
;
JS
::
Rooted
String
js_str
(
cx
)
;
JS
::
Rooted
Value
val
(
cx
)
;
sub_t
*
sub
;
if
(
subnum
==
INVALID_SUB
||
subnum
>=
cfg
->
total_subs
)
...
...
@@ -118,128 +118,128 @@ BOOL DLLCALL js_CreateMsgAreaProperties(JSContext* cx, scfg_t* cfg, JSObject* su
sub
=
cfg
->
sub
[
subnum
];
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"number"
,
INT_TO_JSVAL
(
subnum
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"number"
,
subnum
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"grp_number"
,
INT_TO_JSVAL
(
sub
->
grp
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"grp_number"
,
sub
->
grp
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
cfg
->
grp
[
sub
->
grp
]
->
sname
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"grp_name"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"grp_name"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
code
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"code"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"code"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
sname
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"name"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"name"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
lname
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"description"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"description"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
qwkname
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"qwk_name"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"qwk_name"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
subnewsgroupname
(
cfg
,
sub
,
str
,
sizeof
(
str
))))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"newsgroup"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"newsgroup"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
arstr
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"ars"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"ars"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
read_arstr
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"read_ars"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"read_ars"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
post_arstr
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"post_ars"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"post_ars"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
op_arstr
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"operator_ars"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"operator_ars"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
mod_arstr
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"moderated_ars"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"moderated_ars"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
data_dir
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"data_dir"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"data_dir"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
origline
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"fidonet_origin"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"fidonet_origin"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
((
js_str
=
JS_NewStringCopyZ
(
cx
,
sub
->
tagline
))
==
NULL
)
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"qwknet_tagline"
,
STRING_TO_JSVAL
(
js_str
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"qwknet_tagline"
,
js_str
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
val
=
UINT_TO_JSVAL
(
sub
->
misc
);
val
.
setNumber
(
sub
->
misc
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"settings"
,
val
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"ptridx"
,
INT_TO_JSVAL
(
sub
->
ptridx
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"ptridx"
,
sub
->
ptridx
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"qwk_conf"
,
INT_TO_JSVAL
(
sub
->
qwkconf
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"qwk_conf"
,
sub
->
qwkconf
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"max_crcs"
,
INT_TO_JSVAL
(
sub
->
maxcrcs
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"max_crcs"
,
sub
->
maxcrcs
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"max_msgs"
,
INT_TO_JSVAL
(
sub
->
maxmsgs
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"max_msgs"
,
sub
->
maxmsgs
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"max_age"
,
INT_TO_JSVAL
(
sub
->
maxage
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"max_age"
,
sub
->
maxage
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"print_mode"
,
INT_TO_JSVAL
(
sub
->
pmode
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"print_mode"
,
sub
->
pmode
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"print_mode_neg"
,
INT_TO_JSVAL
(
sub
->
n_pmode
)
,
NULL
,
NULL
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
if
(
!
JS_DefineProperty
(
cx
,
subobj
,
"print_mode_neg"
,
sub
->
n_pmode
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
))
return
(
FALSE
);
...
...
@@ -262,43 +262,43 @@ enum {
static
bool
js_sub_get
(
JSContext
*
cx
,
JS
::
HandleObject
obj
,
JS
::
HandleId
id
,
JS
::
MutableHandleValue
vp
)
{
JS
::
Value
idval
;
in
t
tiny
;
JS
::
Rooted
Value
idval
(
cx
)
;
int32_
t
tiny
;
subscan_t
*
scan
;
if
((
scan
=
(
subscan_t
*
)
JS_GetPrivate
(
obj
))
==
NULL
)
return
(
true
);
JS_IdToValue
(
cx
,
id
,
&
idval
);
tiny
=
JSVAL_TO_INT
(
idval
);
tiny
=
idval
.
toInt32
(
);
switch
(
tiny
)
{
case
SUB_PROP_SCAN_PTR
:
vp
.
set
(
UINT_TO_JSVAL
(
scan
->
ptr
)
)
;
vp
.
set
Number
((
unsigned
)
scan
->
ptr
);
break
;
case
SUB_PROP_SCAN_CFG
:
vp
.
set
(
UINT_TO_JSVAL
(
scan
->
cfg
)
)
;
vp
.
set
Number
((
unsigned
)
scan
->
cfg
);
break
;
case
SUB_PROP_LAST_READ
:
vp
.
set
(
UINT_TO_JSVAL
(
scan
->
last
)
)
;
vp
.
set
Number
((
unsigned
)
scan
->
last
);
break
;
}
return
(
true
);
}
static
bool
js_sub_set
(
JSContext
*
cx
,
JS
::
HandleObject
obj
,
JS
::
HandleId
id
,
bool
strict
,
JS
::
MutableHandleValue
vp
)
static
bool
js_sub_set
(
JSContext
*
cx
,
JS
::
HandleObject
obj
,
JS
::
HandleId
id
,
JS
::
MutableHandleValue
vp
,
JS
::
ObjectOpResult
&
result
)
{
JS
::
Value
idval
;
JS
::
Rooted
Value
idval
(
cx
)
;
int32_t
val
=
0
;
in
t
tiny
;
int32_
t
tiny
;
subscan_t
*
scan
;
if
((
scan
=
(
subscan_t
*
)
JS_GetPrivate
(
obj
))
==
NULL
)
return
(
true
);
JS_IdToValue
(
cx
,
id
,
&
idval
);
tiny
=
JSVAL_TO_INT
(
idval
);
tiny
=
idval
.
toInt32
(
);
switch
(
tiny
)
{
case
SUB_PROP_SCAN_PTR
:
...
...
@@ -504,29 +504,6 @@ bool DLLCALL js_msg_area_resolve(JSContext* cx, JS::HandleObject areaobj, JS::Ha
if
((
subobj
=
JS_NewObject
(
cx
,
&
js_sub_class
,
subobj_proto
,
NULL
))
==
NULL
)
return
false
;
/** Crash ^^^ Here in JSexec/ircd upon recycle/reload of script:
mozjs185-1.0.dll!62e4a968()
[Frames below may be incorrect and/or missing, no symbols loaded for mozjs185-1.0.dll]
mozjs185-1.0.dll!62eda4b2()
mozjs185-1.0.dll!62e9cd4e()
mozjs185-1.0.dll!62ea3cf0()
mozjs185-1.0.dll!62e4e39e()
mozjs185-1.0.dll!62edd884()
mozjs185-1.0.dll!62e8010f()
mozjs185-1.0.dll!62e5b0c9()
mozjs185-1.0.dll!62e4b1ee()
> sbbs.dll!js_CreateMsgAreaObject(JSContext * cx=0x07b33ce8, JSObject * parent=0x0a37f028, scfg_t * cfg=0x004a2b20, user_t * user=0x00000000, client_t * client=0x00000000, subscan_t * subscan=0x00000000) Line 459 + 0x17 bytes C
sbbs.dll!js_CreateUserObjects(JSContext * cx=0x07b33ce8, JSObject * parent=0x0a37f028, scfg_t * cfg=0x004a2b20, user_t * user=0x00000000, client_t * client=0x00000000, char * html_index_file=0x00000000, subscan_t * subscan=0x00000000) Line 1431 + 0x1d bytes C
sbbs.dll!js_CreateCommonObjects(JSContext * js_cx=0x07b33ce8, scfg_t * cfg=0x004a2b20, scfg_t * node_cfg=0x004a2b20, jsSyncMethodSpec * methods=0x00000000, __int64 uptime=0, char * host_name=0x101bdaa6, char * socklib_desc=0x101bdaa6, js_branch_t * branch=0x019c8f30, js_startup_t * js_startup=0x0012f7cc, client_t * client=0x00000000, unsigned int client_socket=4294967295, js_server_props_t * props=0x00000000) Line 3858 + 0x1b bytes C
sbbs.dll!js_load(JSContext * cx=0x02e36300, unsigned int argc=3, unsigned __int64 * arglist=0x01d700d0) Line 282 + 0x44 bytes C
mozjs185-1.0.dll!62e91dfd()
jsexec.exe!__lock_fhandle(int fh=1240564) Line 467 C
7ffdf000()
ffff0007()
mozjs185-1.0.dll!62fe9c60()
*/
if
(
p
->
subscan
!=
NULL
)
JS_SetPrivate
(
subobj
,
&
p
->
subscan
[
d
]);
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/objects.mk
+
2
−
2
View file @
fc04380f
...
...
@@ -40,7 +40,6 @@ OBJS = $(MTOBJODIR)$(DIRSEP)ansiterm$(OFILE) \
$(
MTOBJODIR
)$(
DIRSEP
)
getstr
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
inkey
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
ident
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_private
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_bbs
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_client
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_com
$(
OFILE
)
\
...
...
@@ -54,6 +53,7 @@ OBJS = $(MTOBJODIR)$(DIRSEP)ansiterm$(OFILE) \
$(
MTOBJODIR
)$(
DIRSEP
)
js_internal
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_msg_area
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_msgbase
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_private
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_queue
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_request
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_rtpool
$(
OFILE
)
\
...
...
@@ -246,7 +246,6 @@ JSDOOR_OBJS = \
$(
MTOBJODIR
)$(
DIRSEP
)
date_str
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
dat_rec
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
jsdoor
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_private
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_uifc
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_conio
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_request
$(
OFILE
)
\
...
...
@@ -258,6 +257,7 @@ JSDOOR_OBJS = \
$(
MTOBJODIR
)$(
DIRSEP
)
js_cryptcert
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_cryptkeyset
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_global
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_private
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_rtpool
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_sprintf
$(
OFILE
)
\
$(
MTOBJODIR
)$(
DIRSEP
)
js_file
$(
OFILE
)
\
...
...
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