I have the whole http (firstline, headers and content) within a buffer and
want to send it "as it is" to the browser. (in my example this is *txt)

I'm looking for a method that will sent it without any modification (no
evhttp_make_header, ...).


By looking within the code, I've found the that we need to add buffers into
the evcon->output_buffer, but the callback to evhttp_send_done does not
work.
If I'm copying the procedure evhttp_send_done within my code, I receive
several errors mainly because this is based on "not public" functions.


If I replace evhttp_send_done by NULL, it works (browser receive exactly
what I've sent, thus *txt), but the connection never close ;-).


I'm using libevent-1.3e


Here a small meta code of what I'm trying to do:
    struct evbuffer *buff=evbuffer_new();
    char *txt="HTTP/1.x 200 OK\nContent-Type: text/html\nConnection:
close\n\nHello\n";
    evbuffer_add(buff, txt, strlen(txt));
    printf("REMOTE BUFF:%s\n",EVBUFFER_DATA(buff));
    evbuffer_add_buffer(req->evcon->output_buffer, buff);
    evhttp_write_buffer(req->evcon, evhttp_send_done NULL);



Note:
this code is part of a callback procedure triggered by a evhttp_set_cb



_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to