Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload info strings on ircd restart #112

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions sable_ircd/src/server/server_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub struct ClientServerState {
auth_state: AuthClientState,
client_caps: CapabilityRepository,
listener_state: SavedListenerCollection,
info_strings: config::ServerInfoStrings,
}

#[async_trait]
Expand Down Expand Up @@ -107,7 +106,6 @@ impl sable_server::ServerType for ClientServer {
.save()
.await
.map_err(ServerSaveError::IoError)?,
info_strings: self.info_strings,
})
}

Expand All @@ -116,6 +114,7 @@ impl sable_server::ServerType for ClientServer {
state: ClientServerState,
node: Arc<NetworkNode>,
history_receiver: UnboundedReceiver<NetworkHistoryUpdate>,
config: &Self::ProcessedConfig,
) -> std::io::Result<Self> {
let (auth_send, auth_recv) = unbounded_channel();
let (action_send, action_recv) = unbounded_channel();
Expand Down Expand Up @@ -148,7 +147,7 @@ impl sable_server::ServerType for ClientServer {
client_caps: state.client_caps,
history_receiver: Mutex::new(history_receiver),
listeners: Movable::new(listeners),
info_strings: state.info_strings,
info_strings: config.info_strings.clone(),
})
}

Expand Down
6 changes: 5 additions & 1 deletion sable_server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,14 @@ where
state: ServerState<ST>,
net_config: SyncConfig,
server_config: ServerConfig<ST>,
) -> std::io::Result<Self> {
) -> Result<Self, anyhow::Error> {
let (server_send, server_recv) = unbounded_channel();
let (history_send, history_recv) = unbounded_channel();
let (remote_send, remote_recv) = unbounded_channel();

let processed_server_config = ST::validate_config(&server_config.server)
.context("Could not load server configuration")?;

let log = Arc::new(ReplicatedEventLog::restore(
state.log_state,
server_send,
Expand All @@ -342,6 +345,7 @@ where
state.server_state,
Arc::clone(&node),
history_recv,
&processed_server_config,
)?);

Ok(Self {
Expand Down
1 change: 1 addition & 0 deletions sable_server/src/server_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub trait ServerType: Send + Sync + Sized + 'static {
state: Self::Saved,
node: Arc<NetworkNode>,
history_receiver: UnboundedReceiver<NetworkHistoryUpdate>,
config: &Self::ProcessedConfig,
) -> std::io::Result<Self>;

/// Handle a request originating from a remote server
Expand Down
1 change: 1 addition & 0 deletions sable_services/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ where
_state: Self::Saved,
_node: Arc<NetworkNode>,
_history_receiver: UnboundedReceiver<sable_network::rpc::NetworkHistoryUpdate>,
_config: &Self::ProcessedConfig,
) -> std::io::Result<Self> {
unimplemented!("services can't hot-upgrade");
}
Expand Down
Loading