Commit 7d0d3b6f authored by deuce's avatar deuce
Browse files

Track the last user object created for the JS runtime and don't re-create it

if it's already "right"
parent 06801c54
......@@ -207,6 +207,7 @@ typedef struct {
int last_user_num;
time_t logon_time;
char username[LEN_NAME+1];
int last_js_user_num;
/* JavaScript parameters */
JSRuntime* js_runtime;
......@@ -1057,6 +1058,8 @@ void http_logoff(http_session_t * session)
BOOL http_checkuser(http_session_t * session)
{
if(session->req.dynamic==IS_SSJS) {
if(session->last_js_user_num==session->user.number)
return(TRUE);
lprintf(LOG_INFO,"%04d JavaScript: Initializing User Objects",session->socket);
if(session->user.number>0) {
if(!js_CreateUserObjects(session->js_cx, session->js_glob, &scfg, &session->user
......@@ -1074,6 +1077,7 @@ BOOL http_checkuser(http_session_t * session)
return(FALSE);
}
}
session->last_js_user_num==session->user.number;
}
return(TRUE);
}
......@@ -2676,6 +2680,7 @@ void http_session_thread(void* arg)
startup->socket_open(startup->cbdata,TRUE);
session.last_user_num=-1;
session.last_js_user_num=-1;
session.logon_time=0;
while(!session.finished && server_socket!=INVALID_SOCKET) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment