跳到主要内容

网络库 CURL 错误码

Player Network SDK 的网络库使用 libcurl 解决方案。在 SDK 返回的错误码中,如果 retcode 为 4 则表示网络错误,需要根据 thirdcode 来判断网络错误的详细原因。以下是 CURL 的错误码:

错误码名称对应错误码和解释说明
CURLE_OK0-
CURLE_UNSUPPORTED_PROTOCOL1-
CURLE_FAILED_INIT2-
CURLE_URL_MALFORMAT3-
CURLE_NOT_BUILT_IN44 - [was obsoleted in August 2007 for 7.17.0, reused in April 2011 for 7.21.5]
CURLE_COULDNT_RESOLVE_PROXY5-
CURLE_COULDNT_RESOLVE_HOST6-
CURLE_COULDNT_CONNECT7-
CURLE_WEIRD_SERVER_REPLY8-
CURLE_REMOTE_ACCESS_DENIED99 - a service was denied by the server due to lack of access - when login fails this is not returned.
CURLE_FTP_ACCEPT_FAILED1010 - [was obsoleted in April 2006 for 7.15.4, reused in Dec 2011 for 7.24.0]
CURLE_FTP_WEIRD_PASS_REPLY11-
CURLE_FTP_ACCEPT_TIMEOUT1212 - timeout occurred accepting server [was obsoleted in August 2007 for 7.17.0, reused in Dec 2011 for 7.24.0]
CURLE_FTP_WEIRD_PASV_REPLY13-
CURLE_FTP_WEIRD_227_FORMAT14-
CURLE_FTP_CANT_GET_HOST15-
CURLE_HTTP216http2 框架层中的问题 [错误代码已于 2007 年 8 月针对 7.17.0 废弃,并于 2014 年 7 月针对 7.38.0 重新使用]
CURLE_FTP_COULDNT_SET_TYPE17-
CURLE_PARTIAL_FILE18-
CURLE_FTP_COULDNT_RETR_FILE19-
CURLE_OBSOLETE202046 - NOT USED
CURLE_QUOTE_ERROR2121 - quote command failure
CURLE_HTTP_RETURNED_ERROR22-
CURLE_WRITE_ERROR23-
CURLE_OBSOLETE242424 - NOT USED
CURLE_UPLOAD_FAILED2525 - failed upload "command"
CURLE_READ_ERROR2626 - could not open/read from file
CURLE_OUT_OF_MEMORY2727 - CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error instead of a memory allocation error if CURL_DOES_CONVERSIONS is defined
CURLE_OPERATION_TIMEDOUT2828 - the timeout time was reached
CURLE_OBSOLETE292944 - NOT USED
CURLE_FTP_PORT_FAILED3030 - FTP PORT operation failed
CURLE_FTP_COULDNT_USE_REST3131 - the REST command failed
CURLE_OBSOLETE323232 - NOT USED
CURLE_RANGE_ERROR3333 - RANGE "command" did not work
CURLE_HTTP_POST_ERROR34-
CURLE_SSL_CONNECT_ERROR3535 - wrong when connecting with SSL
CURLE_BAD_DOWNLOAD_RESUME3636 - could not resume download
CURLE_FILE_COULDNT_READ_FILE37-
CURLE_LDAP_CANNOT_BIND38-
CURLE_LDAP_SEARCH_FAILED39-
CURLE_OBSOLETE404020 - NOT USED
CURLE_FUNCTION_NOT_FOUND4141 - NOT USED starting with 7.53.0
CURLE_ABORTED_BY_CALLBACK42-
CURLE_BAD_FUNCTION_ARGUMENT43-
4440 - NOT USED
CURLE_INTERFACE_FAILED45以下是 CURL 的错误码:
CURLE_OBSOLETE464629 - NOT USED
CURLE_TOO_MANY_REDIRECTS4747 - catch endless re-direct loops
CURLE_UNKNOWN_OPTION4848 - User specified an unknown option
CURLE_TELNET_OPTION_SYNTAX4949 - Malformed telnet option
CURLE_OBSOLETE5050 - NOT USED45 - CURLOPT_INTERFACE failed
CURLE_PEER_FAILED_VERIFICATION5151 - peer's certificate or fingerprint was not verified fine
CURLE_GOT_NOTHING5252 - when this is a specific error
CURLE_SSL_ENGINE_NOTFOUND5353 - SSL crypto engine not found
CURLE_SSL_ENGINE_SETFAILED5454 - can not set SSL crypto engine as default
CURLE_SEND_ERROR5555 - failed sending network data
CURLE_RECV_ERROR5656 - failure in receiving network data
CURLE_OBSOLETE575757 - NOT IN USE
CURLE_SSL_CERTPROBLEM5858 - problem with the local certificate
CURLE_SSL_CIPHER5959 - could not use specified cipher
CURLE_SSL_CACERT6060 - problem with the CA cert (path?)
CURLE_BAD_CONTENT_ENCODING6161 - unrecognized/bad encoding
CURLE_LDAP_INVALID_URL6262 - invalid LDAP URL
CURLE_FILESIZE_EXCEEDED6363 - maximum file size exceeded
CURLE_USE_SSL_FAILED6464 - requested FTP SSL level failed
CURLE_SEND_FAIL_REWIND6565 - sending the data requires a rewind that failed
CURLE_SSL_ENGINE_INITFAILED6666 - failed to initialise ENGINE
CURLE_LOGIN_DENIED6767 - user, password or similar was not accepted and we failed to login
CURLE_TFTP_NOTFOUND6868 - file not found on server
CURLE_TFTP_PERM6969 - permission problem on server
CURLE_REMOTE_DISK_FULL70服务器磁盘空间不足
CURLE_TFTP_ILLEGAL7171 - illegal TFTP operation
CURLE_TFTP_UNKNOWNID72未知传输 ID
CURLE_REMOTE_FILE_EXISTS7373 - file already exists
CURLE_TFTP_NOSUCHUSER7474 - no such user
CURLE_CONV_FAILED7575 - conversion failed
CURLE_CONV_REQD76Caller 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_BADFILE7777 - could not load CACERT file, missing or wrong format
CURLE_REMOTE_FILE_NOT_FOUND7878 - remote file not found
CURLE_SSH7979 - error from the SSH layer, somewhat generic so the error message will be of interest when this has happened
CURLE_SSL_SHUTDOWN_FAILED8080 - failed to shut down the SSL connection
CURLE_AGAIN8181 - socket is not ready for send/recv, wait till it is ready and try again (Added in 7.18.2)
CURLE_SSL_CRL_BADFILE8282 - could not load CRL file, missing or wrong format (Added in 7.19.0)
CURLE_SSL_ISSUER_ERROR83Issuer check failed. (Added in 7.19.0)
CURLE_FTP_PRET_FAILED8484 - a PRET command failed
CURLE_RTSP_CSEQ_ERROR8585 - mismatch of RTSP CSeq numbers
CURLE_RTSP_SESSION_ERROR8686 - mismatch of RTSP Session Ids
CURLE_FTP_BAD_FILE_LIST8787 - unable to parse FTP file list
CURLE_CHUNK_FAILED88Chunk callback reported error
CURLE_NO_CONNECTION_AVAILABLE89No connection available, the session will be queued
CURLE_SSL_PINNEDPUBKEYNOTMATCH90Specified pinned public key did not match
CURLE_SSL_INVALIDCERTSTATUS9191 - invalid certificate status
CURLE_HTTP2_STREAM9292 - stream error in HTTP/2 framing layer
CURLE_RECURSIVE_API_CALL93an API function was called from inside a callback
CURL_LASTnever use!-