From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqPY4-00022s-0A for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:58:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqPXy-00022P-9D for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:58:10 -0400 Received: from [199.232.76.173] (port=42045 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqPXy-00022M-2t for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:58:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14208) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqPXx-0006ER-Gw for qemu-devel@nongnu.org; Wed, 23 Sep 2009 06:58:05 -0400 Message-ID: <4AB9FF35.9090208@redhat.com> Date: Wed, 23 Sep 2009 13:57:57 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] ANN: QEMU Monitor Protocol git tree References: <20090921224430.610da97b@doriath> <4AB98034.3060608@codemonkey.ws> <20090923095701.GE29269@redhat.com> In-Reply-To: <20090923095701.GE29269@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, Luiz Capitulino On 09/23/2009 12:57 PM, Daniel P. Berrange wrote: >> Ignoring the dos-ism, since you can parse JSON with a regexp, why do we >> need explicit message boundaries? >> > I think it would be nice to be able to assume that each JSON message > will not cross a line-end boundary. Whether we use CRLF, just CR or > just LF I don't mind. Its much easier to search for a message boundary > by just doing strchr('\n') than having to actually parse the JSON or > use a regexp at that point. > A good parser will consume exactly enough characters to make up an object or let you know if it needs more. I don't think using a regexp is warranted. -- error compiling committee.c: too many arguments to function