AFUnixSourceDriver * afunix_sd_new_instance(TransportMapper *transport_mapper, gchar *filename) { AFUnixSourceDriver *self = g_new0(AFUnixSourceDriver, 1); afsocket_sd_init_instance(&self->super, socket_options_new(), transport_mapper); self->super.super.super.super.init = afunix_sd_init; self->super.super.super.super.free_fn = afunix_sd_free; self->super.acquire_socket = afunix_sd_acquire_socket; self->super.setup_addresses = afunix_sd_setup_addresses; self->super.max_connections = 256; self->super.recvd_messages_are_local = TRUE; self->filename = g_strdup(filename); file_perm_options_defaults(&self->file_perm_options); self->file_perm_options.file_perm = 0666; afunix_sd_adjust_reader_options(self, configuration); return self; }
AFUnixSourceDriver * afunix_sd_new_instance(TransportMapper *transport_mapper, gchar *filename, GlobalConfig *cfg) { AFUnixSourceDriver *self = g_new0(AFUnixSourceDriver, 1); afsocket_sd_init_instance(&self->super, socket_options_new(), transport_mapper, cfg); self->super.super.super.super.init = afunix_sd_init; self->super.super.super.super.free_fn = afunix_sd_free; self->super.setup_addresses = afunix_sd_setup_addresses; self->super.max_connections = 256; self->super.recvd_messages_are_local = TRUE; self->filename = g_strdup(filename); file_perm_options_defaults(&self->file_perm_options); self->file_perm_options.file_perm = 0666; self->pass_unix_credentials = cfg->pass_unix_credentials; self->create_dirs = cfg->create_dirs; afunix_sd_set_pass_unix_credentials(self, self->pass_unix_credentials); afunix_sd_adjust_reader_options(self, cfg); return self; }