Properly handle a two-phase read: header, then body

Fixes the dumb overflow error I was seeing for the padding.  However, I
still think the original protocol is buggy, but only in the sense that
I thought the padding should move it to exactly 1k, rather than at
*least* 1k.