From a87fdc6f1e5ba89de1de7bcf993b7ec6f08615ed Mon Sep 17 00:00:00 2001 From: Matthew Mondor Date: Thu, 7 Jul 2005 20:48:41 +0000 Subject: [PATCH] *** empty log message *** --- tests/js-test/js/httpd/httpd.js | 12 +++++++----- tests/js-test/js/httpd/options.js | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/js-test/js/httpd/httpd.js b/tests/js-test/js/httpd/httpd.js index 070f05d..7cb867f 100644 --- a/tests/js-test/js/httpd/httpd.js +++ b/tests/js-test/js/httpd/httpd.js @@ -1,4 +1,4 @@ -/* $Id: httpd.js,v 1.27 2005/07/07 20:36:26 mmondor Exp $ */ +/* $Id: httpd.js,v 1.28 2005/07/07 20:48:41 mmondor Exp $ */ /* * Copyright (c) 2005, Matthew Mondor @@ -90,7 +90,7 @@ eval(file_read('root.js')); /* Root object for virtual chroot(2) */ * Server identification */ SERVER_VERSION = 'mmondor_js_httpd/0.0.1 (NetBSD)'; -SERVER_CVSID = '$Id: httpd.js,v 1.27 2005/07/07 20:36:26 mmondor Exp $'; +SERVER_CVSID = '$Id: httpd.js,v 1.28 2005/07/07 20:48:41 mmondor Exp $'; @@ -203,11 +203,11 @@ function session_gc(time) function Session(time, exp) { - var rval = session_randfd.read(64); + var rval = session_randfd.read(options.sess_id_size); var i; this.sessid = ''; - for (i = 0; i < 64; i++) + for (i = 0; i < options.sess_id_size; i++) this.sessid += session_charlist.charAt(rval.charCodeAt(i) & 0x3f); @@ -828,11 +828,13 @@ FD.prototype.httpRespond = function(time) (this.http_vhost.session_exp != undefined ? this.http_vhost.session_exp : options.default_session_exp)); + sess.variables.count = 1; cookie = 'Set-Cookie: SessionID=' + sess.sessid + '; expires=' + (new Date(sess.expires * 1000)).toGMTString() + '; path=/'; - } + } else + this.http_vars_session.count++; /* * If client only wanted the document if it wasn't modified since diff --git a/tests/js-test/js/httpd/options.js b/tests/js-test/js/httpd/options.js index ad0355d..931d305 100644 --- a/tests/js-test/js/httpd/options.js +++ b/tests/js-test/js/httpd/options.js @@ -1,4 +1,4 @@ -/* $Id: options.js,v 1.7 2005/07/07 20:36:26 mmondor Exp $ */ +/* $Id: options.js,v 1.8 2005/07/07 20:48:41 mmondor Exp $ */ var options = { /* Maximum number of concurrent clients that we should serve */ @@ -15,7 +15,8 @@ var options = { default_mimetype: "application/octet-stream", default_charset: "us-ascii", default_session_exp: 1800, - sess_gc_interval: 600 + sess_gc_interval: 600, + sess_id_size: 64 }; /* Address:port combinations to listen to */ -- 2.9.0