*** empty log message ***
authorMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 16 Nov 2006 06:59:18 +0000 (06:59 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Thu, 16 Nov 2006 06:59:18 +0000 (06:59 +0000)
mmsoftware/js/js-sh/app/httpd/httpd.js
mmsoftware/js/js-sh/app/httpd/options.js

index 7c9d674..13f4cd5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: httpd.js,v 1.41 2006/10/27 05:20:41 mmondor Exp $ */
+/* $Id: httpd.js,v 1.42 2006/11/16 06:59:18 mmondor Exp $ */
 
 /*
  * Copyright (c) 2005-2006, Matthew Mondor
@@ -76,7 +76,7 @@
  * Server identification
  */
 const SERVER_VERSION = 'mmondor_js_httpd/0.1.0 (NetBSD)';
-const SERVER_CVSID = '$Id: httpd.js,v 1.41 2006/10/27 05:20:41 mmondor Exp $';
+const SERVER_CVSID = '$Id: httpd.js,v 1.42 2006/11/16 06:59:18 mmondor Exp $';
 
 
 
@@ -731,7 +731,7 @@ FD.prototype.parseQuery = function(time)
        var evil_browser = evil_os = false;
        var vhost = '';
        var lines;
-       var words;
+       var words, w;
        var i;
        /*
        var sessid, sess;
@@ -781,24 +781,26 @@ FD.prototype.parseQuery = function(time)
 
        /*
         * Parse header for interesting lines.
+        * The element name is case-insensitive.
         */
        if (valid && !this.http_old_get) {
                for (i in lines) {
                        words = lines[i].split(' ');
-                       if (words[0] == 'Host:' && words.length == 2) {
+                       w = words[0].toLowerCase();
+                       if (w == 'host:' && words.length == 2) {
                                var i2;
 
                                if ((i2 = words[1].indexOf(':')) != -1)
                                        words[1] = words[1].substr(0, i2);
                                vhost = words[1];
-                       } else if (words[0] == 'Cookie:') {
+                       } else if (w == 'cookie:') {
                                words = (lines[i].substr(8)).split('=');
                                if (words.length == 2) {
                                        property_add(this.http_vars_cookies,
                                            words[0], words[1]);
                                        this.http_vars_cookies_count++;
                                }
-                       } else if (words[0] == 'User-Agent:') {
+                       } else if (w == 'user-agent:') {
                                this.http_agent = lines[i].substr(12);
                                if (options.ban_msie == true &&
                                    this.http_agent.indexOf('MSIE') != -1)
@@ -806,13 +808,12 @@ FD.prototype.parseQuery = function(time)
                                if (options.ban_windows == true &&
                                    this.http_agent.indexOf('Windows') != -1)
                                        evil_os = true;
-                       } else if (words[0] == 'Content-Length:' &&
-                                  words.length == 2)
+                       } else if (w == 'content-length:' && words.length == 2)
                                this.http_content_length = words[1].valueOf();
-                       else if (words[0] == 'If-Modified-Since:')
+                       else if (w == 'if-modified-since:')
                                this.http_modified_since = Math.round(
                                    Date.parse(lines[i].substr(19)) / 1000);
-                       else if (words[0] == 'Range:')
+                       else if (w == 'range:')
                                this.http_range = lines[i].substr(7);
                }
        }
index c065a52..2091160 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: options.js,v 1.26 2006/08/22 13:52:27 mmondor Exp $ */
+/* $Id: options.js,v 1.27 2006/11/16 06:59:18 mmondor Exp $ */
 
 var ilibprefix = "/home/mmondor/work/mmondor/mmsoftware/js/jslib/";
 
@@ -6,7 +6,7 @@ var ilibprefix = "/home/mmondor/work/mmondor/mmsoftware/js/jslib/";
 var options = {
        debug:                  true,
        max_connections:        64,
-       max_connections_addr:   8,
+       max_connections_addr:   8,      /* 8 minimum recommended */
        max_query_size:         4096,
        max_post_size:          65535,
        io_timeout:             60,