cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Problem in curl_multi_perform while storing html content into Mysql database

From: Hemachandran <hemachan83_at_gmail.com>
Date: Mon, 24 Aug 2009 09:45:07 +0530

Hi,

Thanks for your early reply, when i'm using curl_easy_perform() it works
perfect and both the below mentioned sites comes seperately, but when i'm
using curl_multi_perform() both of the sites content merged. Is there any
problem in curl_multi_perform() or i'm not sure whether i'm using that
function wrongly.

Please help me. I'm awaiting for your reply....

Source code of my program

/*****************************************************************************
 * _ _ ____ _
 * Project ___| | | | _ \| |
 * / __| | | | |_) | |
 * | (__| |_| | _ <| |___
 * \___|\___/|_| \_\_____|
 *
 * $Id: simple.c,v 1.6 2004/08/23 14:22:52 bagder Exp $
 */

#include <curl/curl.h>

int main(void)
{

  CURL *curl1, *curl2;
  //CURLcode res1, res2;

  CURLM *mcurl;

  mcurl = curl_multi_init();

  curl1 = curl_easy_init();
  curl2 = curl_easy_init();

  curl_easy_setopt(curl1, CURLOPT_URL, "http://www.cuil.com");
  curl_easy_setopt(curl2, CURLOPT_URL, "http://www.altavista.com");

  curl_multi_add_handle(mcurl,curl1);
  curl_multi_add_handle(mcurl,curl2);

    int still_running = NULL;

    do {
        curl_multi_perform(mcurl,&still_running);
    } while(still_running>0);

   curl_multi_cleanup(mcurl);
   curl_easy_cleanup(curl1);
   curl_easy_cleanup(curl2);

  return 0;
}

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-08-24