taf2-curb 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/ext/curb_easy.h ADDED
@@ -0,0 +1,94 @@
1
+ /* curb_easy.h - Curl easy mode
2
+ * Copyright (c)2006 Ross Bamford.
3
+ * Licensed under the Ruby License. See LICENSE for details.
4
+ *
5
+ * $Id: curb_easy.h 25 2006-12-07 23:38:25Z roscopeco $
6
+ */
7
+ #ifndef __CURB_EASY_H
8
+ #define __CURB_EASY_H
9
+
10
+ #include "curb.h"
11
+
12
+ #include <curl/easy.h>
13
+
14
+ /* a lot of this *could* be kept in the handler itself,
15
+ * but then we lose the ability to query it's status.
16
+ */
17
+ typedef struct {
18
+ /* The handler */
19
+ CURL *curl;
20
+
21
+ /* Objects we associate */
22
+ VALUE url;
23
+ VALUE proxy_url;
24
+
25
+ VALUE body_proc;
26
+ VALUE header_proc;
27
+ VALUE body_data; /* Holds the response body from the last call to curl_easy_perform */
28
+ VALUE header_data; /* unless a block is supplied (they'll be nil) */
29
+ VALUE progress_proc;
30
+ VALUE debug_proc;
31
+ VALUE interface;
32
+ VALUE userpwd;
33
+ VALUE proxypwd;
34
+ VALUE headers; /* ruby array of strings with headers to set */
35
+ VALUE cookiejar; /* filename */
36
+ VALUE cert;
37
+ VALUE encoding;
38
+
39
+ VALUE success_proc;
40
+ VALUE failure_proc;
41
+ VALUE complete_proc;
42
+
43
+ /* Other opts */
44
+ unsigned short local_port; // 0 is no port
45
+ unsigned short local_port_range; // " " " "
46
+ unsigned short proxy_port; // " " " "
47
+ int proxy_type;
48
+ long http_auth_types;
49
+ long proxy_auth_types;
50
+ long max_redirs;
51
+ unsigned long timeout;
52
+ unsigned long connect_timeout;
53
+ long dns_cache_timeout;
54
+ unsigned long ftp_response_timeout;
55
+
56
+ /* bool flags */
57
+ char proxy_tunnel;
58
+ char fetch_file_time;
59
+ char ssl_verify_peer;
60
+ char ssl_verify_host;
61
+ char header_in_body;
62
+ char use_netrc;
63
+ char follow_location;
64
+ char unrestricted_auth;
65
+ char verbose;
66
+ char multipart_form_post;
67
+ char enable_cookies;
68
+
69
+ /* this is sometimes used as a buffer for a form data string,
70
+ * which we alloc in C and need to hang around for the call,
71
+ * and in case it's asked for before the next call.
72
+ */
73
+ VALUE postdata_buffer;
74
+
75
+ /* when added to a multi handle these buffers are needed
76
+ * when the easy handle isn't supplied the body proc
77
+ * or a custom http header is passed.
78
+ */
79
+ VALUE bodybuf;
80
+ VALUE headerbuf;
81
+ struct curl_slist *curl_headers;
82
+
83
+ VALUE self; /* pointer to self, used by multi interface */
84
+
85
+ } ruby_curl_easy;
86
+
87
+ extern VALUE cCurlEasy;
88
+
89
+ VALUE ruby_curl_easy_setup(ruby_curl_easy *rbce, VALUE *bodybuf, VALUE *headerbuf, struct curl_slist **headers);
90
+ VALUE ruby_curl_easy_cleanup(VALUE self, ruby_curl_easy *rbce, VALUE bodybuf, VALUE headerbuf, struct curl_slist *headers);
91
+
92
+ void init_curb_easy();
93
+
94
+ #endif
data/ext/curb_errors.c ADDED
@@ -0,0 +1,518 @@
1
+ /* curb_errors.c - Ruby exception types for curl errors
2
+ * Copyright (c)2006 Ross Bamford.
3
+ * Licensed under the Ruby License. See LICENSE for details.
4
+ *
5
+ * $Id: curb_errors.c 10 2006-11-20 00:17:30Z roscopeco $
6
+ */
7
+ #include "curb_errors.h"
8
+
9
+ extern VALUE mCurl;
10
+
11
+ #ifdef RDOC_NEVER_DEFINED
12
+ mCurl = rb_define_module("Curl");
13
+ #endif
14
+
15
+ /* base errors */
16
+ VALUE mCurlErr;
17
+ VALUE eCurlErrError;
18
+ VALUE eCurlErrFTPError;
19
+ VALUE eCurlErrHTTPError;
20
+ VALUE eCurlErrFileError;
21
+ VALUE eCurlErrLDAPError;
22
+ VALUE eCurlErrTelnetError;
23
+ VALUE eCurlErrTFTPError;
24
+
25
+ /* Specific libcurl errors */
26
+ VALUE eCurlErrUnsupportedProtocol;
27
+ VALUE eCurlErrFailedInit;
28
+ VALUE eCurlErrMalformedURL;
29
+ VALUE eCurlErrMalformedURLUser;
30
+ VALUE eCurlErrProxyResolution;
31
+ VALUE eCurlErrHostResolution;
32
+ VALUE eCurlErrConnectFailed;
33
+ VALUE eCurlErrFTPWierdReply;
34
+ VALUE eCurlErrFTPAccessDenied;
35
+ VALUE eCurlErrFTPBadPassword;
36
+ VALUE eCurlErrFTPWierdPassReply;
37
+ VALUE eCurlErrFTPWierdUserReply;
38
+ VALUE eCurlErrFTPWierdPasvReply;
39
+ VALUE eCurlErrFTPWierd227Format;
40
+ VALUE eCurlErrFTPCantGetHost;
41
+ VALUE eCurlErrFTPCantReconnect;
42
+ VALUE eCurlErrFTPCouldntSetBinary;
43
+ VALUE eCurlErrPartialFile;
44
+ VALUE eCurlErrFTPCouldntRetrFile;
45
+ VALUE eCurlErrFTPWrite;
46
+ VALUE eCurlErrFTPQuote;
47
+ VALUE eCurlErrHTTPFailed;
48
+ VALUE eCurlErrWriteError;
49
+ VALUE eCurlErrMalformedUser;
50
+ VALUE eCurlErrFTPCouldntStorFile;
51
+ VALUE eCurlErrReadError;
52
+ VALUE eCurlErrOutOfMemory;
53
+ VALUE eCurlErrTimeout;
54
+ VALUE eCurlErrFTPCouldntSetASCII;
55
+ VALUE eCurlErrFTPPortFailed;
56
+ VALUE eCurlErrFTPCouldntUseRest;
57
+ VALUE eCurlErrFTPCouldntGetSize;
58
+ VALUE eCurlErrHTTPRange;
59
+ VALUE eCurlErrHTTPPost;
60
+ VALUE eCurlErrSSLConnectError;
61
+ VALUE eCurlErrBadResume;
62
+ VALUE eCurlErrFileCouldntRead;
63
+ VALUE eCurlErrLDAPCouldntBind;
64
+ VALUE eCurlErrLDAPSearchFailed;
65
+ VALUE eCurlErrLibraryNotFound;
66
+ VALUE eCurlErrFunctionNotFound;
67
+ VALUE eCurlErrAbortedByCallback;
68
+ VALUE eCurlErrBadFunctionArgument;
69
+ VALUE eCurlErrBadCallingOrder;
70
+ VALUE eCurlErrInterfaceFailed;
71
+ VALUE eCurlErrBadPasswordEntered;
72
+ VALUE eCurlErrTooManyRedirects;
73
+ VALUE eCurlErrTelnetUnknownOption;
74
+ VALUE eCurlErrTelnetBadOptionSyntax;
75
+ VALUE eCurlErrObsolete;
76
+ VALUE eCurlErrSSLPeerCertificate;
77
+ VALUE eCurlErrGotNothing;
78
+ VALUE eCurlErrSSLEngineNotFound;
79
+ VALUE eCurlErrSSLEngineSetFailed;
80
+ VALUE eCurlErrSendError;
81
+ VALUE eCurlErrRecvError;
82
+ VALUE eCurlErrShareInUse;
83
+ VALUE eCurlErrSSLCertificate;
84
+ VALUE eCurlErrSSLCipher;
85
+ VALUE eCurlErrSSLCACertificate;
86
+ VALUE eCurlErrBadContentEncoding;
87
+ VALUE eCurlErrLDAPInvalidURL;
88
+ VALUE eCurlErrFileSizeExceeded;
89
+ VALUE eCurlErrFTPSSLFailed;
90
+ VALUE eCurlErrSendFailedRewind;
91
+ VALUE eCurlErrSSLEngineInitFailed;
92
+ VALUE eCurlErrLoginDenied;
93
+ VALUE eCurlErrTFTPNotFound;
94
+ VALUE eCurlErrTFTPPermission;
95
+ VALUE eCurlErrTFTPDiskFull;
96
+ VALUE eCurlErrTFTPIllegalOperation;
97
+ VALUE eCurlErrTFTPUnknownID;
98
+ VALUE eCurlErrTFTPFileExists;
99
+ VALUE eCurlErrTFTPNoSuchUser;
100
+
101
+ /* multi errors */
102
+ VALUE mCurlErrCallMultiPerform;
103
+ VALUE mCurlErrBadHandle;
104
+ VALUE mCurlErrBadEasyHandle;
105
+ VALUE mCurlErrOutOfMemory;
106
+ VALUE mCurlErrInternalError;
107
+ VALUE mCurlErrBadSocket;
108
+ VALUE mCurlErrUnknownOption;
109
+
110
+ /* binding errors */
111
+ VALUE eCurlErrInvalidPostField;
112
+
113
+
114
+ /* rb_raise an approriate exception for the supplied CURLcode */
115
+ void raise_curl_easy_error_exception(CURLcode code) {
116
+ VALUE exclz;
117
+ const char *exmsg = NULL;
118
+
119
+ switch (code) {
120
+ case CURLE_UNSUPPORTED_PROTOCOL: /* 1 */
121
+ exclz = eCurlErrUnsupportedProtocol;
122
+ break;
123
+ case CURLE_FAILED_INIT: /* 2 */
124
+ exclz = eCurlErrFailedInit;
125
+ break;
126
+ case CURLE_URL_MALFORMAT: /* 3 */
127
+ exclz = eCurlErrMalformedURL;
128
+ break;
129
+ case CURLE_URL_MALFORMAT_USER: /* 4 (NOT USED) */
130
+ exclz = eCurlErrMalformedURLUser;
131
+ break;
132
+ case CURLE_COULDNT_RESOLVE_PROXY: /* 5 */
133
+ exclz = eCurlErrProxyResolution;
134
+ break;
135
+ case CURLE_COULDNT_RESOLVE_HOST: /* 6 */
136
+ exclz = eCurlErrHostResolution;
137
+ break;
138
+ case CURLE_COULDNT_CONNECT: /* 7 */
139
+ exclz = eCurlErrConnectFailed;
140
+ break;
141
+ case CURLE_FTP_WEIRD_SERVER_REPLY: /* 8 */
142
+ exclz = eCurlErrFTPWierdReply;
143
+ break;
144
+ case CURLE_FTP_ACCESS_DENIED: /* 9 denied due to lack of access. */
145
+ exclz = eCurlErrFTPAccessDenied;
146
+ break;
147
+ case CURLE_FTP_USER_PASSWORD_INCORRECT: /* 10 */
148
+ exclz = eCurlErrFTPBadPassword;
149
+ break;
150
+ case CURLE_FTP_WEIRD_PASS_REPLY: /* 11 */
151
+ exclz = eCurlErrFTPWierdPassReply;
152
+ break;
153
+ case CURLE_FTP_WEIRD_USER_REPLY: /* 12 */
154
+ exclz = eCurlErrFTPWierdUserReply;
155
+ break;
156
+ case CURLE_FTP_WEIRD_PASV_REPLY: /* 13 */
157
+ exclz = eCurlErrFTPWierdPasvReply;
158
+ break;
159
+ case CURLE_FTP_WEIRD_227_FORMAT: /* 14 */
160
+ exclz = eCurlErrFTPWierd227Format;
161
+ break;
162
+ case CURLE_FTP_CANT_GET_HOST: /* 15 */
163
+ exclz = eCurlErrFTPCantGetHost;
164
+ break;
165
+ case CURLE_FTP_CANT_RECONNECT: /* 16 */
166
+ exclz = eCurlErrFTPCantReconnect;
167
+ break;
168
+ case CURLE_FTP_COULDNT_SET_BINARY: /* 17 */
169
+ exclz = eCurlErrFTPCouldntSetBinary;
170
+ break;
171
+ case CURLE_PARTIAL_FILE: /* 18 */
172
+ exclz = eCurlErrPartialFile;
173
+ break;
174
+ case CURLE_FTP_COULDNT_RETR_FILE: /* 19 */
175
+ exclz = eCurlErrFTPCouldntRetrFile;
176
+ break;
177
+ case CURLE_FTP_WRITE_ERROR: /* 20 */
178
+ exclz = eCurlErrFTPWrite;
179
+ break;
180
+ case CURLE_FTP_QUOTE_ERROR: /* 21 */
181
+ exclz = eCurlErrFTPQuote;
182
+ break;
183
+ case CURLE_HTTP_RETURNED_ERROR: /* 22 */
184
+ exclz = eCurlErrHTTPFailed;
185
+ break;
186
+ case CURLE_WRITE_ERROR: /* 23 */
187
+ exclz = eCurlErrWriteError;
188
+ break;
189
+ case CURLE_MALFORMAT_USER: /* 24 - NOT USED */
190
+ exclz = eCurlErrMalformedUser;
191
+ break;
192
+ case CURLE_FTP_COULDNT_STOR_FILE: /* 25 - failed FTP upload */
193
+ exclz = eCurlErrFTPCouldntStorFile;
194
+ break;
195
+ case CURLE_READ_ERROR: /* 26 - could open/read from file */
196
+ exclz = eCurlErrReadError;
197
+ break;
198
+ case CURLE_OUT_OF_MEMORY: /* 27 */
199
+ exclz = eCurlErrOutOfMemory;
200
+ break;
201
+ case CURLE_OPERATION_TIMEOUTED: /* 28 - the timeout time was reached */
202
+ exclz = eCurlErrTimeout;
203
+ break;
204
+ case CURLE_FTP_COULDNT_SET_ASCII: /* 29 - TYPE A failed */
205
+ exclz = eCurlErrFTPCouldntSetASCII;
206
+ break;
207
+ case CURLE_FTP_PORT_FAILED: /* 30 - FTP PORT operation failed */
208
+ exclz = eCurlErrFTPPortFailed;
209
+ break;
210
+ case CURLE_FTP_COULDNT_USE_REST: /* 31 - the REST command failed */
211
+ exclz = eCurlErrFTPCouldntUseRest;
212
+ break;
213
+ case CURLE_FTP_COULDNT_GET_SIZE: /* 32 - the SIZE command failed */
214
+ exclz = eCurlErrFTPCouldntGetSize;
215
+ break;
216
+ case CURLE_HTTP_RANGE_ERROR: /* 33 - RANGE "command" didn't work */
217
+ exclz = eCurlErrHTTPRange;
218
+ break;
219
+ case CURLE_HTTP_POST_ERROR: /* 34 */
220
+ exclz = eCurlErrHTTPPost;
221
+ break;
222
+ case CURLE_SSL_CONNECT_ERROR: /* 35 - wrong when connecting with SSL */
223
+ exclz = eCurlErrSSLConnectError;
224
+ break;
225
+ case CURLE_BAD_DOWNLOAD_RESUME: /* 36 - couldn't resume download */
226
+ exclz = eCurlErrBadResume;
227
+ break;
228
+ case CURLE_FILE_COULDNT_READ_FILE: /* 37 */
229
+ exclz = eCurlErrFileCouldntRead;
230
+ break;
231
+ case CURLE_LDAP_CANNOT_BIND: /* 38 */
232
+ exclz = eCurlErrLDAPCouldntBind;
233
+ break;
234
+ case CURLE_LDAP_SEARCH_FAILED: /* 39 */
235
+ exclz = eCurlErrLDAPSearchFailed;
236
+ break;
237
+ case CURLE_LIBRARY_NOT_FOUND: /* 40 */
238
+ exclz = eCurlErrLibraryNotFound;
239
+ break;
240
+ case CURLE_FUNCTION_NOT_FOUND: /* 41 */
241
+ exclz = eCurlErrFunctionNotFound;
242
+ break;
243
+ case CURLE_ABORTED_BY_CALLBACK: /* 42 */
244
+ exclz = eCurlErrAbortedByCallback;
245
+ break;
246
+ case CURLE_BAD_FUNCTION_ARGUMENT: /* 43 */
247
+ exclz = eCurlErrBadFunctionArgument;
248
+ break;
249
+ case CURLE_BAD_CALLING_ORDER: /* 44 - NOT USED */
250
+ exclz = eCurlErrBadCallingOrder;
251
+ break;
252
+ case CURLE_INTERFACE_FAILED: /* 45 - CURLOPT_INTERFACE failed */
253
+ exclz = eCurlErrInterfaceFailed;
254
+ break;
255
+ case CURLE_BAD_PASSWORD_ENTERED: /* 46 - NOT USED */
256
+ exclz = eCurlErrBadPasswordEntered;
257
+ break;
258
+ case CURLE_TOO_MANY_REDIRECTS: /* 47 - catch endless re-direct loops */
259
+ exclz = eCurlErrTooManyRedirects;
260
+ break;
261
+ case CURLE_UNKNOWN_TELNET_OPTION: /* 48 - User specified an unknown option */
262
+ exclz = eCurlErrTelnetUnknownOption;
263
+ break;
264
+ case CURLE_TELNET_OPTION_SYNTAX: /* 49 - Malformed telnet option */
265
+ exclz = eCurlErrTelnetBadOptionSyntax;
266
+ break;
267
+ case CURLE_OBSOLETE: /* 50 - NOT USED */
268
+ exclz = eCurlErrObsolete;
269
+ break;
270
+ case CURLE_SSL_PEER_CERTIFICATE: /* 51 - peer's certificate wasn't ok */
271
+ exclz = eCurlErrSSLPeerCertificate;
272
+ break;
273
+ case CURLE_GOT_NOTHING: /* 52 - when this is a specific error */
274
+ exclz = eCurlErrGotNothing;
275
+ break;
276
+ case CURLE_SSL_ENGINE_NOTFOUND: /* 53 - SSL crypto engine not found */
277
+ exclz = eCurlErrSSLEngineNotFound;
278
+ break;
279
+ case CURLE_SSL_ENGINE_SETFAILED: /* 54 - can not set SSL crypto engine as default */
280
+ exclz = eCurlErrSSLEngineSetFailed;
281
+ break;
282
+ case CURLE_SEND_ERROR: /* 55 - failed sending network data */
283
+ exclz = eCurlErrSendError;
284
+ break;
285
+ case CURLE_RECV_ERROR: /* 56 - failure in receiving network data */
286
+ exclz = eCurlErrRecvError;
287
+ break;
288
+ case CURLE_SHARE_IN_USE: /* 57 - share is in use */
289
+ exclz = eCurlErrShareInUse;
290
+ break;
291
+ case CURLE_SSL_CERTPROBLEM: /* 58 - problem with the local certificate */
292
+ exclz = eCurlErrSSLCertificate;
293
+ break;
294
+ case CURLE_SSL_CIPHER: /* 59 - couldn't use specified cipher */
295
+ exclz = eCurlErrSSLCipher;
296
+ break;
297
+ case CURLE_SSL_CACERT: /* 60 - problem with the CA cert (path?) */
298
+ exclz = eCurlErrSSLCACertificate;
299
+ break;
300
+ case CURLE_BAD_CONTENT_ENCODING: /* 61 - Unrecognized transfer encoding */
301
+ exclz = eCurlErrBadContentEncoding;
302
+ break;
303
+ case CURLE_LDAP_INVALID_URL: /* 62 - Invalid LDAP URL */
304
+ exclz = eCurlErrLDAPInvalidURL;
305
+ break;
306
+ case CURLE_FILESIZE_EXCEEDED: /* 63 - Maximum file size exceeded */
307
+ exclz = eCurlErrFileSizeExceeded;
308
+ break;
309
+ case CURLE_FTP_SSL_FAILED: /* 64 - Requested FTP SSL level failed */
310
+ exclz = eCurlErrFTPSSLFailed;
311
+ break;
312
+ case CURLE_SEND_FAIL_REWIND: /* 65 - Sending the data requires a rewind that failed */
313
+ exclz = eCurlErrSendFailedRewind;
314
+ break;
315
+ case CURLE_SSL_ENGINE_INITFAILED: /* 66 - failed to initialise ENGINE */
316
+ exclz = eCurlErrSSLEngineInitFailed;
317
+ break;
318
+ case CURLE_LOGIN_DENIED: /* 67 - user, password or similar was not accepted and we failed to login */
319
+ exclz = eCurlErrLoginDenied;
320
+ break;
321
+
322
+ // recent additions, may not be present in all supported versions
323
+ #ifdef CURLE_TFTP_NOTFOUND
324
+ case CURLE_TFTP_NOTFOUND: /* 68 - file not found on server */
325
+ exclz = eCurlErrTFTPNotFound;
326
+ break;
327
+ #endif
328
+ #ifdef CURLE_TFTP_PERM
329
+ case CURLE_TFTP_PERM: /* 69 - permission problem on server */
330
+ exclz = eCurlErrTFTPPermission;
331
+ break;
332
+ #endif
333
+ #ifdef CURLE_TFTP_DISKFULL
334
+ case CURLE_TFTP_DISKFULL: /* 70 - out of disk space on server */
335
+ exclz = eCurlErrTFTPDiskFull;
336
+ break;
337
+ #endif
338
+ #ifdef CURLE_TFTP_ILLEGAL
339
+ case CURLE_TFTP_ILLEGAL: /* 71 - Illegal TFTP operation */
340
+ exclz = eCurlErrTFTPIllegalOperation;
341
+ break;
342
+ #endif
343
+ #ifdef CURLE_TFTP_UNKNOWNID
344
+ case CURLE_TFTP_UNKNOWNID: /* 72 - Unknown transfer ID */
345
+ exclz = eCurlErrTFTPUnknownID;
346
+ break;
347
+ #endif
348
+ #ifdef CURLE_TFTP_EXISTS
349
+ case CURLE_TFTP_EXISTS: /* 73 - File already exists */
350
+ exclz = eCurlErrTFTPFileExists;
351
+ break;
352
+ #endif
353
+ #ifdef CURLE_TFTP_NOSUCHUSER
354
+ case CURLE_TFTP_NOSUCHUSER: /* 74 - No such user */
355
+ exclz = eCurlErrTFTPNotFound;
356
+ break;
357
+ #endif
358
+ default:
359
+ exclz = eCurlErrError;
360
+ exmsg = "Unknown error result from libcurl";
361
+ }
362
+
363
+ if (!exmsg) {
364
+ exmsg = curl_easy_strerror(code);
365
+ }
366
+
367
+ rb_raise(exclz, exmsg);
368
+ }
369
+ void raise_curl_multi_error_exception(CURLMcode code) {
370
+ VALUE exclz;
371
+ const char *exmsg = NULL;
372
+
373
+ switch(code) {
374
+ case CURLM_CALL_MULTI_PERFORM: /* -1 */
375
+ exclz = mCurlErrCallMultiPerform;
376
+ break;
377
+ case CURLM_BAD_HANDLE: /* 1 */
378
+ exclz = mCurlErrBadHandle;
379
+ break;
380
+ case CURLM_BAD_EASY_HANDLE: /* 2 */
381
+ exclz = mCurlErrBadEasyHandle;
382
+ break;
383
+ case CURLM_OUT_OF_MEMORY: /* 3 */
384
+ exclz = mCurlErrOutOfMemory;
385
+ break;
386
+ case CURLM_INTERNAL_ERROR: /* 4 */
387
+ exclz = mCurlErrInternalError;
388
+ break;
389
+ case CURLM_BAD_SOCKET: /* 5 */
390
+ exclz = mCurlErrBadSocket;
391
+ break;
392
+ case CURLM_UNKNOWN_OPTION: /* 6 */
393
+ exclz = mCurlErrUnknownOption;
394
+ break;
395
+ default:
396
+ exclz = eCurlErrError;
397
+ exmsg = "Unknown error result from libcurl";
398
+ }
399
+
400
+ if (!exmsg) {
401
+ exmsg = curl_multi_strerror(code);
402
+ }
403
+
404
+ rb_raise(exclz, exmsg);
405
+ }
406
+
407
+ void init_curb_errors() {
408
+ mCurlErr = rb_define_module_under(mCurl, "Err");
409
+ eCurlErrError = rb_define_class_under(mCurlErr, "CurlError", rb_eRuntimeError);
410
+
411
+ eCurlErrFTPError = rb_define_class_under(mCurlErr, "FTPError", eCurlErrError);
412
+ eCurlErrHTTPError = rb_define_class_under(mCurlErr, "HTTPError", eCurlErrError);
413
+ eCurlErrFileError = rb_define_class_under(mCurlErr, "FileError", eCurlErrError);
414
+ eCurlErrLDAPError = rb_define_class_under(mCurlErr, "LDAPError", eCurlErrError);
415
+ eCurlErrTelnetError = rb_define_class_under(mCurlErr, "TelnetError", eCurlErrError);
416
+ eCurlErrTFTPError = rb_define_class_under(mCurlErr, "TFTPError", eCurlErrError);
417
+
418
+ eCurlErrUnsupportedProtocol = rb_define_class_under(mCurlErr, "UnsupportedProtocolError", eCurlErrError);
419
+ eCurlErrFailedInit = rb_define_class_under(mCurlErr, "FailedInitError", eCurlErrError);
420
+ eCurlErrMalformedURL = rb_define_class_under(mCurlErr, "MalformedURLError", eCurlErrError);
421
+ eCurlErrMalformedURLUser = rb_define_class_under(mCurlErr, "MalformedURLUserError", eCurlErrError);
422
+ eCurlErrProxyResolution = rb_define_class_under(mCurlErr, "ProxyResolutionError", eCurlErrError);
423
+ eCurlErrHostResolution = rb_define_class_under(mCurlErr, "HostResolutionError", eCurlErrError);
424
+ eCurlErrConnectFailed = rb_define_class_under(mCurlErr, "ConnectionFailedError", eCurlErrError);
425
+
426
+ eCurlErrFTPWierdReply = rb_define_class_under(mCurlErr, "WierdReplyError", eCurlErrFTPError);
427
+ eCurlErrFTPAccessDenied = rb_define_class_under(mCurlErr, "AccessDeniedError", eCurlErrFTPError);
428
+ eCurlErrFTPBadPassword = rb_define_class_under(mCurlErr, "BadBasswordError", eCurlErrFTPError);
429
+ eCurlErrFTPWierdPassReply = rb_define_class_under(mCurlErr, "WierdPassReplyError", eCurlErrFTPError);
430
+ eCurlErrFTPWierdUserReply = rb_define_class_under(mCurlErr, "WierdUserReplyError", eCurlErrFTPError);
431
+ eCurlErrFTPWierdPasvReply = rb_define_class_under(mCurlErr, "WierdPasvReplyError", eCurlErrFTPError);
432
+ eCurlErrFTPWierd227Format = rb_define_class_under(mCurlErr, "Wierd227FormatError", eCurlErrFTPError);
433
+ eCurlErrFTPCantGetHost = rb_define_class_under(mCurlErr, "CantGetHostError", eCurlErrFTPError);
434
+ eCurlErrFTPCantReconnect = rb_define_class_under(mCurlErr, "CantReconnectError", eCurlErrFTPError);
435
+ eCurlErrFTPCouldntSetBinary = rb_define_class_under(mCurlErr, "CouldntSetBinaryError", eCurlErrFTPError);
436
+
437
+ eCurlErrPartialFile = rb_define_class_under(mCurlErr, "PartialFileError", eCurlErrError);
438
+
439
+ eCurlErrFTPCouldntRetrFile = rb_define_class_under(mCurlErr, "CouldntRetrFileError", eCurlErrFTPError);
440
+ eCurlErrFTPWrite = rb_define_class_under(mCurlErr, "FTPWriteError", eCurlErrFTPError);
441
+ eCurlErrFTPQuote = rb_define_class_under(mCurlErr, "FTPQuoteError", eCurlErrFTPError);
442
+
443
+ eCurlErrHTTPFailed = rb_define_class_under(mCurlErr, "HTTPFailedError", eCurlErrHTTPError);
444
+
445
+ eCurlErrWriteError = rb_define_class_under(mCurlErr, "WriteError", eCurlErrError);
446
+ eCurlErrMalformedUser = rb_define_class_under(mCurlErr, "MalformedUserError", eCurlErrError);
447
+
448
+ eCurlErrFTPCouldntStorFile = rb_define_class_under(mCurlErr, "CouldntStorFileError", eCurlErrFTPError);
449
+
450
+ eCurlErrReadError = rb_define_class_under(mCurlErr, "ReadError", eCurlErrError);
451
+ eCurlErrOutOfMemory = rb_define_class_under(mCurlErr, "OutOfMemoryError", eCurlErrError);
452
+ eCurlErrTimeout = rb_define_class_under(mCurlErr, "TimeoutError", eCurlErrError);
453
+
454
+ eCurlErrFTPCouldntSetASCII = rb_define_class_under(mCurlErr, "CouldntSetASCIIError", eCurlErrFTPError);
455
+ eCurlErrFTPPortFailed = rb_define_class_under(mCurlErr, "PortFailedError", eCurlErrFTPError);
456
+ eCurlErrFTPCouldntUseRest = rb_define_class_under(mCurlErr, "CouldntUseRestError", eCurlErrFTPError);
457
+ eCurlErrFTPCouldntGetSize = rb_define_class_under(mCurlErr, "CouldntGetSizeError", eCurlErrFTPError);
458
+
459
+ eCurlErrHTTPRange = rb_define_class_under(mCurlErr, "HTTPRangeError", eCurlErrHTTPError);
460
+ eCurlErrHTTPPost = rb_define_class_under(mCurlErr, "HTTPPostError", eCurlErrHTTPError);
461
+
462
+ eCurlErrSSLConnectError = rb_define_class_under(mCurlErr, "SSLConnectError", eCurlErrError);
463
+ eCurlErrBadResume = rb_define_class_under(mCurlErr, "BadResumeError", eCurlErrError);
464
+
465
+ eCurlErrFileCouldntRead = rb_define_class_under(mCurlErr, "CouldntReadError", eCurlErrFileError);
466
+
467
+ eCurlErrLDAPCouldntBind = rb_define_class_under(mCurlErr, "CouldntBindError", eCurlErrLDAPError);
468
+ eCurlErrLDAPSearchFailed = rb_define_class_under(mCurlErr, "SearchFailedError", eCurlErrLDAPError);
469
+
470
+ eCurlErrLibraryNotFound = rb_define_class_under(mCurlErr, "LibraryNotFoundError", eCurlErrError);
471
+ eCurlErrFunctionNotFound = rb_define_class_under(mCurlErr, "FunctionNotFoundError", eCurlErrError);
472
+ eCurlErrAbortedByCallback = rb_define_class_under(mCurlErr, "AbortedByCallbackError", eCurlErrError);
473
+ eCurlErrBadFunctionArgument = rb_define_class_under(mCurlErr, "BadFunctionArgumentError", eCurlErrError);
474
+ eCurlErrBadCallingOrder = rb_define_class_under(mCurlErr, "BadCallingOrderError", eCurlErrError);
475
+ eCurlErrInterfaceFailed = rb_define_class_under(mCurlErr, "InterfaceFailedError", eCurlErrError);
476
+
477
+ eCurlErrBadPasswordEntered = rb_define_class_under(mCurlErr, "BadPasswordEnteredError", eCurlErrError);
478
+ eCurlErrTooManyRedirects = rb_define_class_under(mCurlErr, "TooManyRedirectsError", eCurlErrError);
479
+
480
+ eCurlErrTelnetUnknownOption = rb_define_class_under(mCurlErr, "UnknownOptionError", eCurlErrTelnetError);
481
+ eCurlErrTelnetBadOptionSyntax = rb_define_class_under(mCurlErr, "BadOptionSyntaxError", eCurlErrTelnetError);
482
+
483
+ eCurlErrObsolete = rb_define_class_under(mCurlErr, "ObsoleteError", eCurlErrError);
484
+ eCurlErrSSLPeerCertificate = rb_define_class_under(mCurlErr, "SSLPeerCertificateError", eCurlErrError);
485
+ eCurlErrGotNothing = rb_define_class_under(mCurlErr, "GotNothingError", eCurlErrError);
486
+
487
+ eCurlErrSSLEngineNotFound = rb_define_class_under(mCurlErr, "SSLEngineNotFoundError", eCurlErrError);
488
+ eCurlErrSSLEngineSetFailed = rb_define_class_under(mCurlErr, "SSLEngineSetFailedError", eCurlErrError);
489
+
490
+ eCurlErrSendError = rb_define_class_under(mCurlErr, "SendError", eCurlErrError);
491
+ eCurlErrRecvError = rb_define_class_under(mCurlErr, "RecvError", eCurlErrError);
492
+ eCurlErrShareInUse = rb_define_class_under(mCurlErr, "ShareInUseError", eCurlErrError);
493
+
494
+ eCurlErrSSLCertificate = rb_define_class_under(mCurlErr, "SSLCertificateError", eCurlErrError);
495
+ eCurlErrSSLCipher = rb_define_class_under(mCurlErr, "SSLCypherError", eCurlErrError);
496
+ eCurlErrSSLCACertificate = rb_define_class_under(mCurlErr, "SSLCACertificateError", eCurlErrError);
497
+ eCurlErrBadContentEncoding = rb_define_class_under(mCurlErr, "BadContentEncodingError", eCurlErrError);
498
+
499
+ eCurlErrLDAPInvalidURL = rb_define_class_under(mCurlErr, "InvalidLDAPURLError", eCurlErrLDAPError);
500
+
501
+ eCurlErrFileSizeExceeded = rb_define_class_under(mCurlErr, "FileSizeExceededError", eCurlErrError);
502
+
503
+ eCurlErrFTPSSLFailed = rb_define_class_under(mCurlErr, "FTPSSLFailed", eCurlErrFTPError);
504
+
505
+ eCurlErrSendFailedRewind = rb_define_class_under(mCurlErr, "SendFailedRewind", eCurlErrError);
506
+ eCurlErrSSLEngineInitFailed = rb_define_class_under(mCurlErr, "SSLEngineInitFailedError", eCurlErrError);
507
+ eCurlErrLoginDenied = rb_define_class_under(mCurlErr, "LoginDeniedError", eCurlErrError);
508
+
509
+ eCurlErrTFTPNotFound = rb_define_class_under(mCurlErr, "NotFoundError", eCurlErrTFTPError);
510
+ eCurlErrTFTPPermission = rb_define_class_under(mCurlErr, "PermissionError", eCurlErrTFTPError);
511
+ eCurlErrTFTPDiskFull = rb_define_class_under(mCurlErr, "DiskFullError", eCurlErrTFTPError);
512
+ eCurlErrTFTPIllegalOperation = rb_define_class_under(mCurlErr, "IllegalOperationError", eCurlErrTFTPError);
513
+ eCurlErrTFTPUnknownID = rb_define_class_under(mCurlErr, "UnknownIDError", eCurlErrTFTPError);
514
+ eCurlErrTFTPFileExists = rb_define_class_under(mCurlErr, "FileExistsError", eCurlErrTFTPError);
515
+ eCurlErrTFTPNoSuchUser = rb_define_class_under(mCurlErr, "NoSuchUserError", eCurlErrTFTPError);
516
+
517
+ eCurlErrInvalidPostField = rb_define_class_under(mCurlErr, "InvalidPostFieldError", eCurlErrError);
518
+ }