Use Traffic Server style unused parameters
Avoid warning: "__STDC_LIMIT_MACROS" redefined
If a header is not comma-separated, an idx of 0 or -1 are the same, but the latter is preferred, http://trafficserver.readthedocs.org/en/latest/reference/api/TSMimeHdrFieldValueStringGet.en.html
Reorder some functions so related functions are grouped together
Rename some variables to more easily disambiguate them
Copy the upstream nbytes (if known) downstream to preserve the "Content-Length: ..." header.  In that case there will be a TS_EVENT_VCONN_WRITE_COMPLETE event from downstream before ntodo is zero, so write the digest to the cache in transform_vconn_write_complete().  If the upstream nbytes isn't known until the end of the content, update the downstream nbytes and reenable it to get it to send a TS_EVENT_VCONN_WRITE_COMPLETE event.  Fix some memory management.
Avoid segfault in TSVIOReenable() if the client disconnected
Drop TSVIOBufferGet() and test TSVIOReaderGet() instead
I don't know what this does
Improve comments
Whitespace
Minor edits
Declare variables outside switch statements, for consistency