Hi Alvaro,
I have implemented you 'generic' code into my handler.
ret_t
cherokee_handler_example_step (cherokee_handler_example_t *hdl,
cherokee_buffer_t *buf)
{
if (cherokee_buffer_is_empty (&hdl->prebuilt))
return ret_eof;
cherokee_buffer_add (buf, &hdl->prebuilt, 1024);
cherokee_buffer_move_to_begin (&hdl->prebuilt, 1024);
if (cherokee_buffer_is_empty (&hdl->prebuilt))
return ret_eof_have_data;
return ret_ok;
}
Now cherokee_buffer_add seems to be wrongly used, we all don't know what
type prebuilt is, but I think we can assume it is a cherokee_buffer_t, so
one would wonder...
What do you mean here?
Do you want to:
cherokee_buffer_add (buf, hdl->prebuilt.buf, 1024);
What the alternative was to use add_buffer, but that probably adds the
entire buffer.
Currently I'm doing the following thing, I generate an RRD 'png' image. In
to a filename:
cherokee_buffer_read_file(&hdl->prebuilt, filename);
But the behavior I see, if I start hitting F5 on my handler, *sometimes*
instead of serving me a nice PNG. It will return a headerless binary
transmission.
When I look at the dump I see a very strange binary prefix before
HTTP/1.1, as if buffers get too big or looping. I'll try some valgrinding.
But maybe someone has some hints.
Stefan
I have implemented you 'generic' code into my handler.
ret_t
cherokee_handler_example_step (cherokee_handler_example_t *hdl,
cherokee_buffer_t *buf)
{
if (cherokee_buffer_is_empty (&hdl->prebuilt))
return ret_eof;
cherokee_buffer_add (buf, &hdl->prebuilt, 1024);
cherokee_buffer_move_to_begin (&hdl->prebuilt, 1024);
if (cherokee_buffer_is_empty (&hdl->prebuilt))
return ret_eof_have_data;
return ret_ok;
}
Now cherokee_buffer_add seems to be wrongly used, we all don't know what
type prebuilt is, but I think we can assume it is a cherokee_buffer_t, so
one would wonder...
What do you mean here?
Do you want to:
cherokee_buffer_add (buf, hdl->prebuilt.buf, 1024);
What the alternative was to use add_buffer, but that probably adds the
entire buffer.
Currently I'm doing the following thing, I generate an RRD 'png' image. In
to a filename:
cherokee_buffer_read_file(&hdl->prebuilt, filename);
But the behavior I see, if I start hitting F5 on my handler, *sometimes*
instead of serving me a nice PNG. It will return a headerless binary
transmission.
When I look at the dump I see a very strange binary prefix before
HTTP/1.1, as if buffers get too big or looping. I'll try some valgrinding.
But maybe someone has some hints.
Stefan