[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] bufferevent_setwatermark() enables reading



Hello,

I do this:

bufev = bufferevent_socket_new(...);
bufferevent_setcb(bufev, foo, ...);
bufferevent_setwatermark(bufev, EV_READ, ...);

When input exceeding the read watermark is received, foo() is called
even though I did not call bufferevent_enable(bufev, EV_READ).

Why is this?

Inside foo(), bufev->enabled only has EV_WRITE set.

I investigated a bit and I have the following stack trace:

> Breakpoint 3, be_socket_enable (bufev=0x60eb20, event=2)
>     at bufferevent_sock.c:543
> 543		if (event & EV_READ) {
> (gdb) bt
> #0  be_socket_enable (bufev=0x60eb20, event=2) at bufferevent_sock.c:543
> #1  0x00007ffff7b99824 in bufferevent_unsuspend_read (bufev=0x60eb20, what=1)
>     at bufferevent.c:82
> #2  0x00007ffff7b9a768 in bufferevent_setwatermark (bufev=0x60eb20, 
>     events=2, lowmark=10, highmark=0) at bufferevent.c:550

This doesn't seem right.

Thanks for any help,
Simon
-- 
NAT64/DNS64 open-source --> http://ecdysis.viagenie.ca
STUN/TURN server        --> http://numb.viagenie.ca
vCard 4.0               --> http://www.vcarddav.org
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.