curb 0.7.15 → 0.8.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/README CHANGED
@@ -40,6 +40,10 @@ Curb is tested only on GNU/Linux x86 and Mac OSX - YMMV on other platforms.
40
40
  If you do use another platform and experience problems, or if you can
41
41
  expand on the above instructions, please report the issue at http://github.com/taf2/curb/issues
42
42
 
43
+ On Ubuntu, the dependencies can be satisfied by installing the following packages:
44
+
45
+ $ sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev
46
+
43
47
  Curb has fairly extensive RDoc comments in the source. You can build the
44
48
  documentation with:
45
49
 
@@ -116,7 +120,7 @@ Same thing, more manual:
116
120
 
117
121
  c = Curl::Easy.new("http://my.rails.box/files/upload")
118
122
  c.multipart_form_post = true
119
- c.http_post(Curl::PostField.file('myfile.rb'))
123
+ c.http_post(Curl::PostField.file('thing[file]', 'myfile.rb'))
120
124
 
121
125
  ### Multi Interface (Basic HTTP GET):
122
126
 
data/Rakefile CHANGED
@@ -2,10 +2,14 @@
2
2
  #
3
3
  require 'rake/clean'
4
4
  require 'rake/testtask'
5
- require 'rake/rdoctask'
5
+ begin
6
+ require 'rdoc/task'
7
+ rescue LoadError => e
8
+ require 'rake/rdoctask'
9
+ end
6
10
 
7
11
  CLEAN.include '**/*.o'
8
- CLEAN.include "**/*.#{Config::MAKEFILE_CONFIG['DLEXT']}"
12
+ CLEAN.include "**/*.#{(defined?(RbConfig) ? RbConfig : Config)::MAKEFILE_CONFIG['DLEXT']}"
9
13
  CLOBBER.include 'doc'
10
14
  CLOBBER.include '**/*.log'
11
15
  CLOBBER.include '**/Makefile'
@@ -40,7 +44,7 @@ make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
40
44
  MAKECMD = ENV['MAKE_CMD'] || make_program
41
45
  MAKEOPTS = ENV['MAKE_OPTS'] || ''
42
46
 
43
- CURB_SO = "ext/curb_core.#{Config::MAKEFILE_CONFIG['DLEXT']}"
47
+ CURB_SO = "ext/curb_core.#{(defined?(RbConfig) ? RbConfig : Config)::MAKEFILE_CONFIG['DLEXT']}"
44
48
 
45
49
  file 'ext/Makefile' => 'ext/extconf.rb' do
46
50
  Dir.chdir('ext') do
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
 
@@ -352,6 +353,604 @@ void Init_curb_core() {
352
353
  rb_define_const(mCurl, "CURLAUTH_ANY", INT2FIX(0));
353
354
  #endif
354
355
 
356
+ CURB_DEFINE(CURLOPT_VERBOSE);
357
+ CURB_DEFINE(CURLOPT_HEADER);
358
+ CURB_DEFINE(CURLOPT_NOPROGRESS);
359
+ CURB_DEFINE(CURLOPT_NOSIGNAL);
360
+ CURB_DEFINE(CURLOPT_WRITEFUNCTION);
361
+ CURB_DEFINE(CURLOPT_WRITEDATA);
362
+ CURB_DEFINE(CURLOPT_READFUNCTION);
363
+ CURB_DEFINE(CURLOPT_READDATA);
364
+ CURB_DEFINE(CURLOPT_IOCTLFUNCTION);
365
+ CURB_DEFINE(CURLOPT_IOCTLDATA);
366
+ #if HAVE_CURLOPT_SEEKFUNCTION
367
+ CURB_DEFINE(CURLOPT_SEEKFUNCTION);
368
+ #endif
369
+ #if HAVE_CURLOPT_SEEKDATA
370
+ CURB_DEFINE(CURLOPT_SEEKDATA);
371
+ #endif
372
+ #if HAVE_CURLOPT_SOCKOPTFUNCTION
373
+ CURB_DEFINE(CURLOPT_SOCKOPTFUNCTION);
374
+ #endif
375
+ #if HAVE_CURLOPT_SOCKOPTDATA
376
+ CURB_DEFINE(CURLOPT_SOCKOPTDATA);
377
+ #endif
378
+ #if HAVE_CURLOPT_OPENSOCKETFUNCTION
379
+ CURB_DEFINE(CURLOPT_OPENSOCKETFUNCTION);
380
+ #endif
381
+ #if HAVE_CURLOPT_OPENSOCKETDATA
382
+ CURB_DEFINE(CURLOPT_OPENSOCKETDATA);
383
+ #endif
384
+ CURB_DEFINE(CURLOPT_PROGRESSFUNCTION);
385
+ CURB_DEFINE(CURLOPT_PROGRESSDATA);
386
+ CURB_DEFINE(CURLOPT_HEADERFUNCTION);
387
+ CURB_DEFINE(CURLOPT_WRITEHEADER);
388
+ CURB_DEFINE(CURLOPT_DEBUGFUNCTION);
389
+ CURB_DEFINE(CURLOPT_DEBUGDATA);
390
+ CURB_DEFINE(CURLOPT_SSL_CTX_FUNCTION);
391
+ CURB_DEFINE(CURLOPT_SSL_CTX_DATA);
392
+ CURB_DEFINE(CURLOPT_CONV_TO_NETWORK_FUNCTION);
393
+ CURB_DEFINE(CURLOPT_CONV_FROM_NETWORK_FUNCTION);
394
+ CURB_DEFINE(CURLOPT_CONV_FROM_UTF8_FUNCTION);
395
+
396
+ #if HAVE_CURLOPT_INTERLEAVEFUNCTION
397
+ CURB_DEFINE(CURLOPT_INTERLEAVEFUNCTION);
398
+ #endif
399
+ #if HAVE_CURLOPT_INTERLEAVEDATA
400
+ CURB_DEFINE(CURLOPT_INTERLEAVEDATA);
401
+ #endif
402
+ #if HAVE_CURLOPT_CHUNK_BGN_FUNCTION
403
+ CURB_DEFINE(CURLOPT_CHUNK_BGN_FUNCTION);
404
+ #endif
405
+ #if HAVE_CURLOPT_CHUNK_END_FUNCTION
406
+ CURB_DEFINE(CURLOPT_CHUNK_END_FUNCTION);
407
+ #endif
408
+ #if HAVE_CURLOPT_CHUNK_DATA
409
+ CURB_DEFINE(CURLOPT_CHUNK_DATA);
410
+ #endif
411
+ #if HAVE_CURLOPT_FNMATCH_FUNCTION
412
+ CURB_DEFINE(CURLOPT_FNMATCH_FUNCTION);
413
+ #endif
414
+ #if HAVE_CURLOPT_FNMATCH_DATA
415
+ CURB_DEFINE(CURLOPT_FNMATCH_DATA);
416
+ #endif
417
+ #if HAVE_CURLOPT_ERRORBUFFER
418
+ CURB_DEFINE(CURLOPT_ERRORBUFFER);
419
+ #endif
420
+ #if HAVE_CURLOPT_STDERR
421
+ CURB_DEFINE(CURLOPT_STDERR);
422
+ #endif
423
+ #if HAVE_CURLOPT_FAILONERROR
424
+ CURB_DEFINE(CURLOPT_FAILONERROR);
425
+ #endif
426
+ CURB_DEFINE(CURLOPT_URL);
427
+ CURB_DEFINE(CURLOPT_PROTOCOLS);
428
+ CURB_DEFINE(CURLOPT_REDIR_PROTOCOLS);
429
+ CURB_DEFINE(CURLOPT_PROXY);
430
+ CURB_DEFINE(CURLOPT_PROXYPORT);
431
+ #if HAVE_CURLOPT_PROXYTYPE
432
+ CURB_DEFINE(CURLOPT_PROXYTYPE);
433
+ #endif
434
+ #if HAVE_CURLOPT_NOPROXY
435
+ CURB_DEFINE(CURLOPT_NOPROXY);
436
+ #endif
437
+ CURB_DEFINE(CURLOPT_HTTPPROXYTUNNEL);
438
+ #if HAVE_CURLOPT_SOCKS5_GSSAPI_SERVICE
439
+ CURB_DEFINE(CURLOPT_SOCKS5_GSSAPI_SERVICE);
440
+ #endif
441
+ #if HAVE_CURLOPT_SOCKS5_GSSAPI_NEC
442
+ CURB_DEFINE(CURLOPT_SOCKS5_GSSAPI_NEC);
443
+ #endif
444
+ CURB_DEFINE(CURLOPT_INTERFACE);
445
+ #if HAVE_CURLOPT_LOCALPORT
446
+ CURB_DEFINE(CURLOPT_LOCALPORT);
447
+ #endif
448
+ CURB_DEFINE(CURLOPT_DNS_CACHE_TIMEOUT);
449
+ CURB_DEFINE(CURLOPT_DNS_USE_GLOBAL_CACHE);
450
+ CURB_DEFINE(CURLOPT_BUFFERSIZE);
451
+ CURB_DEFINE(CURLOPT_PORT);
452
+ CURB_DEFINE(CURLOPT_TCP_NODELAY);
453
+ #if HAVE_CURLOPT_ADDRESS_SCOPE
454
+ CURB_DEFINE(CURLOPT_ADDRESS_SCOPE);
455
+ #endif
456
+ CURB_DEFINE(CURLOPT_NETRC);
457
+ CURB_DEFINE(CURL_NETRC_OPTIONAL);
458
+ CURB_DEFINE(CURL_NETRC_IGNORED);
459
+ CURB_DEFINE(CURL_NETRC_REQUIRED);
460
+ #if HAVE_CURLOPT_NETRC_FILE
461
+ CURB_DEFINE(CURLOPT_NETRC_FILE);
462
+ #endif
463
+ CURB_DEFINE(CURLOPT_USERPWD);
464
+ CURB_DEFINE(CURLOPT_PROXYUSERPWD);
465
+ #if HAVE_CURLOPT_USERNAME
466
+ CURB_DEFINE(CURLOPT_USERNAME);
467
+ #endif
468
+ #if HAVE_CURLOPT_PASSWORD
469
+ CURB_DEFINE(CURLOPT_PASSWORD);
470
+ #endif
471
+ #if HAVE_CURLOPT_PROXYUSERNAME
472
+ CURB_DEFINE(CURLOPT_PASSWORD);
473
+ #endif
474
+ #if HAVE_CURLOPT_PROXYPASSWORD
475
+ CURB_DEFINE(CURLOPT_PASSWORD);
476
+ #endif
477
+
478
+ #if HAVE_CURLOPT_HTTPAUTH
479
+ CURB_DEFINE(CURLOPT_HTTPAUTH);
480
+ #endif
481
+ #if HAVE_CURLAUTH_DIGEST_IE
482
+ CURB_DEFINE(CURLAUTH_DIGEST_IE);
483
+ #endif
484
+ #if HAVE_CURLAUTH_ONLY
485
+ CURB_DEFINE(CURLAUTH_ONLY);
486
+ #endif
487
+ #if HAVE_CURLOPT_TLSAUTH_TYPE
488
+ CURB_DEFINE(CURLOPT_TLSAUTH_TYPE);
489
+ #endif
490
+ #if HAVE_CURLOPT_TLSAUTH_SRP
491
+ CURB_DEFINE(CURLOPT_TLSAUTH_SRP);
492
+ #endif
493
+ #if HAVE_CURLOPT_TLSAUTH_USERNAME
494
+ CURB_DEFINE(CURLOPT_TLSAUTH_USERNAME);
495
+ #endif
496
+ #if HAVE_CURLOPT_TLSAUTH_PASSWORD
497
+ CURB_DEFINE(CURLOPT_TLSAUTH_PASSWORD);
498
+ #endif
499
+ #if HAVE_CURLOPT_PROXYAUTH
500
+ CURB_DEFINE(CURLOPT_PROXYAUTH);
501
+ #endif
502
+ #if HAVE_CURLOPT_AUTOREFERER
503
+ CURB_DEFINE(CURLOPT_AUTOREFERER);
504
+ #endif
505
+ #if HAVE_CURLOPT_ENCODING
506
+ CURB_DEFINE(CURLOPT_ENCODING);
507
+ #endif
508
+ #if HAVE_CURLOPT_FOLLOWLOCATION
509
+ CURB_DEFINE(CURLOPT_FOLLOWLOCATION);
510
+ #endif
511
+ #if HAVE_CURLOPT_UNRESTRICTED_AUTH
512
+ CURB_DEFINE(CURLOPT_UNRESTRICTED_AUTH);
513
+ #endif
514
+ #if HAVE_CURLOPT_MAXREDIRS
515
+ CURB_DEFINE(CURLOPT_MAXREDIRS);
516
+ #endif
517
+ #if HAVE_CURLOPT_POSTREDIR
518
+ CURB_DEFINE(CURLOPT_POSTREDIR);
519
+ #endif
520
+ #if HAVE_CURLOPT_PUT
521
+ CURB_DEFINE(CURLOPT_PUT);
522
+ #endif
523
+ #if HAVE_CURLOPT_POST
524
+ CURB_DEFINE(CURLOPT_POST);
525
+ #endif
526
+ CURB_DEFINE(CURLOPT_POSTFIELDS);
527
+ CURB_DEFINE(CURLOPT_POSTFIELDSIZE);
528
+ #if HAVE_CURLOPT_POSTFIELDSIZE_LARGE
529
+ CURB_DEFINE(CURLOPT_POSTFIELDSIZE_LARGE);
530
+ #endif
531
+ #if HAVE_CURLOPT_COPYPOSTFIELDS
532
+ CURB_DEFINE(CURLOPT_COPYPOSTFIELDS);
533
+ #endif
534
+ #if HAVE_CURLOPT_HTTPPOST
535
+ CURB_DEFINE(CURLOPT_HTTPPOST);
536
+ #endif
537
+ CURB_DEFINE(CURLOPT_REFERER);
538
+ CURB_DEFINE(CURLOPT_USERAGENT);
539
+ CURB_DEFINE(CURLOPT_HTTPHEADER);
540
+ #if HAVE_CURLOPT_HTTP200ALIASES
541
+ CURB_DEFINE(CURLOPT_HTTP200ALIASES);
542
+ #endif
543
+
544
+ CURB_DEFINE(CURLOPT_COOKIE);
545
+ CURB_DEFINE(CURLOPT_COOKIEFILE);
546
+ CURB_DEFINE(CURLOPT_COOKIEJAR);
547
+
548
+ #if HAVE_CURLOPT_COOKIESESSION
549
+ CURB_DEFINE(CURLOPT_COOKIESESSION);
550
+ #endif
551
+ #if HAVE_CURLOPT_COOKIELIST
552
+ CURB_DEFINE(CURLOPT_COOKIELIST);
553
+ #endif
554
+ #if HAVE_CURLOPT_HTTPGET
555
+ CURB_DEFINE(CURLOPT_HTTPGET);
556
+ #endif
557
+ CURB_DEFINE(CURLOPT_HTTP_VERSION);
558
+ CURB_DEFINE(CURL_HTTP_VERSION_NONE);
559
+ CURB_DEFINE(CURL_HTTP_VERSION_1_0);
560
+ CURB_DEFINE(CURL_HTTP_VERSION_1_1);
561
+ #if HAVE_CURLOPT_IGNORE_CONTENT_LENGTH
562
+ CURB_DEFINE(CURLOPT_IGNORE_CONTENT_LENGTH);
563
+ #endif
564
+ #if HAVE_CURLOPT_HTTP_CONTENT_DECODING
565
+ CURB_DEFINE(CURLOPT_HTTP_CONTENT_DECODING);
566
+ #endif
567
+ #if HAVE_CURLOPT_HTTP_TRANSFER_DECODING
568
+ CURB_DEFINE(CURLOPT_HTTP_TRANSFER_DECODING);
569
+ #endif
570
+ #if HAVE_CURLOPT_MAIL_FROM
571
+ CURB_DEFINE(CURLOPT_MAIL_FROM);
572
+ #endif
573
+ #if HAVE_CURLOPT_MAIL_RCPT
574
+ CURB_DEFINE(CURLOPT_MAIL_RCPT);
575
+ #endif
576
+ #if HAVE_CURLOPT_TFTP_BLKSIZE
577
+ CURB_DEFINE(CURLOPT_TFTP_BLKSIZE);
578
+ #endif
579
+ #if HAVE_CURLOPT_FTPPORT
580
+ CURB_DEFINE(CURLOPT_FTPPORT);
581
+ #endif
582
+ #if HAVE_CURLOPT_QUOTE
583
+ CURB_DEFINE(CURLOPT_QUOTE);
584
+ #endif
585
+ #if HAVE_CURLOPT_POSTQUOTE
586
+ CURB_DEFINE(CURLOPT_POSTQUOTE);
587
+ #endif
588
+ #if HAVE_CURLOPT_PREQUOTE
589
+ CURB_DEFINE(CURLOPT_PREQUOTE);
590
+ #endif
591
+ #if HAVE_CURLOPT_DIRLISTONLY
592
+ CURB_DEFINE(CURLOPT_DIRLISTONLY);
593
+ #endif
594
+ #if HAVE_CURLOPT_APPEND
595
+ CURB_DEFINE(CURLOPT_APPEND);
596
+ #endif
597
+ #if HAVE_CURLOPT_FTP_USE_EPRT
598
+ CURB_DEFINE(CURLOPT_FTP_USE_EPRT);
599
+ #endif
600
+ #if HAVE_CURLOPT_FTP_USE_EPSV
601
+ CURB_DEFINE(CURLOPT_FTP_USE_EPSV);
602
+ #endif
603
+ #if HAVE_CURLOPT_FTP_USE_PRET
604
+ CURB_DEFINE(CURLOPT_FTP_USE_PRET);
605
+ #endif
606
+ #if HAVE_CURLOPT_FTP_CREATE_MISSING_DIRS
607
+ CURB_DEFINE(CURLOPT_FTP_CREATE_MISSING_DIRS);
608
+ #endif
609
+ #if HAVE_CURLOPT_FTP_RESPONSE_TIMEOUT
610
+ CURB_DEFINE(CURLOPT_FTP_RESPONSE_TIMEOUT);
611
+ #endif
612
+ #if HAVE_CURLOPT_FTP_ALTERNATIVE_TO_USER
613
+ CURB_DEFINE(CURLOPT_FTP_ALTERNATIVE_TO_USER);
614
+ #endif
615
+ #if HAVE_CURLOPT_FTP_SKIP_PASV_IP
616
+ CURB_DEFINE(CURLOPT_FTP_SKIP_PASV_IP);
617
+ #endif
618
+ #if HAVE_CURLOPT_FTPSSLAUTH
619
+ CURB_DEFINE(CURLOPT_FTPSSLAUTH);
620
+ #endif
621
+ #if HAVE_CURLFTPAUTH_DEFAULT
622
+ CURB_DEFINE(CURLFTPAUTH_DEFAULT);
623
+ #endif
624
+ #if HAVE_CURLFTPAUTH_SSL
625
+ CURB_DEFINE(CURLFTPAUTH_SSL);
626
+ #endif
627
+ #if HAVE_CURLFTPAUTH_TLS
628
+ CURB_DEFINE(CURLFTPAUTH_TLS);
629
+ #endif
630
+ #if HAVE_CURLOPT_FTP_SSL_CCC
631
+ CURB_DEFINE(CURLOPT_FTP_SSL_CCC);
632
+ #endif
633
+ #if HAVE_CURLFTPSSL_CCC_NONE
634
+ CURB_DEFINE(CURLFTPSSL_CCC_NONE);
635
+ #endif
636
+ #if HAVE_CURLFTPSSL_CCC_PASSIVE
637
+ CURB_DEFINE(CURLFTPSSL_CCC_PASSIVE);
638
+ #endif
639
+ #if HAVE_CURLFTPSSL_CCC_ACTIVE
640
+ CURB_DEFINE(CURLFTPSSL_CCC_ACTIVE);
641
+ #endif
642
+ #if HAVE_CURLOPT_FTP_ACCOUNT
643
+ CURB_DEFINE(CURLOPT_FTP_ACCOUNT);
644
+ #endif
645
+ #if HAVE_CURLOPT_FTP_FILEMETHOD
646
+ CURB_DEFINE(CURLOPT_FTP_FILEMETHOD);
647
+ #endif
648
+ #if HAVE_CURLFTPMETHOD_MULTICWD
649
+ CURB_DEFINE(CURLFTPMETHOD_MULTICWD);
650
+ #endif
651
+ #if HAVE_CURLFTPMETHOD_NOCWD
652
+ CURB_DEFINE(CURLFTPMETHOD_NOCWD);
653
+ #endif
654
+ #if HAVE_CURLFTPMETHOD_SINGLECWD
655
+ CURB_DEFINE(CURLFTPMETHOD_SINGLECWD);
656
+ #endif
657
+ #if HAVE_CURLOPT_RTSP_REQUEST
658
+ CURB_DEFINE(CURLOPT_RTSP_REQUEST);
659
+ #endif
660
+ #if HAVE_CURL_RTSPREQ_OPTIONS
661
+ CURB_DEFINE(CURL_RTSPREQ_OPTIONS);
662
+ #endif
663
+ #if HAVE_CURL_RTSPREQ_DESCRIBE
664
+ CURB_DEFINE(CURL_RTSPREQ_DESCRIBE);
665
+ #endif
666
+ #if HAVE_CURL_RTSPREQ_ANNOUNCE
667
+ CURB_DEFINE(CURL_RTSPREQ_ANNOUNCE);
668
+ #endif
669
+ #if HAVE_CURL_RTSPREQ_SETUP
670
+ CURB_DEFINE(CURL_RTSPREQ_SETUP);
671
+ #endif
672
+ #if HAVE_CURL_RTSPREQ_PLAY
673
+ CURB_DEFINE(CURL_RTSPREQ_PLAY);
674
+ #endif
675
+ #if HAVE_CURL_RTSPREQ_PAUSE
676
+ CURB_DEFINE(CURL_RTSPREQ_PAUSE);
677
+ #endif
678
+ #if HAVE_CURL_RTSPREQ_TEARDOWN
679
+ CURB_DEFINE(CURL_RTSPREQ_TEARDOWN);
680
+ #endif
681
+ #if HAVE_CURL_RTSPREQ_GET_PARAMETER
682
+ CURB_DEFINE(CURL_RTSPREQ_GET_PARAMETER);
683
+ #endif
684
+ #if HAVE_CURL_RTSPREQ_SET_PARAMETER
685
+ CURB_DEFINE(CURL_RTSPREQ_SET_PARAMETER);
686
+ #endif
687
+ #if HAVE_CURL_RTSPREQ_RECORD
688
+ CURB_DEFINE(CURL_RTSPREQ_RECORD);
689
+ #endif
690
+ #if HAVE_CURL_RTSPREQ_RECEIVE
691
+ CURB_DEFINE(CURL_RTSPREQ_RECEIVE);
692
+ #endif
693
+ #if HAVE_CURLOPT_RTSP_SESSION_ID
694
+ CURB_DEFINE(CURLOPT_RTSP_SESSION_ID);
695
+ #endif
696
+ #if HAVE_CURLOPT_RTSP_STREAM_URI
697
+ CURB_DEFINE(CURLOPT_RTSP_STREAM_URI);
698
+ #endif
699
+ #if HAVE_CURLOPT_RTSP_TRANSPORT
700
+ CURB_DEFINE(CURLOPT_RTSP_TRANSPORT);
701
+ #endif
702
+ #if HAVE_CURLOPT_RTSP_HEADER
703
+ CURB_DEFINE(CURLOPT_RTSP_HEADER);
704
+ #endif
705
+ #if HAVE_CURLOPT_RTSP_CLIENT_CSEQ
706
+ CURB_DEFINE(CURLOPT_RTSP_CLIENT_CSEQ);
707
+ #endif
708
+ #if HAVE_CURLOPT_RTSP_SERVER_CSEQ
709
+ CURB_DEFINE(CURLOPT_RTSP_SERVER_CSEQ);
710
+ #endif
711
+
712
+ CURB_DEFINE(CURLOPT_TRANSFERTEXT);
713
+ #if HAVE_CURLOPT_PROXY_TRANSFER_MODE
714
+ CURB_DEFINE(CURLOPT_PROXY_TRANSFER_MODE);
715
+ #endif
716
+ #if HAVE_CURLOPT_CRLF
717
+ CURB_DEFINE(CURLOPT_CRLF);
718
+ #endif
719
+ #if HAVE_CURLOPT_RANGE
720
+ CURB_DEFINE(CURLOPT_RANGE);
721
+ #endif
722
+ #if HAVE_CURLOPT_RESUME_FROM
723
+ CURB_DEFINE(CURLOPT_RESUME_FROM);
724
+ #endif
725
+ #if HAVE_CURLOPT_RESUME_FROM_LARGE
726
+ CURB_DEFINE(CURLOPT_RESUME_FROM_LARGE);
727
+ #endif
728
+ #if HAVE_CURLOPT_CUSTOMREQUEST
729
+ CURB_DEFINE(CURLOPT_CUSTOMREQUEST);
730
+ #endif
731
+ #if HAVE_CURLOPT_FILETIME
732
+ CURB_DEFINE(CURLOPT_FILETIME);
733
+ #endif
734
+ #if HAVE_CURLOPT_NOBODY
735
+ CURB_DEFINE(CURLOPT_NOBODY);
736
+ #endif
737
+ #if HAVE_CURLOPT_INFILESIZE
738
+ CURB_DEFINE(CURLOPT_INFILESIZE);
739
+ #endif
740
+ #if HAVE_CURLOPT_INFILESIZE_LARGE
741
+ CURB_DEFINE(CURLOPT_INFILESIZE_LARGE);
742
+ #endif
743
+ #if HAVE_CURLOPT_UPLOAD
744
+ CURB_DEFINE(CURLOPT_UPLOAD);
745
+ #endif
746
+ #if HAVE_CURLOPT_MAXFILESIZE
747
+ CURB_DEFINE(CURLOPT_MAXFILESIZE);
748
+ #endif
749
+ #if HAVE_CURLOPT_MAXFILESIZE_LARGE
750
+ CURB_DEFINE(CURLOPT_MAXFILESIZE_LARGE);
751
+ #endif
752
+ #if HAVE_CURLOPT_TIMECONDITION
753
+ CURB_DEFINE(CURLOPT_TIMECONDITION);
754
+ #endif
755
+ #if HAVE_CURLOPT_TIMEVALUE
756
+ CURB_DEFINE(CURLOPT_TIMEVALUE);
757
+ #endif
758
+
759
+ #if HAVE_CURLOPT_TIMEOUT
760
+ CURB_DEFINE(CURLOPT_TIMEOUT);
761
+ #endif
762
+ #if HAVE_CURLOPT_TIMEOUT_MS
763
+ CURB_DEFINE(CURLOPT_TIMEOUT_MS);
764
+ #endif
765
+ #if HAVE_CURLOPT_LOW_SPEED_LIMIT
766
+ CURB_DEFINE(CURLOPT_LOW_SPEED_LIMIT);
767
+ #endif
768
+ #if HAVE_CURLOPT_LOW_SPEED_TIME
769
+ CURB_DEFINE(CURLOPT_LOW_SPEED_TIME);
770
+ #endif
771
+ #if HAVE_CURLOPT_MAX_SEND_SPEED_LARGE
772
+ CURB_DEFINE(CURLOPT_MAX_SEND_SPEED_LARGE);
773
+ #endif
774
+ #if HAVE_CURLOPT_MAX_RECV_SPEED_LARGE
775
+ CURB_DEFINE(CURLOPT_MAX_RECV_SPEED_LARGE);
776
+ #endif
777
+ #if HAVE_CURLOPT_MAXCONNECTS
778
+ CURB_DEFINE(CURLOPT_MAXCONNECTS);
779
+ #endif
780
+ #if HAVE_CURLOPT_CLOSEPOLICY
781
+ CURB_DEFINE(CURLOPT_CLOSEPOLICY);
782
+ #endif
783
+ #if HAVE_CURLOPT_FRESH_CONNECT
784
+ CURB_DEFINE(CURLOPT_FRESH_CONNECT);
785
+ #endif
786
+ #if HAVE_CURLOPT_FORBID_REUSE
787
+ CURB_DEFINE(CURLOPT_FORBID_REUSE);
788
+ #endif
789
+ #if HAVE_CURLOPT_CONNECTTIMEOUT
790
+ CURB_DEFINE(CURLOPT_CONNECTTIMEOUT);
791
+ #endif
792
+ #if HAVE_CURLOPT_CONNECTTIMEOUT_MS
793
+ CURB_DEFINE(CURLOPT_CONNECTTIMEOUT_MS);
794
+ #endif
795
+ #if HAVE_CURLOPT_IPRESOLVE
796
+ CURB_DEFINE(CURLOPT_IPRESOLVE);
797
+ #endif
798
+ #if HAVE_CURL_IPRESOLVE_WHATEVER
799
+ CURB_DEFINE(CURL_IPRESOLVE_WHATEVER);
800
+ #endif
801
+ #if HAVE_CURL_IPRESOLVE_V4
802
+ CURB_DEFINE(CURL_IPRESOLVE_V4);
803
+ #endif
804
+ #if HAVE_CURL_IPRESOLVE_V6
805
+ CURB_DEFINE(CURL_IPRESOLVE_V6);
806
+ #endif
807
+ #if HAVE_CURLOPT_CONNECT_ONLY
808
+ CURB_DEFINE(CURLOPT_CONNECT_ONLY);
809
+ #endif
810
+ #if HAVE_CURLOPT_USE_SSL
811
+ CURB_DEFINE(CURLOPT_USE_SSL);
812
+ #endif
813
+ #if HAVE_CURLUSESSL_NONE
814
+ CURB_DEFINE(CURLUSESSL_NONE);
815
+ #endif
816
+ #if HAVE_CURLUSESSL_TRY
817
+ CURB_DEFINE(CURLUSESSL_TRY);
818
+ #endif
819
+ #if HAVE_CURLUSESSL_CONTROL
820
+ CURB_DEFINE(CURLUSESSL_CONTROL);
821
+ #endif
822
+ #if HAVE_CURLUSESSL_ALL
823
+ CURB_DEFINE(CURLUSESSL_ALL);
824
+ #endif
825
+ #if HAVE_CURLOPT_RESOLVE
826
+ CURB_DEFINE(CURLOPT_RESOLVE);
827
+ #endif
828
+
829
+ #if HAVE_CURLOPT_SSLCERT
830
+ CURB_DEFINE(CURLOPT_SSLCERT);
831
+ #endif
832
+ #if HAVE_CURLOPT_SSLCERTTYPE
833
+ CURB_DEFINE(CURLOPT_SSLCERTTYPE);
834
+ #endif
835
+ #if HAVE_CURLOPT_SSLKEY
836
+ CURB_DEFINE(CURLOPT_SSLKEY);
837
+ #endif
838
+ #if HAVE_CURLOPT_SSLKEYTYPE
839
+ CURB_DEFINE(CURLOPT_SSLKEYTYPE);
840
+ #endif
841
+ #if HAVE_CURLOPT_KEYPASSWD
842
+ CURB_DEFINE(CURLOPT_KEYPASSWD);
843
+ #endif
844
+ #if HAVE_CURLOPT_SSLENGINE
845
+ CURB_DEFINE(CURLOPT_SSLENGINE);
846
+ #endif
847
+ #if HAVE_CURLOPT_SSLENGINE_DEFAULT
848
+ CURB_DEFINE(CURLOPT_SSLENGINE_DEFAULT);
849
+ #endif
850
+ #if HAVE_CURLOPT_SSLVERSION
851
+ CURB_DEFINE(CURLOPT_SSLVERSION);
852
+ #endif
853
+ #if HAVE_CURL_SSLVERSION_TLSv1
854
+ CURB_DEFINE(CURL_SSLVERSION_TLSv1);
855
+ #endif
856
+ #if HAVE_CURL_SSLVERSION_SSLv2
857
+ CURB_DEFINE(CURL_SSLVERSION_SSLv2);
858
+ #endif
859
+ #if HAVE_CURL_SSLVERSION_SSLv3
860
+ CURB_DEFINE(CURL_SSLVERSION_SSLv3);
861
+ #endif
862
+ #if HAVE_CURLOPT_SSL_VERIFYPEER
863
+ CURB_DEFINE(CURLOPT_SSL_VERIFYPEER);
864
+ #endif
865
+ #if HAVE_CURLOPT_CAINFO
866
+ CURB_DEFINE(CURLOPT_CAINFO);
867
+ #endif
868
+ #if HAVE_CURLOPT_ISSUERCERT
869
+ CURB_DEFINE(CURLOPT_ISSUERCERT);
870
+ #endif
871
+ #if HAVE_CURLOPT_CAPATH
872
+ CURB_DEFINE(CURLOPT_CAPATH);
873
+ #endif
874
+ #if HAVE_CURLOPT_CRLFILE
875
+ CURB_DEFINE(CURLOPT_CRLFILE);
876
+ #endif
877
+ #if HAVE_CURLOPT_SSL_VERIFYHOST
878
+ CURB_DEFINE(CURLOPT_SSL_VERIFYHOST);
879
+ #endif
880
+ #if HAVE_CURLOPT_CERTINFO
881
+ CURB_DEFINE(CURLOPT_CERTINFO);
882
+ #endif
883
+ #if HAVE_CURLOPT_RANDOM_FILE
884
+ CURB_DEFINE(CURLOPT_RANDOM_FILE);
885
+ #endif
886
+ #if HAVE_CURLOPT_EGDSOCKET
887
+ CURB_DEFINE(CURLOPT_EGDSOCKET);
888
+ #endif
889
+ #if HAVE_CURLOPT_SSL_CIPHER_LIST
890
+ CURB_DEFINE(CURLOPT_SSL_CIPHER_LIST);
891
+ #endif
892
+ #if HAVE_CURLOPT_SSL_SESSIONID_CACHE
893
+ CURB_DEFINE(CURLOPT_SSL_SESSIONID_CACHE);
894
+ #endif
895
+ #if HAVE_CURLOPT_KRBLEVEL
896
+ CURB_DEFINE(CURLOPT_KRBLEVEL);
897
+ #endif
898
+
899
+ #if HAVE_CURLOPT_SSH_AUTH_TYPES
900
+ CURB_DEFINE(CURLOPT_SSH_AUTH_TYPES);
901
+ #endif
902
+ #if HAVE_CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
903
+ CURB_DEFINE(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5);
904
+ #endif
905
+ #if HAVE_CURLOPT_SSH_PUBLIC_KEYFILE
906
+ CURB_DEFINE(CURLOPT_SSH_PUBLIC_KEYFILE);
907
+ #endif
908
+ #if HAVE_CURLOPT_SSH_PRIVATE_KEYFILE
909
+ CURB_DEFINE(CURLOPT_SSH_PRIVATE_KEYFILE);
910
+ #endif
911
+ #if HAVE_CURLOPT_SSH_KNOWNHOSTS
912
+ CURB_DEFINE(CURLOPT_SSH_KNOWNHOSTS);
913
+ #endif
914
+ #if HAVE_CURLOPT_SSH_KEYFUNCTION
915
+ CURB_DEFINE(CURLOPT_SSH_KEYFUNCTION);
916
+ #endif
917
+ #if HAVE_CURLKHSTAT_FINE_ADD_TO_FILE
918
+ CURB_DEFINE(CURLKHSTAT_FINE_ADD_TO_FILE);
919
+ #endif
920
+ #if HAVE_CURLKHSTAT_FINE
921
+ CURB_DEFINE(CURLKHSTAT_FINE);
922
+ #endif
923
+ #if HAVE_CURLKHSTAT_REJECT
924
+ CURB_DEFINE(CURLKHSTAT_REJECT);
925
+ #endif
926
+ #if HAVE_CURLKHSTAT_DEFER
927
+ CURB_DEFINE(CURLKHSTAT_DEFER);
928
+ #endif
929
+ #if HAVE_CURLOPT_SSH_KEYDATA
930
+ CURB_DEFINE(CURLOPT_SSH_KEYDATA);
931
+ #endif
932
+
933
+ #if HAVE_CURLOPT_PRIVATE
934
+ CURB_DEFINE(CURLOPT_PRIVATE);
935
+ #endif
936
+ #if HAVE_CURLOPT_SHARE
937
+ CURB_DEFINE(CURLOPT_SHARE);
938
+ #endif
939
+ #if HAVE_CURLOPT_NEW_FILE_PERMS
940
+ CURB_DEFINE(CURLOPT_NEW_FILE_PERMS);
941
+ #endif
942
+ #if HAVE_CURLOPT_NEW_DIRECTORY_PERMS
943
+ CURB_DEFINE(CURLOPT_NEW_DIRECTORY_PERMS);
944
+ #endif
945
+
946
+ #if HAVE_CURLOPT_TELNETOPTIONS
947
+ CURB_DEFINE(CURLOPT_TELNETOPTIONS);
948
+ #endif
949
+
950
+ rb_define_const(mCurl, "HTTP_1_1", LONG2NUM(CURL_HTTP_VERSION_1_1));
951
+ rb_define_const(mCurl, "HTTP_1_0", LONG2NUM(CURL_HTTP_VERSION_1_0));
952
+ rb_define_const(mCurl, "HTTP_NONE", LONG2NUM(CURL_HTTP_VERSION_NONE));
953
+
355
954
  rb_define_singleton_method(mCurl, "ipv6?", ruby_curl_ipv6_q, 0);
356
955
  rb_define_singleton_method(mCurl, "kerberos4?", ruby_curl_kerberos4_q, 0);
357
956
  rb_define_singleton_method(mCurl, "ssl?", ruby_curl_ssl_q, 0);
@@ -370,4 +969,5 @@ void Init_curb_core() {
370
969
  init_curb_easy();
371
970
  init_curb_postfield();
372
971
  init_curb_multi();
972
+ init_curb_upload();
373
973
  }
data/ext/curb.h CHANGED
@@ -20,12 +20,12 @@
20
20
  #include "curb_macros.h"
21
21
 
22
22
  // These should be managed from the Rake 'release' task.
23
- #define CURB_VERSION "0.7.15"
24
- #define CURB_VER_NUM 715
23
+ #define CURB_VERSION "0.8.0"
24
+ #define CURB_VER_NUM 800
25
25
  #define CURB_VER_MAJ 0
26
- #define CURB_VER_MIN 7
27
- #define CURB_VER_MIC 1
28
- #define CURB_VER_PATCH 5
26
+ #define CURB_VER_MIN 8
27
+ #define CURB_VER_MIC 0
28
+ #define CURB_VER_PATCH 0
29
29
 
30
30
 
31
31
  // Maybe not yet defined in Ruby