cURL / Mailing Lists / curl-library / Single Mail

curl-library

about doubt about using curl

From: pengyi Peng(Yi) <pengyi.pengyi_at_huawei.com>
Date: Wed, 22 May 2013 03:58:53 +0000

In xmlrpc-c, when timeout occurred, there are no messages in the queue, so, when it calls curl_multi_info_read to get privateCurlMsgP, curl_multi_info_read will return NULL. In this situation, xmlrpc fails to get resources and the memory won't be freed.

In normal situation, curl_multi_info_read will return te messages. Then, calls curl_easy_getinfo to retrieve information from a performed transfer. Finally xmlrpc-c calls the function curlTransaction_finish of its own to release the resources.

However, if timeout occurs, curl_multi_info_read return &easy->msg->extmsg which is NULL. Is there a function in curl like curl_multi_info_read which returns the easy->easy_handle directly?

Like:
CURL *curl_multi_easy_handle_read(CURLM *multi_handle)
{
  struct Curl_multi *multi=(struct Curl_multi *)multi_handle;

  if(GOOD_MULTI_HANDLE(multi)) {
    struct Curl_one_easy *easy;

    easy=multi->easy.next;

    if(!easy) {
      return NULL;
    }
    if(easy->msg_num) {
      easy->msg_num --;
      multi->num_msgs--;
    }

    return easy->easy_handle;
  }
  else
    return NULL;
}

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-05-22