Commit fea817da authored by Philipp Schafft's avatar Philipp Schafft 🦁

Update: Replaced listensocket_container_new()

parent b875e802
...@@ -1703,7 +1703,7 @@ void connection_setup_sockets (ice_config_t *config) ...@@ -1703,7 +1703,7 @@ void connection_setup_sockets (ice_config_t *config)
allowed_ip = matchfile_new(config->allowfile); allowed_ip = matchfile_new(config->allowfile);
} }
global.listensockets = listensocket_container_new(); global.listensockets = refobject_new(listensocket_container_t);
listensocket_container_configure(global.listensockets, config); listensocket_container_configure(global.listensockets, config);
global_unlock(); global_unlock();
......
...@@ -150,26 +150,25 @@ static void __listensocket_container_free(refobject_t self, void **userdata) ...@@ -150,26 +150,25 @@ static void __listensocket_container_free(refobject_t self, void **userdata)
thread_mutex_destroy(&container->lock); thread_mutex_destroy(&container->lock);
} }
REFOBJECT_DEFINE_TYPE(listensocket_container_t, int __listensocket_container_new(refobject_t self, const refobject_type_t *type, va_list ap)
REFOBJECT_DEFINE_TYPE_FREE(__listensocket_container_free)
);
listensocket_container_t * listensocket_container_new(void)
{ {
listensocket_container_t *self = refobject_new__new(listensocket_container_t, NULL, NULL, NULL); listensocket_container_t *ret = REFOBJECT_TO_TYPE(self, listensocket_container_t*);
if (!self)
return NULL;
self->sock = NULL; ret->sock = NULL;
self->sock_len = 0; ret->sock_len = 0;
self->sockcount_cb = NULL; ret->sockcount_cb = NULL;
self->sockcount_userdata = NULL; ret->sockcount_userdata = NULL;
thread_mutex_create(&self->lock); thread_mutex_create(&ret->lock);
return self; return 0;
} }
REFOBJECT_DEFINE_TYPE(listensocket_container_t,
REFOBJECT_DEFINE_TYPE_FREE(__listensocket_container_free),
REFOBJECT_DEFINE_TYPE_NEW(__listensocket_container_new)
);
static inline void __find_matching_entry(listensocket_container_t *self, const listener_t *listener, listensocket_t ***found, int **ref) static inline void __find_matching_entry(listensocket_container_t *self, const listener_t *listener, listensocket_t ***found, int **ref)
{ {
const listener_t *b; const listener_t *b;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment