Re: [Libevent-users] Win64 compile issues

2009-11-14 Thread Nick Mathewson
On Mon, Nov 09, 2009 at 05:19:26PM -0500, Patrick Galbraith wrote: > Hi all, > > I'm wondering if there's anyone out there who has had luck with mingw > compiling libevent on Windows 64-bit? I have had no problem on win32, > but I have this error on a windows 64-bit (windows 2008) in the compile

[Libevent-users] Migrating from Subversion to Git

2009-11-20 Thread Nick Mathewson
http://www.kernel.org/pub/software/scm/git/docs/everyday.html Git for SVN users: http://git.or.cz/course/svn.html This may also be a good time to consider the parable of the bikeshed: http://www.bikeshed.com/;) -- Nick Mathewson *

Re: [Libevent-users] [PATCH] evdns lock violation while thread is used

2009-11-27 Thread Nick Mathewson
On Wed, Nov 25, 2009 at 03:30:08PM +0800, Zhuang Yuyao wrote: > evdns contains a bug related to thread lock. > > enable thread lock by evthread_use_pthreads() will cause successive > evdns_base_resolve_ipv4() (and other resolve functions i think) to > hang on EVDNS_LOCK(base) after one or several

Re: [Libevent-users] Valgrind patch

2009-11-29 Thread Nick Mathewson
On Fri, Nov 27, 2009 at 05:56:25PM -0800, William Ahern wrote: > Valgrind complains on startup because kq_init passes to kevent only a > partially initialized structure. The code doesn't expect kevent to look at > .fflags, .udata, or .data, I suppose, because it merely tickles the > kernel looking

Re: [Libevent-users] Threading concerns

2009-11-29 Thread Nick Mathewson
On Sun, Nov 29, 2009 at 11:18:19PM -0500, Donghua Xu wrote: > Hi, > > Sorry if this is a stupid question. But I have not found a clear > answer in the documentations. I am just beginning to look into using > libevent for our project. We will need to schedule millions of timed > events, and thousan

Re: [Libevent-users] get next timeout from libevent

2009-12-01 Thread Nick Mathewson
On Tue, Nov 24, 2009 at 03:31:18PM +0100, Filippo Giunchedi wrote: [rewrapped] > Hi, > > we are trying to build a library which uses libevent but also has > the capability to be integrated into an application's main loop. > > Our solution so far includes three functions: > - get the list of file

Re: [Libevent-users] question about poll()

2009-12-01 Thread Nick Mathewson
On Wed, Nov 25, 2009 at 02:44:37PM -0500, Patrick Galbraith wrote: > Hi there all! > > I'm working on trying to port libmemcached to Windows. It is not an easy > task! I've just found that libmemcached uses poll() and this is a bit of > a road-block! What do you guys do to get cross-platform sup

Re: [Libevent-users] Threading concerns

2009-12-01 Thread Nick Mathewson
On Mon, Nov 30, 2009 at 02:49:09AM -0500, Donghua Xu wrote: > Thanks Nick. How do I enable the "common timeout" logic? Or is it > enabled by default in 2.0.3-alphra? Check out the documentation for event_base_init_common_timeout() in include/event2/event.h in Libevent 2.0.3-alpha. Basically, if y

Re: [Libevent-users] Assertion in event_base_free

2009-12-07 Thread Nick Mathewson
On Sun, Dec 06, 2009 at 01:36:27AM +, Matthew Wild wrote: > Hi all, > > I'm getting the following assertion fail when my application shuts down: > >event.c:241: event_base_free: Assertion > `((&base->timetree)->rbh_root == ((void *)0))' failed. > > Now from what I can gather in the sourc

Re: [Libevent-users] Lib and sample's compilation on Windows

2009-12-21 Thread Nick Mathewson
On Mon, Dec 21, 2009 at 05:32:02PM +0800, Tao Feng wrote: > Hello all, > > I just started looking into libevent. On Linux the lib and samples > compile fine and works as expected. But on Windows, how do you > compile the lib and samples? Is there a script/makefile for this? I either use mingw or

Re: [Libevent-users] Patch for mingw64 (64-bit windows)

2009-12-21 Thread Nick Mathewson
On Fri, Dec 18, 2009 at 04:53:41PM -0500, Patrick Galbraith wrote: [...] > @@ -11,6 +11,6 @@ > Requires: > Conflicts: > Libs: -L${libdir} -levent > -Libs.private: > +Libs.private: -lws2_32 > Cflags: -I${includedir} Hm. Is there some way to do this conditionally? We only want to link again

Re: [Libevent-users] patch to released 2.0.4 for Windows

2010-03-11 Thread Nick Mathewson
On Thu, Mar 11, 2010 at 1:31 PM, Patrick Galbraith wrote: > Hi there! I have a patch for 2.0.4 in order to compile on Windows (tested on > Windows 2008 64-bit), if not already addressed. Small issue. See attached. > The select.c backend is not for Windows; it will not work there, even if you make

Re: [Libevent-users] patch to released 2.0.4 for Windows

2010-03-11 Thread Nick Mathewson
On Thu, Mar 11, 2010 at 2:10 PM, Patrick Galbraith wrote: > Nick, > > I'm using mingw-w64, using msysgit as my shell setup. My compile options > are: > > ./configure --host=x86_64-w64-mingw32 --build=i686-pc-mingw32 --prefix=/usr > > Would the issue be Makefile.am - start looking there? Either Ma

Re: [Libevent-users] FD_SETSIZE - max connections in Windows - help!

2010-03-15 Thread Nick Mathewson
On Mon, Mar 15, 2010 at 12:03 PM, Patrick Galbraith wrote: > Hi all, > > We have hit a brick wall with memcached - namely max connections with > select. > > Namely, select from libvent use by memcached on windows, according to the > documentation from MSDN you need to > set FD_SETSIZE to the maxim

Re: [Libevent-users] FD_SETSIZE - max connections in Windows - help!

2010-03-16 Thread Nick Mathewson
On Tue, Mar 16, 2010 at 6:50 AM, W.C.A. Wijngaards wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > This problem is 64 max for the windows event notification calls, > WSAWaitForMultipleEvents.  select() probably calls one of the others > behind the scenes. > > Best regards, >   Wouter

Re: [Libevent-users] Pass in __FILE__ __LINE__ __func__ for better logging?

2010-03-19 Thread Nick Mathewson
On Fri, Mar 19, 2010 at 10:27 PM, Shuo Chen wrote: > Hi there, > > Now the log callback takes two parameters: > > typedef void (*event_log_cb)(int severity, const char *msg); > > How about adding another two or thee: > > typedef void (*event_log_cb)(int severity, const char *msg, const > char* fil

Re: [Libevent-users] levent 2.x multithreaded?

2010-03-19 Thread Nick Mathewson
On Thu, Mar 18, 2010 at 12:52 PM, Roman Puls wrote: > Hi Folks, > > I thought libevent would work multithreaded in the sense we can create > (let's say) 4 worker threads that poll the same event_base. Is that > assumption wrong? Yes. Each event base can only have one thread invoking event_base_d

Re: [Libevent-users] Using timerfd and signalfd on Linux

2010-03-19 Thread Nick Mathewson
On Fri, Mar 19, 2010 at 8:42 AM, Shuo Chen wrote: > Hi there, > > Is it possible that libevent 2.0 utilizes timerfd and/or signalfd > provided by recent Linux kernels? > >  - timerfd features a better timing resolution (microseconds) than > epoll (milliseconds), and I wouldn't mind support for th

Re: [Libevent-users] how to flush output immediately?

2010-03-24 Thread Nick Mathewson
On Wed, Mar 24, 2010 at 11:24 AM, Jarod Liu wrote: > I want to implement a server which listen on a port. When new > connection come, write out something, then close the connection. > I try use bufferevent_write put data to output buffer then > bufferevent_free, but I found the connection close wi

Re: [Libevent-users] Recuring timers

2010-03-29 Thread Nick Mathewson
On Mon, Mar 29, 2010 at 12:36 PM, M P wrote: > Is there a way to install timers that are not one-shot ? currently I > have to re-add the timer in the callback to make it restart, however, > it creates obvious drift. > I'm looking for a timer that restarts itself automatically... If you're using L

Re: [Libevent-users] evbuffer - how to read without draining data?

2010-03-31 Thread Nick Mathewson
On Wed, Mar 31, 2010 at 7:10 AM, Sebastian Sjöberg wrote: > On Mar 31, 2010, at 10:02 AM, Jarod Liu wrote: > >> Hi, >> I writing a eventbuffer socket app. My app packet have a length >> header, I want to read data only when input buffer length > packet >> length(I need to read the length header fi

Re: [Libevent-users] Unable to construct simple socket client with bufferevent

2010-03-31 Thread Nick Mathewson
On Wed, Mar 31, 2010 at 11:53 AM, Anomit Ghosh wrote: > I'm basically trying to a write a very simple echo server/client > combination, just for trying out libevent. The server doesn't use > libevent's bufferevent, but the client does. > > Code for server: http://codepad.org/nP0KsfPY > Code for cl

Re: [Libevent-users] evutil_closesocket() macro portability.

2010-04-13 Thread Nick Mathewson
On Wed, Mar 24, 2010 at 6:21 AM, Sebastian Sjöberg wrote: > Hi, > > The EVUTIL_CLOSESOCKET() macro requires you to include unistd.h in your > source for linux and I don't know what on windows. To ease portablilty > wouldn't it be nice if we either turned the macro into a function or included >

Re: [Libevent-users] A patch for evrpc, allowing extra argument of request_new and reply_new

2010-04-14 Thread Nick Mathewson
On Mon, Mar 29, 2010 at 11:42 AM, Shuo Chen wrote: > Another patch to make libevent2 working with Google protocol buffers. > It provides access to the evrpc_req_generic struct members. > http://evproto.googlecode.com/svn/trunk/libevent-2.0.4-alpha-get-request-reply.patch > > To be applied after th

Re: [Libevent-users] When will libevent 2.x be released?

2010-04-14 Thread Nick Mathewson
On Tue, Apr 13, 2010 at 10:03 PM, Angus Salkeld wrote: > Hi > > We are quite keen to use libevent for corosync (corosync.org) > but wish to use the 2.x branch as our daemon is very threaded. > > When do you hope to release the 2.x branch? > > Note: there is no pressure we just want to plan when to

Re: [Libevent-users] evutil_closesocket() macro portability.

2010-04-14 Thread Nick Mathewson
On Wed, Apr 14, 2010 at 5:05 AM, Sebastian Sjöberg wrote: > On Apr 14, 2010, at 7:39 AM, Nick Mathewson wrote: > >> On Wed, Mar 24, 2010 at 6:21 AM, Sebastian Sjöberg >> wrote: >>> Hi, >>> >>> The EVUTIL_CLOSESOCKET() macro requires you to include

Re: [Libevent-users] evhttp_connection_set_timeout granularity

2010-04-15 Thread Nick Mathewson
On Thu, Apr 15, 2010 at 4:44 PM, Ron Combs wrote: > Hello, > > What is the best way to set millisecond timeout to a evhttp_connection using > the evhttp framework? Looks like the best long-term solution is to write a patch to add support for having http timeouts as struct timeval rather than as i

Re: [Libevent-users] event_add fails with ENOENT when on epoll

2010-04-20 Thread Nick Mathewson
On Mon, Apr 19, 2010 at 11:24 PM, Denis Bilenko wrote: > Hi, > > I've run into an issue where event_add() fails with ENOENT. > This happens when a socket reuses a descriptor that was recently > closed and was used before with another event. > > The details are below. The question I have is - what

Re: [Libevent-users] registering the same filehandle with EV_READ (without EV_PERSIST) multiple times

2010-04-25 Thread Nick Mathewson
2010/4/24 Péter Szabó : > Hi, > > I'd like to register two struct event's for the same filehandle, with > EV_READ (without EV_PERSIST), with multiple callbacks, and whenever > the file becomes readable, I'd like to get both of my callbacks be > called Libevent 1.4.x and earlier don't support this.

Re: [Libevent-users] 100% cpu utilization with openssl bufferevent.

2010-04-29 Thread Nick Mathewson
On Thu, Apr 29, 2010 at 5:19 AM, Sebastian Sjöberg wrote: > Hi, > > I've encountered a problem with openssl bufferevents where libevent reports > fd:s as writeable but no action is being taken. [...] > There is no problem when I'm connecting without tls so I think this is an > issue with opens

Re: [Libevent-users] 100% cpu utilization with openssl bufferevent.

2010-05-03 Thread Nick Mathewson
On Thu, Apr 29, 2010 at 2:14 PM, Sebastian Sjöberg wrote: [...] > Cheers, I haven't yet been able to reproduce it when disabling epoll. > > I've started to debug the evmap_io_active calls and after a while there are a > no events being activated as you said so I guess at some point the there's a

Re: [Libevent-users] resuming libevent2 after closing all file descriptors

2010-05-06 Thread Nick Mathewson
2010/5/3 Péter Szabó : > Hi, > > I'm doing the following with libevent 2.0.4 on Linux: > >  strcut event_base *base = event_init() >  ...  /* not registering any events */ >  for (int fd = 3; fd < 256; ++fd) close(fd); >  event_reinit(base); >  ... > This eventually reports the following warning: >

[Libevent-users] ANN: Libevent 2.0.5-beta released; Libevent 2.0 now in feature-freeze

2010-05-12 Thread Nick Mathewson
eppe Scrivano, Jardel Weyrich, Joachim Bauch, Patrick Galbraith, Pierre Phaneuf, Sebastian Hahn, Sebastian Sjöberg, Shuo Chen, Tao Feng, Trond Norbye, William Ahern and Zack Weinberg. peace, -- Nick Mathewson *** To unsubscribe, send an e-mail to majord...@freehaven.net with unsubscribe libevent-usersin the body.

Re: [Libevent-users] Server closes connection to client just after accept()

2010-05-12 Thread Nick Mathewson
On Wed, May 12, 2010 at 2:55 PM, Anomit Ghosh wrote: > This is the code in question: http://codepad.org/7eD9n14B > Run the code as `./server 127.0.0.1 ` > > I registered a callback(sock_callback) on the listening socket that > puts the new connections after accepting in a list. Now the problem > s

Re: [Libevent-users] evhttpd_cmd_type and support for other HTTP methods

2010-05-17 Thread Nick Mathewson
On Tue, Apr 6, 2010 at 1:04 PM, Graham Leggett wrote: > Hi all, > > I need to implement the OPTIONS method in a small evhttp based webserver, > and have discovered that the API only allows me to receive GET, HEAD and > POST requests. > > Is there a way to receive a method outside of this set such

Re: [Libevent-users] Assertion error + Segmentation Fault

2010-05-17 Thread Nick Mathewson
On Thu, Apr 8, 2010 at 7:46 AM, Sherif Fanous wrote: > Hi > I am using libevent 2.0.4 alpha in my C application. > The below snapshot of my code occasionally encounters the following 2 > problems > > [err] event.c:1961: Assertion !(ev->ev_flags & ~EVLIST_ALL) failed in > event_del_internal > Abort

Re: [Libevent-users] 100% cpu utilization with openssl bufferevent.

2010-05-18 Thread Nick Mathewson
ck the bug down. Also, is there some code I can run to try to reproduce this bug myself? I've tried writing examples with openssl, but I can't make the warnings trigger. yrs, -- Nick From 2a8a0d0a81fda941bb221f04c4bc6e0cd269ab77 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date:

Re: [Libevent-users] ANN: Libevent 2.0.5-beta released; Libevent 2.0 now in feature-freeze

2010-05-18 Thread Nick Mathewson
On Thu, May 13, 2010 at 4:57 AM, Aleksandar Lazic wrote: > Hi Nick, > > On Mit 12.05.2010 21:15, Nick Mathewson wrote: >> >> Hi everyone! >> >> Thanks to many people's hard work, Libevent 2.0 has now had its first >> beta release.  You can download

Re: [Libevent-users] ev_send_error() and friends

2010-05-26 Thread Nick Mathewson
On Mon, May 24, 2010 at 8:16 PM, Felix Nawothnig wrote: > Forwarding this discussion from Bug #3006553 to the ML: For reference, that's https://sourceforge.net/tracker/?func=detail&aid=3006553&group_id=50884&atid=461322 > If you have no objections, feel free to apply it. Done, with minor tweaki

Re: [Libevent-users] ev_send_error() and friends

2010-05-26 Thread Nick Mathewson
On Wed, May 26, 2010 at 3:54 PM, Felix Nawothnig wrote: > On Wed, 2010-05-26 at 13:50 -0400, Nick Mathewson wrote: >> > If you have no objections, feel free to apply it. >> Done, with minor tweaking to make it C90-compliant. > > Great. Sorry about the C99 thing - why don&#

Re: [Libevent-users] libevent with EV_WRITE question

2010-06-03 Thread Nick Mathewson
On Sat, May 29, 2010 at 6:44 AM, Sherif Fanous wrote: > Hi > I have the following scenario, and want to verify the expected outcome > pthread_wrlock_rdlock(&(server->lock)); > if (server->is_connected) { >     struct send_packets_args *send_packets_args; >     send_packets_args = malloc(sizeof (st

Re: [Libevent-users] socket message boundary problem

2010-06-03 Thread Nick Mathewson
On Mon, May 31, 2010 at 1:14 PM, Hor Meng Yoong wrote: > Hi: > >   I am using libevent2. Is that a wrapper function/library to send and > receive fixed length message, or variable length message with message length > embedded in the first 2 bytes with libevent2? Thank Got all three of your messag

Re: [Libevent-users] How to close bufferevent connection?

2010-06-03 Thread Nick Mathewson
On Mon, May 31, 2010 at 11:07 PM, Felix Nawothnig wrote: > Hey. > > What's the "suggested" way to close a bufferevent connection? > > Currently I do: > >        fd = bufferevent_getfd(bev); >        evutil_closesocket(fd); > > ... followed by a manual: > >        my_event_handler(bev, BEV_EVENT_EO

Re: [Libevent-users] BUG: libevent 1.4.14, wrong version info

2010-06-12 Thread Nick Mathewson
On Sat, Jun 12, 2010 at 9:29 AM, Juergen Daubert wrote: > Hello, > > The libraries of libevent 1.4.13 and older are versioned by > libtool as > >   *-1.4.so.2.1.3 > > whereas libevent 1.4.14 is using > >   *-1.4.so.1.2.3 > > This breaks every application linked against 1.4.13 if you > upgrade to v

Re: [Libevent-users] setting bufferevent without heap-allocation

2010-06-17 Thread Nick Mathewson
On Thu, Jun 17, 2010 at 2:35 AM, Avi Bab wrote: > > > Hi All, > > Is there an option to set up a bufferevent without heap-allocation > (something like event_assign() for events) ? > I'm afraid not; bufferevents need to be able to do heap allocation internally for their evbuffers, so they don't re

Re: [Libevent-users] BUG: libevent 1.4.14, wrong version info

2010-06-19 Thread Nick Mathewson
On Sat, Jun 12, 2010 at 2:10 PM, Niels Provos wrote: > On Sat, Jun 12, 2010 at 7:29 AM, Nick Mathewson wrote: >> Ugh, how annoying!  I think this warrants a 1.4.14b, if Niels agrees. >> (1.4.14b should contain this fix, and nothing else.) > > Fine by me. Okay, I've

Re: [Libevent-users] Thread safety with Evbuffers and Bufferevents

2010-06-21 Thread Nick Mathewson
On Sun, Jun 20, 2010 at 5:51 AM, Avi Bab wrote: > Hello all, > > > > I’d like to use a socket based bufferevent to perform asynchronous writing > to the underlying socket: > > One thread, X, adds data to the output  evbuffer (either by > evbuffer_reserve_space+ evbuffer_commit_space or by evbuffer

Re: [Libevent-users] deadlock in libevent-2.0.5-beta

2010-07-02 Thread Nick Mathewson
On Thu, Jul 1, 2010 at 6:44 AM, Avi Bab wrote: > > > Running on Linux with pthreads. > > > > One thread (CBTcpProxyListenerThread below) adds bufferevents (with option > BEV_OPT_THREADSAFE) to an event_base. > > A second thread (CBTcpProxySenderThread) dispatches on the event_base. > > > > buffere

Re: [Libevent-users] deadlock in libevent-2.0.5-beta

2010-07-04 Thread Nick Mathewson
On Sat, Jul 3, 2010 at 2:10 AM, Zhou Li wrote: > I met such deadlock too. It happened under very high load just as you said. > I think the cause is that the call write(th_notify_fd[1]) got blocked ( > sorry I didn't remember the exact position of this call to write > th_notify_fd). > In event.c li

Re: [Libevent-users] deadlock in libevent-2.0.5-beta

2010-07-04 Thread Nick Mathewson
On Sun, Jul 4, 2010 at 4:29 AM, Avi Bab wrote: > > Indeed it seems that someone, some when, failed to release the lock. > At the time of the deadlock the third thread (The ReceiverThread) is > dispatching on a different eventbase. > > This third thread does do some manipulation on bufferevents th

Re: [Libevent-users] deadlock in libevent-2.0.5-beta

2010-07-05 Thread Nick Mathewson
On Mon, Jul 5, 2010 at 3:03 AM, Avi Bab wrote: > > I now have a clearer view of things. > Like Zhou said - there is a thread adding an event to the sender's event_base > which is blocked on writing to base->th_notify_fd[1]: Oho! Indeed, this is absolutely right. My apologies to Zhou Li for not

Re: [Libevent-users] When to use libevent?

2010-07-05 Thread Nick Mathewson
On Sun, Jul 4, 2010 at 10:06 AM, Stef Bon wrote: > Hello, > > I'm building a construction serving the user in his/her homedirectory > easy access to various resources like > a SMB share, USB stick, partition on harddisks etc. See: > > http://linux.bononline.nl/projects/mount.md5key.new/ > > I'm wo

Re: [Libevent-users] the usage of ev_pncalls in struct event

2010-07-07 Thread Nick Mathewson
On Thu, Jul 1, 2010 at 11:31 AM, xiaobing jiang wrote: > hi all: >     what's the usage of ev_pncalls in struct event? why not direct > use ev_ncalls? > > two question: > 1. in libevent 1.4.14, it seems only used in event_process_active(), > but in libeven2 it used in event_signal_closure. why? B

[Libevent-users] Re: cmake build harness

2010-07-07 Thread Nick Mathewson
2010/5/31 Brodie Thiesfield : > Hi all, > > I've updated the cmake build harness that Alexey Ozeritsky supplied, and > I've updated it to build the latest source both released and in git. > I've tested the build on both Windows (VC 2008) and Linux (gcc 4.4) and > apart from warnings it builds. > >

Re: [Libevent-users] [PATCH] uri parsing helpers

2010-07-14 Thread Nick Mathewson
On Wed, Jul 14, 2010 at 8:43 AM, Pavel Plesov wrote: > This patch introduces evhttp_uri_* functions to deal with URI parsing. > > See evhttp_uri_parse(), evhttp_uri_clear() and evhttp_uri_join() for details. > > Patch is made against Nick's master branch @ github > Thanks for the patch, Pavel! C

Re: [Libevent-users] [PATCH] http: Allow wildcards in request callback paths

2010-07-14 Thread Nick Mathewson
On Sat, Jul 10, 2010 at 4:05 AM, Bobby Powers wrote: > this allows you to register callbacks with paths like "/artist*". > > based on the patch here: > http://www.mail-archive.com/libevent-us...@monkey.org/msg00985.html Neat! There's a tracker entry for this feature request on the sourceforge tr

Re: [Libevent-users] Ability to shutdown() socket with bufferevents?

2010-07-27 Thread Nick Mathewson
On Tue, Jul 27, 2010 at 12:55 PM, Corey Stup wrote: > I'm needing the ability to shutdown(fd, 1) on a bufferevent managed > socket [created with bufferevent_socket_new() and > bufferevent_socket_connect()] as part of my protocol.   The flow of > which looks somethign like this: > > Client opens co

[Libevent-users] Re: [Libevent-users] error: aggregate ‘evkeyvalq q uery’ has incomplete type and cannot be defined

2010-07-27 Thread Nick Mathewson
On Sun, Jul 25, 2010 at 11:12 AM, Mihai Draghicioiu wrote: > Hi guys. I'm trying to extract parameters from the url query, but i > can't seem to figure out why i'm getting this error. Here is the code: What version of libevent? What order are you including the headers in? -- Nick *

Re: [Libevent-users] SSL support in evhttp.h

2010-07-28 Thread Nick Mathewson
On Wed, Jul 28, 2010 at 9:10 AM, Graham Leggett wrote: > Hi all, > > Is SSL support planned for the event driven http server described in > evhttp.h? > It would be good to add, if somebody has the time to implement it. It won't go into Libevent 2.0, since that's in feature-freeze, but I'd bet a

Re: [Libevent-users] running libevent with multiple bases

2010-07-28 Thread Nick Mathewson
On Tue, Jul 27, 2010 at 5:16 PM, Amy Hwang wrote: > I have an architecture that reads and writes to a large number of > sockets, where the sockets are spread over a number of threads, each > with its own libevent base. Each socket is "owned" by a single > libevent base, and the bases don't interac

Re: [Libevent-users] 100% cpu utilization with openssl bufferevent.

2010-07-28 Thread Nick Mathewson
On Thu, Apr 29, 2010 at 5:19 AM, Sebastian Sjöberg wrote: > Hi, > > I've encountered a problem with openssl bufferevents where libevent reports > fd:s as writeable but no action is being taken. I think Mike Smellie finally tacked this down in his comments in bug http://sourceforge.net/tracker/?

Re: [Libevent-users] lock question

2010-07-29 Thread Nick Mathewson
On Thu, Jul 29, 2010 at 4:23 AM, Avi Bab wrote: > > > Does writing to an output evbuffer (specifocally I use > evbuffer_add_reference) of a bufferevent attempt to acquire the event_base’s > lock? Usually not. It does acquire the bufferevent's lock. It *might* have to tell the bufferevent to sta

Re: [Libevent-users] SSL support in evhttp.h

2010-07-29 Thread Nick Mathewson
On Wed, Jul 28, 2010 at 11:28 PM, Zhuang Yuyao wrote: > hi, > > here is my patch and sample code for libevent 2.0 to add ssl support to > evhttp. > the trick is to allow the caller to set bufev of struct evhttp_connection. > > Best regards, >  Zhuang Yuyao Thanks! Two quick questions: 1) Would

Re: [Libevent-users] Small patch for grabbing underlying event_base from an evhttp_request

2010-07-29 Thread Nick Mathewson
On Tue, Jul 27, 2010 at 3:34 PM, Mark Ellzey wrote: > Greetings, > > Attached is a small patch which allows a user to grab the underlying > event_base from an evhttp_request. I have patched this against the > current master on github. > > If there is a better way to do this, I am open to suggestio

[Libevent-users] Re: [Libevent-users] Re: [Libevent-users] Re: [Libev ent-users] error: aggregate ‘evkeyvalq query’ has incomp lete type and cannot be defined

2010-07-29 Thread Nick Mathewson
On Thu, Jul 29, 2010 at 4:02 AM, Mihai Draghicioiu wrote: > Thanks to your suggestion, i've fixed it by prepending #include > to the other libevent headers. Thanks! Ugh. That's what I suspected, but it really shouldn't be necessary. I've added a bug about it, targeting 2.1: https://sourceforge.

Re: [Libevent-users] Measuring load

2010-07-31 Thread Nick Mathewson
On Sat, Jul 31, 2010 at 8:21 AM, Matthew Wild wrote: > Hi all, > > I've been wondering if there is some way I can add load measurement to > my application when using libevent. > > How to define "load" is open to interpretation, but generally I refer > to the case where events are being fired faste

Re: [Libevent-users] libevent with python segfaulting

2010-08-03 Thread Nick Mathewson
On Sun, Aug 1, 2010 at 3:01 PM, Michael Gale wrote: > Hello, >     I am using the latest release of libevent-python and the latest release > of libevent-1.4. > After I am done writing data and close the socket I attempt to remove the > write event callback from the event loop. If I do this the ser

Re: [Libevent-users] bufferevents and write signalling

2010-08-05 Thread Nick Mathewson
On Thu, Aug 5, 2010 at 2:13 PM, Mark Ellzey wrote: > > This is an odd question that hopefully someone can help me out with. I > have a function right now that looks a bit like this: > > void > read_data(struct bufferevent *bev, void *args) { >        evbuffer *data; > >        data = bufferevent_g

[Libevent-users] ANN: Libevent 2.0.6-rc released

2010-08-06 Thread Nick Mathewson
Christopher Davis, Trond Norbye, Joachim Bauch, Mike Smellie, Zhou Li, Avi Bab, Scott Lamb, Sebastian Hahn, Felix Nawothnig, Pierre Phaneuf, and Brodie Thiesfield, and my deep apologies if I forgot to list you here. peace, -- Nick Mathewson

Re: [Libevent-users] To upgrade or not to upgrade - that is the question

2010-08-10 Thread Nick Mathewson
On Tue, Aug 10, 2010 at 7:27 PM, Gilad Benjamini wrote: > We have working Linux application using libevent 1.4 > We are now beginning work on a new version, which would include, among other > things porting our code to Windows. > > Theoretically, it looks like a good point in time to upgrade our l

Re: [Libevent-users] To upgrade or not to upgrade - that is the question

2010-08-11 Thread Nick Mathewson
On Wed, Aug 11, 2010 at 1:21 AM, Gilad Benjamini wrote: > Nick, > Thanks for the answer and the detailed document. > Out of the different open source projects out there using libevent, which > ones have already moved to 2.0 ? Tor supports some but not all of the new 2.0 stuff, and will move to us

Re: [Libevent-users] Include order in Makefile.nmake

2010-08-13 Thread Nick Mathewson
On Thu, Aug 12, 2010 at 3:18 PM, Gilad Benjamini wrote: > Makefile.nmake in the tarball has this line >    CFLAGS=/Iinclude /Icompat /IWIN32-Code /DWIN32 /DHAVE_CONFIG_H /EHsc /I. > > event-config.h exists in both include/event2 and WIN32-Code/event2 > > Therefore, the file is taken from the wrong

Re: [Libevent-users] Compiling libevent on Windows

2010-08-13 Thread Nick Mathewson
On Fri, Aug 13, 2010 at 3:35 AM, Gilad Benjamini wrote: > I tried compiling libevent on Windows, using WinDDK. > I initially had some issues with Makefile.nmake, and then abandoned it in > favor of the simple "sources" file, used by the "build" utility. Hi, Gilad! FYI, it is *way way easier* for

Re: [Libevent-users] deadlock in version 2.0.5

2010-08-13 Thread Nick Mathewson
On Thu, Aug 12, 2010 at 2:31 AM, Avi Bab wrote: > The scenario – Ick. I've added this one to the bugtracker as https://sourceforge.net/tracker/index.php?func=detail&aid=3044479&group_id=50884&atid=461322 ; further discussion there. >From what I can see now, there doesn't seem to be a better sol

Re: [Libevent-users] Ability to shutdown() socket with bufferevents?

2010-08-13 Thread Nick Mathewson
On Tue, Jul 27, 2010 at 2:42 PM, Corey Stup wrote: >> Right now there's no way to make a bufferevent call shutdown() itself, >> but what if you have a write handler on the client bufferevent just >> call shutdown() manually on the fd to send a FIN when the write buffer >> is empty?  You can get th

Re: [Libevent-users] Compiling libevent on Windows

2010-08-13 Thread Nick Mathewson
On Fri, Aug 13, 2010 at 3:59 AM, Gilad Benjamini wrote: > and one more to end the day... > event_struct.h has this code >   #ifndef TAILQ_ENTRY >   #define _EVENT_DEFINED_TQENTRY >   #define TAILQ_ENTRY(type)                                            \ >   struct {                                

Re: [Libevent-users] deadlock in version 2.0.5

2010-08-17 Thread Nick Mathewson
On Fri, Aug 13, 2010 at 1:17 PM, Nick Mathewson wrote: > On Thu, Aug 12, 2010 at 2:31 AM, Avi Bab wrote: >> The scenario – > > Ick.  I've added this one to the bugtracker as > https://sourceforge.net/tracker/index.php?func=detail&aid=3044479&group_id=50884&

Re: [Libevent-users] Event after close

2010-08-18 Thread Nick Mathewson
On Wed, Aug 18, 2010 at 10:44 AM, Gilad Benjamini wrote: > I have a read event on a socket. At some point I realize the connection is > broken. > I delete the event and close the socket. > If the socket had pending data at that point, is there a chance that I will > get a read event ? I.e. an even

Re: [Libevent-users] 1.4.13 (and lower): bug in configure: kqueue test-case w/ x86_64

2010-08-19 Thread Nick Mathewson
On Thu, Aug 19, 2010 at 1:24 AM, Christopher Layne wrote: [...] > Just by adding a simple "memset(&ev, 0, sizeof ev)" above the initial ev > struct assignments we're doing in the test-case, I see the following > results: [...] > The reason I think this is kind of an annoying bug is that if compi

Re: [Libevent-users] To upgrade or not to upgrade - that is the question

2010-08-19 Thread Nick Mathewson
On Wed, Aug 11, 2010 at 3:16 PM, Thor Lancelot Simon wrote: > On Tue, Aug 10, 2010 at 04:27:47PM -0700, Gilad Benjamini wrote: >> >> What are the major benefits of 2.0 ? > > From my point of view, a lot of convenience code was added which many > large programs already written to the libevent 1.4 A

Re: [Libevent-users] bufferevent_flush on bufferevent_sock

2010-08-27 Thread Nick Mathewson
On Tue, Aug 24, 2010 at 11:14 AM, Andrei Chirila wrote: > Hello, > > I'm using libevent 2.0.6 on a startup project, I just updated from 2.0.5. > I've written a server and I had the surprise, after testing it for a while, > that, for some messages, if I'm using the zlib filter, the last fragment of

Re: [Libevent-users] loopbreak vs. loopexit

2010-08-30 Thread Nick Mathewson
On Sun, Aug 29, 2010 at 2:01 PM, Scott Lamb wrote: [...] > By an active event, I meant one which has triggered and whose callback > needs to be called. [I see this explanation in the docstring for the > activequeues but unless I'm missing it, not anywhere prominent in the > documentation. And unf

Re: [Libevent-users] Cant compile for armel

2010-09-02 Thread Nick Mathewson
On Wed, Sep 1, 2010 at 7:20 AM, Alexander Seibel wrote: > Hi > I am a noob when it comes to compiling. When I want to compile > libevent-1.4.14b-stable for armel, i  get errors like this : > > //./libevent-1.4.14b-stable/signal.c:117: undefined reference to > `event_warn' > /

Re: [Libevent-users] Libevent 2.0.6-rc libtool

2010-09-03 Thread Nick Mathewson
On Fri, Sep 3, 2010 at 11:59 AM, Ralph Castain wrote: > Hi folks > > I've been working on integrating 2.0.6-rc into the Open MPI code base and ran > across an issue. You distribute an aclocal.m4 that was generated by libtool > 2.2.6b, and you don't whack it at the beginning of autogen.sh. Thus,

Re: [Libevent-users] A patch to test/bench.c

2010-09-06 Thread Nick Mathewson
On Mon, Sep 6, 2010 at 8:09 AM, Shuo Chen wrote: > Hi there, > > I found that test/bench not working in 2.0.6rc. here's a simple fix: > > diff --git a/test/bench.c b/test/bench.c > index 76717d7..de4e814 100644 > --- a/test/bench.c > +++ b/test/bench.c > @@ -85,7 +85,8 @@ run_once(void) >        s

Re: [Libevent-users] What's the story with cygevent-1-4-2.dll?

2010-09-06 Thread Nick Mathewson
On Mon, Sep 6, 2010 at 1:36 AM, Chris Brown wrote: [...] > The logfile contains the following ... > > /usr/local/sbin/gearmand.exe: error while loading shared libraries: > cygevent-1-4-2.dll: cannot open shared object file: No such file or directory > > Can anyone explain why gearmand.exe runs f

Re: [Libevent-users] Something to consider for future

2010-09-07 Thread Nick Mathewson
Hi, Ralph! On Tue, Sep 7, 2010 at 11:04 AM, Ralph Castain wrote: [...] > (b) we need to modify it somewhat to get things working correctly across the > broad range of our installed base. Any chances of getting the patches here upstreamed? "Working correctly across a broad install base" sounds

[Libevent-users] ANN: Libevent 2.0.7-rc is released

2010-09-09 Thread Nick Mathewson
Hello again! Thanks to many people's hard work, Libevent 2.0 has now had its second release candidate. You can download it from the Sourceforge site at: https://sourceforge.net/projects/levent/files/libevent/libevent-2.0/libevent-2.0.7-rc.tar.gz/download There's also a pgp signature of it (b

Re: [Libevent-users] bufferevent_setwatermark() enables reading

2010-09-10 Thread Nick Mathewson
On Thu, Sep 9, 2010 at 5:40 PM, Simon Perreault wrote: > On 2010-09-09 17:28, Simon Perreault wrote: >> Would this be the right fix? > > Argh, git-send-email didn't do what I wanted it to do. Here's the patch > in attachment. Sorry. This looks good to me. Merging it. Thanks for tracking this do

Re: [Libevent-users] ANN: Libevent 2.0.7-rc is released

2010-09-12 Thread Nick Mathewson
On Fri, Sep 10, 2010 at 3:55 PM, Mihai Draghicioiu wrote: > Good job. > > However, i seem to be getting a lot of different crashes with the http > code. I'm not sure if it's my application or the libevent code, i'll > have to debug it, but i hope you've planned a http bug hunt until the > next tar

Re: [Libevent-users] Write quirks in default eventbuffer implementation?

2010-09-12 Thread Nick Mathewson
On Thu, Sep 9, 2010 at 3:09 PM, Kelly Brock wrote: [...] >        So, anyway, it is at the challenge point where I'm getting a little > problem with my initial test.  I grab the output evbuffer from event buffer > for the socket and then reserve/write/commit space into the evbuffer.  I > then set

Re: [Libevent-users] Configure changes

2010-09-13 Thread Nick Mathewson
On Tue, Sep 7, 2010 at 2:31 PM, Ralph Castain wrote: > Hi folks > Continuing the discussion re pushing some of Open MPI's experiences > upstream, I have attached our opal_setup_libevent.m4 script for building > libevent as part of OMPI. Note that the comments describe several scenarios > where the

Re: [Libevent-users] epoll erros

2010-09-17 Thread Nick Mathewson
On Thu, Sep 16, 2010 at 2:59 PM, Gilad Benjamini wrote: > My Linux code, which uses libevent 2.0.x occasionally prints these error > messages >    Epoll ADD on fd 14 failed.  Old events were 0; read change was 1 (add); > write change was 0 (none).: File exists > When they appear, it can be as freq

Re: [Libevent-users] Re: help with debugging

2010-09-17 Thread Nick Mathewson
On Fri, Sep 17, 2010 at 5:22 AM, Mihai Draghicioiu wrote: [...] > Core was generated by `/home/mihai/frogmod-justice/frogserv'. > Program terminated with signal 11, Segmentation fault. > [New process 14829] > #0  evhttp_request_get_input_buffer (req=0x99d90f8) at http.c:3014 > 3014    { > (gdb) up

Re: [Libevent-users] epoll erros

2010-09-20 Thread Nick Mathewson
On Fri, Sep 17, 2010 at 3:06 PM, Gilad Benjamini wrote: >> The first thing to do here is to use event_enable_debug_mode() to have >> libevent track event adds/deletes/etc to make sure that there's >> nothing screwy going on there. (Did this turn anything up? You don't need to build with any spec

Re: [Libevent-users] Stop listening on http server when accept() returns Too Many Open Files

2010-09-20 Thread Nick Mathewson
On Mon, Sep 20, 2010 at 12:22 PM, Simon Perreault wrote: > Does anyone have an answer to that? We just hit this problem in real > life. It's not just theory. > > Thanks, > Simon > > On 2010-09-03 03:49, Yee Keat Phuah wrote: >> Hi, >> >> I am using the http server part of libevent 2.0.6, and curre

Re: [Libevent-users] Stop listening on http server when accept() returns Too Many Open Files

2010-09-20 Thread Nick Mathewson
On Mon, Sep 20, 2010 at 12:50 PM, Simon Perreault wrote: > Thanks a lot for your reply! > > On 2010-09-20 12:29, Nick Mathewson wrote: >> One possibility is that, when a non-retriable error occurs, the >> callback is invoked with fd set to -1, and errno (LastSocketError) set

Re: [Libevent-users] Stop listening on http server when accept() returns Too Many Open Files

2010-09-20 Thread Nick Mathewson
On Mon, Sep 20, 2010 at 2:09 PM, Simon Perreault wrote: > On 2010-09-20 13:53, Nick Mathewson wrote: >>> Would the attached patch work? >> >> Looks okay to me.   Probably, you'd want to rename "ecb" to "errorcb" >> or something; we do

Re: [Libevent-users] epoll erros

2010-09-21 Thread Nick Mathewson
2010/9/21 Gilad Benjamini : [...] > Any chance you can make something out of the attached log ? That's pretty helpful! It's almost but not quite enough information to figure out what's up here. There are a couple of epoll debugging messages that don't give enough detail. I just added a couple

Re: [Libevent-users] epoll erros

2010-09-22 Thread Nick Mathewson
On Wed, Sep 22, 2010 at 11:53 AM, Gilad Benjamini wrote: >> >> 2010/9/21 Gilad Benjamini : >>  [...] >> > Any chance you can hmake something out of the attached log ? >> >> That's pretty helpful!  It's almost but not quite enough information >> to figure out what's up here.  There are a couple of

  1   2   3   4   5   6   >