* The nickname argument to watch notify can be optional.
Fixes a crash in server. Affected file silcd/packet_send.c.
+ * Remove the client entry from cache if the WATCH notify type
+ is KILLED, SERVER_SIGNOFF or SIGNOFF. Affected file is
+ lib/silcclient/client_notify.c.
+
Wed May 15 19:01:42 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Merged with Irssi CVS for Irssi SILC client.
void ask_passphrase_completion(const char *passphrase, void *context)
{
AskPassphrase p = (AskPassphrase)context;
+ if (passphrase && passphrase[0] == '\0')
+ passphrase = NULL;
p->completion((unsigned char *)passphrase,
passphrase ? strlen(passphrase) : 0, p->context);
silc_free(p);
silc_server_send_notify_dest(server, sock, FALSE, watcher->id,
SILC_ID_CLIENT, SILC_NOTIFY_TYPE_WATCH,
4, idp->data, idp->len,
- nickname, strlen(nickname),
+ nickname, nickname ? strlen(nickname) : 0,
mode, sizeof(mode),
type != SILC_NOTIFY_TYPE_NONE ?
n : NULL, sizeof(n));
if (tmp && notify == SILC_NOTIFY_TYPE_NICK_CHANGE &&
!silc_hash_table_count(client_entry->channels))
silc_client_del_client(client, conn, client_entry);
+ else if (notify == SILC_NOTIFY_TYPE_SIGNOFF ||
+ notify == SILC_NOTIFY_TYPE_SERVER_SIGNOFF ||
+ notify == SILC_NOTIFY_TYPE_KILLED)
+ silc_client_del_client(client, conn, client_entry);
}
break;
buffer = silc_command_payload_encode_va(SILC_COMMAND_OPER, 0, 2,
1, cmd->argv[1],
strlen(cmd->argv[1]),
- 2, auth->data, auth->len);
+ 2, auth ? auth->data : NULL,
+ auth ? auth->len : 0);
silc_client_packet_send(cmd->client, conn->sock, SILC_PACKET_COMMAND, NULL,
0, NULL, NULL, buffer->data, buffer->len, TRUE);
buffer = silc_command_payload_encode_va(SILC_COMMAND_SILCOPER, 0, 2,
1, cmd->argv[1],
strlen(cmd->argv[1]),
- 2, auth->data, auth->len);
+ 2, auth ? auth->data : NULL,
+ auth ? auth->len : 0);
silc_client_packet_send(cmd->client, conn->sock, SILC_PACKET_COMMAND, NULL,
0, NULL, NULL, buffer->data, buffer->len, TRUE);