]> code.citadel.org Git - citadel.git/blobdiff - citadel/event_client.h
don't call curl_multi_add_handle() from outside of the event queue
[citadel.git] / citadel / event_client.h
index cb833e0683c6cdc7e45d7ebb13be51445e1e9630..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, 
@@ -163,7 +173,7 @@ void InitC_ares_dns(AsyncIO *IO);
        do { \
                sta = curl_easy_setopt(chnd, (CURLOPT_##s), (v)); \
                if (sta)  {                                             \
-                       CtdlLogPrintf(CTDL_ERR, "error setting option " #s " on curl handle: %s", curl_easy_strerror(sta)); \
+                       syslog(LOG_ERR, "error setting option " #s " on curl handle: %s", curl_easy_strerror(sta)); \
        } } while (0)
 
 
@@ -177,6 +187,4 @@ eNextState ReAttachIO(AsyncIO *IO,
                      void *pData, 
                      int ReadFirst);
 
-void evcurl_handle_start(AsyncIO *IO);
-
 #endif /* __EVENT_CLIENT_H__ */