cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: ares again

From: Giuseppe Attardi <attardi_at_di.unipi.it>
Date: Mon, 13 Oct 2003 12:42:31 +0200

I enclose a short program that exibits the behavior.
Notice that when it crashes, in Curl_disconnect
connectindex has an anomalous value:

(gdb) p conn->connectindex
$2 = 1108533832

-- Beppe

#include "test.h"

/*
 * Reuse same easy_handle within multi_handle
 * Works fine without ARES.
 */

CURL* init(char* url)
{
  CURL* c = curl_easy_init();
  curl_easy_setopt(c, CURLOPT_URL, url);
  curl_easy_setopt(c, CURLOPT_NOSIGNAL, 1);
  return c;
}

int main(int argc, char **argv)
{
  CURL *c;
  CURLM *m;
  CURLMcode res;
  int running=1;
  int rest = 1;

  curl_global_init(CURL_GLOBAL_ALL);
  m = curl_multi_init();

  c = init("http://localhost:5678/robots.txt");
  curl_multi_add_handle(m, c);
  while (running) {
    res = curl_multi_perform(m, &running);
    if (running <= 0)
        break;
  }
  curl_multi_remove_handle(m, c);
  curl_easy_cleanup(c);
  curl_multi_cleanup(m);

  return 0;
}

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
Received on 2003-10-13