*** empty log message ***
authorMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 7 Jul 2005 20:48:41 +0000 (20:48 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 7 Jul 2005 20:48:41 +0000 (20:48 +0000)
tests/js-test/js/httpd/httpd.js
tests/js-test/js/httpd/options.js

index 070f05d..7cb867f 100644 (file)
@@ -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
index ad0355d..931d305 100644 (file)
@@ -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 */