Re: [Qemu-devel] [PATCH] sheepdog: discard the payload if the header is invalid

2015-09-01 Thread Liu Yuan
On Tue, Sep 01, 2015 at 10:05:38AM +0800, Liu Yuan wrote: > On Mon, Aug 31, 2015 at 09:51:00PM -0400, Jeff Cody wrote: > > On Tue, Sep 01, 2015 at 09:29:31AM +0800, Liu Yuan wrote: > > > From: Liu Yuan > > > > > > We need to discard the payload if we get a invalid header due to whatever > > > re

Re: [Qemu-devel] [PATCH] sheepdog: discard the payload if the header is invalid

2015-08-31 Thread Liu Yuan
On Mon, Aug 31, 2015 at 09:51:00PM -0400, Jeff Cody wrote: > On Tue, Sep 01, 2015 at 09:29:31AM +0800, Liu Yuan wrote: > > From: Liu Yuan > > > > We need to discard the payload if we get a invalid header due to whatever > > reason > > to avoid data stream curruption. > > If the header is invali

Re: [Qemu-devel] [PATCH] sheepdog: discard the payload if the header is invalid

2015-08-31 Thread Jeff Cody
On Tue, Sep 01, 2015 at 09:29:31AM +0800, Liu Yuan wrote: > From: Liu Yuan > > We need to discard the payload if we get a invalid header due to whatever > reason > to avoid data stream curruption. If the header is invalid / corrupted, how can rsp.data_length be trusted? Out of curiosity, is th

[Qemu-devel] [PATCH] sheepdog: discard the payload if the header is invalid

2015-08-31 Thread Liu Yuan
From: Liu Yuan We need to discard the payload if we get a invalid header due to whatever reason to avoid data stream curruption. For e.g., the response consists of header plus data payload. If we simply read the header then the data payload is left in the socket buffer and the next time we would