File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -589,10 +589,15 @@ define class <curl-info-error> (<curl-error>) end;
589
589
590
590
// /////////////////////////////////////////////////////////////////////////////
591
591
//
592
- // Curlerrors as exceptions
592
+ // <curl> and <curl-easy> classes
593
593
//
594
594
// /////////////////////////////////////////////////////////////////////////////
595
595
596
+ //
597
+ // *curl-options* is a table from keywords to setter methods. Used to
598
+ // initialize the class in the `make` method.
599
+ //
600
+
596
601
define variable *curl-options*
597
602
= make (<table> );
598
603
@@ -607,13 +612,18 @@ end;
607
612
608
613
define method make
609
614
(class == <curl-easy>, #rest options, #key ) => (_ :: <curl-easy>)
615
+
616
+ // Assign slot default initialization or value passed with headers:
610
617
let curl = next-method ();
611
618
619
+ // check that slot has been initialized
612
620
if (null-pointer?(curl.curl-handle))
613
621
signal (make (<curl-init-error>))
614
622
end ;
615
623
616
- // initialize options
624
+ // initialize curl's options using setters.
625
+ // parameter options contains pairs of keywords and values
626
+ // (e.g. #"url", "http://example.com", #"verbose", #t ...)
617
627
for (i from 0 below options.size - 1 by 2 )
618
628
let keyword = options[i];
619
629
let value = options[i + 1 ];
You can’t perform that action at this time.
0 commit comments