#include "extnotify.h"
eNextState EvaluateResult(AsyncIO *IO);
+eNextState ExtNotifyTerminate(AsyncIO *IO);
/*
* \brief Sends a message to the Funambol server notifying
char *SOAPMessage = NULL;
char *contenttype = NULL;
StrBuf *ReplyBuf;
+ StrBuf *Buf;
CURL *chnd;
AsyncIO *IO;
IO = (AsyncIO*) malloc(sizeof(AsyncIO));
memset(IO, 0, sizeof(AsyncIO));
- IO->CitContext = CC;
+ IO->CitContext = CloneContext(CC);
snprintf(msgnumstr, 128, "%ld", MsgNum);
IO->HttpReq.headers = curl_slist_append(IO->HttpReq.headers, "Pragma: no-cache");
}
- ParseURL(&IO->ConnectMe, NewStrBufPlain (remoteurl, -1), 80);
+ Buf = NewStrBufPlain (remoteurl, -1);
+ ParseURL(&IO->ConnectMe, Buf, 80);
+ FreeStrBuf(&Buf); /* TODO: this is uncool... */
CurlPrepareURL(IO->ConnectMe);
if (! evcurl_init(IO,
// Ctx,
NULL,
"Citadel ExtNotify",
- EvaluateResult))
+ EvaluateResult,
+ ExtNotifyTerminate))
{
CtdlLogPrintf(CTDL_ALERT, "Unable to initialize libcurl.\n");
goto abort;
///FreeStrBuf (&ReplyBuf);
return 0;
}
+
+eNextState ExtNotifyTerminate(AsyncIO *IO)
+{
+ free(IO);
+ return eAbort;
+}