...
 
Commits (1)
  • Rob Swindell's avatar
    Stop pretending to configure the JavaScript Context stack · c0cd8686
    Rob Swindell authored
    The argument to JS_NewContext that we were allowing to be configured was not the contest stack size, but rather:
    "The size, in bytes, of each "stack chunk". This is a memory management tuning parameter which most users should not adjust. 8192 is a good default value." - per Mozilla.
    
    So we're just going to use the suggested default, hard-coded.
    c0cd8686
/* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */
/* $Id: MainFormUnit.cpp,v 1.213 2020/04/17 20:38:56 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -15,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -797,7 +783,6 @@ __fastcall TMainForm::TMainForm(TComponent* Owner)
memset(&global,0,sizeof(global));
SAFECOPY(global.ctrl_dir,"c:\\sbbs\\ctrl\\");
global.js.max_bytes=JAVASCRIPT_MAX_BYTES;
global.js.cx_stack=JAVASCRIPT_CONTEXT_STACK;
global.js.time_limit=JAVASCRIPT_TIME_LIMIT;
global.js.gc_interval=JAVASCRIPT_GC_INTERVAL;
global.js.yield_interval=JAVASCRIPT_YIELD_INTERVAL;
......@@ -2974,7 +2959,6 @@ void __fastcall TMainForm::PropertiesExecute(TObject *Sender)
PropertiesDlg->FileAssociationsCheckBox->Checked=UseFileAssociations;
PropertiesDlg->PasswordEdit->Text=Password;
PropertiesDlg->JS_MaxBytesEdit->Text=byte_count_to_str(global.js.max_bytes, str, sizeof(str));
PropertiesDlg->JS_ContextStackEdit->Text=byte_count_to_str(global.js.cx_stack, str, sizeof(str));
PropertiesDlg->JS_TimeLimitEdit->Text=IntToStr(global.js.time_limit);
PropertiesDlg->JS_GcIntervalEdit->Text=IntToStr(global.js.gc_interval);
PropertiesDlg->JS_YieldIntervalEdit->Text=IntToStr(global.js.yield_interval);
......@@ -3044,8 +3028,6 @@ void __fastcall TMainForm::PropertiesExecute(TObject *Sender)
js_startup_t js=global.js; // save for later comparison
global.js.max_bytes
=parse_byte_count(PropertiesDlg->JS_MaxBytesEdit->Text.c_str(), 1);
global.js.cx_stack
=parse_byte_count(PropertiesDlg->JS_ContextStackEdit->Text.c_str(), 1);
global.js.time_limit
=PropertiesDlg->JS_TimeLimitEdit->Text.ToIntDef(JAVASCRIPT_TIME_LIMIT);
global.js.gc_interval
......
......@@ -592,6 +592,7 @@ object PropertiesDlg: TPropertiesDlg
Height = 19
AutoSize = False
Caption = 'Context Stack'
Enabled = false
end
object Label12: TLabel
Left = 7
......@@ -646,6 +647,7 @@ object PropertiesDlg: TPropertiesDlg
ParentShowHint = False
ShowHint = True
TabOrder = 1
Enabled = false
end
object JS_TimeLimitEdit: TEdit
Left = 98
......
/* Synchronet FTP server */
/* $Id: ftpsrvr.c,v 1.501 2020/08/15 19:15:39 rswindell Exp $ */
// vi: tabstop=4
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -16,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -568,10 +553,7 @@ js_initcx(JSRuntime* runtime, SOCKET sock, JSObject** glob, JSObject** ftp, js_c
BOOL success=FALSE;
BOOL rooted=FALSE;
lprintf(LOG_DEBUG,"%04d JavaScript: Initializing context (stack: %lu bytes)"
,sock,startup->js.cx_stack);
if((js_cx = JS_NewContext(runtime, startup->js.cx_stack))==NULL)
if((js_cx = JS_NewContext(runtime, JAVASCRIPT_CONTEXT_STACK))==NULL)
return(NULL);
JS_BEGINREQUEST(js_cx);
......@@ -6071,7 +6053,6 @@ void DLLCALL ftp_server(void* arg)
else
startup->options|=FTP_OPT_NO_JAVASCRIPT;
if(startup->js.max_bytes==0) startup->js.max_bytes=JAVASCRIPT_MAX_BYTES;
if(startup->js.cx_stack==0) startup->js.cx_stack=JAVASCRIPT_CONTEXT_STACK;
protected_uint32_adjust(&thread_count,1);
thread_up(FALSE /* setuid */);
......
/* Execute a Synchronet JavaScript module from the command-line */
/* $Id: jsexec.c,v 1.217 2020/08/17 00:48:28 rswindell Exp $ */
// vi: tabstop=4
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -16,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -68,7 +53,6 @@ js_callback_t cb;
scfg_t scfg;
char* text[TOTAL_TEXT];
ulong js_max_bytes=JAVASCRIPT_MAX_BYTES;
ulong js_cx_stack=JAVASCRIPT_CONTEXT_STACK;
FILE* confp;
FILE* errfp;
FILE* nulfp;
......@@ -133,7 +117,6 @@ void usage(FILE* fp)
" -d run in background (daemonize)\n"
#endif
" -m<bytes> set maximum heap size (default=%u bytes)\n"
" -s<bytes> set context stack size (default=%u bytes)\n"
" -t<limit> set time limit (default=%u, 0=unlimited)\n"
" -y<interval> set yield interval (default=%u, 0=never)\n"
" -g<interval> set garbage collection interval (default=%u, 0=never)\n"
......@@ -163,7 +146,6 @@ void usage(FILE* fp)
" -! wait for keypress (pause) on error\n"
" -D debugs the script\n"
,JAVASCRIPT_MAX_BYTES
,JAVASCRIPT_CONTEXT_STACK
,JAVASCRIPT_TIME_LIMIT
,JAVASCRIPT_YIELD_INTERVAL
,JAVASCRIPT_GC_INTERVAL
......@@ -830,10 +812,7 @@ static BOOL js_init(char** env)
if((js_runtime = jsrt_GetNew(js_max_bytes, 5000, __FILE__, __LINE__))==NULL)
return(FALSE);
fprintf(statfp,"JavaScript: Initializing context (stack: %lu bytes)\n"
,js_cx_stack);
if((js_cx = JS_NewContext(js_runtime, js_cx_stack))==NULL)
if((js_cx = JS_NewContext(js_runtime, JAVASCRIPT_CONTEXT_STACK))==NULL)
return(FALSE);
#ifdef JSDOOR
JS_SetOptions(js_cx, JSOPTION_JIT | JSOPTION_METHODJIT | JSOPTION_COMPILE_N_GO | JSOPTION_PROFILING);
......@@ -1141,7 +1120,6 @@ void get_ini_values(str_list_t ini, const char* section, js_callback_t* cb)
umask_val = iniGetInteger(ini, section, "umask", umask_val);
js_max_bytes = (ulong)iniGetBytes(ini, section, strJavaScriptMaxBytes ,/* unit: */1, js_max_bytes);
js_cx_stack = (ulong)iniGetBytes(ini, section, strJavaScriptContextStack,/* unit: */1, js_cx_stack);
cb->limit = iniGetInteger(ini, section, strJavaScriptTimeLimit , cb->limit);
cb->gc_interval = iniGetInteger(ini, section, strJavaScriptGcInterval , cb->gc_interval);
cb->yield_interval = iniGetInteger(ini, section, strJavaScriptYieldInterval , cb->yield_interval);
......@@ -1292,9 +1270,6 @@ int main(int argc, char **argv, char** env)
return(do_bail(1));
}
break;
case 's':
js_cx_stack=(ulong)parse_byte_count(p, /* units: */1);
break;
case 't':
cb.limit=strtoul(p,NULL,0);
break;
......
/* Synchronet Mail (SMTP/POP3) server and sendmail threads */
/* $Id: mailsrvr.c,v 1.735 2020/10/22 19:04:06 rswindell Exp $ */
// vi: tabstop=4
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -16,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -2261,10 +2246,7 @@ js_mailproc(SOCKET sock, client_t* client, user_t* user, struct mailproc* mailpr
}
if(*js_cx==NULL) {
lprintf(LOG_DEBUG,"%04d %s JavaScript: Initializing context (stack: %lu bytes)\n"
,sock, log_prefix, startup->js.cx_stack);
if((*js_cx = JS_NewContext(*js_runtime, startup->js.cx_stack))==NULL)
if((*js_cx = JS_NewContext(*js_runtime, JAVASCRIPT_CONTEXT_STACK))==NULL)
return FALSE;
}
JS_BEGINREQUEST(*js_cx);
......@@ -6123,7 +6105,6 @@ void DLLCALL mail_server(void* arg)
if(startup->max_inactivity==0) startup->max_inactivity=MAIL_DEFAULT_MAX_INACTIVITY; /* seconds */
if(startup->sem_chk_freq==0) startup->sem_chk_freq=DEFAULT_SEM_CHK_FREQ;
if(startup->js.max_bytes==0) startup->js.max_bytes=JAVASCRIPT_MAX_BYTES;
if(startup->js.cx_stack==0) startup->js.cx_stack=JAVASCRIPT_CONTEXT_STACK;
protected_uint32_adjust(&thread_count,1);
thread_up(FALSE /* setuid */);
......
/* Synchronet terminal server thread and related functions */
/* $Id: main.cpp,v 1.794 2020/08/08 20:17:02 rswindell Exp $ */
// vi: tabstop=4
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -16,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -1271,17 +1256,13 @@ JSContext* sbbs_t::js_init(JSRuntime** runtime, JSObject** glob, const char* des
JSContext* js_cx;
if(startup->js.max_bytes==0) startup->js.max_bytes=JAVASCRIPT_MAX_BYTES;
if(startup->js.cx_stack==0) startup->js.cx_stack=JAVASCRIPT_CONTEXT_STACK;
lprintf(LOG_DEBUG,"JavaScript: Creating %s runtime: %lu bytes"
,desc, startup->js.max_bytes);
if((*runtime = jsrt_GetNew(startup->js.max_bytes, 1000, __FILE__, __LINE__)) == NULL)
return NULL;
lprintf(LOG_DEBUG,"JavaScript: Initializing %s context (stack: %lu bytes)"
,desc, startup->js.cx_stack);
if((js_cx = JS_NewContext(*runtime, startup->js.cx_stack))==NULL)
if((js_cx = JS_NewContext(*runtime, JAVASCRIPT_CONTEXT_STACK))==NULL)
return NULL;
JS_BEGINREQUEST(js_cx);
......
/* Synchronet initialization (.ini) file routines */
/* $Id: sbbs_ini.c,v 1.170 2019/07/24 04:41:49 rswindell Exp $ */
// vi: tabstop=4
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -16,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -68,7 +53,6 @@ static const char* strLoginAttemptTempBanThreshold="LoginAttemptTempBanThreshold
static const char* strLoginAttemptTempBanDuration="LoginAttemptTempBanDuration";
static const char* strLoginAttemptFilterThreshold="LoginAttemptFilterThreshold";
static const char* strJavaScriptMaxBytes ="JavaScriptMaxBytes";
static const char* strJavaScriptContextStack ="JavaScriptContextStack";
static const char* strJavaScriptTimeLimit ="JavaScriptTimeLimit";
static const char* strJavaScriptGcInterval ="JavaScriptGcInterval";
static const char* strJavaScriptYieldInterval ="JavaScriptYieldInterval";
......@@ -104,7 +88,6 @@ static void sbbs_fix_js_settings(js_startup_t* js)
{
/* Some sanity checking here */
if(js->max_bytes==0) js->max_bytes=JAVASCRIPT_MAX_BYTES;
if(js->cx_stack==0) js->cx_stack=JAVASCRIPT_CONTEXT_STACK;
}
void sbbs_get_js_settings(
......@@ -117,7 +100,6 @@ void sbbs_get_js_settings(
char* p;
js->max_bytes = (ulong)iniGetBytes(list,section,strJavaScriptMaxBytes ,/* unit: */1,defaults->max_bytes);
js->cx_stack = (ulong)iniGetBytes(list,section,strJavaScriptContextStack ,/* unit: */1,defaults->cx_stack);
js->time_limit = iniGetInteger(list,section,strJavaScriptTimeLimit ,defaults->time_limit);
js->gc_interval = iniGetInteger(list,section,strJavaScriptGcInterval ,defaults->gc_interval);
js->yield_interval = iniGetInteger(list,section,strJavaScriptYieldInterval ,defaults->yield_interval);
......@@ -142,7 +124,6 @@ BOOL sbbs_set_js_settings(
BOOL failure=FALSE;
js_startup_t global_defaults = {
JAVASCRIPT_MAX_BYTES
,JAVASCRIPT_CONTEXT_STACK
,JAVASCRIPT_TIME_LIMIT
,JAVASCRIPT_GC_INTERVAL
,JAVASCRIPT_YIELD_INTERVAL
......@@ -160,11 +141,6 @@ BOOL sbbs_set_js_settings(
else
failure|=iniSetBytes(lp,section,strJavaScriptMaxBytes,/*unit: */1, js->max_bytes,style)==NULL;
if(js->cx_stack==defaults->cx_stack)
iniRemoveValue(lp,section,strJavaScriptContextStack);
else
failure|=iniSetBytes(lp,section,strJavaScriptContextStack,/*unit: */1,js->cx_stack,style)==NULL;
if(js->time_limit==defaults->time_limit)
iniRemoveValue(lp,section,strJavaScriptTimeLimit);
else
......@@ -246,7 +222,6 @@ static void get_ini_globals(str_list_t list, global_startup_t* global)
/* Setup default values here */
global->js.max_bytes = JAVASCRIPT_MAX_BYTES;
global->js.cx_stack = JAVASCRIPT_CONTEXT_STACK;
global->js.time_limit = JAVASCRIPT_TIME_LIMIT;
global->js.gc_interval = JAVASCRIPT_GC_INTERVAL;
global->js.yield_interval = JAVASCRIPT_YIELD_INTERVAL;
......
/* Synchronet constants, macros, and structure definitions */
/* $Id: sbbsdefs.h,v 1.267 2020/08/14 02:00:47 rswindell Exp $ */
// vi: tabstop=4
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -16,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -74,8 +59,8 @@
#define STR_UNKNOWN_USER "<unknown user>"
#define STR_NO_HOSTNAME "<no name>"
#define JAVASCRIPT_MAX_BYTES (8*1024*1024)
#define JAVASCRIPT_CONTEXT_STACK (16*1024)
#define JAVASCRIPT_MAX_BYTES (16*1024*1024)
#define JAVASCRIPT_CONTEXT_STACK (8*1024)
#define JAVASCRIPT_TIME_LIMIT (24*60*600) /* in 100ms ticks */
#define JAVASCRIPT_YIELD_INTERVAL 10000
#define JAVASCRIPT_GC_INTERVAL 100
......
/* Synchronet Services */
/* $Id: services.c,v 1.336 2020/08/08 23:27:23 rswindell Exp $ */
// vi: tabstop=4
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -16,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -759,7 +744,7 @@ js_initcx(JSRuntime* js_runtime, SOCKET sock, service_client_t* service_client,
BOOL success=FALSE;
BOOL rooted=FALSE;
if((js_cx = JS_NewContext(js_runtime, service_client->service->js.cx_stack))==NULL)
if((js_cx = JS_NewContext(js_runtime, JAVASCRIPT_CONTEXT_STACK))==NULL)
return(NULL);
JS_BEGINREQUEST(js_cx);
......@@ -1784,7 +1769,6 @@ void DLLCALL services_thread(void* arg)
/* Setup intelligent defaults */
if(startup->sem_chk_freq==0) startup->sem_chk_freq=DEFAULT_SEM_CHK_FREQ;
if(startup->js.max_bytes==0) startup->js.max_bytes=JAVASCRIPT_MAX_BYTES;
if(startup->js.cx_stack==0) startup->js.cx_stack=JAVASCRIPT_CONTEXT_STACK;
thread_up(FALSE /* setuid */);
......
/* Synchronet main/telnet server thread startup structure */
/* $Id: startup.h,v 1.84 2019/03/22 21:28:27 rswindell Exp $ */
// vi: tabstop=4
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -16,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -50,7 +35,6 @@
typedef struct {
ulong max_bytes; /* max allocated bytes before garbage collection */
ulong cx_stack; /* bytes for script execution stack */
ulong time_limit; /* maximum number of ticks (for infinite loop detection) */
ulong gc_interval; /* number of ticks between garbage collection attempts */
ulong yield_interval; /* number of ticks between time-slice yields */
......
/* Synchronet Web Server */
/* $Id: websrvr.c,v 1.720 2020/08/08 19:04:57 rswindell Exp $ */
// vi: tabstop=4
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -16,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -5754,10 +5739,7 @@ js_initcx(http_session_t *session)
{
JSContext* js_cx;
lprintf(LOG_DEBUG,"%04d JavaScript: Initializing context (stack: %lu bytes)"
,session->socket,startup->js.cx_stack);
if((js_cx = JS_NewContext(session->js_runtime, startup->js.cx_stack))==NULL)
if((js_cx = JS_NewContext(session->js_runtime, JAVASCRIPT_CONTEXT_STACK))==NULL)
return(NULL);
JS_BEGINREQUEST(js_cx);
......@@ -6971,7 +6953,6 @@ void DLLCALL web_server(void* arg)
if(startup->max_cgi_inactivity==0) startup->max_cgi_inactivity=WEB_DEFAULT_MAX_CGI_INACTIVITY; /* seconds */
if(startup->sem_chk_freq==0) startup->sem_chk_freq=DEFAULT_SEM_CHK_FREQ; /* seconds */
if(startup->js.max_bytes==0) startup->js.max_bytes=JAVASCRIPT_MAX_BYTES;
if(startup->js.cx_stack==0) startup->js.cx_stack=JAVASCRIPT_CONTEXT_STACK;
if(startup->ssjs_ext[0]==0) SAFECOPY(startup->ssjs_ext,".ssjs");
protected_uint32_adjust(&thread_count,1);
......