curb 0.7.15 → 1.0.0

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