Added SilcStack suppor to SILC Scheduler API.
[silc.git] / lib / silcclient / client.c
index ab13fd6d9fea4963b88eeeaeebb528f46c18fa38..9fef6df8b6ed453bd9a1353bbc31d529be815925 100644 (file)
@@ -1041,7 +1041,7 @@ SilcBool silc_client_init(SilcClient client, const char *username,
   silc_rng_global_init(client->rng);
 
   /* Initialize the scheduler */
-  client->schedule = silc_schedule_init(0, client);
+  client->schedule = silc_schedule_init(0, client, NULL);
   if (!client->schedule)
     return FALSE;
 
@@ -1099,6 +1099,12 @@ void silc_client_stop(SilcClient client, SilcClientStopped stopped,
 {
   SILC_LOG_DEBUG(("Stopping client"));
 
+  if (!silc_fsm_is_started(&client->internal->fsm)) {
+    SILC_LOG_WARNING(("Attempting to stop client library before it has been "
+                     "started (silc_client_init not called)"));
+    return;
+  }
+
   client->internal->running = (SilcClientRunning)stopped;
   client->internal->running_context = context;