don't call curl_multi_add_handle() from outside of the event queue
[citadel.git] / citadel / event_client.h
index de36f29ed126b31c3c82d4ec0ffb6bf2984961ad..828ee0cb5a236b3fe073444dd7234232846e81c3 100644 (file)
@@ -14,13 +14,19 @@ typedef struct AsyncIO AsyncIO;
 typedef enum _eNextState {
        eSendDNSQuery,
        eReadDNSReply,
+
        eDBQuery,
+
        eConnect,
        eSendReply, 
        eSendMore,
+       eSendFile,
+
        eReadMessage, 
        eReadMore,
        eReadPayload,
+       eReadFile,
+
        eTerminateConnection,
        eAbort
 }eNextState;
@@ -82,6 +88,8 @@ struct AsyncIO {
        IOBuffer SendBuf, 
                RecvBuf;
 
+       FDIOBuffer IOB; /* when sending from / reading into files, this is used. */
+
        /* our events... */
        ev_cleanup abort_by_shutdown, /* server wants to go down... */
                db_abort_by_shutdown; /* server wants to go down... */
@@ -102,6 +110,7 @@ struct AsyncIO {
                Terminate,    /* shutting down... */
                Timeout,      /* Timeout handler; may also be connection timeout */
                ConnFail,     /* What to do when one connection failed? */
+               DNSFail,      /* the dns lookup didn't work out. */
                ShutdownAbort,/* we're going down. make your piece. */ 
                NextDBOperation; /* Perform Database IO */
 
@@ -135,6 +144,7 @@ void FreeAsyncIOContents(AsyncIO *IO);
 eNextState NextDBOperation(AsyncIO *IO, IO_CallBack CB);
 eNextState QueueDBOperation(AsyncIO *IO, IO_CallBack CB);
 eNextState QueueEventContext(AsyncIO *IO, IO_CallBack CB);
+eNextState QueueCurlContext(AsyncIO *IO);
 int ShutDownEventQueue(void);
 
 eNextState InitEventIO(AsyncIO *IO, 
@@ -177,6 +187,4 @@ eNextState ReAttachIO(AsyncIO *IO,
                      void *pData, 
                      int ReadFirst);
 
-void evcurl_handle_start(AsyncIO *IO);
-
 #endif /* __EVENT_CLIENT_H__ */