]> code.citadel.org Git - citadel.git/blobdiff - citadel/event_client.h
cURL: put error description into the status message.
[citadel.git] / citadel / event_client.h
index bf4aa4ea4ef58e00d3177fdf295783d29709cc57..99d4259f65b3c377bf9f1803102f82c28b13c72e 100644 (file)
@@ -32,6 +32,38 @@ typedef struct AsyncIO AsyncIO;
 typedef struct CitContext CitContext;
 #endif
 
+typedef enum __eIOState { 
+       eDBQ,
+       eQDBNext,
+       eDBAttach,
+       eDBNext,
+       eDBStop,
+       eDBX,
+       eDBTerm,
+       eIOQ,
+       eIOAttach,
+       eIOConnectSock,
+       eIOAbort,
+       eIOTimeout,
+       eIOConnfail,
+       eIOConnfailNow,
+       eIOConnNow,
+       eIOConnWait,
+       eCurlQ,
+       eCurlStart,
+       eCurlShutdown,
+       eCurlNewIO,
+       eCurlGotIO,
+       eCurlGotData,
+       eCurlGotStatus,
+       eCaresStart,
+       eCaresDoneIO,
+       eCaresFinished,
+       eCaresX,
+       eKill,
+       eExit
+}eIOState;
+
 typedef enum _eNextState {
        eSendDNSQuery,
        eReadDNSReply,
@@ -52,6 +84,8 @@ typedef enum _eNextState {
        eAbort
 }eNextState;
 
+void SetEVState(AsyncIO *IO, eIOState State);
+
 typedef eNextState (*IO_CallBack)(AsyncIO *IO);
 typedef eReadState (*IO_LineReaderCallback)(AsyncIO *IO);
 typedef void (*ParseDNSAnswerCb)(AsyncIO*, unsigned char*, int);
@@ -90,6 +124,7 @@ typedef struct _evcurl_request_data
        CURL                    *chnd;
        struct curl_slist       *headers;
        char                     errdesc[CURL_ERROR_SIZE];
+       const char              *CurlError;
 
        int                      attached;
 
@@ -244,9 +279,11 @@ void FreeAsyncIOContents(AsyncIO *IO);
 
 eNextState NextDBOperation(AsyncIO *IO, IO_CallBack CB);
 eNextState QueueDBOperation(AsyncIO *IO, IO_CallBack CB);
+eNextState EventQueueDBOperation(AsyncIO *IO, IO_CallBack CB);
 void StopDBWatchers(AsyncIO *IO);
 eNextState QueueEventContext(AsyncIO *IO, IO_CallBack CB);
 eNextState QueueCurlContext(AsyncIO *IO);
+eNextState DBQueueEventContext(AsyncIO *IO, IO_CallBack CB);
 
 eNextState EvConnectSock(AsyncIO *IO,
                         double conn_timeout,
@@ -308,6 +345,7 @@ int InitcURLIOStruct(AsyncIO *IO,
 void KillAsyncIOContext(AsyncIO *IO);
 void StopCurlWatchers(AsyncIO *IO);
 
+eNextState CurlQueueDBOperation(AsyncIO *IO, IO_CallBack CB);
 
 eNextState ReAttachIO(AsyncIO *IO,
                      void *pData,