• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ curl_version函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中curl_version函数的典型用法代码示例。如果您正苦于以下问题:C++ curl_version函数的具体用法?C++ curl_version怎么用?C++ curl_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了curl_version函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: tool_version_info

void tool_version_info(void)
{
  const char *const *proto;

  printf(CURL_ID "%s\n", curl_version());
#ifdef CURL_PATCHSTAMP
  printf("Release-Date: %s, security patched: %s\n",
         LIBCURL_TIMESTAMP, CURL_PATCHSTAMP);
#else
  printf("Release-Date: %s\n", LIBCURL_TIMESTAMP);
#endif
  if(curlinfo->protocols) {
    printf("Protocols: ");
    for(proto = curlinfo->protocols; *proto; ++proto) {
      printf("%s ", *proto);
    }
    puts(""); /* newline */
  }
  if(curlinfo->features) {
    unsigned int i;
    printf("Features: ");
    for(i = 0; i < sizeof(feats)/sizeof(feats[0]); i++) {
      if(curlinfo->features & feats[i].bitmask)
        printf("%s ", feats[i].name);
    }
#ifdef USE_METALINK
    printf("Metalink ");
#endif
#ifdef USE_LIBPSL
    printf("PSL ");
#endif
    puts(""); /* newline */
  }
}
开发者ID:Andersbakken,项目名称:curl,代码行数:34,代码来源:tool_help.c


示例2: debug_curl_version

char* debug_curl_version(void)
{
  char* ret;
  ret = curl_version();
  Dout(dc::curl, "curl_version() = \"" << ret << '"');
  return ret;
}
开发者ID:Nekrofage,项目名称:SingularityViewer,代码行数:7,代码来源:debug_libcurl.cpp


示例3: show_version

void
show_version(void)
{
	struct utsname u;
	const char *fmt = " %s: %s\n";

	fprintf(stderr, "%s %s\n", __progname, vertag);

	fprintf(stderr, "Run-time versions:\n");
	fprintf(stderr, fmt, "assl", assl_verstring());
#ifdef NEED_LIBCLENS
	fprintf(stderr, fmt, "clens", clens_verstring());
#endif /* NEED_LIBCLENS */
	fprintf(stderr, fmt, "clog", clog_verstring());
	fprintf(stderr, fmt, "curl", curl_version());
	fprintf(stderr, fmt, "event", event_get_version());
	fprintf(stderr, fmt, "exude", exude_verstring());
	fprintf(stderr, fmt, "openssl", SSLeay_version(SSLEAY_VERSION));
	fprintf(stderr, fmt, "shrink", shrink_verstring());
	fprintf(stderr, fmt, "xmlsd", xmlsd_verstring());

	fprintf(stderr, "O/S identification: ");
	if (uname(&u) == -1)
		fprintf(stderr, "INVALID\n");
	else
		fprintf(stderr, "%s-%s-%s %s\n", u.sysname, u.machine, u.release, u.version);
}
开发者ID:finid,项目名称:cyphertite,代码行数:27,代码来源:ct_main.c


示例4: _ch

vz::Api::Api(Channel::Ptr ch)
		: _ch(ch)
						//    , _api(api)
{
	char url[255], agent[255];

/* prepare header, uuid & url */
	sprintf(agent, "User-Agent: %s/%s (%s)", PACKAGE, VERSION, curl_version());     /* build user agent */
	sprintf(url, "%s/data/%s.json", _ch->middleware(), _ch->uuid());                        /* build url */

	_api.headers = NULL;
	_api.headers = curl_slist_append(_api.headers, "Content-type: application/json");
	_api.headers = curl_slist_append(_api.headers, "Accept: application/json");
	_api.headers = curl_slist_append(_api.headers, agent);

	// WORKAROUND for lighthttp not supporting Expect: properly
	_api.headers = curl_slist_append(_api.headers, "Expect: ");

	_api.curl = curl_easy_init();
	if (!_api.curl) {
		throw vz::VZException("CURL: cannot create handle.");
	}

	curl_easy_setopt(_api.curl, CURLOPT_URL, url);
	curl_easy_setopt(_api.curl, CURLOPT_HTTPHEADER, _api.headers);
	curl_easy_setopt(_api.curl, CURLOPT_VERBOSE, options.verbosity());
	curl_easy_setopt(_api.curl, CURLOPT_DEBUGFUNCTION, curl_custom_debug_callback);
	curl_easy_setopt(_api.curl, CURLOPT_DEBUGDATA, _ch.get());

}
开发者ID:mbehr1,项目名称:vzlogger,代码行数:30,代码来源:api.cpp


示例5: curl_global_init

void HttpClient::initCURL()
{
    // init global
    static bool globalInitialized = false;
    if (!globalInitialized)
    {
        curl_global_init(CURL_GLOBAL_ALL); // there won't be curl_global_cleanup();
        globalInitialized = true;
    }
    
    // init current session
    m_curl = curl_easy_init();
    
    //    curl_easy_setopt(m_curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);	// support basic, digest, and NTLM authentication
    // try not to use signals
    curl_easy_setopt(m_curl, CURLOPT_NOSIGNAL, 1L);
    
    // set a default user agent
    curl_easy_setopt(m_curl, CURLOPT_USERAGENT, curl_version());
    
#ifdef DEBUG_MODE
    // Switch on full protocol/debug output while testing
    curl_easy_setopt(m_curl, CURLOPT_VERBOSE, 1L);
    
    // disable progress meter, set to 0L to enable and disable debug output
    curl_easy_setopt(m_curl, CURLOPT_NOPROGRESS, 1L);
#endif
}
开发者ID:jvaemape,项目名称:Downloader,代码行数:28,代码来源:HttpClient.cpp


示例6: tool_version_info

void tool_version_info(void)
{
  const char *const *proto;

  printf(CURL_ID "%s\n", curl_version());
  if(curlinfo->protocols) {
    printf("Protocols: ");
    for(proto = curlinfo->protocols; *proto; ++proto) {
      printf("%s ", *proto);
    }
    puts(""); /* newline */
  }
  if(curlinfo->features) {
    unsigned int i;
    printf("Features: ");
    for(i = 0; i < sizeof(feats)/sizeof(feats[0]); i++) {
      if(curlinfo->features & feats[i].bitmask)
        printf("%s ", feats[i].name);
    }
#ifdef USE_METALINK
    printf("Metalink ");
#endif
    puts(""); /* newline */
  }
}
开发者ID:FPSzeYad,项目名称:curl,代码行数:25,代码来源:tool_help.c


示例7: VSICurlSetOptions

void VSICurlStreamingHandle::DownloadInThread()
{
    VSICurlSetOptions(hCurlHandle, pszURL);

    static int bHasCheckVersion = FALSE;
    static int bSupportGZip = FALSE;
    if (!bHasCheckVersion)
    {
        bSupportGZip = strstr(curl_version(), "zlib/") != NULL;
        bHasCheckVersion = TRUE;
    }
    if (bSupportGZip && CSLTestBoolean(CPLGetConfigOption("CPL_CURL_GZIP", "YES")))
    {
        curl_easy_setopt(hCurlHandle, CURLOPT_ENCODING, "gzip");
    }

    if (pabyHeaderData == NULL)
        pabyHeaderData = (GByte*) CPLMalloc(HEADER_SIZE + 1);
    nHeaderSize = 0;
    nBodySize = 0;
    nHTTPCode = 0;

    curl_easy_setopt(hCurlHandle, CURLOPT_HEADERDATA, this);
    curl_easy_setopt(hCurlHandle, CURLOPT_HEADERFUNCTION, VSICurlStreamingHandleReceivedBytesHeader);

    curl_easy_setopt(hCurlHandle, CURLOPT_WRITEDATA, this);
    curl_easy_setopt(hCurlHandle, CURLOPT_WRITEFUNCTION, VSICurlStreamingHandleReceivedBytes);

    char szCurlErrBuf[CURL_ERROR_SIZE+1];
    szCurlErrBuf[0] = '\0';
    curl_easy_setopt(hCurlHandle, CURLOPT_ERRORBUFFER, szCurlErrBuf );

    CURLcode eRet = curl_easy_perform(hCurlHandle);

    curl_easy_setopt(hCurlHandle, CURLOPT_WRITEDATA, NULL);
    curl_easy_setopt(hCurlHandle, CURLOPT_WRITEFUNCTION, NULL);
    curl_easy_setopt(hCurlHandle, CURLOPT_HEADERDATA, NULL);
    curl_easy_setopt(hCurlHandle, CURLOPT_HEADERFUNCTION, NULL);

    AcquireMutex();
    if (!bAskDownloadEnd && eRet == 0 && !bHastComputedFileSize)
    {
        poFS->AcquireMutex();
        CachedFileProp* cachedFileProp = poFS->GetCachedFileProp(pszURL);
        cachedFileProp->fileSize = fileSize = nBodySize;
        cachedFileProp->bHastComputedFileSize = bHastComputedFileSize = TRUE;
        if (ENABLE_DEBUG)
            CPLDebug("VSICURL", "File size = " CPL_FRMT_GUIB, fileSize);
        poFS->ReleaseMutex();
    }

    bDownloadInProgress = FALSE;
    bDownloadStopped = TRUE;

    /* Signal to the consumer that the download has ended */
    CPLCondSignal(hCondProducer);
    ReleaseMutex();
}
开发者ID:0004c,项目名称:node-gdal,代码行数:58,代码来源:cpl_vsil_curl_streaming.cpp


示例8: set_info

/*
 * Assumes the table is on top of the stack.
 */
static void set_info (lua_State *L) 
{
	LUA_SET_TABLE(L, literal, "_COPYRIGHT", literal, "(C) 2003-2006 AVIQ Systems AG");
	LUA_SET_TABLE(L, literal, "_DESCRIPTION", literal, "LuaCurl binds the CURL easy interface to Lua");
	LUA_SET_TABLE(L, literal, "_NAME", literal, "luacurl");
	LUA_SET_TABLE(L, literal, "_VERSION", literal, "1.1.0");
	LUA_SET_TABLE(L, literal, "_CURLVERSION", string, curl_version());
	LUA_SET_TABLE(L, literal, "_SUPPORTED_CURLVERSION", literal, LIBCURL_VERSION);
}
开发者ID:catyguan,项目名称:gamedev.platform,代码行数:12,代码来源:luacurl.c


示例9: snprintf

/*
 * my_useragent: returns allocated string with default user agent
 */
char *my_useragent(void)
{
  char useragent[256]; /* we don't want a larger default user agent */

  snprintf(useragent, sizeof(useragent),
           CURL_NAME "/" CURL_VERSION " (" OS ") " "%s", curl_version());

  return strdup(useragent);
}
开发者ID:matthewstory,项目名称:curl,代码行数:12,代码来源:tool_operhlp.c


示例10: sprintf

void *do_subscribe_stuff(void *postfields)
{
  char *response, url[] = "http://127.0.0.1/kn";
  CURL *curl_handle;
  CURLcode res;
  long int status = 0;
/*  char name[12];
  FILE *file;

  sprintf(name,"dumpit%d.txt", pthread_self());
  file = fopen(name, "w");*/
  /* init the curl session */
  curl_handle = curl_easy_init();

  printf ("SUB %s\n", curl_version());

  if(curl_handle) {

    /* specify URL to get */
    curl_easy_setopt(curl_handle, CURLOPT_URL, subdata[0]);
/*    curl_easy_setopt(curl_handle, CURLOPT_FILE, file);*/
    curl_easy_setopt(curl_handle, CURLOPT_HEADER, 0);
    curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1);
/*    curl_easy_setopt(curl_handle, CURLOPT_POST, 1);*/
/*    curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, subdata[0]);*/
    curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "PubSub Throughput 1.0");
#ifdef DEBUG
    curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1);
#else
    curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1);
    curl_easy_setopt(curl_handle, CURLOPT_MUTE, 1);
#endif

/*   while (1) {*/
    printf("\n sub thread %d\n", pthread_self());

    /* get it! */
    res = curl_easy_perform(curl_handle);
    if(res==0) {
      /*
       * Now, our chunk.memory points to a memory block that is chunk.size
       * bytes big and contains the remote file.
       */
      curl_easy_getinfo(curl_handle, CURLINFO_HTTP_CODE, &status);
    }
    curl_easy_setopt(curl_handle, CURLOPT_URL, subdata[1]);

    printf("\n sub thread change url\n");

    res = curl_easy_perform(curl_handle);
/*   }*/
  }
  curl_easy_cleanup(curl_handle);
/*  fclose(file);*/
  return 0;
}
开发者ID:kragen,项目名称:mod_pubsub,代码行数:56,代码来源:throughput.c


示例11: HTTP_Init

/*
===============
HTTP_Init

Init libcurl.
===============
*/
void HTTP_Init (void)
{
	curl_global_init (CURL_GLOBAL_NOTHING);
	multi = curl_multi_init ();

	Com_sprintf (hostHeader, sizeof(hostHeader), "Host: %s", g_http_domain->string);
	http_header_slist = curl_slist_append (http_header_slist, hostHeader);

	gi.dprintf ("%s initialized.\n", curl_version());
}
开发者ID:notr1ch,项目名称:opentdm,代码行数:17,代码来源:g_tdm_curl.c


示例12: libcurl_mod_init

int libcurl_mod_init(const struct ammodule_t* module, int flags)
{
    CLOGI("libcurl module init\n");
    char * ver = NULL;
    ver = curl_version();
    CLOGI("curl version : [%s]", ver);
    curl_global_init(CURL_GLOBAL_ALL);
    av_register_protocol(&ff_curl_protocol);
    return 0;
}
开发者ID:CoreTech-Development,项目名称:amlogic-libplayer,代码行数:10,代码来源:curl_mod.c


示例13: CUserReporterWorker

	CUserReporterWorker(const std::string& userID, const std::string& url) :
		m_URL(url), m_UserID(userID), m_Enabled(false), m_Shutdown(false), m_Status("disabled"),
		m_PauseUntilTime(timer_Time()), m_LastUpdateTime(timer_Time())
	{
		// Set up libcurl:

		m_Curl = curl_easy_init();
		ENSURE(m_Curl);

#if DEBUG_UPLOADS
		curl_easy_setopt(m_Curl, CURLOPT_VERBOSE, 1L);
#endif

		// Capture error messages
		curl_easy_setopt(m_Curl, CURLOPT_ERRORBUFFER, m_ErrorBuffer);

		// Disable signal handlers (required for multithreaded applications)
		curl_easy_setopt(m_Curl, CURLOPT_NOSIGNAL, 1L);

		// To minimise security risks, don't support redirects
		curl_easy_setopt(m_Curl, CURLOPT_FOLLOWLOCATION, 0L);

		// Set IO callbacks
		curl_easy_setopt(m_Curl, CURLOPT_WRITEFUNCTION, ReceiveCallback);
		curl_easy_setopt(m_Curl, CURLOPT_WRITEDATA, this);
		curl_easy_setopt(m_Curl, CURLOPT_READFUNCTION, SendCallback);
		curl_easy_setopt(m_Curl, CURLOPT_READDATA, this);

		// Set URL to POST to
		curl_easy_setopt(m_Curl, CURLOPT_URL, url.c_str());
		curl_easy_setopt(m_Curl, CURLOPT_POST, 1L);

		// Set up HTTP headers
		m_Headers = NULL;
		// Set the UA string
		std::string ua = "User-Agent: 0ad ";
		ua += curl_version();
		ua += " (http://play0ad.com/)";
		m_Headers = curl_slist_append(m_Headers, ua.c_str());
		// Override the default application/x-www-form-urlencoded type since we're not using that type
		m_Headers = curl_slist_append(m_Headers, "Content-Type: application/octet-stream");
		// Disable the Accept header because it's a waste of a dozen bytes
		m_Headers = curl_slist_append(m_Headers, "Accept: ");
		curl_easy_setopt(m_Curl, CURLOPT_HTTPHEADER, m_Headers);


		// Set up the worker thread:

		// Use SDL semaphores since OS X doesn't implement sem_init
		m_WorkerSem = SDL_CreateSemaphore(0);
		ENSURE(m_WorkerSem);

		int ret = pthread_create(&m_WorkerThread, NULL, &RunThread, this);
		ENSURE(ret == 0);
	}
开发者ID:2asoft,项目名称:0ad,代码行数:55,代码来源:UserReport.cpp


示例14: ApiIF

vz::api::Volkszaehler::Volkszaehler(
	Channel::Ptr ch,
	std::list<Option> pOptions
	)
	: ApiIF(ch)
	, _last_timestamp(0)
{
	OptionList optlist;
	char url[255], agent[255];
	unsigned short curlTimeout = 30; // 30 seconds

/* parse options */
	try {
		_middleware = optlist.lookup_string(pOptions, "middleware");
	} catch (vz::OptionNotFoundException &e) {
		throw;
	} catch (vz::VZException &e) {
		throw;
	}

	try {
		curlTimeout = optlist.lookup_int(pOptions, "timeout");
	} catch (vz::OptionNotFoundException &e) {
	// use default value instead
		curlTimeout = 30; // 30 seconds
	} catch (vz::VZException &e) {
		throw;
	}

/* prepare header, uuid & url */
	sprintf(agent, "User-Agent: %s/%s (%s)", PACKAGE, VERSION, curl_version());     /* build user agent */
	sprintf(url, "%s/data/%s.json", middleware().c_str(), channel()->uuid());                        /* build url */

	_api.headers = NULL;
	_api.headers = curl_slist_append(_api.headers, "Content-type: application/json");
	_api.headers = curl_slist_append(_api.headers, "Accept: application/json");
	_api.headers = curl_slist_append(_api.headers, agent);

	_api.curl = curl_easy_init();
	if (!_api.curl) {
		throw vz::VZException("CURL: cannot create handle.");
	}

	curl_easy_setopt(_api.curl, CURLOPT_URL, url);
	curl_easy_setopt(_api.curl, CURLOPT_HTTPHEADER, _api.headers);
	curl_easy_setopt(_api.curl, CURLOPT_VERBOSE, options.verbosity());
	curl_easy_setopt(_api.curl, CURLOPT_DEBUGFUNCTION, curl_custom_debug_callback);
	curl_easy_setopt(_api.curl, CURLOPT_DEBUGDATA, channel().get());

	// signal-handling in libcurl is NOT thread-safe. so force to deactivated them!
	curl_easy_setopt(_api.curl, CURLOPT_NOSIGNAL, 1);

	// set timeout to 5 sec. required if next router has an ip-change.
	curl_easy_setopt(_api.curl, CURLOPT_TIMEOUT, curlTimeout);
}
开发者ID:DoganA,项目名称:vzlogger,代码行数:55,代码来源:Volkszaehler.cpp


示例15: HTTP_Init

/*
===============
HTTP_Init

Init libcurl and multi handle.
===============
*/
void HTTP_Init (void) {
    cl_http_downloads = Cvar_Get ("cl_http_downloads", "1", 0);
    cl_http_filelists = Cvar_Get ("cl_http_filelists", "1", 0);
    cl_http_max_connections = Cvar_Get ("cl_http_max_connections", "2", 0);
    //cl_http_max_connections->changed = _cl_http_max_connections_changed;
    cl_http_proxy = Cvar_Get ("cl_http_proxy", "", 0);
#ifdef _DEBUG
    cl_http_debug = Cvar_Get ("cl_http_debug", "0", 0);
#endif

    curl_global_init (CURL_GLOBAL_NOTHING);
    curl_initialized = qtrue;
    Com_DPrintf ("%s initialized.\n", curl_version());
}
开发者ID:Bad-ptr,项目名称:q2pro,代码行数:21,代码来源:cl_http.c


示例16: main

int main(int argc, char *argv[]) { 
    
    printf(curl_version()); 

    /* Initialize curl, args is flags */
    curl_global_init(CURL_GLOBAL_NOTHING);
    CURL *handle = curl_easy_init(); 
    curl_easy_setopt(handle, CURLOPT_VERBOSE, 1); 
    curl_easy_setopt(handle, CURLOPT_URL, "http://www.google.com/"); 
    /* Not Setting this goes to stdout */
    //curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, write_function); 
    
    return curl_easy_perform(handle); 
}
开发者ID:KWMalik,项目名称:twilio-c,代码行数:14,代码来源:curltest.c


示例17: uploader_init

int uploader_init(const char* url, const char* token, size_t queueSize, int numThreads)
{
	m_url = url;
	m_token = token;	
	m_numThreads = numThreads;

	uploader_setInterval(1000);

	// Initialize CURL
	// This must be done before calling curl_easy_init from any other thread
	CURLcode code = curl_global_init(CURL_GLOBAL_ALL);
	if (code != CURLE_OK) {
		LOG(0, "Failed to initialize CURL (%s): %s\n", 
			curl_version(), curl_easy_strerror(code));
		return 0;
	}

	// Initialize queue
	m_queue = queue_create(queueSize, sizeof(char*));
	if (!m_queue) {
		LOG(0, "Failed to create upload queue: %s\n", strerror(errno));
		return 0;
	}

	// Create array to hold thread IDs
	m_threads = calloc(numThreads, sizeof(pthread_t));
	if (!m_threads) {
		LOG(0, "Failed to allocate thread array\n");
		queue_free(m_queue);
		return 0;
	}

	// Spawn sender threads
	m_running = 1; // Enter loop in senderProc
	for (int threadNum = 0; threadNum < m_numThreads; threadNum++) {
		
		int error = pthread_create(&m_threads[threadNum], NULL, uploadProc, (void*)threadNum);
		if (error) {
			LOG(1, "Failed to create sender thread %d: %s\n", threadNum, strerror(error));
			m_numThreads = threadNum; // So we can have only that many threads
			break;
		}
	}

	LOG(2, "Sending data to %s with token '%s' using %d threads and queue with capacity %d\n", 
		m_url, m_token, m_numThreads, queueSize);	
	
	return 1; // Success
}
开发者ID:wkleiminger,项目名称:pylon,代码行数:49,代码来源:uploader.c


示例18: main

int main(int argc, char *argv[])
{
	CURLcode ret = curl_global_init(CURL_GLOBAL_ALL);
	if (ret != CURLE_OK) {
		fprintf(stderr, "初始化curl失败!\n");
		exit(EXIT_FAILURE);
	}

	// 获取到版本信息的字符串
	printf("%s\n", curl_version());
	// 这个方法可以获取到版本的详细信息
	//curl_version_info_data *p_version = curl_version_info(CURLVERSION_NOW);

	curl_global_cleanup();
	return 0;
}
开发者ID:gwq5210,项目名称:learn_curl,代码行数:16,代码来源:curl_version.c


示例19: curl_easy_init

void *do_post_curl_stuff(void *postfields)
{
  char *response, url[] = "http://127.0.0.1/kn";
  CURL *curl_handle;
  CURLcode res;
  long int status = 0;
  int j = 0;

  /* init the curl session */
  curl_handle = curl_easy_init();

  printf ("POST %s\n", curl_version());

  if(curl_handle) {

    /* specify URL to get */
    curl_easy_setopt(curl_handle, CURLOPT_URL, url);
    curl_easy_setopt(curl_handle, CURLOPT_HEADER, 0);
    curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1);
    curl_easy_setopt(curl_handle, CURLOPT_POST, 1);
    curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, postfields);
    curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "PubSub Throughput 1.0");
#ifdef DDEBUG
    curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1);
#else
    curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1);
    curl_easy_setopt(curl_handle, CURLOPT_MUTE, 1);
#endif

   while ( j < 50 ) {
    printf("\nthread %d\n", pthread_self());
    j++;

    /* get it! */
    res = curl_easy_perform(curl_handle);
    if(res==0) {
      /*
       * Now, our chunk.memory points to a memory block that is chunk.size
       * bytes big and contains the remote file.
       */
      curl_easy_getinfo(curl_handle, CURLINFO_HTTP_CODE, &status);
    }
   }
  }
  curl_easy_cleanup(curl_handle);
  return 0;
}
开发者ID:kragen,项目名称:mod_pubsub,代码行数:47,代码来源:throughput.c


示例20: curl_download_init

/* This should to be called from main() to make sure thread safe */
void curl_download_init()
{
  curl_global_init(CURL_GLOBAL_ALL);
  curl_download_user_agent = g_strdup_printf ("%s/%s %s", PACKAGE, VERSION, curl_version());

#ifdef CURL_NO_SSL_VERIFYPEER
  curl_ssl_verifypeer = 0;
#endif
  gboolean tmp;
  if ( a_settings_get_boolean ( "curl_ssl_verifypeer", &tmp ) )
    curl_ssl_verifypeer = tmp;
  gchar *str = NULL;
  if ( a_settings_get_string ( "curl_cainfo", &str ) ) {
    curl_cainfo = g_strdup ( str );
    g_free ( str );
  }
}
开发者ID:guyou,项目名称:viking,代码行数:18,代码来源:curl_download.c



注:本文中的curl_version函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ curl_version_info函数代码示例发布时间:2022-05-30
下一篇:
C++ curl_slist_append函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap