Version 21 of Wibble change log

Updated 2010-12-23 01:31:22 by AMG

AMG: This page lists detailed change information for Wibble implementation. See also Wibble news for higher-level announcements. Discussion can be in-line here, on the Wibble discussion page if it's lengthy, or on Wibble bugs if you want to report a problem.

Fetching backrefs...

2010-12-22 - Fix 501 bug

Release version: [L1 ]; line differences: [L2 ]; word differences: [L3 ]; announcement: [L4 ]

AMG: Oops. The 501 code didn't work. I forgot to quote the value of the header key, resulting in an extra argument to [dict create].

  • Fix 501 bug.

2010-12-20 - Remove no-op [nexthandler] invocations, rearrange [suspend]

Release version: [L5 ]; line differences: [L6 ]; word differences: [L7 ]; announcement: [L8 ]

AMG: Per JBR's suggestion, I removed the [nexthandler $state] calls when $state is unmodified. Instead the zone handler just returns. This winds up having the same effect, because the no-op [nexthandler $state] was changing $system without really modifying it. ;^)

  • Remove no-op [nexthandler] invocations throughout Wibble.
  • Clarify the comment for [resume].
  • Rearrange [suspend] to be a little easier to understand.

2010-12-18 - State dicts, coroutine helpers, fixed zone handler order

Release version: [L9 ]; line differences: [L10 ]; word differences: [L11 ]; announcement: [L12 ]

AMG: I changed the zone handler arguments, so any existing zone handlers will have to be rewritten. I hope this new method works better than the fixed request/response approach I had before. Also, I changed the way the coroutines [yield] and are resumed; this should make AJAX work better. (Yes, Wibble supports AJAX!)

  • Cutesy CSS changes in [vars].
  • Update all zone handlers to receive a unified state dict instead of request and response dicts.
  • Update [vars] to display all sub-dicts in $state.
  • Pointless wording, capitalization, comment, and indentation changes.
  • Fix [dumprequest] to format query the same as post.
  • Write [resume] and [suspend] as wrappers around reinvoking the coroutine and [yield].
  • Remove [chan names] testing code since it didn't work anyway.
  • Update [getline] and [getblock] to use [suspend].
  • Rename $zones to $zonehandlers.
  • Change $zonehandlers to be a flat list instead of a dict.
  • Rewrite [getresponse] to use state dictionaries instead of request/response pairs.
  • Don't merge options into the request dict; instead make a separate options dict in $state.
  • Fix zone order handling in [getresponse].
  • Fix a subtle bug in [getresponse] that can make it replace the wrong state entry in $system.
  • Update the [chan copy] code to use [resume] and [suspend].
  • Don't install the [chan event] handler in [listen] since it'll be installed by [suspend].

2010-11-13 - Non-blocking file transfers, bug workarounds

Release version: [L13 ]; line differences: [L14 ]; word differences: [L15 ]; announcement: [L16 ]

AMG: Sorry about the blocking [chan copy]. It's fixed now.

  • Don't initialize $wibble::zones to empty string. This makes it easier to re-[source] wibble.tcl while it's running.
  • Removed some extra [chan close]s. The channel will be closed anyway by the finally clause at the end of [process].
  • Added workaround for the Wiki bug that was corrupting [enhtml] and [enattr] (see [L17 ]).
  • Removed the question mark from [enquery] to make it mirror [dequery]
  • Made [chan copy] be non-blocking.
  • Added workaround for the "command returned bad code: 2" Tcl bug (see [L18 ]).
  • Spelled out "peerhost" and "peerport".
  • Re-fixed the [namespace code] in [accept] (see [L19 ]).

2010-11-07 - Separate templates and scripts, improved request dictionary reporting

Release version: [L20 ]; line differences: [L21 ]; word differences: [L22 ]; announcement: [L23 ]

AMG: Now that I've finished reorganizing all the Wibble pages, I'm eager to edit them some more! :^)

  • Wrote [dumprequest] to partially "flatten" a request dictionary to make it easier to display.
  • Made the output of the vars zone handler much nicer.
  • Made the error log nicer too.
  • Split the template zone handler into two pieces:
    • [template]: Compile *.tmpl files into *.script files.
    • [script]: Execute *.script files.
  • Added rawtime, time, and port to the request dictionary.
  • Completely removed PUT.
  • Slightly simplified POST handling.
  • Replaced [dict for] with [foreach] to support duplicate keys.
  • Improved the failsafe ![info exists $request] error log.
  • Removed -nonewline option from [log].
  • Moved \n from the end to the beginning of the line.
  • Added new script zone handler to example code.
  • Removed special logging of the never-implemented "content" key in the request dictionary.
  • Removed [accept] and changed [listen] to use [apply].

2010-11-06 - Header and POST parsing

Release version: [L24 ]; line differences: [L25 ]; word differences: [L26 ]; announcement: [L27 ]

AMG: I've been holding on to these changes for far too long, and I'm glad to finally publish them.

  • Added separator comments delimiting major sections of the code.
  • Changed usage of [dict with request] to cut down on indenting.
  • Added many conversion routines:
    • [enhtml]: Encode for HTML.
    • [enattr]: Encode for HTML tag attribute.
    • [enpre]: Encode for HTML <pre>.
    • [enquery]: Encode a query string.
    • [dequery]: Decode a query string into a list.
    • [enhex]: Encode most non-alphanumerics with hexadecimal codes.
    • [dehex]: Decode hexadecimal encoding.
    • [enurl]: Encode for URLs.
    • [deurl]: Decode URL encoding.
    • [delist]: Decode header list encoding.
    • [dequote]: Decode header quoting.
    • [deheader]: Decode HTTP headers. (!!!)
  • Actually, [dehex] already existed, named [unhex]. Renamed because [enhex] and [unhex] are too similar.
  • Modified zone handlers to use new conversion routines, e.g. [enhtml].
  • Replaced <td><b> with <th> in [vars].
  • Simplified the way [dirlist] adds .. to the directory listing.
  • Changed [applytemplate] to [compiletemplate], which returns the script instead of running it.
  • Made [template] cache the result of [compiletemplate].
  • Simplified append's arguments in [compiletemplate].
  • Added channel closure detection to [getline] and [getblock].
  • Reverted second-chance [chan gets] in [getline], since I'm not convinced it's necessary (see [L28 ]).
  • Changed the way [nexthandler] and [sendresponse] pass control back to [getresponse].
  • Added accept, post, and rawpost to the request dictionary.
  • Added Accept*: header handling.
  • Added POST handling.
  • Unset request dictionary after sending the response to avoid stale data.
  • Correct error report charset.
  • Incorporated APN's [accept] fix (see [L29 ]).

The channel closure detection makes it possible to close connections due to timeouts. This isn't implemented yet, but it would be nice to harden Wibble against basic DoS attacks.