[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [RFC][PATCH v7 06/16] virtagent: transport definitions
From: |
Adam Litke |
Subject: |
[Qemu-devel] Re: [RFC][PATCH v7 06/16] virtagent: transport definitions |
Date: |
Mon, 07 Mar 2011 15:38:48 -0600 |
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
[Qemu-devel] Re: [RFC][PATCH v7 01/16] Move code related to fd handlers into utility functions, Paolo Bonzini, 2011/03/09
[Qemu-devel] [RFC][PATCH v7 06/16] virtagent: transport definitions, Michael Roth, 2011/03/07
- [Qemu-devel] Re: [RFC][PATCH v7 06/16] virtagent: transport definitions,
Adam Litke <=
[Qemu-devel] [RFC][PATCH v7 13/16] virtagent: add va_shutdown HMP/QMP command, Michael Roth, 2011/03/07
[Qemu-devel] [RFC][PATCH v7 11/16] virtagent: add va_ping HMP/QMP command, Michael Roth, 2011/03/07
[Qemu-devel] [RFC][PATCH v7 15/16] virtagent: qemu-va, system-level virtagent guest agent, Michael Roth, 2011/03/07
[Qemu-devel] [RFC][PATCH v7 16/16] virtagent: add bits to build virtagent host/guest components, Michael Roth, 2011/03/07
[Qemu-devel] [RFC][PATCH v7 12/16] virtagent: add "shutdown" RPC to server, Michael Roth, 2011/03/07
[Qemu-devel] [RFC][PATCH v7 14/16] virtagent: add virtagent chardev, Michael Roth, 2011/03/07
[Qemu-devel] [RFC][PATCH v7 07/16] virtagent: base RPC client definitions, Michael Roth, 2011/03/07
[Qemu-devel] [RFC][PATCH v7 08/16] virtagnet: base RPC server definitions, Michael Roth, 2011/03/07
[Qemu-devel] [RFC][PATCH v7 04/16] virtagent: bi-directional RPC handling logic, Michael Roth, 2011/03/07