-/* $Id: httpd.js,v 1.38 2006/08/22 12:50:07 mmondor Exp $ */
+/* $Id: httpd.js,v 1.39 2006/08/22 13:51:58 mmondor Exp $ */
/*
* Copyright (c) 2005-2006, Matthew Mondor
* Server identification
*/
const SERVER_VERSION = 'mmondor_js_httpd/0.1.0 (NetBSD)';
-const SERVER_CVSID = '$Id: httpd.js,v 1.38 2006/08/22 12:50:07 mmondor Exp $';
+const SERVER_CVSID = '$Id: httpd.js,v 1.39 2006/08/22 13:51:58 mmondor Exp $';
if (this.transfer_eof)
stat = PSTAT_CLOSE_SUCCESS;
else {
+ /*
+ * XXX For some reason, we now get problems with
+ * immediate writing mode. Dandling client and file
+ * descriptors remain, like if HUP was ignored for
+ * some reason.
+ */
if (this.bwrite(this.transfer_data, false, false)
!= -1) {
this.transfer_state = TSTATE_READ;
* events, which will tell when we should drop the
* client.
*/
- if ((efd.revents & (FD.POLLHUP | FD.POLLERR)) != 0)
+ if ((efd.revents & (FD.POLLHUP | FD.POLLERR)) != 0 ||
+ /* XXX poll(2) says POLLOUT | POLLHUP impossible */
+ ((efd.events & FD.POLLOUT) == 1 &&
+ (efd.revents & FD.POLLIN) == 1))
efd.stat = PSTAT_CLOSE_ERROR;
else if (efd.stat != PSTAT_CLOSE_ERROR &&
(efd.revents & (FD.POLLIN | FD.POLLOUT)) != 0) {
-/* $Id: options.js,v 1.24 2006/08/20 20:32:42 mmondor Exp $ */
+/* $Id: options.js,v 1.25 2006/08/22 13:51:58 mmondor Exp $ */
var ilibprefix = "/home/mmondor/work/mmondor/mmsoftware/js/jslib/";
max_query_size: 4096,
max_post_size: 65536,
io_timeout: 60,
- file_buf_size: 65536,
+ file_buf_size: 65535,
default_vhost: "appserv.pulsar-zone.net",
default_mimetype: "application/octet-stream",
default_charset: "us-ascii",
-/* $Id: fd.js,v 1.9 2006/08/22 12:49:57 mmondor Exp $ */
+/* $Id: fd.js,v 1.10 2006/08/22 13:47:18 mmondor Exp $ */
/*
* Copyright (C) 2006, Matthew Mondor
}
if (len == data.length)
return 0;
+
this.bwrite_buffer += data.substr(len);
- this.events |= FD.POLLOUT;
- return 1;
- } else {
- this.events |= FD.POLLOUT;
+ /* FALLTHROUGH */
+ } else
this.bwrite_buffer += data;
- if (this.bwrite_buffer.length > 65535)
- return this.bflushw(poll);
- }
- return 0;
+ this.events |= FD.POLLOUT;
+ if (this.bwrite_buffer.length > 65534)
+ return this.bflushw(poll);
+
+ return 1;
}
/*