[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Stateful protocol fix
- To: "libevent-users@xxxxxxxx" <libevent-users@xxxxxxxxxxxxx>
- Subject: [Libevent-users] Stateful protocol fix
- From: Dan Moore <danmoore63043@xxxxxxxxx>
- Date: Sun, 2 Jul 2017 17:52:05 +0000 (UTC)
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Sun, 02 Jul 2017 13:52:09 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1499017925; bh=OxqD8xfbRfI2p8kataNfUjRNydHtJENzri9atSF42JY=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=WTd+2SiuMc9ZGn/uUm9848FeqiGwBmcheInR6cZgkIkzf5Zlw3zmNohD58SH4iE4GjKsMDcgffe6+diFAcaKsByeklraJnkojgJk4XdaPJhr+aBEzVjkwVbzDG8ArdG5jkhtKBp1K1lv/rYxhlqDI4gjfqDTGuuZeOjxzoS8ok+ybTQkRXWaj6R/klA9l/aL6gL4yTtwHB46cw7YACyIN8wCcZFBg0dRU49y9jpRDZ9QQPrTTP4iO2z97cpHz1Ka51x5yhD5zl+UiWC9EZV+HHHbDuRGbqeFJpKnjBvYdQGYykHOuL3PMzN2zzDjviRGN1THR5NFQNwwFueg2FWQfw==
- References: <1659113116.3621489.1499017925077.ref@mail.yahoo.com>
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
I think I need a function named bufferevent_free_setcb(). It would run after all of the other queued events for the fd.
I have a stateful protocol, and when I ditch a connection with bufferevent_free(), callbacks still run that reference my context structure. I understand why this is happening, but it means that I have to guess how long I should wait and then add a timer event to free the context.
I noticed a foreach function in a later version, and thought of switching to that, cycling through all the queued events to check if they're related to my fd, storing them in a list, and then deleting those events.
Then I said "what the hell!"
So, hereby requesting:
bufferevent_free_setcb()
Thanks,
Dan
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.