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