curb 0.8.5 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +579 -0
  3. data/Rakefile +85 -27
  4. data/doc.rb +48 -8
  5. data/ext/banned.h +32 -0
  6. data/ext/curb.c +563 -233
  7. data/ext/curb.h +19 -10
  8. data/ext/curb_easy.c +3229 -368
  9. data/ext/curb_easy.h +42 -0
  10. data/ext/curb_errors.c +117 -18
  11. data/ext/curb_errors.h +9 -5
  12. data/ext/curb_macros.h +33 -21
  13. data/ext/curb_multi.c +1904 -272
  14. data/ext/curb_multi.h +11 -3
  15. data/ext/curb_postfield.c +149 -77
  16. data/ext/curb_postfield.h +1 -0
  17. data/ext/curb_upload.c +38 -11
  18. data/ext/curb_upload.h +2 -0
  19. data/ext/extconf.rb +355 -35
  20. data/lib/curb.rb +1 -0
  21. data/lib/curl/download.rb +160 -0
  22. data/lib/curl/easy.rb +422 -88
  23. data/lib/curl/multi.rb +295 -56
  24. data/lib/curl.rb +676 -11
  25. data/tests/bug_crash_on_debug.rb +14 -28
  26. data/tests/bug_crash_on_progress.rb +32 -16
  27. data/tests/bug_curb_easy_blocks_ruby_threads.rb +10 -15
  28. data/tests/bug_curb_easy_post_with_string_no_content_length_header.rb +6 -30
  29. data/tests/bug_follow_redirect_288.rb +83 -0
  30. data/tests/bug_instance_post_differs_from_class_post.rb +3 -5
  31. data/tests/bug_issue102.rb +17 -0
  32. data/tests/bug_issue_noproxy.rb +56 -0
  33. data/tests/bug_issue_post_redirect.rb +93 -0
  34. data/tests/bug_issue_spnego.rb +41 -0
  35. data/tests/bug_multi_segfault.rb +1 -0
  36. data/tests/bug_poison.rb +29 -0
  37. data/tests/bug_raise_on_callback.rb +30 -0
  38. data/tests/helper.rb +400 -44
  39. data/tests/leak_trace.rb +237 -0
  40. data/tests/mem_check.rb +3 -0
  41. data/tests/tc_curl.rb +31 -1
  42. data/tests/tc_curl_download.rb +98 -7
  43. data/tests/tc_curl_easy.rb +985 -66
  44. data/tests/tc_curl_easy_cookielist.rb +277 -0
  45. data/tests/tc_curl_easy_request_target.rb +41 -0
  46. data/tests/tc_curl_easy_resolve.rb +48 -0
  47. data/tests/tc_curl_maxfilesize.rb +212 -0
  48. data/tests/tc_curl_multi.rb +1111 -51
  49. data/tests/tc_curl_native_coverage.rb +145 -0
  50. data/tests/tc_curl_network_policy.rb +1475 -0
  51. data/tests/tc_curl_postfield.rb +207 -30
  52. data/tests/tc_curl_protocols.rb +388 -0
  53. data/tests/tc_fiber_scheduler.rb +584 -0
  54. data/tests/tc_ftp_options.rb +39 -0
  55. data/tests/tc_gc_compact.rb +223 -0
  56. data/tests/tc_test_server_methods.rb +110 -0
  57. data/tests/timeout.rb +30 -6
  58. metadata +66 -31
  59. data/README +0 -194
data/ext/curb.c CHANGED
@@ -143,12 +143,14 @@ static VALUE ruby_curl_asyncdns_q(VALUE mod) {
143
143
  * in RFC 2478). For libcurl versions < 7.10.8, always returns false.
144
144
  */
145
145
  static VALUE ruby_curl_spnego_q(VALUE mod) {
146
- #ifdef HAVE_CURL_VERSION_SPNEGO
147
146
  curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
148
- return((ver->features & CURL_VERSION_SPNEGO) ? Qtrue : Qfalse);
149
- #else
150
- return Qfalse;
147
+ #ifdef HAVE_CURL_VERSION_SPNEGO
148
+ if (ver->features & CURL_VERSION_SPNEGO) return Qtrue;
151
149
  #endif
150
+ #ifdef HAVE_CURL_VERSION_GSSNEGOTIATE
151
+ if (ver->features & CURL_VERSION_GSSNEGOTIATE) return Qtrue;
152
+ #endif
153
+ return Qfalse;
152
154
  }
153
155
 
154
156
  /*
@@ -219,12 +221,32 @@ static VALUE ruby_curl_conv_q(VALUE mod) {
219
221
  #endif
220
222
  }
221
223
 
224
+ /*
225
+ * call-seq:
226
+ * Curl.http2? => true or false
227
+ *
228
+ * Returns true if the installed libcurl was built with support for HTTP2.
229
+ * For libcurl versions < 7.33.0, always returns false.
230
+ */
231
+ static VALUE ruby_curl_http2_q(VALUE mod) {
232
+ #ifdef HAVE_CURL_VERSION_HTTP2
233
+ curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
234
+ return((ver->features & CURL_VERSION_HTTP2) ? Qtrue : Qfalse);
235
+ #else
236
+ return Qfalse;
237
+ #endif
238
+ }
239
+
240
+ static void finalize_curb_core(VALUE data) {
241
+ curl_global_cleanup();
242
+ }
243
+
222
244
  void Init_curb_core() {
223
- // TODO we need to call curl_global_cleanup at exit!
224
245
  curl_version_info_data *ver;
225
246
  VALUE curlver, curllongver, curlvernum;
226
247
 
227
248
  curl_global_init(CURL_GLOBAL_ALL);
249
+ rb_set_end_proc(finalize_curb_core, Qnil);
228
250
  ver = curl_version_info(CURLVERSION_NOW);
229
251
 
230
252
  mCurl = rb_define_module("Curl");
@@ -242,306 +264,416 @@ void Init_curb_core() {
242
264
  rb_define_const(mCurl, "CURL_LONG_VERSION", curllongver);
243
265
 
244
266
  /* Passed to on_debug handler to indicate that the data is informational text. */
245
- rb_define_const(mCurl, "CURLINFO_TEXT", INT2FIX(CURLINFO_TEXT));
267
+ rb_define_const(mCurl, "CURLINFO_TEXT", LONG2NUM(CURLINFO_TEXT));
246
268
 
247
269
  /* Passed to on_debug handler to indicate that the data is header (or header-like) data received from the peer. */
248
- rb_define_const(mCurl, "CURLINFO_HEADER_IN", INT2FIX(CURLINFO_HEADER_IN));
270
+ rb_define_const(mCurl, "CURLINFO_HEADER_IN", LONG2NUM(CURLINFO_HEADER_IN));
249
271
 
250
272
  /* Passed to on_debug handler to indicate that the data is header (or header-like) data sent to the peer. */
251
- rb_define_const(mCurl, "CURLINFO_HEADER_OUT", INT2FIX(CURLINFO_HEADER_OUT));
273
+ rb_define_const(mCurl, "CURLINFO_HEADER_OUT", LONG2NUM(CURLINFO_HEADER_OUT));
252
274
 
253
275
  /* Passed to on_debug handler to indicate that the data is protocol data received from the peer. */
254
- rb_define_const(mCurl, "CURLINFO_DATA_IN", INT2FIX(CURLINFO_DATA_IN));
276
+ rb_define_const(mCurl, "CURLINFO_DATA_IN", LONG2NUM(CURLINFO_DATA_IN));
255
277
 
256
278
  /* Passed to on_debug handler to indicate that the data is protocol data sent to the peer. */
257
- rb_define_const(mCurl, "CURLINFO_DATA_OUT", INT2FIX(CURLINFO_DATA_OUT));
279
+ rb_define_const(mCurl, "CURLINFO_DATA_OUT", LONG2NUM(CURLINFO_DATA_OUT));
258
280
 
259
- #ifdef HAVE_CURLFTPMETHOD_MULTICWD
260
- rb_define_const(mCurl, "CURL_MULTICWD", INT2FIX(CURLFTPMETHOD_MULTICWD));
281
+ #ifdef HAVE_CURLFTPMETHOD_MULTICWD
282
+ rb_define_const(mCurl, "CURL_MULTICWD", LONG2NUM(CURLFTPMETHOD_MULTICWD));
261
283
  #endif
262
284
 
263
- #ifdef HAVE_CURLFTPMETHOD_NOCWD
264
- rb_define_const(mCurl, "CURL_NOCWD", INT2FIX(CURLFTPMETHOD_NOCWD));
285
+ #ifdef HAVE_CURLFTPMETHOD_NOCWD
286
+ rb_define_const(mCurl, "CURL_NOCWD", LONG2NUM(CURLFTPMETHOD_NOCWD));
265
287
  #endif
266
288
 
267
- #ifdef HAVE_CURLFTPMETHOD_SINGLECWD
268
- rb_define_const(mCurl, "CURL_SINGLECWD", INT2FIX(CURLFTPMETHOD_SINGLECWD));
289
+ #ifdef HAVE_CURLFTPMETHOD_SINGLECWD
290
+ rb_define_const(mCurl, "CURL_SINGLECWD", LONG2NUM(CURLFTPMETHOD_SINGLECWD));
269
291
  #endif
270
292
 
271
293
  /* When passed to Curl::Easy#proxy_type , indicates that the proxy is an HTTP proxy. (libcurl >= 7.10) */
272
294
  #ifdef HAVE_CURLPROXY_HTTP
273
- rb_define_const(mCurl, "CURLPROXY_HTTP", INT2FIX(CURLPROXY_HTTP));
295
+ rb_define_const(mCurl, "CURLPROXY_HTTP", LONG2NUM(CURLPROXY_HTTP));
274
296
  #else
275
- rb_define_const(mCurl, "CURLPROXY_HTTP", INT2FIX(-1));
297
+ rb_define_const(mCurl, "CURLPROXY_HTTP", LONG2NUM(-1));
276
298
  #endif
277
299
 
278
300
  #ifdef CURL_VERSION_SSL
279
- rb_define_const(mCurl, "CURL_SSLVERSION_DEFAULT", INT2FIX(CURL_SSLVERSION_DEFAULT));
280
- rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1", INT2FIX(CURL_SSLVERSION_TLSv1));
281
- rb_define_const(mCurl, "CURL_SSLVERSION_SSLv2", INT2FIX(CURL_SSLVERSION_SSLv2));
282
- rb_define_const(mCurl, "CURL_SSLVERSION_SSLv3", INT2FIX(CURL_SSLVERSION_SSLv3));
283
-
284
- rb_define_const(mCurl, "CURL_USESSL_CONTROL", INT2FIX(CURB_FTPSSL_CONTROL));
285
- rb_define_const(mCurl, "CURL_USESSL_NONE", INT2FIX(CURB_FTPSSL_NONE));
286
- rb_define_const(mCurl, "CURL_USESSL_TRY", INT2FIX(CURB_FTPSSL_TRY));
287
- rb_define_const(mCurl, "CURL_USESSL_ALL", INT2FIX(CURB_FTPSSL_ALL));
301
+ rb_define_const(mCurl, "CURL_SSLVERSION_DEFAULT", LONG2NUM(CURL_SSLVERSION_DEFAULT));
302
+ rb_define_const(mCurl, "CURL_SSLVERSION_MAX_DEFAULT", LONG2NUM(CURL_SSLVERSION_MAX_DEFAULT));
303
+ rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1", LONG2NUM(CURL_SSLVERSION_TLSv1));
304
+ rb_define_const(mCurl, "CURL_SSLVERSION_SSLv2", LONG2NUM(CURL_SSLVERSION_SSLv2));
305
+ rb_define_const(mCurl, "CURL_SSLVERSION_SSLv3", LONG2NUM(CURL_SSLVERSION_SSLv3));
306
+ #ifdef HAVE_CURL_SSLVERSION_TLSV1_0
307
+ rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_0", LONG2NUM(CURL_SSLVERSION_TLSv1_0));
308
+ rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_0", LONG2NUM(CURL_SSLVERSION_MAX_TLSv1_0));
309
+ #endif
310
+ #ifdef HAVE_CURL_SSLVERSION_TLSV1_1
311
+ rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_1", LONG2NUM(CURL_SSLVERSION_TLSv1_1));
312
+ rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_1", LONG2NUM(CURL_SSLVERSION_MAX_TLSv1_1));
313
+ #endif
314
+ #ifdef HAVE_CURL_SSLVERSION_TLSV1_2
315
+ rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_2", LONG2NUM(CURL_SSLVERSION_TLSv1_2));
316
+ rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_2", LONG2NUM(CURL_SSLVERSION_MAX_TLSv1_2));
317
+ #endif
318
+ #ifdef HAVE_CURL_SSLVERSION_TLSV1_3
319
+ rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_3", LONG2NUM(CURL_SSLVERSION_TLSv1_3));
320
+ rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_3", LONG2NUM(CURL_SSLVERSION_MAX_TLSv1_3));
321
+ #endif
322
+
323
+ rb_define_const(mCurl, "CURL_USESSL_CONTROL", LONG2NUM(CURB_FTPSSL_CONTROL));
324
+ rb_define_const(mCurl, "CURL_USESSL_NONE", LONG2NUM(CURB_FTPSSL_NONE));
325
+ rb_define_const(mCurl, "CURL_USESSL_TRY", LONG2NUM(CURB_FTPSSL_TRY));
326
+ rb_define_const(mCurl, "CURL_USESSL_ALL", LONG2NUM(CURB_FTPSSL_ALL));
288
327
  #else
289
- rb_define_const(mCurl, "CURL_SSLVERSION_DEFAULT", INT2FIX(-1));
290
- rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1", INT2FIX(-1));
291
- rb_define_const(mCurl, "CURL_SSLVERSION_SSLv2", INT2FIX(-1));
292
- rb_define_const(mCurl, "CURL_SSLVERSION_SSLv3", INT2FIX(-1));
328
+ rb_define_const(mCurl, "CURL_SSLVERSION_DEFAULT", LONG2NUM(-1));
329
+ rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1", LONG2NUM(-1));
330
+ rb_define_const(mCurl, "CURL_SSLVERSION_SSLv2", LONG2NUM(-1));
331
+ rb_define_const(mCurl, "CURL_SSLVERSION_SSLv3", LONG2NUM(-1));
332
+ #ifdef HAVE_CURL_SSLVERSION_TLSv1_0
333
+ rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_0", LONG2NUM(-1));
334
+ rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_0", LONG2NUM(-1));
335
+ #endif
336
+ #ifdef HAVE_CURL_SSLVERSION_TLSv1_1
337
+ rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_1", LONG2NUM(-1));
338
+ rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_1", LONG2NUM(-1));
339
+ #endif
340
+ #ifdef HAVE_CURL_SSLVERSION_TLSv1_2
341
+ rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_2", LONG2NUM(-1));
342
+ rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_2", LONG2NUM(-1));
343
+ #endif
344
+ #ifdef HAVE_CURL_SSLVERSION_TLSv1_3
345
+ rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_3", LONG2NUM(-1));
346
+ rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_3", LONG2NUM(-1));
347
+ #endif
293
348
 
294
- rb_define_const(mCurl, "CURL_USESSL_CONTROL", INT2FIX(-1));
295
- rb_define_const(mCurl, "CURL_USESSL_NONE", INT2FIX(-1));
296
- rb_define_const(mCurl, "CURL_USESSL_TRY", INT2FIX(-1));
297
- rb_define_const(mCurl, "CURL_USESSL_ALL", INT2FIX(-1));
349
+ rb_define_const(mCurl, "CURL_USESSL_CONTROL", LONG2NUM(-1));
350
+ rb_define_const(mCurl, "CURL_USESSL_NONE", LONG2NUM(-1));
351
+ rb_define_const(mCurl, "CURL_USESSL_TRY", LONG2NUM(-1));
352
+ rb_define_const(mCurl, "CURL_USESSL_ALL", LONG2NUM(-1));
298
353
  #endif
299
354
 
300
355
  /* When passed to Curl::Easy#proxy_type , indicates that the proxy is a SOCKS4 proxy. (libcurl >= 7.15.2) */
301
356
  #ifdef HAVE_CURLPROXY_SOCKS4
302
- rb_define_const(mCurl, "CURLPROXY_SOCKS4", INT2FIX(CURLPROXY_SOCKS4));
357
+ rb_define_const(mCurl, "CURLPROXY_SOCKS4", LONG2NUM(CURLPROXY_SOCKS4));
303
358
  #else
304
- rb_define_const(mCurl, "CURLPROXY_SOCKS4", INT2FIX(-2));
359
+ rb_define_const(mCurl, "CURLPROXY_SOCKS4", LONG2NUM(-2));
360
+ #endif
361
+
362
+ /* When passed to Curl::Easy#proxy_type , indicates that the proxy is a SOCKS4A proxy. (libcurl >= 7.18.0) */
363
+ #ifdef HAVE_CURLPROXY_SOCKS4A
364
+ rb_define_const(mCurl, "CURLPROXY_SOCKS4A", LONG2NUM(CURLPROXY_SOCKS4A));
365
+ #else
366
+ rb_define_const(mCurl, "CURLPROXY_SOCKS4A", LONG2NUM(-2));
305
367
  #endif
306
368
 
307
369
  /* When passed to Curl::Easy#proxy_type , indicates that the proxy is a SOCKS5 proxy. (libcurl >= 7.10) */
308
370
  #ifdef HAVE_CURLPROXY_SOCKS5
309
- rb_define_const(mCurl, "CURLPROXY_SOCKS5", INT2FIX(CURLPROXY_SOCKS5));
371
+ rb_define_const(mCurl, "CURLPROXY_SOCKS5", LONG2NUM(CURLPROXY_SOCKS5));
310
372
  #else
311
- rb_define_const(mCurl, "CURLPROXY_SOCKS5", INT2FIX(-2));
373
+ rb_define_const(mCurl, "CURLPROXY_SOCKS5", LONG2NUM(-2));
374
+ #endif
375
+
376
+ /* When passed to Curl::Easy#proxy_type , indicates that the proxy is a SOCKS5 proxy (and that the proxy should resolve the hostname). (libcurl >= 7.17.2) */
377
+ #ifdef HAVE_CURLPROXY_SOCKS5_HOSTNAME
378
+ rb_define_const(mCurl, "CURLPROXY_SOCKS5_HOSTNAME", LONG2NUM(CURLPROXY_SOCKS5_HOSTNAME));
379
+ #else
380
+ rb_define_const(mCurl, "CURLPROXY_SOCKS5_HOSTNAME", LONG2NUM(-2));
312
381
  #endif
313
382
 
314
383
  /* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, directs libcurl to use Basic authentication. */
315
384
  #ifdef HAVE_CURLAUTH_BASIC
316
- rb_define_const(mCurl, "CURLAUTH_BASIC", INT2FIX(CURLAUTH_BASIC));
385
+ rb_define_const(mCurl, "CURLAUTH_BASIC", LONG2NUM(CURLAUTH_BASIC));
317
386
  #else
318
- rb_define_const(mCurl, "CURLAUTH_BASIC", INT2FIX(0));
387
+ rb_define_const(mCurl, "CURLAUTH_BASIC", LONG2NUM(0));
319
388
  #endif
320
389
 
321
390
  /* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, directs libcurl to use Digest authentication. */
322
391
  #ifdef HAVE_CURLAUTH_DIGEST
323
- rb_define_const(mCurl, "CURLAUTH_DIGEST", INT2FIX(CURLAUTH_DIGEST));
392
+ rb_define_const(mCurl, "CURLAUTH_DIGEST", LONG2NUM(CURLAUTH_DIGEST));
324
393
  #else
325
- rb_define_const(mCurl, "CURLAUTH_DIGEST", INT2FIX(0));
394
+ rb_define_const(mCurl, "CURLAUTH_DIGEST", LONG2NUM(0));
326
395
  #endif
327
396
 
328
397
  /* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, directs libcurl to use GSS Negotiate authentication. Requires a suitable GSS-API library. */
329
398
  #ifdef HAVE_CURLAUTH_GSSNEGOTIATE
330
- rb_define_const(mCurl, "CURLAUTH_GSSNEGOTIATE", INT2FIX(CURLAUTH_GSSNEGOTIATE));
399
+ rb_define_const(mCurl, "CURLAUTH_GSSNEGOTIATE", LONG2NUM(CURLAUTH_GSSNEGOTIATE));
331
400
  #else
332
- rb_define_const(mCurl, "CURLAUTH_GSSNEGOTIATE", INT2FIX(0));
401
+ rb_define_const(mCurl, "CURLAUTH_GSSNEGOTIATE", LONG2NUM(0));
333
402
  #endif
334
403
 
335
404
  /* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, directs libcurl to use HTTP NTLM authentication. Requires MS Windows or OpenSSL support. */
336
405
  #ifdef HAVE_CURLAUTH_NTLM
337
- rb_define_const(mCurl, "CURLAUTH_NTLM", INT2FIX(CURLAUTH_NTLM));
406
+ rb_define_const(mCurl, "CURLAUTH_NTLM", LONG2NUM(CURLAUTH_NTLM));
338
407
  #else
339
- rb_define_const(mCurl, "CURLAUTH_NTLM", INT2FIX(0));
408
+ rb_define_const(mCurl, "CURLAUTH_NTLM", LONG2NUM(0));
340
409
  #endif
341
410
 
342
411
  /* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, allows libcurl to select any suitable authentication method except basic. */
343
412
  #ifdef HAVE_CURLAUTH_ANYSAFE
344
- rb_define_const(mCurl, "CURLAUTH_ANYSAFE", INT2FIX(CURLAUTH_ANYSAFE));
413
+ rb_define_const(mCurl, "CURLAUTH_ANYSAFE", LONG2NUM(CURLAUTH_ANYSAFE));
345
414
  #else
346
- rb_define_const(mCurl, "CURLAUTH_ANYSAFE", INT2FIX(0));
415
+ rb_define_const(mCurl, "CURLAUTH_ANYSAFE", LONG2NUM(0));
347
416
  #endif
348
417
 
349
418
  /* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, allows libcurl to select any suitable authentication method. */
350
419
  #ifdef HAVE_CURLAUTH_ANY
351
- rb_define_const(mCurl, "CURLAUTH_ANY", INT2FIX(CURLAUTH_ANY));
420
+ rb_define_const(mCurl, "CURLAUTH_ANY", LONG2NUM(CURLAUTH_ANY));
352
421
  #else
353
- rb_define_const(mCurl, "CURLAUTH_ANY", INT2FIX(0));
422
+ rb_define_const(mCurl, "CURLAUTH_ANY", LONG2NUM(0));
354
423
  #endif
355
424
 
356
425
  CURB_DEFINE(CURLOPT_VERBOSE);
357
426
  CURB_DEFINE(CURLOPT_HEADER);
358
427
  CURB_DEFINE(CURLOPT_NOPROGRESS);
359
428
  CURB_DEFINE(CURLOPT_NOSIGNAL);
429
+ #ifdef HAVE_CURLOPT_PATH_AS_IS
430
+ CURB_DEFINE(CURLOPT_PATH_AS_IS);
431
+ #endif
360
432
  CURB_DEFINE(CURLOPT_WRITEFUNCTION);
361
433
  CURB_DEFINE(CURLOPT_WRITEDATA);
362
434
  CURB_DEFINE(CURLOPT_READFUNCTION);
363
435
  CURB_DEFINE(CURLOPT_READDATA);
436
+ /* CURLOPT_IOCTLFUNCTION/DATA deprecated since 7.18.0, use SEEKFUNCTION/DATA */
437
+ #ifdef HAVE_CURLOPT_IOCTLFUNCTION
364
438
  CURB_DEFINE(CURLOPT_IOCTLFUNCTION);
439
+ #endif
440
+ #ifdef HAVE_CURLOPT_IOCTLDATA
365
441
  CURB_DEFINE(CURLOPT_IOCTLDATA);
366
- #if HAVE_CURLOPT_SEEKFUNCTION
442
+ #endif
443
+ #ifdef HAVE_CURLOPT_SEEKFUNCTION
367
444
  CURB_DEFINE(CURLOPT_SEEKFUNCTION);
368
445
  #endif
369
- #if HAVE_CURLOPT_SEEKDATA
446
+ #ifdef HAVE_CURLOPT_SEEKDATA
370
447
  CURB_DEFINE(CURLOPT_SEEKDATA);
371
448
  #endif
372
- #if HAVE_CURLOPT_SOCKOPTFUNCTION
449
+ #ifdef HAVE_CURLOPT_SOCKOPTFUNCTION
373
450
  CURB_DEFINE(CURLOPT_SOCKOPTFUNCTION);
374
451
  #endif
375
- #if HAVE_CURLOPT_SOCKOPTDATA
452
+ #ifdef HAVE_CURLOPT_SOCKOPTDATA
376
453
  CURB_DEFINE(CURLOPT_SOCKOPTDATA);
377
454
  #endif
378
- #if HAVE_CURLOPT_OPENSOCKETFUNCTION
455
+ #ifdef HAVE_CURLOPT_OPENSOCKETFUNCTION
379
456
  CURB_DEFINE(CURLOPT_OPENSOCKETFUNCTION);
380
457
  #endif
381
- #if HAVE_CURLOPT_OPENSOCKETDATA
458
+ #ifdef HAVE_CURLOPT_OPENSOCKETDATA
382
459
  CURB_DEFINE(CURLOPT_OPENSOCKETDATA);
383
460
  #endif
461
+ #ifdef HAVE_CURLOPT_PREREQFUNCTION
462
+ CURB_DEFINE(CURLOPT_PREREQFUNCTION);
463
+ #endif
464
+ #ifdef HAVE_CURLOPT_PREREQDATA
465
+ CURB_DEFINE(CURLOPT_PREREQDATA);
466
+ #endif
467
+ /* CURLOPT_PROGRESSFUNCTION deprecated since 7.32.0, use XFERINFOFUNCTION */
468
+ #ifdef HAVE_CURLOPT_PROGRESSFUNCTION
384
469
  CURB_DEFINE(CURLOPT_PROGRESSFUNCTION);
470
+ #endif
471
+ #ifdef HAVE_CURLOPT_PROGRESSDATA
385
472
  CURB_DEFINE(CURLOPT_PROGRESSDATA);
473
+ #endif
474
+ #ifdef HAVE_CURLOPT_XFERINFOFUNCTION
475
+ CURB_DEFINE(CURLOPT_XFERINFOFUNCTION);
476
+ #endif
477
+ #ifdef HAVE_CURLOPT_XFERINFODATA
478
+ CURB_DEFINE(CURLOPT_XFERINFODATA);
479
+ #endif
386
480
  CURB_DEFINE(CURLOPT_HEADERFUNCTION);
387
481
  CURB_DEFINE(CURLOPT_WRITEHEADER);
388
482
  CURB_DEFINE(CURLOPT_DEBUGFUNCTION);
389
483
  CURB_DEFINE(CURLOPT_DEBUGDATA);
390
484
  CURB_DEFINE(CURLOPT_SSL_CTX_FUNCTION);
391
485
  CURB_DEFINE(CURLOPT_SSL_CTX_DATA);
486
+ /* CURLOPT_CONV_* deprecated since 7.82.0, serve no purpose anymore */
487
+ #ifdef HAVE_CURLOPT_CONV_TO_NETWORK_FUNCTION
392
488
  CURB_DEFINE(CURLOPT_CONV_TO_NETWORK_FUNCTION);
489
+ #endif
490
+ #ifdef HAVE_CURLOPT_CONV_FROM_NETWORK_FUNCTION
393
491
  CURB_DEFINE(CURLOPT_CONV_FROM_NETWORK_FUNCTION);
492
+ #endif
493
+ #ifdef HAVE_CURLOPT_CONV_FROM_UTF8_FUNCTION
394
494
  CURB_DEFINE(CURLOPT_CONV_FROM_UTF8_FUNCTION);
495
+ #endif
395
496
 
396
- #if HAVE_CURLOPT_INTERLEAVEFUNCTION
497
+ #ifdef HAVE_CURLOPT_INTERLEAVEFUNCTION
397
498
  CURB_DEFINE(CURLOPT_INTERLEAVEFUNCTION);
398
499
  #endif
399
- #if HAVE_CURLOPT_INTERLEAVEDATA
500
+ #ifdef HAVE_CURLOPT_INTERLEAVEDATA
400
501
  CURB_DEFINE(CURLOPT_INTERLEAVEDATA);
401
502
  #endif
402
- #if HAVE_CURLOPT_CHUNK_BGN_FUNCTION
503
+ #ifdef HAVE_CURLOPT_CHUNK_BGN_FUNCTION
403
504
  CURB_DEFINE(CURLOPT_CHUNK_BGN_FUNCTION);
404
505
  #endif
405
- #if HAVE_CURLOPT_CHUNK_END_FUNCTION
506
+ #ifdef HAVE_CURLOPT_CHUNK_END_FUNCTION
406
507
  CURB_DEFINE(CURLOPT_CHUNK_END_FUNCTION);
407
508
  #endif
408
- #if HAVE_CURLOPT_CHUNK_DATA
509
+ #ifdef HAVE_CURLOPT_CHUNK_DATA
409
510
  CURB_DEFINE(CURLOPT_CHUNK_DATA);
410
511
  #endif
411
- #if HAVE_CURLOPT_FNMATCH_FUNCTION
512
+ #ifdef HAVE_CURLOPT_FNMATCH_FUNCTION
412
513
  CURB_DEFINE(CURLOPT_FNMATCH_FUNCTION);
413
514
  #endif
414
- #if HAVE_CURLOPT_FNMATCH_DATA
515
+ #ifdef HAVE_CURLOPT_FNMATCH_DATA
415
516
  CURB_DEFINE(CURLOPT_FNMATCH_DATA);
416
517
  #endif
417
- #if HAVE_CURLOPT_ERRORBUFFER
518
+ #ifdef HAVE_CURLOPT_ERRORBUFFER
418
519
  CURB_DEFINE(CURLOPT_ERRORBUFFER);
419
520
  #endif
420
- #if HAVE_CURLOPT_STDERR
521
+ #ifdef HAVE_CURLOPT_STDERR
421
522
  CURB_DEFINE(CURLOPT_STDERR);
422
523
  #endif
423
- #if HAVE_CURLOPT_FAILONERROR
524
+ #ifdef HAVE_CURLOPT_FAILONERROR
424
525
  CURB_DEFINE(CURLOPT_FAILONERROR);
425
526
  #endif
426
527
  CURB_DEFINE(CURLOPT_URL);
427
- #if HAVE_CURLOPT_PROTOCOLS
528
+ /* CURLOPT_PROTOCOLS deprecated since 7.85.0, use CURLOPT_PROTOCOLS_STR */
529
+ #ifdef HAVE_CURLOPT_PROTOCOLS
428
530
  CURB_DEFINE(CURLOPT_PROTOCOLS);
429
531
  #endif
430
- #if HAVE_CURLOPT_REDIR_PROTOCOLS
532
+ #ifdef HAVE_CURLOPT_PROTOCOLS_STR
533
+ CURB_DEFINE(CURLOPT_PROTOCOLS_STR);
534
+ #endif
535
+ /* CURLOPT_REDIR_PROTOCOLS deprecated since 7.85.0, use CURLOPT_REDIR_PROTOCOLS_STR */
536
+ #ifdef HAVE_CURLOPT_REDIR_PROTOCOLS
431
537
  CURB_DEFINE(CURLOPT_REDIR_PROTOCOLS);
538
+ #endif
539
+ #ifdef HAVE_CURLOPT_REDIR_PROTOCOLS_STR
540
+ CURB_DEFINE(CURLOPT_REDIR_PROTOCOLS_STR);
432
541
  #endif
433
542
  CURB_DEFINE(CURLOPT_PROXY);
434
543
  CURB_DEFINE(CURLOPT_PROXYPORT);
435
- #if HAVE_CURLOPT_PROXYTYPE
544
+ #ifdef HAVE_CURLOPT_PROXYTYPE
436
545
  CURB_DEFINE(CURLOPT_PROXYTYPE);
437
546
  #endif
438
- #if HAVE_CURLOPT_NOPROXY
547
+ #ifdef HAVE_CURLOPT_NOPROXY
439
548
  CURB_DEFINE(CURLOPT_NOPROXY);
440
549
  #endif
441
550
  CURB_DEFINE(CURLOPT_HTTPPROXYTUNNEL);
442
- #if HAVE_CURLOPT_SOCKS5_GSSAPI_SERVICE
551
+ /* CURLOPT_SOCKS5_GSSAPI_SERVICE deprecated since 7.49.0, use CURLOPT_PROXY_SERVICE_NAME */
552
+ #ifdef HAVE_CURLOPT_SOCKS5_GSSAPI_SERVICE
443
553
  CURB_DEFINE(CURLOPT_SOCKS5_GSSAPI_SERVICE);
444
554
  #endif
445
- #if HAVE_CURLOPT_SOCKS5_GSSAPI_NEC
555
+ #ifdef HAVE_CURLOPT_PROXY_SERVICE_NAME
556
+ CURB_DEFINE(CURLOPT_PROXY_SERVICE_NAME);
557
+ #endif
558
+ #ifdef HAVE_CURLOPT_SOCKS5_GSSAPI_NEC
446
559
  CURB_DEFINE(CURLOPT_SOCKS5_GSSAPI_NEC);
447
560
  #endif
448
561
  CURB_DEFINE(CURLOPT_INTERFACE);
449
- #if HAVE_CURLOPT_LOCALPORT
562
+ #ifdef HAVE_CURLOPT_LOCALPORT
450
563
  CURB_DEFINE(CURLOPT_LOCALPORT);
451
564
  #endif
452
565
  CURB_DEFINE(CURLOPT_DNS_CACHE_TIMEOUT);
566
+ #ifdef HAVE_CURLOPT_DNS_SERVERS
567
+ CURB_DEFINE(CURLOPT_DNS_SERVERS);
568
+ #endif
569
+ /* CURLOPT_DNS_USE_GLOBAL_CACHE deprecated since 7.11.1, does nothing since 7.62.0 */
570
+ #ifdef HAVE_CURLOPT_DNS_USE_GLOBAL_CACHE
453
571
  CURB_DEFINE(CURLOPT_DNS_USE_GLOBAL_CACHE);
572
+ #endif
454
573
  CURB_DEFINE(CURLOPT_BUFFERSIZE);
455
574
  CURB_DEFINE(CURLOPT_PORT);
456
575
  CURB_DEFINE(CURLOPT_TCP_NODELAY);
457
- #if HAVE_CURLOPT_ADDRESS_SCOPE
576
+ #ifdef HAVE_CURLOPT_ADDRESS_SCOPE
458
577
  CURB_DEFINE(CURLOPT_ADDRESS_SCOPE);
459
578
  #endif
460
579
  CURB_DEFINE(CURLOPT_NETRC);
461
580
  CURB_DEFINE(CURL_NETRC_OPTIONAL);
462
581
  CURB_DEFINE(CURL_NETRC_IGNORED);
463
582
  CURB_DEFINE(CURL_NETRC_REQUIRED);
464
- #if HAVE_CURLOPT_NETRC_FILE
583
+ #ifdef HAVE_CURLOPT_NETRC_FILE
465
584
  CURB_DEFINE(CURLOPT_NETRC_FILE);
466
585
  #endif
467
586
  CURB_DEFINE(CURLOPT_USERPWD);
468
587
  CURB_DEFINE(CURLOPT_PROXYUSERPWD);
469
- #if HAVE_CURLOPT_USERNAME
588
+ #ifdef HAVE_CURLOPT_USERNAME
470
589
  CURB_DEFINE(CURLOPT_USERNAME);
471
590
  #endif
472
- #if HAVE_CURLOPT_PASSWORD
591
+ #ifdef HAVE_CURLOPT_PASSWORD
473
592
  CURB_DEFINE(CURLOPT_PASSWORD);
474
593
  #endif
475
- #if HAVE_CURLOPT_PROXYUSERNAME
594
+ #ifdef HAVE_CURLOPT_PROXYUSERNAME
476
595
  CURB_DEFINE(CURLOPT_PASSWORD);
477
596
  #endif
478
- #if HAVE_CURLOPT_PROXYPASSWORD
597
+ #ifdef HAVE_CURLOPT_PROXYPASSWORD
479
598
  CURB_DEFINE(CURLOPT_PASSWORD);
480
599
  #endif
481
600
 
482
- #if HAVE_CURLOPT_HTTPAUTH
601
+ #ifdef HAVE_CURLOPT_HTTPAUTH
483
602
  CURB_DEFINE(CURLOPT_HTTPAUTH);
484
603
  #endif
485
- #if HAVE_CURLAUTH_DIGEST_IE
604
+ #ifdef HAVE_CURLAUTH_DIGEST_IE
486
605
  CURB_DEFINE(CURLAUTH_DIGEST_IE);
487
606
  #endif
488
- #if HAVE_CURLAUTH_ONLY
607
+ #ifdef HAVE_CURLAUTH_ONLY
489
608
  CURB_DEFINE(CURLAUTH_ONLY);
490
609
  #endif
491
- #if HAVE_CURLOPT_TLSAUTH_TYPE
610
+ #ifdef HAVE_CURLOPT_TLSAUTH_TYPE
492
611
  CURB_DEFINE(CURLOPT_TLSAUTH_TYPE);
493
612
  #endif
494
- #if HAVE_CURLOPT_TLSAUTH_SRP
613
+ #ifdef HAVE_CURLOPT_TLSAUTH_SRP
495
614
  CURB_DEFINE(CURLOPT_TLSAUTH_SRP);
496
615
  #endif
497
- #if HAVE_CURLOPT_TLSAUTH_USERNAME
616
+ #ifdef HAVE_CURLOPT_TLSAUTH_USERNAME
498
617
  CURB_DEFINE(CURLOPT_TLSAUTH_USERNAME);
499
618
  #endif
500
- #if HAVE_CURLOPT_TLSAUTH_PASSWORD
619
+ #ifdef HAVE_CURLOPT_TLSAUTH_PASSWORD
501
620
  CURB_DEFINE(CURLOPT_TLSAUTH_PASSWORD);
502
621
  #endif
503
- #if HAVE_CURLOPT_PROXYAUTH
622
+ #ifdef HAVE_CURLOPT_PROXYAUTH
504
623
  CURB_DEFINE(CURLOPT_PROXYAUTH);
505
624
  #endif
506
- #if HAVE_CURLOPT_AUTOREFERER
625
+ #ifdef HAVE_CURLOPT_AUTOREFERER
507
626
  CURB_DEFINE(CURLOPT_AUTOREFERER);
508
627
  #endif
509
- #if HAVE_CURLOPT_ENCODING
628
+ #ifdef HAVE_CURLOPT_ENCODING
510
629
  CURB_DEFINE(CURLOPT_ENCODING);
511
630
  #endif
512
- #if HAVE_CURLOPT_FOLLOWLOCATION
631
+ #ifdef HAVE_CURLOPT_FOLLOWLOCATION
513
632
  CURB_DEFINE(CURLOPT_FOLLOWLOCATION);
514
633
  #endif
515
- #if HAVE_CURLOPT_UNRESTRICTED_AUTH
634
+ #ifdef HAVE_CURLOPT_UNRESTRICTED_AUTH
516
635
  CURB_DEFINE(CURLOPT_UNRESTRICTED_AUTH);
517
636
  #endif
518
- #if HAVE_CURLOPT_MAXREDIRS
637
+ #ifdef HAVE_CURLOPT_MAXREDIRS
519
638
  CURB_DEFINE(CURLOPT_MAXREDIRS);
520
639
  #endif
521
- #if HAVE_CURLOPT_POSTREDIR
640
+ #ifdef HAVE_CURLOPT_POSTREDIR
522
641
  CURB_DEFINE(CURLOPT_POSTREDIR);
523
642
  #endif
524
- #if HAVE_CURLOPT_PUT
643
+ /* CURLOPT_PUT deprecated since 7.12.1, use CURLOPT_UPLOAD */
644
+ #ifdef HAVE_CURLOPT_PUT
525
645
  CURB_DEFINE(CURLOPT_PUT);
526
646
  #endif
527
- #if HAVE_CURLOPT_POST
647
+ #ifdef HAVE_CURLOPT_POST
528
648
  CURB_DEFINE(CURLOPT_POST);
529
649
  #endif
530
650
  CURB_DEFINE(CURLOPT_POSTFIELDS);
531
651
  CURB_DEFINE(CURLOPT_POSTFIELDSIZE);
532
- #if HAVE_CURLOPT_POSTFIELDSIZE_LARGE
652
+ #ifdef HAVE_CURLOPT_POSTFIELDSIZE_LARGE
533
653
  CURB_DEFINE(CURLOPT_POSTFIELDSIZE_LARGE);
534
654
  #endif
535
- #if HAVE_CURLOPT_COPYPOSTFIELDS
655
+ #ifdef HAVE_CURLOPT_COPYPOSTFIELDS
536
656
  CURB_DEFINE(CURLOPT_COPYPOSTFIELDS);
537
657
  #endif
538
- #if HAVE_CURLOPT_HTTPPOST
658
+ /* CURLOPT_HTTPPOST deprecated since 7.56.0, use CURLOPT_MIMEPOST */
659
+ #ifdef HAVE_CURLOPT_HTTPPOST
539
660
  CURB_DEFINE(CURLOPT_HTTPPOST);
661
+ #endif
662
+ #ifdef HAVE_CURLOPT_MIMEPOST
663
+ CURB_DEFINE(CURLOPT_MIMEPOST);
540
664
  #endif
541
665
  CURB_DEFINE(CURLOPT_REFERER);
542
666
  CURB_DEFINE(CURLOPT_USERAGENT);
543
667
  CURB_DEFINE(CURLOPT_HTTPHEADER);
544
- #if HAVE_CURLOPT_HTTP200ALIASES
668
+ #ifdef HAVE_CURLOPT_PROXYHEADER
669
+ CURB_DEFINE(CURLOPT_PROXYHEADER);
670
+ #endif
671
+ #ifdef HAVE_CURLOPT_REQUEST_TARGET
672
+ /* Allows overriding the Request-URI target used in the request line.
673
+ * Useful for absolute-form requests or special targets like "*". */
674
+ CURB_DEFINE(CURLOPT_REQUEST_TARGET);
675
+ #endif
676
+ #ifdef HAVE_CURLOPT_HTTP200ALIASES
545
677
  CURB_DEFINE(CURLOPT_HTTP200ALIASES);
546
678
  #endif
547
679
 
@@ -549,425 +681,622 @@ void Init_curb_core() {
549
681
  CURB_DEFINE(CURLOPT_COOKIEFILE);
550
682
  CURB_DEFINE(CURLOPT_COOKIEJAR);
551
683
 
552
- #if HAVE_CURLOPT_COOKIESESSION
684
+ #ifdef HAVE_CURLOPT_COOKIESESSION
553
685
  CURB_DEFINE(CURLOPT_COOKIESESSION);
554
686
  #endif
555
- #if HAVE_CURLOPT_COOKIELIST
687
+ #ifdef HAVE_CURLOPT_COOKIELIST
556
688
  CURB_DEFINE(CURLOPT_COOKIELIST);
557
689
  #endif
558
- #if HAVE_CURLOPT_HTTPGET
690
+ #ifdef HAVE_CURLOPT_HTTPGET
559
691
  CURB_DEFINE(CURLOPT_HTTPGET);
560
692
  #endif
561
693
  CURB_DEFINE(CURLOPT_HTTP_VERSION);
562
694
  CURB_DEFINE(CURL_HTTP_VERSION_NONE);
563
695
  CURB_DEFINE(CURL_HTTP_VERSION_1_0);
564
696
  CURB_DEFINE(CURL_HTTP_VERSION_1_1);
565
- #if HAVE_CURLOPT_IGNORE_CONTENT_LENGTH
697
+ #if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */
698
+ CURB_DEFINE(CURL_HTTP_VERSION_2_0);
699
+ #endif
700
+ #if LIBCURL_VERSION_NUM >= 0x072f00 /* 7.47.0 */
701
+ CURB_DEFINE(CURL_HTTP_VERSION_2TLS);
702
+ #endif
703
+ #ifdef HAVE_CURLOPT_IGNORE_CONTENT_LENGTH
566
704
  CURB_DEFINE(CURLOPT_IGNORE_CONTENT_LENGTH);
567
705
  #endif
568
- #if HAVE_CURLOPT_HTTP_CONTENT_DECODING
706
+ #ifdef HAVE_CURLOPT_HTTP_CONTENT_DECODING
569
707
  CURB_DEFINE(CURLOPT_HTTP_CONTENT_DECODING);
570
708
  #endif
571
- #if HAVE_CURLOPT_HTTP_TRANSFER_DECODING
709
+ #ifdef HAVE_CURLOPT_HTTP_TRANSFER_DECODING
572
710
  CURB_DEFINE(CURLOPT_HTTP_TRANSFER_DECODING);
573
711
  #endif
574
- #if HAVE_CURLOPT_MAIL_FROM
712
+ #ifdef HAVE_CURLOPT_MAIL_FROM
575
713
  CURB_DEFINE(CURLOPT_MAIL_FROM);
576
714
  #endif
577
- #if HAVE_CURLOPT_MAIL_RCPT
715
+ #ifdef HAVE_CURLOPT_MAIL_RCPT
578
716
  CURB_DEFINE(CURLOPT_MAIL_RCPT);
579
717
  #endif
580
- #if HAVE_CURLOPT_TFTP_BLKSIZE
718
+ #ifdef HAVE_CURLOPT_TFTP_BLKSIZE
581
719
  CURB_DEFINE(CURLOPT_TFTP_BLKSIZE);
582
720
  #endif
583
- #if HAVE_CURLOPT_FTPPORT
721
+ #ifdef HAVE_CURLOPT_FTPPORT
584
722
  CURB_DEFINE(CURLOPT_FTPPORT);
585
723
  #endif
586
- #if HAVE_CURLOPT_QUOTE
724
+ #ifdef HAVE_CURLOPT_QUOTE
587
725
  CURB_DEFINE(CURLOPT_QUOTE);
588
726
  #endif
589
- #if HAVE_CURLOPT_POSTQUOTE
727
+ #ifdef HAVE_CURLOPT_POSTQUOTE
590
728
  CURB_DEFINE(CURLOPT_POSTQUOTE);
591
729
  #endif
592
- #if HAVE_CURLOPT_PREQUOTE
730
+ #ifdef HAVE_CURLOPT_PREQUOTE
593
731
  CURB_DEFINE(CURLOPT_PREQUOTE);
594
732
  #endif
595
- #if HAVE_CURLOPT_DIRLISTONLY
733
+ #ifdef HAVE_CURLOPT_DIRLISTONLY
596
734
  CURB_DEFINE(CURLOPT_DIRLISTONLY);
597
735
  #endif
598
- #if HAVE_CURLOPT_APPEND
736
+ #ifdef HAVE_CURLOPT_APPEND
599
737
  CURB_DEFINE(CURLOPT_APPEND);
600
738
  #endif
601
- #if HAVE_CURLOPT_FTP_USE_EPRT
739
+ #ifdef HAVE_CURLOPT_FTP_USE_EPRT
602
740
  CURB_DEFINE(CURLOPT_FTP_USE_EPRT);
603
741
  #endif
604
- #if HAVE_CURLOPT_FTP_USE_EPSV
742
+ #ifdef HAVE_CURLOPT_FTP_USE_EPSV
605
743
  CURB_DEFINE(CURLOPT_FTP_USE_EPSV);
606
744
  #endif
607
- #if HAVE_CURLOPT_FTP_USE_PRET
745
+ #ifdef HAVE_CURLOPT_FTP_USE_PRET
608
746
  CURB_DEFINE(CURLOPT_FTP_USE_PRET);
609
747
  #endif
610
- #if HAVE_CURLOPT_FTP_CREATE_MISSING_DIRS
748
+ #ifdef HAVE_CURLOPT_FTP_CREATE_MISSING_DIRS
611
749
  CURB_DEFINE(CURLOPT_FTP_CREATE_MISSING_DIRS);
612
750
  #endif
613
- #if HAVE_CURLOPT_FTP_RESPONSE_TIMEOUT
751
+ #ifdef HAVE_CURLOPT_FTP_RESPONSE_TIMEOUT
614
752
  CURB_DEFINE(CURLOPT_FTP_RESPONSE_TIMEOUT);
615
753
  #endif
616
- #if HAVE_CURLOPT_FTP_ALTERNATIVE_TO_USER
754
+ #ifdef HAVE_CURLOPT_FTP_ALTERNATIVE_TO_USER
617
755
  CURB_DEFINE(CURLOPT_FTP_ALTERNATIVE_TO_USER);
618
756
  #endif
619
- #if HAVE_CURLOPT_FTP_SKIP_PASV_IP
757
+ #ifdef HAVE_CURLOPT_FTP_SKIP_PASV_IP
620
758
  CURB_DEFINE(CURLOPT_FTP_SKIP_PASV_IP);
621
759
  #endif
622
- #if HAVE_CURLOPT_FTPSSLAUTH
760
+ #ifdef HAVE_CURLOPT_FTPSSLAUTH
623
761
  CURB_DEFINE(CURLOPT_FTPSSLAUTH);
624
762
  #endif
625
- #if HAVE_CURLFTPAUTH_DEFAULT
763
+ #ifdef HAVE_CURLFTPAUTH_DEFAULT
626
764
  CURB_DEFINE(CURLFTPAUTH_DEFAULT);
627
765
  #endif
628
- #if HAVE_CURLFTPAUTH_SSL
766
+ #ifdef HAVE_CURLFTPAUTH_SSL
629
767
  CURB_DEFINE(CURLFTPAUTH_SSL);
630
768
  #endif
631
- #if HAVE_CURLFTPAUTH_TLS
769
+ #ifdef HAVE_CURLFTPAUTH_TLS
632
770
  CURB_DEFINE(CURLFTPAUTH_TLS);
633
771
  #endif
634
- #if HAVE_CURLOPT_FTP_SSL_CCC
772
+ #ifdef HAVE_CURLOPT_FTP_SSL_CCC
635
773
  CURB_DEFINE(CURLOPT_FTP_SSL_CCC);
636
774
  #endif
637
- #if HAVE_CURLFTPSSL_CCC_NONE
775
+ #ifdef HAVE_CURLFTPSSL_CCC_NONE
638
776
  CURB_DEFINE(CURLFTPSSL_CCC_NONE);
639
777
  #endif
640
- #if HAVE_CURLFTPSSL_CCC_PASSIVE
778
+ #ifdef HAVE_CURLFTPSSL_CCC_PASSIVE
641
779
  CURB_DEFINE(CURLFTPSSL_CCC_PASSIVE);
642
780
  #endif
643
- #if HAVE_CURLFTPSSL_CCC_ACTIVE
781
+ #ifdef HAVE_CURLFTPSSL_CCC_ACTIVE
644
782
  CURB_DEFINE(CURLFTPSSL_CCC_ACTIVE);
645
783
  #endif
646
- #if HAVE_CURLOPT_FTP_ACCOUNT
784
+ #ifdef HAVE_CURLOPT_FTP_ACCOUNT
647
785
  CURB_DEFINE(CURLOPT_FTP_ACCOUNT);
648
786
  #endif
649
- #if HAVE_CURLOPT_FTP_FILEMETHOD
787
+ #ifdef HAVE_CURLOPT_FTP_FILEMETHOD
650
788
  CURB_DEFINE(CURLOPT_FTP_FILEMETHOD);
651
789
  #endif
652
- #if HAVE_CURLFTPMETHOD_MULTICWD
790
+ #ifdef HAVE_CURLFTPMETHOD_MULTICWD
653
791
  CURB_DEFINE(CURLFTPMETHOD_MULTICWD);
654
792
  #endif
655
- #if HAVE_CURLFTPMETHOD_NOCWD
793
+ #ifdef HAVE_CURLFTPMETHOD_NOCWD
656
794
  CURB_DEFINE(CURLFTPMETHOD_NOCWD);
657
795
  #endif
658
- #if HAVE_CURLFTPMETHOD_SINGLECWD
796
+ #ifdef HAVE_CURLFTPMETHOD_SINGLECWD
659
797
  CURB_DEFINE(CURLFTPMETHOD_SINGLECWD);
660
798
  #endif
661
- #if HAVE_CURLOPT_RTSP_REQUEST
799
+ #ifdef HAVE_CURLOPT_RTSP_REQUEST
662
800
  CURB_DEFINE(CURLOPT_RTSP_REQUEST);
663
801
  #endif
664
- #if HAVE_CURL_RTSPREQ_OPTIONS
802
+ #ifdef HAVE_CURL_RTSPREQ_OPTIONS
665
803
  CURB_DEFINE(CURL_RTSPREQ_OPTIONS);
666
804
  #endif
667
- #if HAVE_CURL_RTSPREQ_DESCRIBE
805
+ #ifdef HAVE_CURL_RTSPREQ_DESCRIBE
668
806
  CURB_DEFINE(CURL_RTSPREQ_DESCRIBE);
669
807
  #endif
670
- #if HAVE_CURL_RTSPREQ_ANNOUNCE
808
+ #ifdef HAVE_CURL_RTSPREQ_ANNOUNCE
671
809
  CURB_DEFINE(CURL_RTSPREQ_ANNOUNCE);
672
810
  #endif
673
- #if HAVE_CURL_RTSPREQ_SETUP
811
+ #ifdef HAVE_CURL_RTSPREQ_SETUP
674
812
  CURB_DEFINE(CURL_RTSPREQ_SETUP);
675
813
  #endif
676
- #if HAVE_CURL_RTSPREQ_PLAY
814
+ #ifdef HAVE_CURL_RTSPREQ_PLAY
677
815
  CURB_DEFINE(CURL_RTSPREQ_PLAY);
678
816
  #endif
679
- #if HAVE_CURL_RTSPREQ_PAUSE
817
+ #ifdef HAVE_CURL_RTSPREQ_PAUSE
680
818
  CURB_DEFINE(CURL_RTSPREQ_PAUSE);
681
819
  #endif
682
- #if HAVE_CURL_RTSPREQ_TEARDOWN
820
+ #ifdef HAVE_CURL_RTSPREQ_TEARDOWN
683
821
  CURB_DEFINE(CURL_RTSPREQ_TEARDOWN);
684
822
  #endif
685
- #if HAVE_CURL_RTSPREQ_GET_PARAMETER
823
+ #ifdef HAVE_CURL_RTSPREQ_GET_PARAMETER
686
824
  CURB_DEFINE(CURL_RTSPREQ_GET_PARAMETER);
687
825
  #endif
688
- #if HAVE_CURL_RTSPREQ_SET_PARAMETER
826
+ #ifdef HAVE_CURL_RTSPREQ_SET_PARAMETER
689
827
  CURB_DEFINE(CURL_RTSPREQ_SET_PARAMETER);
690
828
  #endif
691
- #if HAVE_CURL_RTSPREQ_RECORD
829
+ #ifdef HAVE_CURL_RTSPREQ_RECORD
692
830
  CURB_DEFINE(CURL_RTSPREQ_RECORD);
693
831
  #endif
694
- #if HAVE_CURL_RTSPREQ_RECEIVE
832
+ #ifdef HAVE_CURL_RTSPREQ_RECEIVE
695
833
  CURB_DEFINE(CURL_RTSPREQ_RECEIVE);
696
834
  #endif
697
- #if HAVE_CURLOPT_RTSP_SESSION_ID
835
+ #ifdef HAVE_CURLOPT_RTSP_SESSION_ID
698
836
  CURB_DEFINE(CURLOPT_RTSP_SESSION_ID);
699
837
  #endif
700
- #if HAVE_CURLOPT_RTSP_STREAM_URI
838
+ #ifdef HAVE_CURLOPT_RTSP_STREAM_URI
701
839
  CURB_DEFINE(CURLOPT_RTSP_STREAM_URI);
702
840
  #endif
703
- #if HAVE_CURLOPT_RTSP_TRANSPORT
841
+ #ifdef HAVE_CURLOPT_RTSP_TRANSPORT
704
842
  CURB_DEFINE(CURLOPT_RTSP_TRANSPORT);
705
843
  #endif
706
- #if HAVE_CURLOPT_RTSP_HEADER
844
+ #ifdef HAVE_CURLOPT_RTSP_HEADER
707
845
  CURB_DEFINE(CURLOPT_RTSP_HEADER);
708
846
  #endif
709
- #if HAVE_CURLOPT_RTSP_CLIENT_CSEQ
847
+ #ifdef HAVE_CURLOPT_RTSP_CLIENT_CSEQ
710
848
  CURB_DEFINE(CURLOPT_RTSP_CLIENT_CSEQ);
711
849
  #endif
712
- #if HAVE_CURLOPT_RTSP_SERVER_CSEQ
850
+ #ifdef HAVE_CURLOPT_RTSP_SERVER_CSEQ
713
851
  CURB_DEFINE(CURLOPT_RTSP_SERVER_CSEQ);
714
852
  #endif
715
853
 
716
854
  CURB_DEFINE(CURLOPT_TRANSFERTEXT);
717
- #if HAVE_CURLOPT_PROXY_TRANSFER_MODE
855
+ #ifdef HAVE_CURLOPT_PROXY_TRANSFER_MODE
718
856
  CURB_DEFINE(CURLOPT_PROXY_TRANSFER_MODE);
719
857
  #endif
720
- #if HAVE_CURLOPT_CRLF
858
+ #ifdef HAVE_CURLOPT_CRLF
721
859
  CURB_DEFINE(CURLOPT_CRLF);
722
860
  #endif
723
- #if HAVE_CURLOPT_RANGE
861
+ #ifdef HAVE_CURLOPT_RANGE
724
862
  CURB_DEFINE(CURLOPT_RANGE);
725
863
  #endif
726
- #if HAVE_CURLOPT_RESUME_FROM
864
+ #ifdef HAVE_CURLOPT_RESUME_FROM
727
865
  CURB_DEFINE(CURLOPT_RESUME_FROM);
728
866
  #endif
729
- #if HAVE_CURLOPT_RESUME_FROM_LARGE
867
+ #ifdef HAVE_CURLOPT_RESUME_FROM_LARGE
730
868
  CURB_DEFINE(CURLOPT_RESUME_FROM_LARGE);
731
869
  #endif
732
- #if HAVE_CURLOPT_CUSTOMREQUEST
870
+ #ifdef HAVE_CURLOPT_CUSTOMREQUEST
733
871
  CURB_DEFINE(CURLOPT_CUSTOMREQUEST);
734
872
  #endif
735
- #if HAVE_CURLOPT_FILETIME
873
+ #ifdef HAVE_CURLOPT_FILETIME
736
874
  CURB_DEFINE(CURLOPT_FILETIME);
737
875
  #endif
738
- #if HAVE_CURLOPT_NOBODY
876
+ #ifdef HAVE_CURLOPT_NOBODY
739
877
  CURB_DEFINE(CURLOPT_NOBODY);
740
878
  #endif
741
- #if HAVE_CURLOPT_INFILESIZE
879
+ #ifdef HAVE_CURLOPT_INFILESIZE
742
880
  CURB_DEFINE(CURLOPT_INFILESIZE);
743
881
  #endif
744
- #if HAVE_CURLOPT_INFILESIZE_LARGE
882
+ #ifdef HAVE_CURLOPT_INFILESIZE_LARGE
745
883
  CURB_DEFINE(CURLOPT_INFILESIZE_LARGE);
746
884
  #endif
747
- #if HAVE_CURLOPT_UPLOAD
885
+ #ifdef HAVE_CURLOPT_UPLOAD
748
886
  CURB_DEFINE(CURLOPT_UPLOAD);
749
887
  #endif
750
- #if HAVE_CURLOPT_MAXFILESIZE
888
+ #ifdef HAVE_CURLOPT_MAXFILESIZE
751
889
  CURB_DEFINE(CURLOPT_MAXFILESIZE);
752
890
  #endif
753
- #if HAVE_CURLOPT_MAXFILESIZE_LARGE
891
+ #ifdef HAVE_CURLOPT_MAXFILESIZE_LARGE
754
892
  CURB_DEFINE(CURLOPT_MAXFILESIZE_LARGE);
755
893
  #endif
756
- #if HAVE_CURLOPT_TIMECONDITION
894
+ #ifdef HAVE_CURLOPT_TIMECONDITION
757
895
  CURB_DEFINE(CURLOPT_TIMECONDITION);
758
896
  #endif
759
- #if HAVE_CURLOPT_TIMEVALUE
897
+ #ifdef HAVE_CURLOPT_TIMEVALUE
760
898
  CURB_DEFINE(CURLOPT_TIMEVALUE);
761
899
  #endif
762
900
 
763
- #if HAVE_CURLOPT_TIMEOUT
901
+ #ifdef HAVE_CURLOPT_TIMEOUT
764
902
  CURB_DEFINE(CURLOPT_TIMEOUT);
765
903
  #endif
766
- #if HAVE_CURLOPT_TIMEOUT_MS
904
+ #ifdef HAVE_CURLOPT_TIMEOUT_MS
767
905
  CURB_DEFINE(CURLOPT_TIMEOUT_MS);
768
906
  #endif
769
- #if HAVE_CURLOPT_LOW_SPEED_LIMIT
907
+ #ifdef HAVE_CURLOPT_LOW_SPEED_LIMIT
770
908
  CURB_DEFINE(CURLOPT_LOW_SPEED_LIMIT);
771
909
  #endif
772
- #if HAVE_CURLOPT_LOW_SPEED_TIME
910
+ #ifdef HAVE_CURLOPT_LOW_SPEED_TIME
773
911
  CURB_DEFINE(CURLOPT_LOW_SPEED_TIME);
774
912
  #endif
775
- #if HAVE_CURLOPT_MAX_SEND_SPEED_LARGE
913
+ #ifdef HAVE_CURLOPT_MAX_SEND_SPEED_LARGE
776
914
  CURB_DEFINE(CURLOPT_MAX_SEND_SPEED_LARGE);
777
915
  #endif
778
- #if HAVE_CURLOPT_MAX_RECV_SPEED_LARGE
916
+ #ifdef HAVE_CURLOPT_MAX_RECV_SPEED_LARGE
779
917
  CURB_DEFINE(CURLOPT_MAX_RECV_SPEED_LARGE);
780
918
  #endif
781
- #if HAVE_CURLOPT_MAXCONNECTS
919
+ #ifdef HAVE_CURLOPT_MAXCONNECTS
782
920
  CURB_DEFINE(CURLOPT_MAXCONNECTS);
783
921
  #endif
784
- #if HAVE_CURLOPT_CLOSEPOLICY
922
+ #ifdef HAVE_CURLOPT_CLOSEPOLICY
785
923
  CURB_DEFINE(CURLOPT_CLOSEPOLICY);
786
924
  #endif
787
- #if HAVE_CURLOPT_FRESH_CONNECT
925
+ #ifdef HAVE_CURLOPT_FRESH_CONNECT
788
926
  CURB_DEFINE(CURLOPT_FRESH_CONNECT);
789
927
  #endif
790
- #if HAVE_CURLOPT_FORBID_REUSE
928
+ #ifdef HAVE_CURLOPT_FORBID_REUSE
791
929
  CURB_DEFINE(CURLOPT_FORBID_REUSE);
792
930
  #endif
793
- #if HAVE_CURLOPT_CONNECTTIMEOUT
931
+ #ifdef HAVE_CURLOPT_CONNECTTIMEOUT
794
932
  CURB_DEFINE(CURLOPT_CONNECTTIMEOUT);
795
933
  #endif
796
- #if HAVE_CURLOPT_CONNECTTIMEOUT_MS
934
+ #ifdef HAVE_CURLOPT_CONNECTTIMEOUT_MS
797
935
  CURB_DEFINE(CURLOPT_CONNECTTIMEOUT_MS);
798
936
  #endif
799
- #if HAVE_CURLOPT_IPRESOLVE
937
+ #ifdef HAVE_CURLOPT_IPRESOLVE
800
938
  CURB_DEFINE(CURLOPT_IPRESOLVE);
801
939
  #endif
802
- #if HAVE_CURL_IPRESOLVE_WHATEVER
940
+ #ifdef HAVE_CURL_IPRESOLVE_WHATEVER
803
941
  CURB_DEFINE(CURL_IPRESOLVE_WHATEVER);
804
942
  #endif
805
- #if HAVE_CURL_IPRESOLVE_V4
943
+ #ifdef HAVE_CURL_IPRESOLVE_V4
806
944
  CURB_DEFINE(CURL_IPRESOLVE_V4);
807
945
  #endif
808
- #if HAVE_CURL_IPRESOLVE_V6
946
+ #ifdef HAVE_CURL_IPRESOLVE_V6
809
947
  CURB_DEFINE(CURL_IPRESOLVE_V6);
810
948
  #endif
811
- #if HAVE_CURLOPT_CONNECT_ONLY
949
+ #ifdef HAVE_CURLOPT_CONNECT_ONLY
812
950
  CURB_DEFINE(CURLOPT_CONNECT_ONLY);
813
951
  #endif
814
- #if HAVE_CURLOPT_USE_SSL
952
+ #ifdef HAVE_CURLOPT_USE_SSL
815
953
  CURB_DEFINE(CURLOPT_USE_SSL);
816
954
  #endif
817
- #if HAVE_CURLUSESSL_NONE
955
+ #ifdef HAVE_CURLUSESSL_NONE
818
956
  CURB_DEFINE(CURLUSESSL_NONE);
819
957
  #endif
820
- #if HAVE_CURLUSESSL_TRY
958
+ #ifdef HAVE_CURLUSESSL_TRY
821
959
  CURB_DEFINE(CURLUSESSL_TRY);
822
960
  #endif
823
- #if HAVE_CURLUSESSL_CONTROL
961
+ #ifdef HAVE_CURLUSESSL_CONTROL
824
962
  CURB_DEFINE(CURLUSESSL_CONTROL);
825
963
  #endif
826
- #if HAVE_CURLUSESSL_ALL
964
+ #ifdef HAVE_CURLUSESSL_ALL
827
965
  CURB_DEFINE(CURLUSESSL_ALL);
828
966
  #endif
829
- #if HAVE_CURLOPT_RESOLVE
967
+ #ifdef HAVE_CURLOPT_CONNECT_TO
968
+ CURB_DEFINE(CURLOPT_CONNECT_TO);
969
+ #endif
970
+ #ifdef HAVE_CURLOPT_RESOLVE
830
971
  CURB_DEFINE(CURLOPT_RESOLVE);
831
972
  #endif
832
973
 
833
- #if HAVE_CURLOPT_SSLCERT
974
+ #ifdef HAVE_CURLOPT_SSLCERT
834
975
  CURB_DEFINE(CURLOPT_SSLCERT);
835
976
  #endif
836
- #if HAVE_CURLOPT_SSLCERTTYPE
977
+ #ifdef HAVE_CURLOPT_SSLCERTTYPE
837
978
  CURB_DEFINE(CURLOPT_SSLCERTTYPE);
838
979
  #endif
839
- #if HAVE_CURLOPT_SSLKEY
980
+ #ifdef HAVE_CURLOPT_SSLKEY
840
981
  CURB_DEFINE(CURLOPT_SSLKEY);
841
982
  #endif
842
- #if HAVE_CURLOPT_SSLKEYTYPE
983
+ #ifdef HAVE_CURLOPT_SSLKEYTYPE
843
984
  CURB_DEFINE(CURLOPT_SSLKEYTYPE);
844
985
  #endif
845
- #if HAVE_CURLOPT_KEYPASSWD
986
+ #ifdef HAVE_CURLOPT_KEYPASSWD
846
987
  CURB_DEFINE(CURLOPT_KEYPASSWD);
847
988
  #endif
848
- #if HAVE_CURLOPT_SSLENGINE
989
+ #ifdef HAVE_CURLOPT_SSLENGINE
849
990
  CURB_DEFINE(CURLOPT_SSLENGINE);
850
991
  #endif
851
- #if HAVE_CURLOPT_SSLENGINE_DEFAULT
992
+ #ifdef HAVE_CURLOPT_SSLENGINE_DEFAULT
852
993
  CURB_DEFINE(CURLOPT_SSLENGINE_DEFAULT);
853
994
  #endif
854
- #if HAVE_CURLOPT_SSLVERSION
995
+ #ifdef HAVE_CURLOPT_SSLVERSION
855
996
  CURB_DEFINE(CURLOPT_SSLVERSION);
856
997
  #endif
857
- #if HAVE_CURL_SSLVERSION_TLSv1
998
+ #ifdef HAVE_CURL_SSLVERSION_TLSv1
858
999
  CURB_DEFINE(CURL_SSLVERSION_TLSv1);
859
1000
  #endif
860
- #if HAVE_CURL_SSLVERSION_SSLv2
1001
+ #ifdef HAVE_CURL_SSLVERSION_SSLv2
861
1002
  CURB_DEFINE(CURL_SSLVERSION_SSLv2);
862
1003
  #endif
863
- #if HAVE_CURL_SSLVERSION_SSLv3
1004
+ #ifdef HAVE_CURL_SSLVERSION_SSLv3
864
1005
  CURB_DEFINE(CURL_SSLVERSION_SSLv3);
865
1006
  #endif
866
- #if HAVE_CURLOPT_SSL_VERIFYPEER
1007
+ #ifdef HAVE_CURL_SSLVERSION_TLSv1_0
1008
+ CURB_DEFINE(CURL_SSLVERSION_TLSv1_0);
1009
+ CURB_DEFINE(CURL_SSLVERSION_MAX_TLSv1_0);
1010
+ #endif
1011
+ #ifdef HAVE_CURL_SSLVERSION_TLSv1_1
1012
+ CURB_DEFINE(CURL_SSLVERSION_TLSv1_1);
1013
+ CURB_DEFINE(CURL_SSLVERSION_MAX_TLSv1_1);
1014
+ #endif
1015
+ #ifdef HAVE_CURL_SSLVERSION_TLSv1_2
1016
+ CURB_DEFINE(CURL_SSLVERSION_TLSv1_2);
1017
+ CURB_DEFINE(CURL_SSLVERSION_MAX_TLSv1_2);
1018
+ #endif
1019
+ #ifdef HAVE_CURL_SSLVERSION_TLSv1_3
1020
+ CURB_DEFINE(CURL_SSLVERSION_TLSv1_3);
1021
+ CURB_DEFINE(CURL_SSLVERSION_MAX_TLSv1_3);
1022
+ #endif
1023
+ #ifdef HAVE_CURLOPT_SSL_VERIFYPEER
867
1024
  CURB_DEFINE(CURLOPT_SSL_VERIFYPEER);
868
1025
  #endif
869
- #if HAVE_CURLOPT_CAINFO
1026
+ #ifdef HAVE_CURLOPT_DOH_URL
1027
+ CURB_DEFINE(CURLOPT_DOH_URL);
1028
+ #endif
1029
+ #ifdef HAVE_CURLOPT_DOH_SSL_VERIFYPEER
1030
+ CURB_DEFINE(CURLOPT_DOH_SSL_VERIFYPEER);
1031
+ #endif
1032
+ #ifdef HAVE_CURLOPT_DOH_SSL_VERIFYHOST
1033
+ CURB_DEFINE(CURLOPT_DOH_SSL_VERIFYHOST);
1034
+ #endif
1035
+ #ifdef HAVE_CURLOPT_DOH_SSL_VERIFYSTATUS
1036
+ CURB_DEFINE(CURLOPT_DOH_SSL_VERIFYSTATUS);
1037
+ #endif
1038
+ #ifdef HAVE_CURLOPT_CAINFO
870
1039
  CURB_DEFINE(CURLOPT_CAINFO);
871
1040
  #endif
872
- #if HAVE_CURLOPT_ISSUERCERT
1041
+ #ifdef HAVE_CURLOPT_ISSUERCERT
873
1042
  CURB_DEFINE(CURLOPT_ISSUERCERT);
874
1043
  #endif
875
- #if HAVE_CURLOPT_CAPATH
1044
+ #ifdef HAVE_CURLOPT_CAPATH
876
1045
  CURB_DEFINE(CURLOPT_CAPATH);
877
1046
  #endif
878
- #if HAVE_CURLOPT_CRLFILE
1047
+ #ifdef HAVE_CURLOPT_CRLFILE
879
1048
  CURB_DEFINE(CURLOPT_CRLFILE);
880
1049
  #endif
881
- #if HAVE_CURLOPT_SSL_VERIFYHOST
1050
+ #ifdef HAVE_CURLOPT_SSL_VERIFYHOST
882
1051
  CURB_DEFINE(CURLOPT_SSL_VERIFYHOST);
883
1052
  #endif
884
- #if HAVE_CURLOPT_CERTINFO
1053
+ #ifdef HAVE_CURLOPT_CERTINFO
885
1054
  CURB_DEFINE(CURLOPT_CERTINFO);
886
1055
  #endif
887
- #if HAVE_CURLOPT_RANDOM_FILE
1056
+ /* CURLOPT_RANDOM_FILE deprecated since 7.84.0, serves no purpose */
1057
+ #ifdef HAVE_CURLOPT_RANDOM_FILE
888
1058
  CURB_DEFINE(CURLOPT_RANDOM_FILE);
889
1059
  #endif
890
- #if HAVE_CURLOPT_EGDSOCKET
1060
+ /* CURLOPT_EGDSOCKET deprecated since 7.84.0, serves no purpose */
1061
+ #ifdef HAVE_CURLOPT_EGDSOCKET
891
1062
  CURB_DEFINE(CURLOPT_EGDSOCKET);
892
1063
  #endif
893
- #if HAVE_CURLOPT_SSL_CIPHER_LIST
1064
+ #ifdef HAVE_CURLOPT_SSL_CIPHER_LIST
894
1065
  CURB_DEFINE(CURLOPT_SSL_CIPHER_LIST);
895
1066
  #endif
896
- #if HAVE_CURLOPT_SSL_SESSIONID_CACHE
1067
+ #ifdef HAVE_CURLOPT_SSL_SESSIONID_CACHE
897
1068
  CURB_DEFINE(CURLOPT_SSL_SESSIONID_CACHE);
898
1069
  #endif
899
- #if HAVE_CURLOPT_KRBLEVEL
1070
+ #ifdef HAVE_CURLOPT_KRBLEVEL
900
1071
  CURB_DEFINE(CURLOPT_KRBLEVEL);
901
1072
  #endif
902
1073
 
903
- #if HAVE_CURLOPT_SSH_AUTH_TYPES
1074
+ #ifdef HAVE_CURLOPT_SSH_AUTH_TYPES
904
1075
  CURB_DEFINE(CURLOPT_SSH_AUTH_TYPES);
905
1076
  #endif
906
- #if HAVE_CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
1077
+ #ifdef HAVE_CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
907
1078
  CURB_DEFINE(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5);
908
1079
  #endif
909
- #if HAVE_CURLOPT_SSH_PUBLIC_KEYFILE
1080
+ #ifdef HAVE_CURLOPT_SSH_PUBLIC_KEYFILE
910
1081
  CURB_DEFINE(CURLOPT_SSH_PUBLIC_KEYFILE);
911
1082
  #endif
912
- #if HAVE_CURLOPT_SSH_PRIVATE_KEYFILE
1083
+ #ifdef HAVE_CURLOPT_SSH_PRIVATE_KEYFILE
913
1084
  CURB_DEFINE(CURLOPT_SSH_PRIVATE_KEYFILE);
914
1085
  #endif
915
- #if HAVE_CURLOPT_SSH_KNOWNHOSTS
1086
+ #ifdef HAVE_CURLOPT_SSH_KNOWNHOSTS
916
1087
  CURB_DEFINE(CURLOPT_SSH_KNOWNHOSTS);
917
1088
  #endif
918
- #if HAVE_CURLOPT_SSH_KEYFUNCTION
1089
+ #ifdef HAVE_CURLOPT_SSH_KEYFUNCTION
919
1090
  CURB_DEFINE(CURLOPT_SSH_KEYFUNCTION);
920
1091
  #endif
921
- #if HAVE_CURLKHSTAT_FINE_ADD_TO_FILE
1092
+ #ifdef HAVE_CURLKHSTAT_FINE_ADD_TO_FILE
922
1093
  CURB_DEFINE(CURLKHSTAT_FINE_ADD_TO_FILE);
923
1094
  #endif
924
- #if HAVE_CURLKHSTAT_FINE
1095
+ #ifdef HAVE_CURLKHSTAT_FINE
925
1096
  CURB_DEFINE(CURLKHSTAT_FINE);
926
1097
  #endif
927
- #if HAVE_CURLKHSTAT_REJECT
1098
+ #ifdef HAVE_CURLKHSTAT_REJECT
928
1099
  CURB_DEFINE(CURLKHSTAT_REJECT);
929
1100
  #endif
930
- #if HAVE_CURLKHSTAT_DEFER
1101
+ #ifdef HAVE_CURLKHSTAT_DEFER
931
1102
  CURB_DEFINE(CURLKHSTAT_DEFER);
932
1103
  #endif
933
- #if HAVE_CURLOPT_SSH_KEYDATA
1104
+ #ifdef HAVE_CURLOPT_SSH_KEYDATA
934
1105
  CURB_DEFINE(CURLOPT_SSH_KEYDATA);
935
1106
  #endif
936
1107
 
937
- #if HAVE_CURLOPT_PRIVATE
1108
+ #ifdef HAVE_CURLOPT_PRIVATE
938
1109
  CURB_DEFINE(CURLOPT_PRIVATE);
939
1110
  #endif
940
- #if HAVE_CURLOPT_SHARE
1111
+ #ifdef HAVE_CURLOPT_SHARE
941
1112
  CURB_DEFINE(CURLOPT_SHARE);
942
1113
  #endif
943
- #if HAVE_CURLOPT_NEW_FILE_PERMS
1114
+ #ifdef HAVE_CURLOPT_NEW_FILE_PERMS
944
1115
  CURB_DEFINE(CURLOPT_NEW_FILE_PERMS);
945
1116
  #endif
946
- #if HAVE_CURLOPT_NEW_DIRECTORY_PERMS
1117
+ #ifdef HAVE_CURLOPT_NEW_DIRECTORY_PERMS
947
1118
  CURB_DEFINE(CURLOPT_NEW_DIRECTORY_PERMS);
948
1119
  #endif
949
1120
 
950
- #if HAVE_CURLOPT_TELNETOPTIONS
1121
+ #ifdef HAVE_CURLOPT_TELNETOPTIONS
951
1122
  CURB_DEFINE(CURLOPT_TELNETOPTIONS);
952
1123
  #endif
953
1124
 
954
- #if HAVE_CURLOPT_GSSAPI_DELEGATION
1125
+ #ifdef HAVE_CURLOPT_GSSAPI_DELEGATION
955
1126
  CURB_DEFINE(CURLOPT_GSSAPI_DELEGATION);
956
1127
  #endif
957
1128
 
958
- #if HAVE_CURLGSSAPI_DELEGATION_FLAG
1129
+ #ifdef HAVE_CURLGSSAPI_DELEGATION_FLAG
959
1130
  CURB_DEFINE(CURLGSSAPI_DELEGATION_FLAG);
960
1131
  #endif
961
1132
 
962
- #if HAVE_CURLGSSAPI_DELEGATION_POLICY_FLAG
1133
+ #ifdef HAVE_CURLGSSAPI_DELEGATION_POLICY_FLAG
963
1134
  CURB_DEFINE(CURLGSSAPI_DELEGATION_POLICY_FLAG);
964
1135
  #endif
965
1136
 
1137
+ #ifdef HAVE_CURLOPT_UNIX_SOCKET_PATH
1138
+ CURB_DEFINE(CURLOPT_UNIX_SOCKET_PATH);
1139
+ #endif
1140
+
1141
+ #ifdef HAVE_CURLOPT_PIPEWAIT
1142
+ CURB_DEFINE(CURLOPT_PIPEWAIT);
1143
+ #endif
1144
+
1145
+ #ifdef HAVE_CURLOPT_TCP_KEEPALIVE
1146
+ CURB_DEFINE(CURLOPT_TCP_KEEPALIVE);
1147
+ CURB_DEFINE(CURLOPT_TCP_KEEPIDLE);
1148
+ CURB_DEFINE(CURLOPT_TCP_KEEPINTVL);
1149
+ #endif
1150
+
1151
+ #ifdef HAVE_CURLOPT_HAPROXYPROTOCOL
1152
+ CURB_DEFINE(CURLOPT_HAPROXYPROTOCOL);
1153
+ #endif
1154
+
1155
+ #ifdef HAVE_CURLOPT_PROXY_SSL_VERIFYHOST
1156
+ CURB_DEFINE(CURLOPT_PROXY_SSL_VERIFYHOST);
1157
+ #endif
1158
+
1159
+ #ifdef HAVE_CURLPROTO_RTMPTE
1160
+ CURB_DEFINE(CURLPROTO_RTMPTE);
1161
+ #endif
1162
+
1163
+ #ifdef HAVE_CURLPROTO_RTMPTS
1164
+ CURB_DEFINE(CURLPROTO_RTMPTS);
1165
+ #endif
1166
+
1167
+ #ifdef HAVE_CURLPROTO_SMBS
1168
+ CURB_DEFINE(CURLPROTO_SMBS);
1169
+ #endif
1170
+
1171
+ #ifdef HAVE_CURLPROTO_LDAP
1172
+ CURB_DEFINE(CURLPROTO_LDAP);
1173
+ #endif
1174
+
1175
+ #ifdef HAVE_CURLPROTO_FTP
1176
+ CURB_DEFINE(CURLPROTO_FTP);
1177
+ #endif
1178
+
1179
+ #ifdef HAVE_CURLPROTO_SMTPS
1180
+ CURB_DEFINE(CURLPROTO_SMTPS);
1181
+ #endif
1182
+
1183
+ #ifdef HAVE_CURLPROTO_HTTP
1184
+ CURB_DEFINE(CURLPROTO_HTTP);
1185
+ #endif
1186
+
1187
+ #ifdef HAVE_CURLPROTO_SMTP
1188
+ CURB_DEFINE(CURLPROTO_SMTP);
1189
+ #endif
966
1190
 
1191
+ #ifdef HAVE_CURLPROTO_TFTP
1192
+ CURB_DEFINE(CURLPROTO_TFTP);
1193
+ #endif
1194
+
1195
+ #ifdef HAVE_CURLPROTO_LDAPS
1196
+ CURB_DEFINE(CURLPROTO_LDAPS);
1197
+ #endif
1198
+
1199
+ #ifdef HAVE_CURLPROTO_IMAPS
1200
+ CURB_DEFINE(CURLPROTO_IMAPS);
1201
+ #endif
1202
+
1203
+ #ifdef HAVE_CURLPROTO_SCP
1204
+ CURB_DEFINE(CURLPROTO_SCP);
1205
+ #endif
1206
+
1207
+ #ifdef HAVE_CURLPROTO_SFTP
1208
+ CURB_DEFINE(CURLPROTO_SFTP);
1209
+ #endif
1210
+
1211
+ #ifdef HAVE_CURLPROTO_TELNET
1212
+ CURB_DEFINE(CURLPROTO_TELNET);
1213
+ #endif
1214
+
1215
+ #ifdef HAVE_CURLPROTO_FILE
1216
+ CURB_DEFINE(CURLPROTO_FILE);
1217
+ #endif
1218
+
1219
+ #ifdef HAVE_CURLPROTO_FTPS
1220
+ CURB_DEFINE(CURLPROTO_FTPS);
1221
+ #endif
1222
+
1223
+ #ifdef HAVE_CURLPROTO_HTTPS
1224
+ CURB_DEFINE(CURLPROTO_HTTPS);
1225
+ #endif
1226
+
1227
+ #ifdef HAVE_CURLPROTO_IMAP
1228
+ CURB_DEFINE(CURLPROTO_IMAP);
1229
+ #endif
1230
+
1231
+ #ifdef HAVE_CURLPROTO_POP3
1232
+ CURB_DEFINE(CURLPROTO_POP3);
1233
+ #endif
1234
+
1235
+ #ifdef HAVE_CURLPROTO_GOPHER
1236
+ CURB_DEFINE(CURLPROTO_GOPHER);
1237
+ #endif
1238
+
1239
+ #ifdef HAVE_CURLPROTO_DICT
1240
+ CURB_DEFINE(CURLPROTO_DICT);
1241
+ #endif
1242
+
1243
+ #ifdef HAVE_CURLPROTO_SMB
1244
+ CURB_DEFINE(CURLPROTO_SMB);
1245
+ #endif
1246
+
1247
+ #ifdef HAVE_CURLPROTO_RTMP
1248
+ CURB_DEFINE(CURLPROTO_RTMP);
1249
+ #endif
1250
+
1251
+ #ifdef HAVE_CURLPROTO_ALL
1252
+ CURB_DEFINE(CURLPROTO_ALL);
1253
+ #endif
1254
+
1255
+ #ifdef HAVE_CURLPROTO_RTMPE
1256
+ CURB_DEFINE(CURLPROTO_RTMPE);
1257
+ #endif
1258
+
1259
+ #ifdef HAVE_CURLPROTO_RTMPS
1260
+ CURB_DEFINE(CURLPROTO_RTMPS);
1261
+ #endif
1262
+
1263
+ #ifdef HAVE_CURLPROTO_RTMPT
1264
+ CURB_DEFINE(CURLPROTO_RTMPT);
1265
+ #endif
1266
+
1267
+ #ifdef HAVE_CURLPROTO_POP3S
1268
+ CURB_DEFINE(CURLPROTO_POP3S);
1269
+ #endif
1270
+
1271
+ #ifdef HAVE_CURLPROTO_RTSP
1272
+ CURB_DEFINE(CURLPROTO_RTSP);
1273
+ #endif
1274
+
1275
+ #if LIBCURL_VERSION_NUM >= 0x072B00 /* 7.43.0 */
1276
+ CURB_DEFINE(CURLPIPE_NOTHING);
1277
+ CURB_DEFINE(CURLPIPE_HTTP1);
1278
+ CURB_DEFINE(CURLPIPE_MULTIPLEX);
1279
+
1280
+ rb_define_const(mCurl, "PIPE_NOTHING", LONG2NUM(CURLPIPE_NOTHING));
1281
+ rb_define_const(mCurl, "PIPE_HTTP1", LONG2NUM(CURLPIPE_HTTP1));
1282
+ rb_define_const(mCurl, "PIPE_MULTIPLEX", LONG2NUM(CURLPIPE_MULTIPLEX));
1283
+ #endif
1284
+
1285
+ #if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */
1286
+ rb_define_const(mCurl, "HTTP_2_0", LONG2NUM(CURL_HTTP_VERSION_2_0));
1287
+ #endif
1288
+ #ifdef CURL_HTTP_VERSION_2TLS
1289
+ rb_define_const(mCurl, "HTTP_2TLS", LONG2NUM(CURL_HTTP_VERSION_2TLS));
1290
+ #endif
1291
+ #ifdef CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE
1292
+ rb_define_const(mCurl, "HTTP_2_PRIOR_KNOWLEDGE", LONG2NUM(CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE));
1293
+ #endif
967
1294
  rb_define_const(mCurl, "HTTP_1_1", LONG2NUM(CURL_HTTP_VERSION_1_1));
968
1295
  rb_define_const(mCurl, "HTTP_1_0", LONG2NUM(CURL_HTTP_VERSION_1_0));
969
1296
  rb_define_const(mCurl, "HTTP_NONE", LONG2NUM(CURL_HTTP_VERSION_NONE));
970
1297
 
1298
+
1299
+
971
1300
  rb_define_singleton_method(mCurl, "ipv6?", ruby_curl_ipv6_q, 0);
972
1301
  rb_define_singleton_method(mCurl, "kerberos4?", ruby_curl_kerberos4_q, 0);
973
1302
  rb_define_singleton_method(mCurl, "ssl?", ruby_curl_ssl_q, 0);
@@ -981,6 +1310,7 @@ void Init_curb_core() {
981
1310
  rb_define_singleton_method(mCurl, "idn?", ruby_curl_idn_q, 0);
982
1311
  rb_define_singleton_method(mCurl, "sspi?", ruby_curl_sspi_q, 0);
983
1312
  rb_define_singleton_method(mCurl, "conv?", ruby_curl_conv_q, 0);
1313
+ rb_define_singleton_method(mCurl, "http2?", ruby_curl_http2_q, 0);
984
1314
 
985
1315
  init_curb_errors();
986
1316
  init_curb_easy();