SMTPSrv: don't use memset() to forget - we have structured data in there now.
[citadel.git] / citadel / event_client.h
index 7a936b97bf463982ac0f103c7c5b10e5d04bdd27..bf4aa4ea4ef58e00d3177fdf295783d29709cc57 100644 (file)
@@ -3,18 +3,12 @@
  * Copyright (c) 1998-2012 by the citadel.org team
  *
  *  This program is open source software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
+ *  it under the terms of the GNU General Public License, version 3.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #ifndef __EVENT_CLIENT_H__
 #include <ares.h>
 #include <curl/curl.h>
 
+#ifndef __ASYNCIO__
+#define __ASYNCIO__
 typedef struct AsyncIO AsyncIO;
+#endif
+#ifndef __CIT_CONTEXT__
+#define __CIT_CONTEXT__
+typedef struct CitContext CitContext;
+#endif
 
 typedef enum _eNextState {
        eSendDNSQuery,
@@ -76,6 +77,8 @@ typedef struct _DNSQueryParts {
        ParseDNSAnswerCb DNS_CB;
        IO_CallBack PostDNS;
 
+       const char *QueryTYPE;
+       const char *QStr;
        int DNSStatus;
        void *VParsedDNSReply;
        FreeDNSReply DNSReplyFree;
@@ -170,7 +173,7 @@ struct AsyncIO {
 
        /* Context specific data; Hint: put AsyncIO in there */
        void *Data;        /* application specific data */
-       void *CitContext;  /* Citadel Session context... */
+       CitContext *CitContext;  /* Citadel Session context... */
 };
 
 typedef struct _IOAddHandler {
@@ -266,7 +269,7 @@ void QueryCbDone(AsyncIO *IO);
 
 void StopClient(AsyncIO *IO);
 
-void StopClientWatchers(AsyncIO *IO);
+void StopClientWatchers(AsyncIO *IO, int CloseFD);
 
 void SetNextTimeout(AsyncIO *IO, double timeout);
 
@@ -302,7 +305,7 @@ int InitcURLIOStruct(AsyncIO *IO,
                     IO_CallBack Terminate,
                     IO_CallBack DBTerminate,
                     IO_CallBack ShutdownAbort);
-
+void KillAsyncIOContext(AsyncIO *IO);
 void StopCurlWatchers(AsyncIO *IO);