1
0
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:
Philipp Schafft 2018-05-10 08:33:19 +00:00
parent a6ff1cb2d7
commit b495a407f9
2 changed files with 24 additions and 0 deletions

View File

@ -186,6 +186,29 @@ int listensocket_container_configure(listensocket_contai
return 0; 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) { int listensocket_container_setup(listensocket_container_t *self) {
size_t i; size_t i;
int ret = 0; int ret = 0;

View File

@ -14,6 +14,7 @@
listensocket_container_t * listensocket_container_new(void); listensocket_container_t * listensocket_container_new(void);
int listensocket_container_configure(listensocket_container_t *self, const ice_config_t *config); 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); int listensocket_container_setup(listensocket_container_t *self);
connection_t * listensocket_container_accept(listensocket_container_t *self, int timeout); 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); int listensocket_container_set_sockcount_cb(listensocket_container_t *self, void (*cb)(size_t count, void *userdata), void *userdata);