SilcClient client = conn->client;
SilcCommandPayload payload = state_context;
SilcArgumentPayload args = silc_command_get_args(payload);
- SilcChannelEntry channel;
+ SilcChannelEntry channel = NULL;
char *topic;
SilcUInt32 len;
SilcID id;
silc_client_command_callback(cmd, channel, channel->topic);
out:
+ silc_client_unref_channel(client, conn, channel);
silc_fsm_next(fsm, silc_client_command_reply_processed);
return SILC_FSM_CONTINUE;
}
SilcClient client = conn->client;
SilcCommandPayload payload = state_context;
SilcArgumentPayload args = silc_command_get_args(payload);
- SilcChannelEntry channel;
+ SilcChannelEntry channel = NULL;
unsigned char *tmp;
SilcUInt32 len;
SilcArgumentPayload invite_args = NULL;
silc_argument_payload_free(invite_args);
out:
+ silc_client_unref_channel(client, conn, channel);
silc_fsm_next(fsm, silc_client_command_reply_processed);
return SILC_FSM_CONTINUE;
}
SilcArgumentPayload args = silc_command_get_args(payload);
unsigned char *tmp;
SilcUInt32 mode;
- SilcChannelEntry channel;
+ SilcChannelEntry channel = NULL;
SilcUInt32 len;
SilcPublicKey public_key = NULL;
SilcID id;
silc_client_command_callback(cmd, channel, mode, public_key,
channel->channel_pubkeys, channel->user_limit);
+ silc_rwlock_wrlock(channel->internal.lock);
+
+ /* If founder key changed, update it */
+ if (public_key &&
+ (!channel->founder_key ||
+ !silc_pkcs_public_key_compare(public_key, channel->founder_key))) {
+ if (channel->founder_key)
+ silc_pkcs_public_key_free(channel->founder_key);
+ channel->founder_key = public_key;
+ public_key = NULL;
+ }
+
+ silc_rwlock_unlock(channel->internal.lock);
+
out:
+ silc_client_unref_channel(client, conn, channel);
if (public_key)
silc_pkcs_public_key_free(public_key);
silc_fsm_next(fsm, silc_client_command_reply_processed);
SilcCommandPayload payload = state_context;
SilcArgumentPayload args = silc_command_get_args(payload);
SilcClientEntry client_entry;
- SilcChannelEntry channel;
+ SilcChannelEntry channel = NULL;
SilcChannelUser chu;
unsigned char *modev;
SilcUInt32 len, mode;
silc_client_unref_client(client, conn, client_entry);
out:
+ silc_client_unref_channel(client, conn, channel);
silc_fsm_next(fsm, silc_client_command_reply_processed);
return SILC_FSM_CONTINUE;
}
SilcCommandPayload payload = state_context;
SilcArgumentPayload args = silc_command_get_args(payload);
SilcClientEntry client_entry;
- SilcChannelEntry channel;
+ SilcChannelEntry channel = NULL;
SilcID id;
/* Sanity checks */
silc_client_unref_client(client, conn, client_entry);
out:
+ silc_client_unref_channel(client, conn, channel);
silc_fsm_next(fsm, silc_client_command_reply_processed);
return SILC_FSM_CONTINUE;
}
SilcClient client = conn->client;
SilcCommandPayload payload = state_context;
SilcArgumentPayload args = silc_command_get_args(payload);
- SilcChannelEntry channel;
+ SilcChannelEntry channel = NULL;
unsigned char *tmp;
SilcUInt32 len;
SilcArgumentPayload invite_args = NULL;
silc_argument_payload_free(invite_args);
out:
+ silc_client_unref_channel(client, conn, channel);
silc_fsm_next(fsm, silc_client_command_reply_processed);
return SILC_FSM_CONTINUE;
}