• last updated 12 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Improve error handling idioms and handle additional error cases where the client has just disconnected

Try to trap additional disconnection-related errors

Put the puts operation in the try catch as well

Fix typo in comment

Use finer grained error handling to intercept disconnection from client

Treat failure to flush the channel as just a warning, because this usually just means client (e.g. browser in a chat) closed the connection

make sure to initialize global nonce value in bgdevlivery thread

improve spelling

  1. … 8 more files in changeset.
Revert massive replacement of empty list creation sentences. The use of '[list]' instead of '{}' adds semantics that could be used for performance improvements in the future, such as using a different internal representation. There is already work in this direction, avoiding the generation of the string representation during comparison of empty strings (huge thanks to Stefan Sobernig for the pointer: https://core.tcl.tk/tcl/info/44527c632ed609c2).

  1. … 475 more files in changeset.
improve grammar

Prefer '{}' to '[list]' when creating empty lists

  1. … 204 more files in changeset.
Fix typo chartype->charset

Use consistently xo::library to ensure application specific subclassability

  1. … 13 more files in changeset.
Reduce verbosity

prefer XOTcl2 idioms

  1. … 10 more files in changeset.
Make ad_returnfile_background work also without libthread

white space changes and typos

improve documentation in the code, and make behavior more explicit

merged changes from the oacs-5-9 branch and resolved conflicts

  1. … 7834 more files in changeset.
Merging back to HEAD all changes that happened in branch oacs-5-8 between tags: vg-merge-oacs-5-8-from-20141027 and vg-merge-oacs-5-8-from-20150427

  1. … 520 more files in changeset.
Merging back to HEAD branch oacs-5-8 (using tag vg-merge-oacs-5-8-from-20141027).

  1. … 2547 more files in changeset.
- use new naviserver command ns_driversection if available to determine writer spooling

- bgdelivery-procs:

* refactor subscriber logic to avoid code duplication

* implement sweeper to check for stale connections

- chat-procs:

* call bgdelivery sweeper from chat sweeper

  1. … 1 more file in changeset.
- Added the changes mostly provided by Antonio Pisano to update the comet behavior for current browsers, which provide nowadays often more complete HTTP stacks.

  1. … 4 more files in changeset.
- fix parametrization of ns_writer for range requests

- changed comet output to chunked encoding

use lassign instead of lset

make sure to configure the channel to nonblocking before we close. A close to a blocking channel can block and can therefore block all spools and therefore potentially the full server.

Background: Tcl's fcopy sets a channel to non-blocking. In earlier Tcl versions, the channel was left in the non-blocking state, also after fcopy terminates (e.g. in error cases).

Newer Tcl versions seem to reestablish the earlier state, so we have to care now for the problem in bgdelivery.

- use naviserver writer thread if configured

Avoid potential attacks via too many open files.

Background: Tcl uses still select() for event processing, which has a pretty much hardcoded limit of max 1024 files (one has to recompile Tcl, libc, and maybe the kernel). With bgdelivery it is possible to deliver more than 1000 files simultaneously, but Tcl panics, when the number of descriptors is too large. We experienced the problem in a sitation, where the 1000+ requests were produced from a incorrect browser behavior (e.g. iPad issues a series of range requests rapidly without closing the last requests); bgdelivery allows now just one spooling request for a file from a user at one time.