mirror of https://gerrit.osmocom.org/libosmocore
write_queue: Make the bfd cb public so it can be used in a different context
* 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.
This commit is contained in:
parent
1e9086684f
commit
a49951fed7
|
@ -39,5 +39,6 @@ struct write_queue {
|
|||
|
||||
void write_queue_init(struct write_queue *queue, int max_length);
|
||||
int write_queue_enqueue(struct write_queue *queue, struct msgb *data);
|
||||
int write_queue_bfd_cb(struct bsc_fd *fd, unsigned int what);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <osmocore/write_queue.h>
|
||||
|
||||
static int queue_cb(struct bsc_fd *fd, unsigned int what)
|
||||
int write_queue_bfd_cb(struct bsc_fd *fd, unsigned int what)
|
||||
{
|
||||
struct write_queue *queue;
|
||||
|
||||
|
@ -57,7 +57,7 @@ void write_queue_init(struct write_queue *queue, int max_length)
|
|||
queue->current_length = 0;
|
||||
queue->read_cb = NULL;
|
||||
queue->write_cb = NULL;
|
||||
queue->bfd.cb = queue_cb;
|
||||
queue->bfd.cb = write_queue_bfd_cb;
|
||||
INIT_LLIST_HEAD(&queue->msg_queue);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue