aboutsummaryrefslogtreecommitdiffstats
path: root/src/write_queue.c
AgeCommit message (Collapse)AuthorFilesLines
2014-07-01write_queue: Use EBADF instead of EBABDFD for portabilityHolger Hans Peter Freyther1-3/+3
EBADFD is linux specific while EBADF is POSIX. Fix the build on FreeBSD and use EBADF throughout the file.
2014-06-22write_queue: Avoid possible use-after-free if fd is read-/writableDaniel Willmann1-5/+18
If the FD is both readable and writable and the read callback closes the connection (and frees the surrounding structure) we shouldn't call the write callback (or check anything else in the read fd). With this patch callback functions can return -EBADFD if they don't want the FD to be handled any more.
2012-04-18doc: Fix the Doxygen section endingsSylvain Munaut1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-08-17doxygen: Add 'write_queue' moduleHarald Welte1-0/+28
2011-05-07write-queue: use namespace prefix osmo_wqueue*Pablo Neira Ayuso1-7/+7
Summary of changes: s/struct write_queue/struct osmo_wqueue/g s/write_queue_init/osmo_wqueue_init/g s/void write_queue_clear/osmo_wqueue_clear/g s/write_queue_enqueue/osmo_wqueue_enqueue/g s/write_queue_bfd_cb/osmo_wqueue_bfd_cb/g
2011-05-07select: use namespace prefix osmo_fd* and osmo_select*Pablo Neira Ayuso1-1/+1
Summary of changes: s/struct bsc_fd/struct osmo_fd/g s/bsc_register_fd/osmo_fd_register/g s/bsc_unregister_fd/osmo_fd_unregister/g s/bsc_select_main/osmo_select_main/g
2011-03-23include: reorganize headers file to include/osmocom/[gsm|core]0.2.0Pablo Neira Ayuso1-1/+1
This patch moves all GSM-specific definitions to include/osmocom/gsm. Moreover, the headers in include/osmocore/ have been moved to include/osmocom/core. This has been proposed by Harald Welte and Sylvain Munaunt. Tested with `make distcheck'. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-02-15write_queue: Only pop the queue if it is not emptyHolger Hans Peter Freyther1-8/+10
It is possible that the queue is cleared after the select and before the callback for writable is called. Check if the list is not empty brefore taking an item out of it.
2010-04-08write_queue: Add callback for exceptions as well.Holger Hans Peter Freyther1-0/+3
2010-03-26write_queue: Add a method to clear the queue.Holger Hans Peter Freyther1-0/+11
2010-03-08write_queue: Make the bfd cb public so it can be used in a different contextHolger Hans Peter Freyther1-2/+2
* I'm doing a nonblocking connect and for this I need to select on writable and the first thing I need to do is to check the SOL_SOCKET SO_ERROR state. I realize this by setting a different cb on the embedded bfd during setup and then go back to the real implementation.
2010-02-26[write_queue] Add a generic write queue classHolger Hans Peter Freyther1-0/+74
The write queue can be a dropin replacement for the bsc_fd. It is featuring two callbacks. One for ready read and one for ready write. Whenever there is a message in the queue the write_queue will set the BSC_FD_WRITE flag and then call the write callback. It will make sure to delete the msgb after the write function has been called. This class is intended to be be used in the osmocom, layer2, bsc_msc_ip, bsc_hack and other applications.