make this generaly in the ev interface.
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 19 Jan 2012 00:42:20 +0000 (01:42 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 19 Jan 2012 00:42:20 +0000 (01:42 +0100)
citadel/event_client.c
citadel/modules/network/serv_networkclient.c

index 833a270a75f316b970133c962dd0ce1116aa5591..5a32cea9bca45878d533fe68cb1cec7f68700147 100644 (file)
@@ -240,8 +240,10 @@ void FreeAsyncIOContents(AsyncIO *IO)
        FreeURL(&IO->ConnectMe);
        FreeStrBuf(&IO->HttpReq.ReplyData);
 
-       Ctx->state = CON_IDLE;
-       Ctx->kill_me = 1;
+       if (Ctx) {
+               Ctx->state = CON_IDLE;
+               Ctx->kill_me = 1;
+       }
 }
 
 
@@ -279,7 +281,6 @@ void ShutDownCLient(AsyncIO *IO)
        IO->Terminate(IO);
 }
 
-
 eReadState HandleInbound(AsyncIO *IO)
 {
        const char *Err = NULL;
index 647ec6ed634fee8cb1e5ef6af863253d4a14a068..7f4ca89d11a3f3f873d5dade7724d1157784766d 100644 (file)
@@ -135,10 +135,6 @@ void DeleteNetworker(void *vptr)
        FreeStrBuf(&NW->port);
        FreeStrBuf(&NW->secret);
        FreeStrBuf(&NW->Url);
-       if (NW->IO.CitContext != NULL) {
-               ((struct CitContext*)NW->IO.CitContext)->state = CON_IDLE;
-               ((struct CitContext*)NW->IO.CitContext)->kill_me = 1;
-       }
        FreeAsyncIOContents(&NW->IO);
        free(NW);
 }