经常性遇到libcurl的问题,而且都特别奇怪,记录一下CURLcode的定义:

http://curl.haxx.se/libcurl/c/libcurl-errors.html

 

#include <curl/curl.h>

enum CURLcode
{
    CURLE_OK = 0,
    CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
    CURLE_FAILED_INIT, /* 2 */
    CURLE_URL_MALFORMAT, /* 3 */
    CURLE_OBSOLETE4, /* 4 - NOT USED */
    CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
    CURLE_COULDNT_RESOLVE_HOST, /* 6 */
    CURLE_COULDNT_CONNECT, /* 7 */
    CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */
    CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
                                        due to lack of access - when login fails
                                        this is not returned. */
    CURLE_OBSOLETE10, /* 10 - NOT USED */
    CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
    CURLE_OBSOLETE12, /* 12 - NOT USED */
    CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
    CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
    CURLE_FTP_CANT_GET_HOST, /* 15 */
    CURLE_OBSOLETE16, /* 16 - NOT USED */
    CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
    CURLE_PARTIAL_FILE, /* 18 */
    CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
    CURLE_OBSOLETE20, /* 20 - NOT USED */
    CURLE_QUOTE_ERROR, /* 21 - quote command failure */
    CURLE_HTTP_RETURNED_ERROR, /* 22 */
    CURLE_WRITE_ERROR, /* 23 */
    CURLE_OBSOLETE24, /* 24 - NOT USED */
    CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
    CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
    CURLE_OUT_OF_MEMORY, /* 27 */
    /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
               instead of a memory allocation error if CURL_DOES_CONVERSIONS
               is defined
      */
    CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
    CURLE_OBSOLETE29, /* 29 - NOT USED */
    CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
    CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
    CURLE_OBSOLETE32, /* 32 - NOT USED */
    CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
    CURLE_HTTP_POST_ERROR, /* 34 */
    CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
    CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
    CURLE_FILE_COULDNT_READ_FILE, /* 37 */
    CURLE_LDAP_CANNOT_BIND, /* 38 */
    CURLE_LDAP_SEARCH_FAILED, /* 39 */
    CURLE_OBSOLETE40, /* 40 - NOT USED */
    CURLE_FUNCTION_NOT_FOUND, /* 41 */
    CURLE_ABORTED_BY_CALLBACK, /* 42 */
    CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
    CURLE_OBSOLETE44, /* 44 - NOT USED */
    CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
    CURLE_OBSOLETE46, /* 46 - NOT USED */
    CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */
    CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
    CURLE_TELNET_OPTION_SYNTAX, /* 49 - Malformed telnet option */
    CURLE_OBSOLETE50, /* 50 - NOT USED */
    CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
                                         wasn't verified fine */
    CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
    CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
    CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
                                        default */
    CURLE_SEND_ERROR, /* 55 - failed sending network data */
    CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
    CURLE_OBSOLETE57, /* 57 - NOT IN USE */
    CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
    CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
    CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
    CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
    CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
    CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
    CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
    CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
                                        that failed */
    CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
    CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
                                        accepted and we failed to login */
    CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
    CURLE_TFTP_PERM, /* 69 - permission problem on server */
    CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
    CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
    CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
    CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
    CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
    CURLE_CONV_FAILED, /* 75 - conversion failed */
    CURLE_CONV_REQD, /* 76 - caller must register conversion
                                        callbacks using curl_easy_setopt options
                                        CURLOPT_CONV_FROM_NETWORK_FUNCTION,
                                        CURLOPT_CONV_TO_NETWORK_FUNCTION, and
                                        CURLOPT_CONV_FROM_UTF8_FUNCTION */
    CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
                                        or wrong format */
    CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
    CURLE_SSH, /* 79 - error from the SSH layer, somewhat
                                        generic so the error message will be of
                                        interest when this has happened */
   
    CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
                                        connection */
    CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
                                        wait till it's ready and try again (Added
                                        in 7.18.2) */
    CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
                                        wrong format (Added in 7.19.0) */
    CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed.  (Added in
                                        7.19.0) */
    CURL_LAST /* never use! */
};

CURLcode的定义的更多相关文章

  1. CWMP开源代码研究2——easycwmp安装和学习

    声明:本文是对开源程序代码学习和研究,严禁用于商业目的. 如有任何问题,欢迎和我交流.(企鹅号:408797506) 本文所有笔记和代码可以到csdn下载:http://download.csdn.n ...

  2. C++ 用libcurl库进行http通讯网络编程

    使用libcurl完成http通讯,很方便而且是线程安全,转载一篇比较好的入门文章 转载自 http://www.cnblogs.com/moodlxs/archive/2012/10/15/2724 ...

  3. C++ 用libcurl库进行http通讯网络编程(转)

    转载:http://www.cnblogs.com/moodlxs/archive/2012/10/15/2724318.html 目录索引: 一.LibCurl基本编程框架 二.一些基本的函数 三. ...

  4. 2.1 LibCurl编程流程(转)

    转载地址:http://blog.chinaunix.net/u/17660/showart_1822514.html2 LibCurl编程2.1 LibCurl编程流程在基于LibCurl的程序里, ...

  5. libcurl

    一.LibCurl基本编程框架 二.一些基本的函数 三.curl_easy_setopt函数部分选项介绍 四.curl_easy_perform 函数说明(error 状态码) 五.libcurl使用 ...

  6. 对CURL的一些研究

    http://www.kuqin.com/article/23candcplusplus/586014.html 前两天看到有人求客户端socket 发HTTP包的代码,受flw版主启发找了一些per ...

  7. LibCurl编程手册以及代码实例

    1. LibCurl编程流程 在基于LibCurl的程序里,主要采用callback function (回调函数)的形式完成传输任务,用户在启动传输前设置好各类参数和回调函数,当满足条件时libcu ...

  8. C++ 用libcurl库进行http通讯网络编程[转]

    http://www.cnblogs.com/moodlxs/archive/2012/10/15/2724318.html 目录索引: 一.LibCurl基本编程框架 二.一些基本的函数 三.cur ...

  9. C/C++ 用libcurl库进行http通讯网络编程

    C/C++ 用libcurl库进行http通讯网络编程 目录索引: 一.LibCurl基本编程框架 二.一些基本的函数 三.curl_easy_setopt函数部分选项介绍 四.curl_easy_p ...

随机推荐

  1. Java编程的逻辑 (14) - 类的组合

    ​本系列文章经补充和完善,已修订整理成书<Java编程的逻辑>,由机械工业出版社华章分社出版,于2018年1月上市热销,读者好评如潮!各大网店和书店有售,欢迎购买,京东自营链接:http: ...

  2. jQuery事件绑定—on()、bind()与delegate()

    啃了一段日子的js相关了,学的过程中发现在jQuery中绑定事件时,有人用bind(),有人用on(),有人用delegate(),还有人用live(),看代码的时候觉得都实现功能了也就掀过去了,只是 ...

  3. 【LOJ】 #2308. 「APIO2017」商旅

    题解 分数题可以想到分数规划,我们预处理出从i到j卖什么货物赚的最多,然后把每条边的边权改成"利润 - 效率 × 时间" 用spfa找正环即可 代码 #include <bi ...

  4. 子组件通过 $emit 触发父组件的自定义事件

    子组件: <template> <div class="train-city"> <h3>父组件传给子组件的toCity:{{sendData} ...

  5. 如何启用内置的Win10 OpenSSH客户端(转)

    如何启用内置的Win10 OpenSSH客户端 关注Windows10,锁定Win10之家(http://www.ghost580.com/windows10/) 如何启用内置的Win10 OpenS ...

  6. python 实现远端ftp文件上传下载

    python 实现ftp上传下载 * 脚本需要传入两个参数,参数1为需要从远端ftp站点下载文件名称,参数2为已知需要下载的文件md5值,文件下载完成后会自动进行md5值校验 * 运行示例 [root ...

  7. 006.LVM快照

    一 快照介绍 快照就是将当时的系统信息记录下来,就好像照相一样,未来若有任何资料变动了,则原始资料会被移动到快照区,没有被改动的区域则由快照区与档案系统共享. 二 快照原理 当建立快照区时,LVM会预 ...

  8. django模型查询操作

    一旦创建好了数据模型,Django就会自动为我们提供一个数据库抽象API,允许创建.检索.更新和删除对象操作 下面的示例都是通过下面参考模型来对模型字段进行操作说明: from django.db i ...

  9. Java文件类

    在Java语言中,无论是目录还是文件,都抽象成java.io.File类 直接上示例吧 java,io,File的常用操作 删除.创建 因为我的e盘里面是没有这个文件的,所以不存在I哦 创建文件: 获 ...

  10. js数据结构之列表的详细实现方法

    * 列表用于存放数据量较少的数据结构* 当数据量较大时,不需要对其进行查找.排序的情况下,使用列表也比较方便. 本数据结构在node环境下运行,需要对node有个基本是了解. 1. listSize: ...