Error Codes
上一篇 / 下一篇 2012-08-02 14:48:49 / 个人分类:[转贴]技术文章
tW3k Dp"L|v0
NAME
libcurl-errors - error codes in libcurl51Testing软件测试网%IEbe9`6_1Q6^,p[
DESCRIPTION
This man page includes most, if not all, available error codes in libcurl. Why they occur and possibly what you can do to fix the problem are also included.
K+y[l!gOk@q0CURLcode
Almost all "easy" interface functions return a CURLcode error code. No matter what, using the curl_easy_setopt(3) option CURLOPT_ERRORBUFFER is a good idea as it will give you a human readable error string that may offer more details about the cause of the error than just the error code. curl_easy_strerror(3) can be called to get an error string from a given CURLcode number.
kRZ7n(M9fl5yhs"@5Y0CURLcode is one of the following:
;Z5eFj$\Sg~+x0l:sdg4B;m I&~0All fine. Proceed as usual.51Testing软件测试网Y0ks&Vd
CURLE_UNSUPPORTED_PROTOCOL (1)51Testing软件测试网g!{#z _mu9m`M
The URL you passed to libcurl used a protocol that this libcurl does not support. The support might be a compile-time option that you didn't use, it can be a misspelled protocol string or just a protocol libcurl has no code for.
&}(~c.Hfc2m0CURLE_FAILED_INIT (2)51Testing软件测试网,W2v+w1f~Q*KS-XH
Very early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental couldn't get done at init time.51Testing软件测试网*Wm*Yb { X:P#X
&]'xp t RXa0The URL was not properly formatted.
D%~i9u g0u0CURLE_NOT_BUILT_IN (4)51Testing软件测试网8_r2Z R ~ Eb3SY
A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. This means that a feature or option was not enabled or explicitly disabled when libcurl was built and in order to get it to function you have to get a rebuilt libcurl.51Testing软件测试网2` lG1Blvw
CURLE_COULDNT_RESOLVE_PROXY (5)51Testing软件测试网:o4QQ `1[#?O
Couldn't resolve proxy. The given proxy host could not be resolved.
!h u-qR'KS T;`#]2P;g0CURLE_COULDNT_RESOLVE_HOST (6)
!ne;bijp'h(Q@0Couldn't resolve host. The given remote host was not resolved.51Testing软件测试网t KH(j0V#W9W3a*J
CURLE_COULDNT_CONNECT (7)51Testing软件测试网y`~,K6D){~)k(a
Failed to connect() to host or proxy.51Testing软件测试网/A:rqdY&xnw
CURLE_FTP_WEIRD_SERVER_REPLY (8)
8a#w][SY0After connecting to a FTP server, libcurl expects to get a certain reply back. This error code implies that it got a strange or bad reply. The given remote server is probably not an OK FTP server.
m#wkiy9O P E%A)u0CURLE_REMOTE_ACCESS_DENIED (9)
Qz*G A)AiU5z&J0We were denied access to the resource given in the URL. For FTP, this occurs while trying to change to the remote directory.
/p8A?5?1J%Yi0CURLE_FTP_ACCEPT_FAILED (10)51Testing软件测试网0f*[D[MF
While waiting for the server to connect back when an active FTP session is used, an error code was sent over the control connection or similar.51Testing软件测试网o'@-M:Z6xT;rE
CURLE_FTP_WEIRD_PASS_REPLY (11)
oB0jP/Lhx@&N0After having sent the FTP password to the server, libcurl expects a proper reply. This error code indicates that an unexpected code was returned.
A$w'^\ Z0I n5yk0CURLE_FTP_ACCEPT_TIMEOUT (12)51Testing软件测试网KPS8yBW Dxk-S
During an active FTP session while waiting for the server to connect, the CURLOPT_ACCEPTTIMOUT_MS (or the internal default) timeout expired.51Testing软件测试网-Q"MV}m)co
CURLE_FTP_WEIRD_PASV_REPLY (13)51Testing软件测试网%A2e6P,D+T%{7[
libcurl failed to get a sensible result back from the server as a response to either a PASV or a EPSV command. The server is flawed.51Testing软件测试网&~*lEZ!PJnpC
CURLE_FTP_WEIRD_227_FORMAT (14)
}y%ngEp3weu0FTP servers return a 227-line as a response to a PASV command. If libcurl fails to parse that line, this return code is passed back.
m/DxK1b+Si)\pP.W0CURLE_FTP_CANT_GET_HOST (15)51Testing软件测试网7Cb p;qL
An internal failure to lookup the host used for the new connection.51Testing软件测试网~7MeS\{ b8uS
CURLE_FTP_COULDNT_SET_TYPE (17)
3SGZ#N`0Received an error when trying to set the transfer mode to binary or ASCII.51Testing软件测试网e,i;HT$U
CURLE_PARTIAL_FILE (18)51Testing软件测试网r'vCVC4Jn6ea1z!@
A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn't match the previously given size.
N"}2Oi%@5[5i%x"rT k0CURLE_FTP_COULDNT_RETR_FILE (19)51Testing软件测试网}/t:m9?Sug
This was either a weird reply to a 'RETR' command or a zero byte transfer complete.
J7^Z ~`?(\} k0CURLE_QUOTE_ERROR (21)51Testing软件测试网Q3jIBWx
When sending custom "QUOTE" commands to the remote server, one of the commands returned an error code that was 400 or higher (for FTP) or otherwise indicated unsuccessful completion of the command.51Testing软件测试网J0I-hm9}
CURLE_HTTP_RETURNED_ERROR (22)51Testing软件测试网m;[ Bw)LK
This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400.
3mf`@nAf4UC*g0CURLE_WRITE_ERROR (23)51Testing软件测试网g`Ie:Zd ~'K
An error occurred when writing received data to a local file, or an error was returned to libcurl from a write callback.51Testing软件测试网1Ed ~ v4[
jc{(n1k_5S0Failed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server's explanation for this.
b;J!kk(]0_)f0@,ok#uZ1W5u0There was a problem reading a local file or an error returned by the read callback.51Testing软件测试网&J0|+l B(\(l|
xr@D4G qg0A memory allocation request failed. This is serious badness and things are severely screwed up if this ever occurs.51Testing软件测试网5ggI-Q!N R(Es
b5r2k'cz0Operation timeout. The specified time-out period was reached according to the conditions.51Testing软件测试网M5u9BspG(QOt
j"ZS*al%yRaMXm0The FTP PORT command returned error. This mostly happens when you haven't specified a good enough address for libcurl to use. See CURLOPT_FTPPORT.
'^q,o9Xu$z0CURLE_FTP_COULDNT_USE_REST (31)
"N#z+~?!m0The FTP REST command returned error. This should never happen if the server is sane.51Testing软件测试网ES*^1](W,]&xV5i0o
CURLE_RANGE_ERROR (33)51Testing软件测试网;Lyt uWN)f v
The server does not support or accept range requests.51Testing软件测试网0O!n-Q5VwI:n(T
CURLE_HTTP_POST_ERROR (34)51Testing软件测试网N1H9_*]&oh5h o3O
This is an odd error that mainly occurs due to internal confusion.
qXF(h"Z0CURLE_SSL_CONNECT_ERROR (35)51Testing软件测试网dG7^%T'Uv/E&E9u7n.gy
A problem occurred somewhere in the SSL/TLS handshake. You really want the error buffer and read the message there as it pinpoints the problem slightly more. Could be certificates (file formats, paths, permissions), passwords, and others.
/E&p O,Z&I*x4s)m0CURLE_BAD_DOWNLOAD_RESUME (36)51Testing软件测试网ZN:@w0QavdI
The download could not be resumed because the specified offset was out of the file boundary.51Testing软件测试网(u5M4cBz4P(U
CURLE_FILE_COULDNT_READ_FILE (37)51Testing软件测试网#D4u C!X/qLd"H
A file given with FILE:// couldn't be opened. Most likely because the file path doesn't identify an existing file. Did you check file permissions?
MZ;UD6q"L0CURLE_LDAP_CANNOT_BIND (38)51Testing软件测试网/~3c\Xt+iv
LDAP cannot bind. LDAP bind operation failed.51Testing软件测试网0m%X;N8FJ i)~
CURLE_LDAP_SEARCH_FAILED (39)51Testing软件测试网p1C1G;I_kF4_`
LDAP search failed.
k(^ q9V.f[;L0CURLE_FUNCTION_NOT_FOUND (41)51Testing软件测试网 Hj1bu:mz
Function not found. A required zlib function was not found.
1n*fq P-pI0CURLE_ABORTED_BY_CALLBACK (42)
'LH\%qR3Dr0Aborted by callback. A callback returned "abort" to libcurl.
T2M8G!T.^)R!]2a0CURLE_BAD_FUNCTION_ARGUMENT (43)
6P_w H L0Internal error. A function was called with a bad parameter.51Testing软件测试网lJLwKG
CURLE_INTERFACE_FAILED (45)51Testing软件测试网u-O#} m8q7P;A7Y!f
Interface error. A specified outgoing interface could not be used. Set which interface to use for outgoing connections' source IP address with CURLOPT_INTERFACE.
5w#cJIx b0CURLE_TOO_MANY_REDIRECTS (47)51Testing软件测试网p |.gRG Pw4Y
Too many redirects. When following redirects, libcurl hit the maximum amount. Set your limit with CURLOPT_MAXREDIRS.
c$v*JwwD4lw2n0l$~2v1NfQ"\0An option passed to libcurl is not recognized/known. Refer to the appropriate documentation. This is most likely a problem in the program that uses libcurl. The error buffer might contain more specific information about which exact option it concerns.
A+F(m8?x-_h)M0CURLE_TELNET_OPTION_SYNTAX (49)
-Z!wb7i ?| C0A telnet option string was Illegally formatted.
6jXOuS3oD2V0CURLE_PEER_FAILED_VERIFICATION (51)51Testing软件测试网/D0VI.W e
The remote server's SSL certificate or SSH md5 fingerprint was deemed not OK.
&c MU;@)XD00^ CN[ q3jw7P0Nothing was returned from the server, and under the circumstances, getting nothing is considered an error.
?T~Lx Jl0CURLE_SSL_ENGINE_NOTFOUND (53)51Testing软件测试网f#kzt~
The specified crypto engine wasn't found.
dm.}Eg R0CURLE_SSL_ENGINE_SETFAILED (54)
e:C L7^)I$N-C0Failed setting the selected SSL crypto engine as default!51Testing软件测试网!]9z7Eu y!D4h~
Q\ _(z;I0Failed sending network data.51Testing软件测试网 F6C ?B%A#Hpy
pjR-d_ em8N} ^0Failure with receiving network data.
g/rB jg;Ll0CURLE_SSL_CERTPROBLEM (58)51Testing软件测试网y0QZ w1I/d(|
problem with the local client certificate.51Testing软件测试网*G ^D+o?
:U1e-t$M.|'P0
TAG: