/* Process events */
- if (client->internal->run_callback && client->internal->running) {
+ if (client->internal->run_callback) {
/* Call running callbcak back to application */
- SILC_LOG_DEBUG(("We are up, call running callback"));
client->internal->run_callback = FALSE;
- client->internal->running(client, client->internal->running_context);
+ if (client->internal->running) {
+ SILC_LOG_DEBUG(("We are up, call running callback"));
+ client->internal->running(client, client->internal->running_context);
+ }
return SILC_FSM_CONTINUE;
}
if (!client || !remote_host)
return NULL;
+ if (client->internal->run_callback) {
+ SILC_LOG_ERROR(("Client library is not started yet. SilcClientRunning "
+ "callback has not been called yet."));
+ return NULL;
+ }
+
/* Add new connection */
conn = silc_client_add_connection(client, SILC_CONN_SERVER, TRUE, params,
public_key, private_key, remote_host,
if (!client || !remote_host)
return NULL;
+ if (client->internal->run_callback) {
+ SILC_LOG_ERROR(("Client library is not started yet. SilcClientRunning "
+ "callback has not been called yet."));
+ return NULL;
+ }
+
if (params)
params->no_authentication = TRUE;
if (!client || !stream)
return NULL;
+ if (client->internal->run_callback) {
+ SILC_LOG_ERROR(("Client library is not started yet. SilcClientRunning "
+ "callback has not been called yet."));
+ return NULL;
+ }
+
if (!silc_socket_stream_get_info(stream, NULL, &host, NULL, &port)) {
SILC_LOG_ERROR(("Socket stream does not have remote host name set"));
callback(client, NULL, SILC_CLIENT_CONN_ERROR, 0, NULL, context);
arguments are same as received from the server except for ID's. If
ID is received application receives the corresponding entry to the
ID. For example, if Client ID is receives application receives
- SilcClientEntry. */
+ SilcClientEntry.
+
+ See: http://silcnet.org/docs/toolkit/command_reply_args.html */
void silc_command_reply(SilcClient client, SilcClientConnection conn,
SilcCommand command, SilcStatus status,
SilcStatus error, va_list ap);
* The `running' callback with `context' is called after the client is
* running after silc_client_run or silc_client_run_one has been called.
* Application may start using the Client library API after that. Setting
- * the callback is optional, but recommended.
+ * the callback is optional, but highly recommended.
*
***/
SilcBool silc_client_init(SilcClient client, const char *username,