Skip to content
Snippets Groups Projects
Commit 3156bde1 authored by rswindell's avatar rswindell
Browse files

Added JavaScript lprintf statements.

parent 22dc9b9f
No related branches found
No related tags found
No related merge requests found
...@@ -919,7 +919,7 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* js_glob, ...@@ -919,7 +919,7 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* js_glob,
} while(0); } while(0);
if(js_script!=NULL) if(js_script!=NULL)
JS_DestroyScript(js_cx, js_script); JS_DestroyScript(js_cx, js_script);
JS_DeleteProperty(js_cx, js_glob, "ftp_path"); JS_DeleteProperty(js_cx, js_glob, "ftp_path");
...@@ -1935,6 +1935,7 @@ static void ctrl_thread(void* arg) ...@@ -1935,6 +1935,7 @@ static void ctrl_thread(void* arg)
#endif #endif
#ifdef JAVASCRIPT #ifdef JAVASCRIPT
lprintf("%04d JavaScript: Initializing context",sock);
if(((js_cx=js_initcx(&js_glob))==NULL)) { if(((js_cx=js_initcx(&js_glob))==NULL)) {
lprintf("%04d !ERROR initializing JavaScript context",sock); lprintf("%04d !ERROR initializing JavaScript context",sock);
sockprintf(sock,"425 Error initializing JavaScript context"); sockprintf(sock,"425 Error initializing JavaScript context");
...@@ -3735,6 +3736,7 @@ static void ctrl_thread(void* arg) ...@@ -3735,6 +3736,7 @@ static void ctrl_thread(void* arg)
#endif #endif
#ifdef JAVASCRIPT #ifdef JAVASCRIPT
lprintf("%04d JavaScript: Destroying context",sock);
JS_DestroyContext(js_cx); /* Free Context */ JS_DestroyContext(js_cx); /* Free Context */
#endif #endif
...@@ -3773,6 +3775,7 @@ static void cleanup(int code) ...@@ -3773,6 +3775,7 @@ static void cleanup(int code)
#endif #endif
#ifdef JAVASCRIPT #ifdef JAVASCRIPT
lprintf("0000 JavaScript: Destroying runtime");
if(js_runtime!=NULL) { if(js_runtime!=NULL) {
JS_DestroyRuntime(js_runtime); JS_DestroyRuntime(js_runtime);
js_runtime=NULL; js_runtime=NULL;
...@@ -3938,11 +3941,16 @@ void DLLCALL ftp_server(void* arg) ...@@ -3938,11 +3941,16 @@ void DLLCALL ftp_server(void* arg)
strlwr(scfg.dir[i]->code); strlwr(scfg.dir[i]->code);
#ifdef JAVASCRIPT #ifdef JAVASCRIPT
lprintf("JavaScript: Creating runtime: %lu bytes"
,JAVASCRIPT_RUNTIME_MEMORY);
if((js_runtime = JS_NewRuntime(JAVASCRIPT_RUNTIME_MEMORY))==NULL) { if((js_runtime = JS_NewRuntime(JAVASCRIPT_RUNTIME_MEMORY))==NULL) {
lprintf("!JS_NewRuntime failed"); lprintf("!JS_NewRuntime failed");
cleanup(1); cleanup(1);
return; return;
} }
lprintf("JavaScript: Context stack: %lu bytes", JAVASCRIPT_CONTEXT_STACK);
#endif #endif
/* open a socket and wait for a client */ /* open a socket and wait for a client */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment