• 大小: 4.05MB
    文件类型: .zip
    金币: 2
    下载: 0 次
    发布日期: 2024-01-24
  • 语言: C/C++
  • 标签: libcurl  7.19  

资源简介

这个版本虽然低一点但是适用于windows系统 利用它可以做SSL HTTPS链接 适用C++

资源截图

代码片段和文件信息

/*****************************************************************************
 *                                  _   _ ____  _
 *  Project                     ___| | | |  _ \| |
 *                             / __| | | | |_) | |
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * $Id: 10-at-a-time.cv 1.9 2008-09-22 17:27:24 danf Exp $
 *
 * Example application source code using the multi interface to download many
 * files but with a capped maximum amount of simultaneous transfers.
 *
 * Written by Michael Wallner
 */

#include 
#include 
#include 
#ifndef WIN32
#  include 
#endif
#include 

static const char *urls[] = {
  “http://www.microsoft.com“
  “http://www.opensource.org“
  “http://www.google.com“
  “http://www.yahoo.com“
  “http://www.ibm.com“
  “http://www.mysql.com“
  “http://www.oracle.com“
  “http://www.ripe.net“
  “http://www.iana.org“
  “http://www.amazon.com“
  “http://www.netcraft.com“
  “http://www.heise.de“
  “http://www.chip.de“
  “http://www.ca.com“
  “http://www.cnet.com“
  “http://www.news.com“
  “http://www.cnn.com“
  “http://www.wikipedia.org“
  “http://www.dell.com“
  “http://www.hp.com“
  “http://www.cert.org“
  “http://www.mit.edu“
  “http://www.nist.gov“
  “http://www.ebay.com“
  “http://www.playstation.com“
  “http://www.uefa.com“
  “http://www.ieee.org“
  “http://www.apple.com“
  “http://www.sony.com“
  “http://www.symantec.com“
  “http://www.zdnet.com“
  “http://www.fujitsu.com“
  “http://www.supermicro.com“
  “http://www.hotmail.com“
  “http://www.ecma.com“
  “http://www.bbc.co.uk“
  “http://news.google.com“
  “http://www.foxnews.com“
  “http://www.msn.com“
  “http://www.wired.com“
  “http://www.sky.com“
  “http://www.usatoday.com“
  “http://www.cbs.com“
  “http://www.nbc.com“
  “http://slashdot.org“
  “http://www.bloglines.com“
  “http://www.techweb.com“
  “http://www.newslink.org“
  “http://www.un.org“
};

#define MAX 10 /* number of simultaneous transfers */
#define CNT sizeof(urls)/sizeof(char*) /* total number of transfers to do */

static size_t cb(char *d size_t n size_t l void *p)
{
  /* take care of the data here ignored in this example */
  (void)d;
  (void)p;
  return n*l;
}

static void init(CURLM *cm int i)
{
  CURL *eh = curl_easy_init();

  curl_easy_setopt(eh CURLOPT_WRITEFUNCTION cb);
  curl_easy_setopt(eh CURLOPT_HEADER 0L);
  curl_easy_setopt(eh CURLOPT_URL urls[i]);
  curl_easy_setopt(eh CURLOPT_PRIVATE urls[i]);
  curl_easy_setopt(eh CURLOPT_VERBOSE 0L);

  curl_multi_add_handle(cm eh);
}

int main(void)
{
  CURLM *cm;
  CURLMsg *msg;
  long L;
  unsigned int C=0;
  int M Q U = -1;
  fd_set R W E;
  struct timeval T;

  curl_global_init(CURL_GLOBAL_ALL);

  cm = curl_multi_init();

  /* we can optionally limit the total amount of connections this multi handle
     uses */
  curl_multi_setopt(cm CURLMOPT_MAXC

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2009-02-16 19:12  docs\
     文件        4207  2008-10-07 20:13  docs\BINDINGS
     文件        3504  2007-07-28 23:50  docs\BUGS
     文件        9450  2007-11-05 10:27  docs\CONTRIBUTE
     文件        4170  2008-12-22 14:07  docs\curl-config.1
     文件        5269  2009-01-19 11:00  docs\curl-config.html
     文件        5890  2009-01-19 11:00  docs\curl-config.pdf
     文件       71405  2008-12-22 14:07  docs\curl.1
     文件      102763  2009-01-19 11:00  docs\curl.html
     文件       75618  2009-01-19 11:00  docs\curl.pdf
     文件        7171  2007-02-11 11:08  docs\DISTRO-DILEMMA
     目录           0  2009-02-16 19:12  docs\examples\
     文件        4646  2008-09-22 22:44  docs\examples\10-at-a-time.c
     文件        4012  2008-09-01 09:46  docs\examples\anyauthput.c
     文件        6148  2008-05-23 11:05  docs\examples\cacertinmem.c
     文件        1305  2008-09-05 16:29  docs\examples\certinfo.c
     文件        3077  2008-05-23 11:05  docs\examples\cookie_interface.c
     文件        3093  2008-05-23 11:05  docs\examples\curlgtk.c
     文件       16086  2008-09-07 23:26  docs\examples\curlx.c
     文件        3161  2008-05-23 11:05  docs\examples\debug.c
     文件       12325  2008-11-21 11:10  docs\examples\evhiperfifo.c
     文件        1863  2008-09-18 14:42  docs\examples\fileupload.c
     文件       14778  2008-09-07 23:26  docs\examples\fopen.c
     文件        2427  2008-05-23 11:05  docs\examples\ftpget.c
     文件        1860  2007-07-19 23:32  docs\examples\ftpgetresp.c
     文件        3752  2008-05-23 11:05  docs\examples\ftpupload.c
     文件        4079  2008-09-01 09:46  docs\examples\ftpuploadresume.c
     文件        1263  2004-11-22 17:24  docs\examples\getinfo.c
     文件        2972  2008-09-07 23:26  docs\examples\getinmemory.c
     文件       12190  2008-05-23 11:05  docs\examples\ghiper.c
     文件       11559  2008-11-19 16:31  docs\examples\hiperfifo.c
............此处省略264个文件信息

评论

共有 条评论