mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
Feature: Added listensocket_container_configure_and_setup() that combines configure and setup into one call
This commit is contained in:
parent
a6ff1cb2d7
commit
b495a407f9
@ -186,6 +186,29 @@ int listensocket_container_configure(listensocket_contai
|
||||
return 0;
|
||||
}
|
||||
|
||||
int listensocket_container_configure_and_setup(listensocket_container_t *self, const ice_config_t *config)
|
||||
{
|
||||
void (*cb)(size_t count, void *userdata);
|
||||
int ret;
|
||||
|
||||
if (!self)
|
||||
return -1;
|
||||
|
||||
cb = self->sockcount_cb;
|
||||
self->sockcount_cb = NULL;
|
||||
|
||||
if (listensocket_container_configure(self, config) == 0) {
|
||||
ret = listensocket_container_setup(self);
|
||||
} else {
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
self->sockcount_cb = cb;
|
||||
__call_sockcount_cb(self);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int listensocket_container_setup(listensocket_container_t *self) {
|
||||
size_t i;
|
||||
int ret = 0;
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
listensocket_container_t * listensocket_container_new(void);
|
||||
int listensocket_container_configure(listensocket_container_t *self, const ice_config_t *config);
|
||||
int listensocket_container_configure_and_setup(listensocket_container_t *self, const ice_config_t *config);
|
||||
int listensocket_container_setup(listensocket_container_t *self);
|
||||
connection_t * listensocket_container_accept(listensocket_container_t *self, int timeout);
|
||||
int listensocket_container_set_sockcount_cb(listensocket_container_t *self, void (*cb)(size_t count, void *userdata), void *userdata);
|
||||
|
Loading…
Reference in New Issue
Block a user