﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>学习日记 &#187; libcurl</title>
	<atom:link href="https://www.softwareace.cn/?feed=rss2&#038;tag=libcurl" rel="self" type="application/rss+xml" />
	<link>https://www.softwareace.cn</link>
	<description>时刻想着为自己的产品多做一些对他好的事情</description>
	<lastBuildDate>Fri, 20 Mar 2026 06:58:28 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>curl_easy_perform 返回值说明</title>
		<link>https://www.softwareace.cn/?p=529</link>
		<comments>https://www.softwareace.cn/?p=529#comments</comments>
		<pubDate>Mon, 19 Aug 2013 09:42:39 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[libcurl]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=529</guid>
		<description><![CDATA[response=curl_easy_perform(curl); response返回的状态值 CURLE_ [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>response=curl_easy_perform(curl);<br />
response返回的状态值<br />
CURLE_OK: printf(&#8220;send ok!\n&#8221;);<br />
CURLE_HTTP_POST_ERROR: printf(&#8220;post error!\n&#8221;);<br />
CURLE_COULDNT_CONNECT: printf(&#8220;cannot connect to server\n&#8221;);</p>
<p>CURLE_OK = 0, 0: no error<br />
CURLE_UNSUPPORTED_PROTOCOL, 1: unsupported protocol<br />
CURLE_FAILED_INIT, 2: failed init<br />
CURLE_URL_MALFORMAT, 3: URL using bad/illegal format or missing URL<br />
CURLE_URL_MALFORMAT_USER, 4: unknown error<br />
CURLE_COULDNT_RESOLVE_PROXY, 5: couldn&#8217;t resolve proxy name<br />
CURLE_COULDNT_RESOLVE_HOST, 6: couldn&#8217;t resolve host name<br />
CURLE_COULDNT_CONNECT, 7: couldn&#8217;t connect to server<br />
CURLE_FTP_WEIRD_SERVER_REPLY, 8: FTP: weird server reply<br />
CURLE_FTP_ACCESS_DENIED,<br />
CURLE_FTP_USER_PASSWORD_INCORRECT, 10: unknown error<br />
CURLE_FTP_WEIRD_PASS_REPLY, 11: FTP: unknown PASS reply<br />
CURLE_FTP_WEIRD_USER_REPLY, 12: FTP: unknown USER reply<br />
CURLE_FTP_WEIRD_PASV_REPLY, 13: FTP: unknown PASV reply<br />
CURLE_FTP_WEIRD_227_FORMAT, 14: FTP: unknown 227 response format<br />
CURLE_FTP_CANT_GET_HOST, 15: FTP: can&#8217;t figure out the host in the PASV response<br />
CURLE_FTP_CANT_RECONNECT, 16: FTP: can&#8217;t connect to server the response code is unknown<br />
CURLE_FTP_COULDNT_SET_BINARY, 17: FTP: couldn&#8217;t set binary mode<br />
CURLE_PARTIAL_FILE, 18: Transferred a partial file<br />
CURLE_FTP_COULDNT_RETR_FILE, 19: FTP: couldn&#8217;t retrieve (RETR failed) the specified file<br />
CURLE_FTP_WRITE_ERROR, 20: FTP: the post-transfer acknowledge response was not OK<br />
CURLE_FTP_QUOTE_ERROR, 21: FTP: a quote command returned error<br />
CURLE_HTTP_RETURNED_ERROR, 22: HTTP response code said error<br />
CURLE_WRITE_ERROR, 23: failed writing received data to disk/application<br />
CURLE_MALFORMAT_USER, 24: unknown error<br />
CURLE_UPLOAD_FAILED, 25: upload failed (at start/before it took off)<br />
CURLE_READ_ERROR, 26: failed to open/read local data from file/application<br />
CURLE_OUT_OF_MEMORY, 27: out of memory</p>
<p>CURLE_OPERATION_TIMEOUTED, 28: a timeout was reached<br />
CURLE_FTP_COULDNT_SET_ASCII, 29: FTP could not set ASCII mode (TYPE A)<br />
CURLE_FTP_PORT_FAILED, 30: FTP command PORT failed<br />
CURLE_FTP_COULDNT_USE_REST, 31: FTP command REST failed<br />
CURLE_FTP_COULDNT_GET_SIZE, 32: FTP command SIZE failed<br />
CURLE_HTTP_RANGE_ERROR, 33: a range was requested but the server did not deliver it<br />
CURLE_HTTP_POST_ERROR, 34: internal problem setting up the POST<br />
CURLE_SSL_CONNECT_ERROR, 35: SSL connect error<br />
CURLE_BAD_DOWNLOAD_RESUME, 36: couldn&#8217;t resume download<br />
CURLE_FILE_COULDNT_READ_FILE, 37: couldn&#8217;t read a file:// file<br />
CURLE_LDAP_CANNOT_BIND, 38: LDAP: cannot bind<br />
CURLE_LDAP_SEARCH_FAILED, 39: LDAP: search failed<br />
CURLE_LIBRARY_NOT_FOUND, 40: a required shared library was not found</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=529</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>curl_easy_perform  crash</title>
		<link>https://www.softwareace.cn/?p=528</link>
		<comments>https://www.softwareace.cn/?p=528#comments</comments>
		<pubDate>Mon, 19 Aug 2013 04:37:23 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[libcurl]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=528</guid>
		<description><![CDATA[把 curl_easy_setopt 中的函数指针 都改为 static &#160;]]></description>
				<content:encoded><![CDATA[<p>把 curl_easy_setopt 中的函数指针 都改为 static</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=528</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>curl_easy_setopt函数介绍</title>
		<link>https://www.softwareace.cn/?p=527</link>
		<comments>https://www.softwareace.cn/?p=527#comments</comments>
		<pubDate>Mon, 19 Aug 2013 02:17:00 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[libcurl]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=527</guid>
		<description><![CDATA[本节主要介绍curl_easy_setopt中跟http相关的参数。注意本节的阐述都是以libcurl作为主体 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>本节主要介绍curl_easy_setopt中跟http相关的参数。注意本节的阐述都是以libcurl作为主体，其它为客体来阐述的。<br />
1.     CURLOPT_URL<br />
设置访问URL<br />
2.       CURLOPT_WRITEFUNCTION，CURLOPT_WRITEDATA<br />
回调函数原型为：size_t function( void *ptr, size_t size, size_t nmemb, void *stream); 函数将在libcurl接收到数据后被调用，因此函数多做数据保存的功能，如处理下载文件。CURLOPT_WRITEDATA 用于表明CURLOPT_WRITEFUNCTION函数中的stream指针的来源。<br />
3.      CURLOPT_HEADERFUNCTION，CURLOPT_HEADERDATA<br />
回调函数原型为 size_t function( void *ptr, size_t size,size_t nmemb, void *stream); libcurl一旦接收到http 头部数据后将调用该函数。CURLOPT_WRITEDATA 传递指针给libcurl，该指针表明CURLOPT_HEADERFUNCTION 函数的stream指针的来源。<br />
4.       CURLOPT_READFUNCTION CURLOPT_READDATA<br />
libCurl需要读取数据传递给远程主机时将调用CURLOPT_READFUNCTION指定的函数，函数原型是：size_t function(void *ptr, size_t size, size_t nmemb,void *stream). CURLOPT_READDATA 表明CURLOPT_READFUNCTION函数原型中的stream指针来源。<br />
5.       CURLOPT_NOPROGRESS，CURLOPT_PROGRESSFUNCTION，CURLOPT_PROGRESSDATA<br />
跟数据传输进度相关的参数。CURLOPT_PROGRESSFUNCTION 指定的函数正常情况下每秒被libcurl调用一次，为了使CURLOPT_PROGRESSFUNCTION被调用，CURLOPT_NOPROGRESS必须被设置为false，CURLOPT_PROGRESSDATA指定的参数将作为CURLOPT_PROGRESSFUNCTION指定函数的第一个参数<br />
6.       CURLOPT_TIMEOUT，CURLOPT_CONNECTIONTIMEOUT:<br />
CURLOPT_TIMEOUT 由于设置传输时间，CURLOPT_CONNECTIONTIMEOUT 设置连接等待时间<br />
7.       CURLOPT_FOLLOWLOCATION<br />
设置重定位URL<br />
CURLOPT_RANGE: CURLOPT_RESUME_FROM:<br />
断点续传相关设置。CURLOPT_RANGE 指定char *参数传递给libcurl，用于指明http域的RANGE头域，例如：<br />
表示头500个字节：bytes=0-499<br />
表示第二个500字节：bytes=500-999<br />
表示最后500个字节：bytes=-500<br />
表示500字节以后的范围：bytes=500-<br />
第一个和最后一个字节：bytes=0-0,-1<br />
同时指定几个范围：bytes=500-600,601-999<br />
CURLOPT_RESUME_FROM 传递一个long参数给libcurl，指定你希望开始传递的<br />
偏移量。</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=527</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
