On Fri, Aug 10, 2012 at 11:42 AM, Chernyshev Vyacheslav wrote:
> Hello. I bet that this question was already asked a couple of times, but…
> What is the right way to execute some action for all currently registered
> descriptors? Let imagine that I have a lot of active client sessions that
> mu
Hello. I bet that this question was already asked a couple of times, but… What
is the right way to execute some action for all currently registered
descriptors? Let imagine that I have a lot of active client sessions that must
save some state to DB when socket is closed and that I use buffered e
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
Hi Dave,
On Fri, Aug 10, 2012 at 11:12 PM, Dave Hart wrote:
> Your code has a race between the child and the parent. If you create
> the base and install the SIGCHLD handling before forking, the race
> will be cured.
Thanks! That worked, I thought it was better to create the base in the
parent
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
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
Hi Yee,
Your code has a race between the child and the parent. If you create
the base and install the SIGCHLD handling before forking, the race
will be cured.
Cheers,
Dave Hart
***
To unsubscribe, send an e-mail to majord...@fre
I have a piece of code that does a fork, and the parent goes into the
event_dispatch loop while the child does something. The child will
exit at some point of time so I will need to attach a SIGCHLD handler
into the event_base (I assume that I shouldn't be calling
event_base_loopexit from a standar