*** empty log message ***
authorMatthew Mondor <mmondor@pulsar-zone.net>
Mon, 8 Aug 2005 15:11:29 +0000 (15:11 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Mon, 8 Aug 2005 15:11:29 +0000 (15:11 +0000)
tests/js-test/js/httpd/httpd.js

index 83315db..5cebc7b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: httpd.js,v 1.71 2005/07/31 04:51:50 mmondor Exp $ */
+/* $Id: httpd.js,v 1.72 2005/08/08 15:11:29 mmondor Exp $ */
 
 /*
  * Copyright (c) 2005, Matthew Mondor
@@ -62,7 +62,7 @@
  * Server identification
  */
 SERVER_VERSION                 = 'mmondor_js_httpd/0.0.1 (NetBSD)';
-SERVER_CVSID   = '$Id: httpd.js,v 1.71 2005/07/31 04:51:50 mmondor Exp $';
+SERVER_CVSID   = '$Id: httpd.js,v 1.72 2005/08/08 15:11:29 mmondor Exp $';
 
 
 
@@ -344,10 +344,12 @@ HTTPReply.prototype = {
                        headers += 'Content-Type: ' + this.type + "\r\n";
                headers += "\r\n";
 
-               if (!fd.http_old_get)
-                       fd.bwrite(headers + contents);
-               else
-                       fd.bwrite(contents);
+               try {
+                       if (!fd.http_old_get)
+                               fd.bwrite(headers + contents);
+                       else
+                               fd.bwrite(contents);
+               } catch (x) {}
        }
 }
 
@@ -857,6 +859,9 @@ FD.prototype.parseRequest = function(time)
        return close;
 }
 
+/*
+ * After reading post data, allows to parse it down into variables
+ */
 FD.prototype.parsePost = function(time)
 {
        var words;
@@ -882,6 +887,9 @@ FD.prototype.parsePost = function(time)
        return this.httpRespond(time);
 }
 
+/*
+ * Finally respond to client request
+ */
 FD.prototype.httpRespond = function(time)
 {
        var path, fd, st, res, ext, mimetype, i, sess, size;
@@ -1297,6 +1305,8 @@ FD.prototype.httpDebug = function()
  * instead of write(2).  The main poll(2) based loop can then handle buffer
  * flushing.  However, we first attempt to immediately write as much as we can
  * before queuing what needs to be written again.
+ * Like write(2), this function can throw an exception on error, including
+ * for EAGAIN.
  */
 FD.prototype.bwrite = function(data)
 {