-/* $Id: httpd.js,v 1.46 2005/07/09 19:15:26 mmondor Exp $ */
+/* $Id: httpd.js,v 1.47 2005/07/10 01:58:25 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.46 2005/07/09 19:15:26 mmondor Exp $';
+SERVER_CVSID = '$Id: httpd.js,v 1.47 2005/07/10 01:58:25 mmondor Exp $';
try {
session_randfd.open('/dev/urandom', FD.O_RDONLY);
} catch (x) {
- err.put(x + "\n");
+ err.put(x + "while attempting to open /dev/urandom\n");
exit();
}
try {
rval = session_randfd.read(options.sess_id_size);
} catch (x) {
- err.put(x + "\n");
+ err.put(x + "while attempting to read from /dev/urandom\n");
}
this.sessid = '';
for (i = 0; i < options.sess_id_size; i++)
this.http_vhost = vhosts_table[vhost.toLowerCase()];
/*
+ * Verify if client sent a session cookie, and if it consists of a
+ * valid one, load session data.
+ */
+ if ((sessid = this.http_vars_cookies['SessionID']) != undefined &&
+ (sess = sessions_table[sessid]) != undefined &&
+ sess.expires > time) {
+ this.http_sessid = sessid;
+ this.http_vars_session = sess.variables;
+ }
+
+ /*
* Fill in associative array with any GET-style supplied
* variables (as part of the URL). We want this even for POST method.
*/
return this.parsePost(time);
}
- /*
- * Verify if client sent a session cookie, and if it consists of a
- * valid one, load session data.
- */
- if ((sessid = this.http_vars_cookies['SessionID']) != undefined &&
- (sess = sessions_table[sessid]) != undefined &&
- sess.expires > time) {
- this.http_sessid = sessid;
- this.http_vars_session = sess.variables;
- }
-
if (!close)
close = this.httpRespond(time);
o = new JSO(path.real, st.st_mtime,
obj.script);
} catch (x) {
- err.put(x + "\n");
+ err.put(x + 'evaluating script ' + path.real
+ + "\n");
http_error(this, 500, 'Internal Server Error',
'Please try again later.');
return true;
obj.script();
obj.flush(this, null);
} catch (x) {
- err.put(x + "\n");
+ err.put(x + 'executing script ' + path.real + "\n");
http_error(this, 500, 'Internal Server Error',
'Please try again later.');
}
err.put("No default_vhost property in options, exiting\n");
exit();
}
- if (vhosts_table[options.default_vhost] != undefined)
+ if (vhosts_table[options.default_vhost.toLowerCase()] != undefined)
default_vhost =
vhosts_table[options.default_vhost.toLowerCase()];
else {