Fix an off-by-one bug in the network protocol handler so that it can accept a
zero-length file.