can do partial reads to different buffers. Affected file is
lib/silccore/silcpacket.c.
+ * Fixed WATCH notify handling in client library. Affected file
+ is lib/silcclient/client_notify.c.
+
Wed Feb 14 17:05:38 EET 2007 Pekka Riikonen <priikone@silcnet.org>
* Fixed packet wrapper stream API to support encoder/decoder
o Remove protocol.[ch]. (***DONE)
- o File transfer rewrite. (***TESTING NEEDED)
+ o File transfer rewrite. (***DONE)
o File transfer API documentation.
o Starting key exchange directly, rewrite. (***DONE)
o Channel messages, channel private keys, channel entires, channel
- search, etc. rewrite.
+ search, etc. rewrite. (***TESTING NEEDED */
o For many APIs leave the hash context allocations to the caller instead
of using client->sha1hash and client->md5hash, or some kind of thread
o UDP connections. (***TESTING NEEDED)
+ o Message ACKing.
+
o in /cmode and /cumode with +r, maybe the public key and private key
could be just some "string", which would then match to "string.pub" and
"string.prv".
o IV Included flag support, UDP transport support (***TESTING NEEDED)
+ o SILC_PACKET_FLAG_ACK support.
+
lib/silccore/silcid.[ch] ****DONE****
========================
Otherwise this pointer is NULL. The 'user_mode' is the client's mode in
the SILC network. The 'notification' contains the notify type that
happened for the 'watched_client' (for example
-SILC_NOTIFY_TYPE_NICK_CHANGE if the client changed their nickname).
+SILC_NOTIFY_TYPE_NICK_CHANGE if the client changed their nickname). If
+the `new_nickname' is NULL and `notification' is SILC_NOTIFY_TYPE_NONE the
+`watched_client' has just joined the network.
</td>
<td width="50%"><small>SilcClientEntry watched_client, char *new_nickname,
SilcUInt32 user_mode, SilcNotifyType notification, SilcPublicKey
silc_ske_free_rekey_material(conn->internal->rekey);
conn->internal->rekey = rekey;
- SILC_LOG_DEBUG(("Rekey completed"));
+ SILC_LOG_DEBUG(("Rekey completed conn %p", conn));
/* Rekey done */
silc_fsm_finish(fsm);
SILC_LOG_DEBUG(("Connection established"));
/* Install rekey timer */
- silc_schedule_task_add_timeout(conn->internal->schedule,
- silc_client_rekey_timer, conn,
- conn->internal->params.rekey_secs, 0);
+ if (conn->type != SILC_CONN_CLIENT)
+ silc_schedule_task_add_timeout(conn->internal->schedule,
+ silc_client_rekey_timer, conn,
+ conn->internal->params.rekey_secs, 0);
/* If we connected to server, now register to network. */
if (conn->type == SILC_CONN_SERVER &&
SilcClientConnection conn = fsm_context;
SilcClient client = conn->client;
- SILC_LOG_DEBUG(("Rekey"));
+ SILC_LOG_DEBUG(("Rekey conn %p", conn));
if (conn->internal->disconnected)
return SILC_FSM_FINISH;
SilcArgumentPayload args = silc_notify_get_args(payload);
SilcClientEntry client_entry = NULL;
SilcNotifyType ntype = 0;
- SilcBool del_client = FALSE;
unsigned char *pk, *tmp;
SilcUInt32 mode, pk_len, tmp_len;
SilcPublicKey public_key = NULL;
client_entry->mode = mode;
- /* If nickname was changed, remove the client entry unless the
- client is on some channel */
- /* XXX, why do we need to remove the client entry?? */
- if (tmp && ntype == SILC_NOTIFY_TYPE_NICK_CHANGE &&
- !silc_hash_table_count(client_entry->channels))
- del_client = TRUE;
- else if (ntype == SILC_NOTIFY_TYPE_SIGNOFF ||
- ntype == SILC_NOTIFY_TYPE_SERVER_SIGNOFF ||
- ntype == SILC_NOTIFY_TYPE_KILLED)
- del_client = TRUE;
-
- if (del_client) {
+ /* Remove client that left the network. */
+ if (ntype == SILC_NOTIFY_TYPE_SIGNOFF ||
+ ntype == SILC_NOTIFY_TYPE_SERVER_SIGNOFF ||
+ ntype == SILC_NOTIFY_TYPE_KILLED) {
silc_client_remove_from_channels(client, conn, client_entry);
+ client_entry->internal.valid = FALSE;
silc_client_del_client(client, conn, client_entry);
}
/************************ Static utility functions **************************/
-/* Command callback. Nothing interesting to do here. */
-
-static SilcBool
-silc_client_register_command_called(SilcClient client,
- SilcClientConnection conn,
- SilcCommand command,
- SilcStatus status,
- SilcStatus error,
- void *context,
- va_list ap)
-{
- return FALSE;
-}
-
/* Continues resuming after resolving. Continue after last reply. */
static SilcBool
/* Issue IDENTIFY command for itself to get resolved hostname
correctly from server. */
silc_client_command_send(client, conn, SILC_COMMAND_IDENTIFY,
- silc_client_register_command_called, NULL,
+ silc_client_command_called_dummy, NULL,
1, 5, silc_buffer_data(conn->internal->local_idp),
silc_buffer_len(conn->internal->local_idp));
/* Issue INFO command to fetch the real server name and server
information and other stuff. */
silc_client_command_send(client, conn, SILC_COMMAND_INFO,
- silc_client_register_command_called, NULL,
+ silc_client_command_called_dummy, NULL,
1, 2, silc_buffer_data(conn->internal->remote_idp),
silc_buffer_len(conn->internal->remote_idp));
/* Send UMODE command to get our own user mode in the network */
SILC_LOG_DEBUG(("Resolving user mode"));
silc_client_command_send(client, conn, SILC_COMMAND_UMODE,
- silc_client_register_command_called, NULL,
+ silc_client_command_called_dummy, NULL,
1, 1, silc_buffer_data(conn->internal->local_idp),
silc_buffer_len(conn->internal->local_idp));
/* Issue IDENTIFY command for itself to get resolved hostname
correctly from server. */
silc_client_command_send(client, conn, SILC_COMMAND_IDENTIFY,
- silc_client_register_command_called, NULL,
+ silc_client_command_called_dummy, NULL,
1, 5, silc_buffer_data(conn->internal->local_idp),
silc_buffer_len(conn->internal->local_idp));
/* Issue INFO command to fetch the real server name and server
information and other stuff. */
silc_client_command_send(client, conn, SILC_COMMAND_INFO,
- silc_client_register_command_called, NULL,
+ silc_client_command_called_dummy, NULL,
1, 2, silc_buffer_data(conn->internal->remote_idp),
silc_buffer_len(conn->internal->remote_idp));
SILC_FSM_CALL_CONTINUE(&cmd->thread);
}
+/* Dummy command callback. Nothing interesting to do here. Use this when
+ you just send command but don't care about reply. */
+
+SilcBool silc_client_command_called_dummy(SilcClient client,
+ SilcClientConnection conn,
+ SilcCommand command,
+ SilcStatus status,
+ SilcStatus error,
+ void *context,
+ va_list ap)
+{
+ return FALSE;
+}
+
+/* Dummy resolving callback. Nothing interesting to do here. Use this
+ when you just resolve entires but don't care about reply. */
+
+void silc_client_command_resolve_dummy(SilcClient client,
+ SilcClientConnection conn,
+ SilcStatus status,
+ SilcDList clients,
+ void *context)
+{
+ /* Nothing */
+}
+
/* Register command to client */
static SilcBool
silc_pkcs_public_key_free(pk);
}
+ /* If watching by nickname, resolve all users with that nickname so that
+ we get their information immediately. */
+ if (type == 2)
+ silc_client_get_clients(conn->client, conn, cmd->argv[2], NULL,
+ silc_client_command_resolve_dummy, NULL);
+
/* Send the commmand */
silc_client_command_send_va(conn, cmd, cmd->cmd, NULL, NULL, 2,
1, silc_buffer_datalen(conn->internal->
SilcUInt32 *argv_types);
void silc_client_commands_register(SilcClient client);
void silc_client_commands_unregister(SilcClient client);
+SilcBool silc_client_command_called_dummy(SilcClient client,
+ SilcClientConnection conn,
+ SilcCommand command,
+ SilcStatus status,
+ SilcStatus error,
+ void *context,
+ va_list ap);
+void silc_client_command_resolve_dummy(SilcClient client,
+ SilcClientConnection conn,
+ SilcStatus status,
+ SilcDList clients,
+ void *context);
#endif /* COMMAND_H */