summaryrefslogtreecommitdiffstats
path: root/src/write_queue.c
Commit message (Collapse)AuthorAgeFilesLines
* wqueue: Reject messges if queue is considered fullHolger Hans Peter Freyther2016-12-091-3/+8
| | | | | | | | | | | | | | | | | | The write queue was always meant to not queue more than the max_length messages but the implementation never rejected a message. Begin to log and enforce the queue size limit, add a testcase to verify the code and initialize except_cb as part of a fix for that new test case. Real applications might now run into the queue limit and drop messages where they just queued them before. It is unfortunate but I still think it is good to implement the routine as it was intended. We need to review osmo_wqueue_enqueue once more to see that no msgb is leaked. Change-Id: I1e6aef30f3e73d4bcf2967bc49f0783aa65395ae
* Update doxygen annotations in libosmocoreHarald Welte2016-05-051-0/+2
| | | | | This adds and improves doxygen API descriptions all over libosmocore, reducing the 'white spots' that don't have any documentation.
* write_queue: Use EBADF instead of EBABDFD for portabilityHolger Hans Peter Freyther2014-07-011-3/+3
| | | | | EBADFD is linux specific while EBADF is POSIX. Fix the build on FreeBSD and use EBADF throughout the file.
* write_queue: Avoid possible use-after-free if fd is read-/writableDaniel Willmann2014-06-221-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.
* doc: Fix the Doxygen section endingsSylvain Munaut2012-04-181-1/+1
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* doxygen: Add 'write_queue' moduleHarald Welte2011-08-171-0/+28
|
* write-queue: use namespace prefix osmo_wqueue*Pablo Neira Ayuso2011-05-071-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
* select: use namespace prefix osmo_fd* and osmo_select*Pablo Neira Ayuso2011-05-071-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
* include: reorganize headers file to include/osmocom/[gsm|core]Pablo Neira Ayuso2011-03-231-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>
* write_queue: Only pop the queue if it is not emptyHolger Hans Peter Freyther2011-02-151-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.
* write_queue: Add callback for exceptions as well.Holger Hans Peter Freyther2010-04-081-0/+3
|
* write_queue: Add a method to clear the queue.Holger Hans Peter Freyther2010-03-261-0/+11
|
* write_queue: Make the bfd cb public so it can be used in a different contextHolger Hans Peter Freyther2010-03-081-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.
* [write_queue] Add a generic write queue classHolger Hans Peter Freyther2010-02-261-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.