cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problems with persistant connections

From: Andy Cedilnik <andy.cedilnik_at_kitware.com>
Date: 10 Jan 2003 09:34:05 -0500

Hi All,

I recently updated to 7.10.2 and I see libcurl crashing when re-using
the connection. When running the following example:

int main(int argc, char **argv)
{
  CURL *curl;
  CURLcode res;

#ifdef MALLOCDEBUG
  /* this sends all memory debug messages to a specified logfile */
  curl_memdebug("memdump");
#endif

  curl_global_init(CURL_GLOBAL_DEFAULT);
  curl = curl_easy_init();
  if(curl) {
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
    curl_easy_setopt(curl, CURLOPT_HEADER, 1);

    /* get the first document */
    curl_easy_setopt(curl, CURLOPT_URL, "http://www.cmake.org/");
    res = curl_easy_perform(curl);

    /* get another document from the same server using the same
       connection */
    curl_easy_setopt(curl, CURLOPT_URL,
"http://www.cmake.org/HTML/Index.html");
    res = curl_easy_perform(curl);

    /* always cleanup */
    curl_easy_cleanup(curl);
  }

  return 0;
}

It gets the first page and then crashes. The crash appears to be in
url.c in the following function:

static void verboseconnect(struct connectdata *conn,
                           struct Curl_dns_entry *dns)

Looks like dns pointer points to NULL.

So, am I doing something wrong or has something changed in Curl or is
this FAQ?

                                Andy

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Received on 2003-01-10