-/* $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
* 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 $';
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);
(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
-/* $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 */
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 */