Re: [Libevent-users] How to read data coming from a POST request

2012-08-10 Thread Riccardo Tacconi
Thank you (Dave too). I started to fear that malloc was not called inside. As you might guess I am a C noob, well re-learning C or trying to learnt it properly. Now I can see the parameters passed from the user agent. On 10 August 2012 17:21, Chernyshev Vyacheslav wrote: > > 10.08.2012, в 19:15

Re: [Libevent-users] How to read data coming from a POST request

2012-08-10 Thread Chernyshev Vyacheslav
10.08.2012, в 19:15, Riccardo Tacconi wrote > char *data; > evbuffer_copyout(in_evb, data, len); Hello. You must have an initialized data buffer before copying anything to it. Something like: char *data = malloc(len); With your current code you try to write to memory that does not belon

Re: [Libevent-users] How to read data coming from a POST request

2012-08-10 Thread Dave Hart
On Fri, Aug 10, 2012 at 15:11 UTC, Riccardo Tacconi wrote: > void servlet(struct evhttp_request *req, struct evbuffer *evb) { > size_t len = evbuffer_get_length(evhttp_request_get_input_buffer(req)); > struct evbuffer *in_evb = evhttp_request_get_input_buffer(req); > char *data; > e