silc_hash_table_add(channel->user_list, client, chl);
silc_hash_table_add(client->channels, channel, chl);
silc_free(client_id);
+ channel->user_count++;
break;
int tlen = strcspn(username, "@");
char *phostname = NULL;
- hostname = silc_calloc((strlen(username) - tlen) + 1, sizeof(char));
- memcpy(hostname, username + tlen + 1, strlen(username) - tlen - 1);
+ hostname = silc_memdup(username + tlen + 1, strlen(username) - tlen - 1);
if (strcmp(sock->hostname, sock->ip) &&
strcmp(sock->hostname, hostname)) {
SilcSocketConnection sock,
SilcPacketContext *packet)
{
- SilcServerConfigSectionClient *client = NULL;
+ SilcServerConfigClient *client = NULL;
uint16 conn_type;
- int ret, port;
+ int ret;
SilcAuthMethod auth_meth = SILC_AUTH_NONE;
SILC_LOG_DEBUG(("Start"));
/* Get the authentication method for the client */
auth_meth = SILC_AUTH_NONE;
- port = server->sockets[server->sock]->port; /* Listenning port */
- client = silc_server_config_find_client(server, sock->ip, port);
+ client = silc_server_config_find_client(server, sock->ip);
if (!client)
- client = silc_server_config_find_client(server, sock->hostname, port);
+ client = silc_server_config_find_client(server, sock->hostname);
if (client) {
if (client->passphrase) {
if (client->publickey && !server->config->prefer_passphrase_auth)