Exemplo n.º 1
0
static void
write_to_header(HioResponseHttp *http,
                const char      *s)
{
    HrtBuffer *buffer;

    buffer = hrt_buffer_new_static_utf8_locked(s);
    hio_output_stream_write(http->header_stream,
                            buffer);
    hrt_buffer_unref(buffer);
}
Exemplo n.º 2
0
/* request has been sufficiently parsed (usually, it has all headers
 * but not the body if any) to go ahead and start working.
 */
void
hwf_request_container_execute(HwfRequestContainer *request,
                              HrtTask             *request_task)
{
    HioResponseHttp *response;
    HrtBuffer *buffer;

    hrt_debug("Executing request %p in task %p", request, request_task);

    response = hio_request_http_get_response(HIO_REQUEST_HTTP(request));

    hio_response_http_send_headers(response);

    buffer = hrt_buffer_new_static_utf8_locked("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"><TITLE>HELLO WORLD</TITLE><P>This is a web page.</P>");

    hio_response_http_write(response, buffer);

    hrt_buffer_unref(buffer);

    hio_response_http_close(response);
}