+ CURLM *mhnd;
+ CURLMsg *msg;
+ int nmsg;
+
+ global->nrun = nnrun;
+ mhnd = global->mhnd;
+
+ syslog(LOG_DEBUG, "CURLEV: gotstatus(): about to call curl_multi_info_read\n");
+ while ((msg = curl_multi_info_read(mhnd, &nmsg))) {
+ syslog(LOG_ERR, "EVCURL: got curl multi_info message msg=%d\n", msg->msg);
+ if (CURLMSG_DONE == msg->msg) {
+ CURL *chnd;
+ char *chandle;
+ CURLcode sta;
+ CURLMcode msta;
+ AsyncIO *IO;
+
+ chandle = NULL;;
+ chnd = msg->easy_handle;
+ sta = curl_easy_getinfo(chnd, CURLINFO_PRIVATE, &chandle);
+ syslog(LOG_ERR, "EVCURL: request complete\n");
+ if (sta)
+ syslog(LOG_ERR, "EVCURL: error asking curl for private cookie of curl handle: %s\n", curl_easy_strerror(sta));
+ IO = (AsyncIO *)chandle;
+
+///// ev_io_stop(event_base, &IO->recv_event);
+
+ sta = msg->data.result;
+ if (sta) {
+ syslog(LOG_ERR, "EVCURL: error description: %s\n", IO->HttpReq.errdesc);
+ syslog(LOG_ERR, "EVCURL: error performing request: %s\n", curl_easy_strerror(sta));
+ }
+ sta = curl_easy_getinfo(chnd, CURLINFO_RESPONSE_CODE, &IO->HttpReq.httpcode);
+ if (sta)
+ syslog(LOG_ERR, "EVCURL: error asking curl for response code from request: %s\n", curl_easy_strerror(sta));
+ syslog(LOG_ERR, "EVCURL: http response code was %ld\n", (long)IO->HttpReq.httpcode);
+/// syslog(LOG_ERR, "EVCURL: disconnecting [%s]\nn", ChrPtr(IO->ConnectMe->URL));
+ msta = curl_multi_remove_handle(mhnd, chnd);
+ if (msta)
+ syslog(LOG_ERR, "EVCURL: warning problem detaching completed handle from curl multi: %s\n", curl_multi_strerror(msta));
+/// syslog(LOG_ERR, "EVCURL: disconnection done [%s]\nn", ChrPtr(IO->ConnectMe->URL));
+
+ IO->HttpReq.attached = 0;
+ IO->SendDone(IO);
+//// syslog(LOG_ERR, "EVCURL: done with [%s]\nn", ChrPtr(IO->ConnectMe->URL));
+
+
+ curl_easy_cleanup(IO->HttpReq.chnd);
+ curl_slist_free_all(IO->HttpReq.headers);