static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers,
char **content_buf, int *content_len)
{
static int decode_headers_content(ODR o, int off, Z_HTTP_Header **headers,
char **content_buf, int *content_len)
{
(*headers)->value = (char*) odr_malloc(o, i - po + 1);
memcpy ((*headers)->value, o->buf + po, i - po);
(*headers)->value[i - po] = '\0';
(*headers)->value = (char*) odr_malloc(o, i - po + 1);
memcpy ((*headers)->value, o->buf + po, i - po);
(*headers)->value[i - po] = '\0';
if (!strcasecmp((*headers)->name, "Transfer-Encoding")
&&
!strcasecmp((*headers)->value, "chunked"))
if (!strcasecmp((*headers)->name, "Transfer-Encoding")
&&
!strcasecmp((*headers)->value, "chunked"))
{
*content_len = o->size - i;
*content_buf = (char*) odr_malloc(o, *content_len + 1);
{
*content_len = o->size - i;
*content_buf = (char*) odr_malloc(o, *content_len + 1);
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\""
" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
"<HTML>\n"
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\""
" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
"<HTML>\n"
while (i < o->size-1 && o->buf[i] != '\n')
i++;
return decode_headers_content(o, i, &hr->headers,
while (i < o->size-1 && o->buf[i] != '\n')
i++;
return decode_headers_content(o, i, &hr->headers,
}
int yaz_decode_http_request(ODR o, Z_HTTP_Request **hr_p)
{
int i, po;
Z_HTTP_Request *hr = (Z_HTTP_Request *) odr_malloc(o, sizeof(*hr));
}
int yaz_decode_http_request(ODR o, Z_HTTP_Request **hr_p)
{
int i, po;
Z_HTTP_Request *hr = (Z_HTTP_Request *) odr_malloc(o, sizeof(*hr));