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
Minor edits
TS-2553 CHANGES