[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] libevent + curl
I'm trying to modify the hiperfifo.c example included in libcurl (http://curl.haxx.se/libcurl/c/hiperfifo.html ) to use libevent 2.0.20 and had a few questions. I know the originator of this code is the libcurl people but I figured this would be a better place to ask since the questions are more about libevent version differences. This has likely been asked before but I couldn't find a way to search the mailing list.
Line 74: The GlobalInfo struct contains 2 event structures. Since the event now(?) appears to be an opaque struct I converted these to event* instead.
Line 114 : Curl will pass -1 into the timer callback if there is no timeout. Passing a negative timeout into evtimer_add causes me to get "a Assertion is_same_common_timeout". Blocking the add when timeout is -1 appears to fix the issue.
Line 236 : Replaced event_set with f->ev = event_new(g->base, f->sockfd, kind, event_cb, g); Also stored base in GlobalInfo since the original relied on the global base which is apparent not a good thing.
Line : 389 : same as above
Do these changes make sense? Any other changes that would make this more up to date? At this point it compiles and appears to run without any crashes.
Thanks-
John
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.