From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56267 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pwi8n-0005Il-8T for qemu-devel@nongnu.org; Mon, 07 Mar 2011 16:38:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pwi8i-0002T7-RS for qemu-devel@nongnu.org; Mon, 07 Mar 2011 16:38:57 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:58211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pwi8i-0002Sl-Kc for qemu-devel@nongnu.org; Mon, 07 Mar 2011 16:38:52 -0500 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e36.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p27LXdEs011640 for ; Mon, 7 Mar 2011 14:33:39 -0700 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p27LcoWL111052 for ; Mon, 7 Mar 2011 14:38:50 -0700 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p27LcoqU023964 for ; Mon, 7 Mar 2011 14:38:50 -0700 From: Adam Litke In-Reply-To: <1299528642-23631-7-git-send-email-mdroth@linux.vnet.ibm.com> References: <1299528642-23631-1-git-send-email-mdroth@linux.vnet.ibm.com> <1299528642-23631-7-git-send-email-mdroth@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 07 Mar 2011 15:38:48 -0600 Message-ID: <1299533928.2267.55.camel@aglitke> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [RFC][PATCH v7 06/16] virtagent: transport definitions List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: agl@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com, Jes.Sorensen@redhat.com, qemu-devel@nongnu.org, markus_mueller@de.ibm.com, aliguori@linux.vnet.ibm.com, abeekhof@redhat.com On Mon, 2011-03-07 at 14:10 -0600, Michael Roth wrote: > +#define VA_LINE_LEN_MAX 1024 > +static void va_rpc_parse_hdr(VAHTState *s) > +{ > + int i, line_pos = 0; > + bool first_line = true; > + char line_buf[VA_LINE_LEN_MAX]; > + > + TRACE("called"); > + > + for (i = 0; i < VA_HDR_LEN_MAX; ++i) { > + if (s->hdr[i] == 0) { > + /* end of header */ > + return; > + } > + if (s->hdr[i] != '\n') { > + /* read line */ > + line_buf[line_pos++] = s->hdr[i]; > + } else { > + /* process line */ > + if (first_line) { > + if (strncmp(line_buf, "POST", 4) == 0) { > + s->http_type = VA_HTTP_TYPE_REQUEST; > + } else if (strncmp(line_buf, "HTTP", 4) == 0) { > + s->http_type = VA_HTTP_TYPE_RESPONSE; > + } else { > + s->http_type = VA_HTTP_TYPE_UNKNOWN; > + } > + first_line = false; > + } > + if (strncmp(line_buf, "Content-Length: ", 16) == 0) { > + s->content_len = atoi(&line_buf[16]); > + } > + if (strncmp(line_buf, "X-Virtagent-Client-Tag: ", 24) == 0) { > + memcpy(s->hdr_client_tag, &line_buf[24], MIN(line_pos-25, 64)); > + //pstrcpy(s->hdr_client_tag, 64, &line_buf[24]); Remove this commented code. > + TRACE("\nTAG<%s>\n", s->hdr_client_tag); > + } > + line_pos = 0; > + memset(line_buf, 0, VA_LINE_LEN_MAX); > + } > + } > +} -- Thanks, Adam