updates.
[silc.git] / lib / silccore / silcprotocol.c
index 7c33c1afbfd3d6191ebc1543378b1e34bf8e221f..9eb50898d1fdf4b1ec6351afa8e3d18b3dd96403 100644 (file)
 /*
  * Created: Tue Nov 25 19:25:33 GMT+0200 1997
  */
-/*
- * $Id$
- * $Log$
- * Revision 1.3  2000/07/20 10:17:25  priikone
- *     Added dynamic protocol registering/unregistering support.  The
- *     patch was provided by cras.
- *
- * Revision 1.2  2000/07/05 06:06:35  priikone
- *     Global cosmetic change.
- *
- * Revision 1.1.1.1  2000/06/27 11:36:55  priikone
- *     Imported from internal CVS/Added Log headers.
- *
- *
- */
+/* $Id$ */
 
 #include "silcincludes.h"
 #include "silcprotocol.h"
@@ -106,6 +92,7 @@ void silc_protocol_alloc(SilcProtocolType type, SilcProtocol *new_protocol,
 
   if (!protocol) {
     SILC_LOG_ERROR(("Requested protocol does not exists"));
+    *new_protocol = NULL;
     return;
   }
 
@@ -157,3 +144,14 @@ void silc_protocol_execute_final(void *qptr, int type,
 
   protocol->final_callback(qptr, 0, context, fd);
 }
+
+/* Cancels the execution of the next state of the protocol. */
+
+void silc_protocol_cancel(void *qptr, void *context)
+{
+  SilcProtocol protocol = (SilcProtocol)context;
+
+  SILC_LOG_DEBUG(("Start"));
+
+  silc_task_unregister_by_callback(qptr, protocol->protocol->callback);
+}