- char *contenttype;
- struct fh_data fh = {
- retbuf,
- 0,
- SIZ
- };
-
- curl = curl_easy_init();
- if (!curl) {
- CtdlLogPrintf(CTDL_ALERT, "Unable to initialize libcurl.\n");
- return 1;
- }
-
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
- curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
- curl_easy_setopt(curl, CURLOPT_WRITEDATA, fh);
- curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, extnotify_callback); /* don't care..*/
- curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errmsg);
- curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
-
- pchs = strchr(remoteurl, ':');
- pche = strchr(remoteurl, '@');
- if ((pche != NULL) &&
- (pchs != NULL) &&
- (pchs < pche) && ((pche - pchs) < SIZ)) {
- memcpy(userpass, pchs + 3, pche - pchs - 3);
-
- userpass[pche - pchs - 3] = '\0';
- curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_BASIC);
- curl_easy_setopt(curl, CURLOPT_USERPWD, userpass);
-
- }
-#ifdef CURLOPT_HTTP_CONTENT_DECODING
- curl_easy_setopt(curl, CURLOPT_HTTP_CONTENT_DECODING, 1);
- curl_easy_setopt(curl, CURLOPT_ENCODING, "");
-#endif
- curl_easy_setopt(curl, CURLOPT_USERAGENT, CITADEL);
- curl_easy_setopt(curl, CURLOPT_TIMEOUT, 180); /* die after 180 seconds */
- if (!IsEmptyStr(config.c_ip_addr)) {
- curl_easy_setopt(curl, CURLOPT_INTERFACE, config.c_ip_addr);
+ char *contenttype = NULL;
+ StrBuf *ReplyBuf;
+ StrBuf *Buf;
+ CURL *chnd;
+ AsyncIO *IO;
+
+ IO = (AsyncIO*) malloc(sizeof(AsyncIO));
+ memset(IO, 0, sizeof(AsyncIO));
+
+ if (! InitcURLIOStruct(IO,
+ NULL, /* we don't have personal data anymore. */
+ "Citadel ExtNotify",
+ EvaluateResult,
+ ExtNotifyTerminate,
+ ExtNotifyShutdownAbort))
+ {
+ syslog(LOG_ALERT, "Unable to initialize libcurl.\n");
+ goto abort;