qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 6/6] io: Reply to ping frames


From: Brandon Carpenter
Subject: Re: [Qemu-devel] [PATCH v2 6/6] io: Reply to ping frames
Date: Mon, 11 Sep 2017 10:43:21 -0700

On Mon, Sep 11, 2017 at 10:37 AM, Daniel P. Berrange <address@hidden> wrote:
At the time qio_channel_websock_decode_header is run, 'encinput' is only guaranteed to contain enough data to decode the header.

Because the PING opcode is a control frame, this bit of code earlier in the function will ensure the entire frame has been read before the PING processing occurs:

      if (ioc->encinput.offset < ioc->payload_remain) {
/* Wait for the entire payload before processing control frames
             * because the payload will most likely be echoed back. */
if (ioc->opcode & QIO_CHANNEL_WEBSOCK_CONTROL_OPCODE_MASK) {
                return QIO_CHANNEL_ERR_BLOCK;
            }
payload_len = ioc->encinput.offset - (ioc->encinput.offset % 4);

--
Brandon Carpenter | Software Engineer
Cypherpath, Inc.
400 Columbia Point Drive Ste 101 | Richland, Washington USA
Office: (650) 713-3060


--


CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain proprietary, confidential or privileged information or otherwise be protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify the sender and destroy all copies and the original message.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]