-
-
Notifications
You must be signed in to change notification settings - Fork 180
Expand file tree
/
Copy pathmormot.lib.curl.pas
More file actions
1695 lines (1563 loc) · 66.1 KB
/
Copy pathmormot.lib.curl.pas
File metadata and controls
1695 lines (1563 loc) · 66.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/// low-level access to the libcurl API
// - this unit is a part of the Open Source Synopse mORMot framework 2,
// licensed under a MPL/GPL/LGPL three license - see LICENSE.md
unit mormot.lib.curl;
{
*****************************************************************************
Cross-Platform and Cross-Compiler libcurl API
- CURL Low-Level Constants and Types
- CURL Functions API
*****************************************************************************
}
interface
{$I ..\mormot.defines.inc}
{.$define LIBCURLMULTI}
// to include the more advanced "multi session" API functions of libcurl
// see https://curl.se/libcurl/c/libcurl-multi.html interface
{.$define LIBCURLSTATIC}
// to use the static libcurl.a version of the library - mainly for Android
uses
sysutils,
classes,
mormot.core.base,
mormot.core.os,
mormot.net.sock;
{ ************ CURL Low-Level Constants and Types }
{$Z4} // enums should be 32-bit integers here below
type
/// low-level exception raised during libcurl library access
ECurl = class(ExceptionWithProps);
/// low-level access to the libcurl CURLOPTTYPE_BLOB options
TCurlBlob = record
data: pointer;
len: PtrUInt;
flags: cardinal;
end;
const
{ actual libcurl options are a combination of the following
constants as actual value type, and a sequence number }
CURLOPTTYPE_LONG = 0;
CURLOPTTYPE_OBJECTPOINT = 10000;
CURLOPTTYPE_FUNCTIONPOINT = 20000;
CURLOPTTYPE_OFF_T = 30000;
CURLOPTTYPE_BLOB = 40000;
CURLOPTTYPE_STRINGPOINT = CURLOPTTYPE_OBJECTPOINT;
CURLOPTTYPE_SLISTPOINT = CURLOPTTYPE_OBJECTPOINT;
CURLOPTTYPE_CBPOINT = CURLOPTTYPE_OBJECTPOINT;
CURLOPTTYPE_VALUES = CURLOPTTYPE_LONG;
// flag bits in the TCurlBlob record
CURL_BLOB_COPY = 1;
CURL_BLOB_NOCOPY = 0;
{$ifdef FPC}
{$WARN 3031 off : Values in enumeration types have to be ascending }
{$endif FPC}
type
/// low-level options for libcurl library API calls
TCurlOption = (
coWriteData = CURLOPTTYPE_CBPOINT + 1,
coUrl = CURLOPTTYPE_STRINGPOINT + 2,
coPort = CURLOPTTYPE_LONG + 3,
coProxy = CURLOPTTYPE_STRINGPOINT + 4,
coUserPwd = CURLOPTTYPE_STRINGPOINT + 5,
coProxyUserPwd = CURLOPTTYPE_STRINGPOINT + 6,
coRange = CURLOPTTYPE_STRINGPOINT + 7,
coReadData = CURLOPTTYPE_CBPOINT + 9,
coErrorBuffer = CURLOPTTYPE_OBJECTPOINT + 10,
coWriteFunction = CURLOPTTYPE_FUNCTIONPOINT + 11,
coReadFunction = CURLOPTTYPE_FUNCTIONPOINT + 12,
coTimeout = CURLOPTTYPE_LONG + 13,
coInFileSize = CURLOPTTYPE_LONG + 14,
coPostFields = CURLOPTTYPE_OBJECTPOINT + 15,
coReferer = CURLOPTTYPE_STRINGPOINT + 16,
coFtpPort = CURLOPTTYPE_STRINGPOINT + 17,
coUserAgent = CURLOPTTYPE_STRINGPOINT + 18,
coLowSpeedLimit = CURLOPTTYPE_LONG + 19,
coLowSpeedTime = CURLOPTTYPE_LONG + 20,
coResumeFrom = CURLOPTTYPE_LONG + 21,
coCookie = CURLOPTTYPE_STRINGPOINT + 22,
coHttpHeader = CURLOPTTYPE_SLISTPOINT + 23,
coHttpPost = CURLOPTTYPE_OBJECTPOINT + 24, // deprecated
coSslCert = CURLOPTTYPE_STRINGPOINT + 25,
coKeyPasswd = CURLOPTTYPE_STRINGPOINT + 26,
coCRLF = CURLOPTTYPE_LONG + 27,
coQuote = CURLOPTTYPE_SLISTPOINT + 28,
coHeaderData = CURLOPTTYPE_CBPOINT + 29,
coCookieFile = CURLOPTTYPE_STRINGPOINT + 31,
coSslVersion = CURLOPTTYPE_VALUES + 32,
coTimeCondition = CURLOPTTYPE_VALUES + 33,
coTimeValue = CURLOPTTYPE_LONG + 34,
coCustomRequest = CURLOPTTYPE_STRINGPOINT + 36,
coStdErr = CURLOPTTYPE_OBJECTPOINT + 37,
coPostQuote = CURLOPTTYPE_SLISTPOINT + 39,
coObsolete40 = CURLOPTTYPE_OBJECTPOINT + 40,
coVerbose = CURLOPTTYPE_LONG + 41,
coHeader = CURLOPTTYPE_LONG + 42,
coNoProgress = CURLOPTTYPE_LONG + 43,
coNobody = CURLOPTTYPE_LONG + 44,
coFailOnError = CURLOPTTYPE_LONG + 45,
coUpload = CURLOPTTYPE_LONG + 46,
coPost = CURLOPTTYPE_LONG + 47,
coDirListOnly = CURLOPTTYPE_LONG + 48,
coAppend = CURLOPTTYPE_LONG + 50,
coNetRC = CURLOPTTYPE_VALUES + 51,
coFollowLocation = CURLOPTTYPE_LONG + 52,
coTransferText = CURLOPTTYPE_LONG + 53,
coPut = CURLOPTTYPE_LONG + 54, // deprecated
coProgressFunction = CURLOPTTYPE_FUNCTIONPOINT + 56, // deprecated
coXferInfoData = CURLOPTTYPE_CBPOINT + 57,
coAutoReferer = CURLOPTTYPE_LONG + 58,
coProxyPort = CURLOPTTYPE_LONG + 59,
coPostFieldSize = CURLOPTTYPE_LONG + 60,
coHttpProxyTunnel = CURLOPTTYPE_LONG + 61,
coInterface = CURLOPTTYPE_STRINGPOINT + 62,
coKRBLevel = CURLOPTTYPE_STRINGPOINT + 63,
coSslVerifyPeer = CURLOPTTYPE_LONG + 64,
coCAInfo = CURLOPTTYPE_STRINGPOINT + 65,
coMaxRedirs = CURLOPTTYPE_LONG + 68,
coFileTime = CURLOPTTYPE_LONG + 69,
coTelnetOptions = CURLOPTTYPE_SLISTPOINT + 70,
coMaxConnects = CURLOPTTYPE_LONG + 71,
coObsolete72 = CURLOPTTYPE_LONG + 72,
coFreshConnect = CURLOPTTYPE_LONG + 74,
coForbidReuse = CURLOPTTYPE_LONG + 75,
coRandomFile = CURLOPTTYPE_STRINGPOINT + 76, // deprecated
coEGDSocket = CURLOPTTYPE_STRINGPOINT + 77, // deprecated
coConnectTimeout = CURLOPTTYPE_LONG + 78,
coHeaderFunction = CURLOPTTYPE_FUNCTIONPOINT + 79,
coHttpGet = CURLOPTTYPE_LONG + 80,
coSslVerifyHost = CURLOPTTYPE_LONG + 81,
coCookieJar = CURLOPTTYPE_STRINGPOINT + 82,
coSslCipherList = CURLOPTTYPE_STRINGPOINT + 83,
coHttpVersion = CURLOPTTYPE_VALUES + 84,
coFtpUseEPSV = CURLOPTTYPE_LONG + 85,
coSslCertType = CURLOPTTYPE_STRINGPOINT + 86,
coSslKey = CURLOPTTYPE_STRINGPOINT + 87,
coSslKeyType = CURLOPTTYPE_STRINGPOINT + 88,
coSslEngine = CURLOPTTYPE_STRINGPOINT + 89,
coSslEngineDefault = CURLOPTTYPE_LONG + 90,
coDnsCacheTimeout = CURLOPTTYPE_LONG + 92,
coPreQuote = CURLOPTTYPE_SLISTPOINT + 93,
coDebugFunction = CURLOPTTYPE_FUNCTIONPOINT + 94,
coDebugData = CURLOPTTYPE_CBPOINT + 95,
coCookieSession = CURLOPTTYPE_LONG + 96,
coCAPath = CURLOPTTYPE_STRINGPOINT + 97,
coBufferSize = CURLOPTTYPE_LONG + 98,
coNoSignal = CURLOPTTYPE_LONG + 99,
coShare = CURLOPTTYPE_OBJECTPOINT + 100,
coProxyType = CURLOPTTYPE_LONG + 101,
coAcceptEncoding = CURLOPTTYPE_STRINGPOINT + 102,
coPrivate = CURLOPTTYPE_OBJECTPOINT + 103,
coHttp200Aliases = CURLOPTTYPE_SLISTPOINT + 104,
coUnrestrictedAuth = CURLOPTTYPE_LONG + 105,
coFtpUseEPRT = CURLOPTTYPE_LONG + 106,
coHttpAuth = CURLOPTTYPE_VALUES + 107,
coSslCtxFunction = CURLOPTTYPE_FUNCTIONPOINT + 108,
coSslCtxData = CURLOPTTYPE_CBPOINT + 109,
coFtpCreateMissingDirs = CURLOPTTYPE_LONG + 110,
coProxyAuth = CURLOPTTYPE_VALUES + 111,
coServerResponseTimeout = CURLOPTTYPE_LONG + 112,
coIPResolve = CURLOPTTYPE_VALUES + 113,
coMaxFileSize = CURLOPTTYPE_LONG + 114,
coInFileSizeLarge = CURLOPTTYPE_OFF_T + 115,
coResumeFromLarge = CURLOPTTYPE_OFF_T + 116,
coMaxFileSizeLarge = CURLOPTTYPE_OFF_T + 117,
coNetRCFile = CURLOPTTYPE_STRINGPOINT + 118,
coUseSsl = CURLOPTTYPE_VALUES + 119,
coPostFieldSizeLarge = CURLOPTTYPE_OFF_T + 120,
coTcpNoDelay = CURLOPTTYPE_LONG + 121,
coFtpSslAuth = CURLOPTTYPE_VALUES + 129,
coIOCTLFunction = CURLOPTTYPE_FUNCTIONPOINT + 130, // deprecated
coIOCTLData = CURLOPTTYPE_CBPOINT + 131, // deprecated
coFtpAccount = CURLOPTTYPE_STRINGPOINT + 134,
coCookieList = CURLOPTTYPE_STRINGPOINT + 135,
coIgnoreContentLength = CURLOPTTYPE_LONG + 136,
coFtpSkipPASVIp = CURLOPTTYPE_LONG + 137,
coFtpFileMethod = CURLOPTTYPE_VALUES + 138,
coLocalPort = CURLOPTTYPE_LONG + 139,
coLocalPortRange = CURLOPTTYPE_LONG + 140,
coConnectOnly = CURLOPTTYPE_LONG + 141,
coMaxSendSpeedLarge = CURLOPTTYPE_OFF_T + 145,
coMaxRecvSpeedLarge = CURLOPTTYPE_OFF_T + 146,
coFtpAlternativeToUser = CURLOPTTYPE_STRINGPOINT + 147,
coSockOptFunction = CURLOPTTYPE_FUNCTIONPOINT + 148,
coSockOptData = CURLOPTTYPE_CBPOINT + 149,
coSslSessionIDCache = CURLOPTTYPE_LONG + 150,
coSshAuthTypes = CURLOPTTYPE_VALUES + 151,
coSshPublicKeyfile = CURLOPTTYPE_STRINGPOINT + 152,
coSshPrivateKeyfile = CURLOPTTYPE_STRINGPOINT + 153,
coFtpSslCCC = CURLOPTTYPE_LONG + 154,
coTimeoutMs = CURLOPTTYPE_LONG + 155,
coConnectTimeoutMs = CURLOPTTYPE_LONG + 156,
coHttpTransferDecoding = CURLOPTTYPE_LONG + 157,
coHttpContentDecoding = CURLOPTTYPE_LONG + 158,
coNewFilePerms = CURLOPTTYPE_LONG + 159,
coNewDirectoryPerms = CURLOPTTYPE_LONG + 160,
coPostRedir = CURLOPTTYPE_VALUES + 161,
coSshHostPublicKeyMD5 = CURLOPTTYPE_STRINGPOINT + 162,
coOpenSocketFunction = CURLOPTTYPE_FUNCTIONPOINT + 163,
coOpenSocketData = CURLOPTTYPE_CBPOINT + 164,
coCopyPostFields = CURLOPTTYPE_OBJECTPOINT + 165,
coProxyTransferMode = CURLOPTTYPE_LONG + 166,
coSeekFunction = CURLOPTTYPE_FUNCTIONPOINT + 167,
coSeekData = CURLOPTTYPE_CBPOINT + 168,
coCRLFile = CURLOPTTYPE_STRINGPOINT + 169,
coIssuerCert = CURLOPTTYPE_STRINGPOINT + 170,
coAddressScope = CURLOPTTYPE_LONG + 171,
coCertInfo = CURLOPTTYPE_LONG + 172,
coUserName = CURLOPTTYPE_STRINGPOINT + 173,
coPassword = CURLOPTTYPE_STRINGPOINT + 174,
coProxyUsername = CURLOPTTYPE_STRINGPOINT + 175,
coProxyPassword = CURLOPTTYPE_STRINGPOINT + 176,
coNoProxy = CURLOPTTYPE_STRINGPOINT + 177,
coTFtpBlkSize = CURLOPTTYPE_LONG + 178,
coSocks5GssApiNec = CURLOPTTYPE_LONG + 180,
coSshKnownHosts = CURLOPTTYPE_STRINGPOINT + 183,
coSshKeyFuntion = CURLOPTTYPE_FUNCTIONPOINT + 184,
coSshKeyData = CURLOPTTYPE_CBPOINT + 185,
coMailFrom = CURLOPTTYPE_STRINGPOINT + 186,
coMailRcpt = CURLOPTTYPE_SLISTPOINT + 187,
coFtpUsePRET = CURLOPTTYPE_LONG + 188,
coRtspRequest = CURLOPTTYPE_VALUES + 189,
coRtspSessionID = CURLOPTTYPE_STRINGPOINT + 190,
coRtspStreamURI = CURLOPTTYPE_STRINGPOINT + 191,
coRtspTransport = CURLOPTTYPE_STRINGPOINT + 192,
coRtspClientCSeq = CURLOPTTYPE_LONG + 193,
coRtspServerCSeq = CURLOPTTYPE_LONG + 194,
coInterleaveData = CURLOPTTYPE_CBPOINT + 195,
coInterleaveFunction = CURLOPTTYPE_FUNCTIONPOINT + 196,
coWildcardMatch = CURLOPTTYPE_LONG + 197,
coChunkBgnFunction = CURLOPTTYPE_FUNCTIONPOINT + 198,
coChunkEndFunction = CURLOPTTYPE_FUNCTIONPOINT + 199,
coFnMatchFunction = CURLOPTTYPE_FUNCTIONPOINT + 200,
coChunkData = CURLOPTTYPE_CBPOINT + 201,
coFnMatchData = CURLOPTTYPE_CBPOINT + 202,
coResolve = CURLOPTTYPE_SLISTPOINT + 203,
coTlsAuthUsername = CURLOPTTYPE_STRINGPOINT + 204,
coTlsAuthPassword = CURLOPTTYPE_STRINGPOINT + 205,
coTlsAuthType = CURLOPTTYPE_STRINGPOINT + 206,
coTransferEncoding = CURLOPTTYPE_LONG + 207,
coCloseSocketFunction = CURLOPTTYPE_FUNCTIONPOINT + 208,
coCloseSocketData = CURLOPTTYPE_CBPOINT + 209,
coGssApiDelegation = CURLOPTTYPE_VALUES + 210,
coDnsServers = CURLOPTTYPE_STRINGPOINT + 211,
coAcceptTimeoutMs = CURLOPTTYPE_LONG + 212,
coTcpKeepalive = CURLOPTTYPE_LONG + 213,
coTcpKeepIdle = CURLOPTTYPE_LONG + 214,
coTcpKeepIntvl = CURLOPTTYPE_LONG + 215,
coSslOptions = CURLOPTTYPE_VALUES + 216,
coMailAuth = CURLOPTTYPE_STRINGPOINT + 217,
coSaslIR = CURLOPTTYPE_LONG + 218,
coXferInfoFunction = CURLOPTTYPE_FUNCTIONPOINT + 219,
coXOAuth2Bearer = CURLOPTTYPE_STRINGPOINT + 220,
coDnsInterface = CURLOPTTYPE_STRINGPOINT + 221,
coDnsLocalIP4 = CURLOPTTYPE_STRINGPOINT + 222,
coDnsLocalIP6 = CURLOPTTYPE_STRINGPOINT + 223,
coLoginOptions = CURLOPTTYPE_STRINGPOINT + 224,
coSslEnableAlpn = CURLOPTTYPE_LONG + 226,
coExpect100TimeoutMs = CURLOPTTYPE_LONG + 227,
coProxyHeader = CURLOPTTYPE_SLISTPOINT + 228,
coHeaderOpt = CURLOPTTYPE_VALUES + 229,
coPinnedPublicKey = CURLOPTTYPE_STRINGPOINT + 230,
coUnixSocketPath = CURLOPTTYPE_STRINGPOINT + 231,
coSslVerifyStatus = CURLOPTTYPE_LONG + 232,
coSslFalseStart = CURLOPTTYPE_LONG + 233,
coPathAsIs = CURLOPTTYPE_LONG + 234,
coProxyServiceName = CURLOPTTYPE_STRINGPOINT + 235,
coServiceName = CURLOPTTYPE_STRINGPOINT + 236,
coPipeWait = CURLOPTTYPE_LONG + 237,
coDefaultProtocol = CURLOPTTYPE_STRINGPOINT + 238,
coStreamWeight = CURLOPTTYPE_LONG + 239,
coStreamDepends = CURLOPTTYPE_OBJECTPOINT + 240,
coStreamDependsE = CURLOPTTYPE_OBJECTPOINT + 241,
coTFtpNoOptions = CURLOPTTYPE_LONG + 242,
coConnectTo = CURLOPTTYPE_SLISTPOINT + 243,
coTcpFastOpen = CURLOPTTYPE_LONG + 244,
coKeepSendingOnError = CURLOPTTYPE_LONG + 245,
coProxyCAInfo = CURLOPTTYPE_STRINGPOINT + 246,
coProxyYCAPath = CURLOPTTYPE_STRINGPOINT + 247,
coProxySslVerifyPeer = CURLOPTTYPE_LONG + 248,
coProxySslVeryfyHost = CURLOPTTYPE_LONG + 249,
coProxySslVersion = CURLOPTTYPE_VALUES + 250,
coProxyTlsAuthUsername = CURLOPTTYPE_STRINGPOINT + 251,
coProxyTlsAuthPassword = CURLOPTTYPE_STRINGPOINT + 252,
coProxyTlsAuthType = CURLOPTTYPE_STRINGPOINT + 253,
coProxySslCert = CURLOPTTYPE_STRINGPOINT + 254,
coProxySslCertType = CURLOPTTYPE_STRINGPOINT + 255,
coProxySslKey = CURLOPTTYPE_STRINGPOINT + 256,
coProxySslKeyType = CURLOPTTYPE_STRINGPOINT + 257,
coProxyKeyPasswd = CURLOPTTYPE_STRINGPOINT + 258,
coProxySslCipherList = CURLOPTTYPE_STRINGPOINT + 259,
coProxyCRLFile = CURLOPTTYPE_STRINGPOINT + 260,
coProxySslOptions = CURLOPTTYPE_LONG + 261,
coPreProxy = CURLOPTTYPE_STRINGPOINT + 262,
coProxyPinnedPublicKey = CURLOPTTYPE_STRINGPOINT + 263,
coAbstractUnixSocket = CURLOPTTYPE_STRINGPOINT + 264,
coSupressConnectHeaders = CURLOPTTYPE_LONG + 265,
coRequestTarget = CURLOPTTYPE_STRINGPOINT + 266,
coSocks5Auth = CURLOPTTYPE_LONG + 267,
coSshCompression = CURLOPTTYPE_LONG + 268,
coMimePost = CURLOPTTYPE_OBJECTPOINT + 269,
coTimeValueLarge = CURLOPTTYPE_OFF_T + 270,
coHappyEyeballsTimeoutMs = CURLOPTTYPE_LONG + 271,
coResolverStartFunction = CURLOPTTYPE_FUNCTIONPOINT + 272,
coResolverStartData = CURLOPTTYPE_CBPOINT + 273,
coHAProxyProtocol = CURLOPTTYPE_LONG + 274,
coDnsShuffleAddresses = CURLOPTTYPE_LONG + 275,
coTls13Ciphers = CURLOPTTYPE_STRINGPOINT + 276,
coProxyTls13Ciphers = CURLOPTTYPE_STRINGPOINT + 277,
coDisallowUsernameInUrl = CURLOPTTYPE_LONG + 278,
coDohUR = CURLOPTTYPE_STRINGPOINT + 279,
coUploadBufferSize = CURLOPTTYPE_LONG + 280,
coUpkeepIntervalMs = CURLOPTTYPE_LONG + 281,
coCurlLU = CURLOPTTYPE_OBJECTPOINT + 282,
coTrailerFunction = CURLOPTTYPE_FUNCTIONPOINT + 283,
coTrailerData = CURLOPTTYPE_CBPOINT + 284,
coHttp09Allowed = CURLOPTTYPE_LONG + 285,
coAltSvcCtrl = CURLOPTTYPE_LONG + 286,
coAltSvc = CURLOPTTYPE_STRINGPOINT + 287,
coMaxAgeConn = CURLOPTTYPE_LONG + 288,
coSaslAuthZID = CURLOPTTYPE_STRINGPOINT + 289,
coMailRcptAllowFails = CURLOPTTYPE_LONG + 290,
coSslCertBlob = CURLOPTTYPE_BLOB + 291,
coSslKeyBlob = CURLOPTTYPE_BLOB + 292,
coProxySslCertBlob = CURLOPTTYPE_BLOB + 293,
coProxySslKeyBlob = CURLOPTTYPE_BLOB + 294,
coIssuerCertBlob = CURLOPTTYPE_BLOB + 295,
coProxyIssuerCert = CURLOPTTYPE_STRINGPOINT + 296,
coProxyIssuerCertBlob = CURLOPTTYPE_BLOB + 297,
coSslECCurves = CURLOPTTYPE_STRINGPOINT + 298,
coHstsCtrl = CURLOPTTYPE_LONG + 299,
coHsts = CURLOPTTYPE_STRINGPOINT + 300,
coHstsReadFuction = CURLOPTTYPE_FUNCTIONPOINT + 301,
coHstsReadData = CURLOPTTYPE_CBPOINT + 302,
coHstsWriteFunction = CURLOPTTYPE_FUNCTIONPOINT + 303,
coHstsWriteDate = CURLOPTTYPE_CBPOINT + 304,
coAwsSigV4 = CURLOPTTYPE_STRINGPOINT + 305,
coDohSslVerifyPeer = CURLOPTTYPE_LONG + 306,
coDohSslVerifyHost = CURLOPTTYPE_LONG + 307,
coDohSslVerifyStatus = CURLOPTTYPE_LONG + 308,
coCAInfoBlob = CURLOPTTYPE_BLOB + 309,
coProxyCAInfoBlob = CURLOPTTYPE_BLOB + 310,
coSshHostPublicKeySHA256 = CURLOPTTYPE_STRINGPOINT + 311,
coPreReqFunction = CURLOPTTYPE_FUNCTIONPOINT + 312,
coPreReqData = CURLOPTTYPE_CBPOINT + 313,
coMaxLifetimeConn = CURLOPTTYPE_LONG + 314,
coMimeOptions = CURLOPTTYPE_LONG + 315,
coSshHostKeyFunction = CURLOPTTYPE_FUNCTIONPOINT + 316,
coSshHostKeyData = CURLOPTTYPE_CBPOINT + 317,
coProtocolsStr = CURLOPTTYPE_STRINGPOINT + 318,
coRedirProtocolsStr = CURLOPTTYPE_STRINGPOINT + 319,
coWSOptions = CURLOPTTYPE_LONG + 320,
coCACacheTimeout = CURLOPTTYPE_LONG + 321,
coQuickExit = CURLOPTTYPE_LONG + 322,
coHAProxyClientIP = CURLOPTTYPE_STRINGPOINT + 323
);
/// low-level result codes for libcurl library API calls
TCurlResult = (
crOK,
crUnsupportedProtocol,
crFailedInit,
crURLMalformat,
crNotBuiltIn,
crCouldNotResolveProxy,
crCouldNotResolveHost,
crCouldNotConnect,
crWeirdServerReply,
crRemoteAccessDenied,
crFtpAccessFailed,
crFtpWeirdPassReply,
crFtpAcceptTimeout,
crFtpWeirdPasvReply,
crFtpWeird227Format,
crFtpCannotGetHost,
crHttp2,
crFtpCouldNotSetType,
crPartialFile,
crFtpCouldNotRetrFile,
crObsolete20,
crQuoteError,
crHttpReturnedError,
crWriteError,
crObsolete24,
crUploadFailed,
crReadError,
crOutOfMemory,
crOperationTimeout,
crObsolete29,
crFtpPortFailed,
crFtpCouldNotUseRest,
crObsolete32,
crRangeError,
crHttpPostError,
crSslConnectError,
crBadDownloadResume,
crFileCouldNotReadFile,
crLdapCannotBind,
crLdapSearchFailed,
crObsolete40,
crFunctionNotFound,
crAbortedByCallback,
crBadFunctionArgument,
crObsolete44,
crInterfaceFailed,
crObsolete46,
crTooManyRedirects,
crUnknownOption,
crSetOptOptionSyntax,
crObsolete50,
crObsolete51,
crGotNothing,
crSslEngineNotFound,
crSslEngineSetFailed,
crSendError,
crRecvError,
crObsolete57,
crSslCertProblem,
crSslCipher,
crPeerFailedVerification,
crBadContentEncoding,
crObsolete62,
crFileSizeExceeded,
crUseSslFailed,
crSendFailRewind,
crSslEngineInitFailed,
crLoginDenied,
crTFtpNotFound,
crTFtpPerm,
crRemoteDiskFull,
crTFtpIllegal,
crTFtpUnknownID,
crRemoteFileExists,
crTFtpNoSuchUser,
crObsolete75,
crObsolete76,
crSslCACertBadFile,
crRemoteFileNotFound,
crSsh,
crSslShutdownFailed,
crAgain,
crSslCrlBadFile,
crSslIssuerError,
crFtpPRETFailed,
crRtspCSeqError,
crRtspSessionError,
crFtpBadFileList,
crChunkFailed,
crNoConnectionAvailable,
crSslPinnedPubKeyNotMatch,
crSslInvalidCertStatus,
crHttp2Stream,
crResursiveApiCall,
crAuthError,
crHttp3,
crQuicConnectError,
crProxy,
crSslClientCert,
crUnrecoverablePoll
);
/// libcurl share interface result codes
TCurlShareResult = (
csrOk,
csrBadOption,
csrInUse,
csrInvalid,
csrNoMem,
csrNotBuiltIn
);
/// libcurl share interface options
TCurlShareOption = (
csoNone,
csoShare,
csoUnShare,
csoLockFunc,
csoUnLockFunc,
csoUserData
);
const
{ actual libcurl infos are a combination of the following
constants as actual value type, and a sequence number }
CURLINFO_STRING = $100000;
CURLINFO_LONG = $200000;
CURLINFO_DOUBLE = $300000;
CURLINFO_SLIST = $400000;
CURLINFO_PTR = $400000; // same as SLIST
CURLINFO_SOCKET = $500000;
CURLINFO_OFF_T = $600000;
type
TCurlInfo = (
ciEffectiveURL = CURLINFO_STRING + 1,
ciResponseCode = CURLINFO_LONG + 2,
ciTotalTime = CURLINFO_DOUBLE + 3,
ciNameLookupTime = CURLINFO_DOUBLE + 4,
ciConnectTime = CURLINFO_DOUBLE + 5,
ciPreTransferTime = CURLINFO_DOUBLE + 6,
ciSizeUpload = CURLINFO_DOUBLE + 7, // deprecated since v7.55.0, use ciSizeUploadT
ciSizeUploadT = CURLINFO_OFF_T + 7,
ciSizeDownload = CURLINFO_DOUBLE + 8, // deprecated since v7.55.0, use ciSizeDownloadT
ciSizeDownloadT = CURLINFO_OFF_T + 8,
ciSpeedDownload = CURLINFO_DOUBLE + 9, // deprecated since v7.55.0, use ciSpeedDownloadT
ciSpeedDownloadT = CURLINFO_OFF_T + 9,
ciSpeedUpload = CURLINFO_DOUBLE + 10, // deprecated since v7.55.0, use ciSpeedUploadT
ciSpeedUploadT = CURLINFO_OFF_T + 10,
ciHeaderSize = CURLINFO_LONG + 11,
ciRequestSize = CURLINFO_LONG + 12,
ciSslVerifyResult = CURLINFO_LONG + 13,
ciFileTime = CURLINFO_LONG + 14,
ciFileTimeT = CURLINFO_OFF_T + 14,
ciContentLengthDownload = CURLINFO_DOUBLE + 15, // deprecated since v7.55.0, use ciContentLengthDownloadT
ciContentLengthDownloadT = CURLINFO_OFF_T + 15,
ciContentLengthUpload = CURLINFO_DOUBLE + 16, // deprecated since v7.55.0, use ciContentLengthUploadT
ciContentLengthUploadT = CURLINFO_OFF_T + 16,
ciStartTransferTime = CURLINFO_DOUBLE + 17,
ciContentType = CURLINFO_STRING + 18,
ciRedirectTime = CURLINFO_DOUBLE + 19,
ciRedirectCount = CURLINFO_LONG + 20,
ciPrivate = CURLINFO_STRING + 21,
ciHttpConnectCode = CURLINFO_LONG + 22,
ciHttpAuthAvail = CURLINFO_LONG + 23,
ciProxyAuthAvail = CURLINFO_LONG + 24,
ciOSErrno = CURLINFO_LONG + 25,
ciNumConnects = CURLINFO_LONG + 26,
ciSslEngines = CURLINFO_SLIST + 27,
ciCookieList = CURLINFO_SLIST + 28,
ciLastSocket = CURLINFO_LONG + 29, // deprecated since v7.45.0, use ciActiveSocket
ciFtpEntryPath = CURLINFO_STRING + 30,
ciRedirectURL = CURLINFO_STRING + 31,
ciPrimaryIP = CURLINFO_STRING + 32,
ciAppConnectTime = CURLINFO_DOUBLE + 33,
ciCertInfo = CURLINFO_PTR + 34,
ciConditionUnmet = CURLINFO_LONG + 35,
ciRtspSessionID = CURLINFO_STRING + 36,
ciRtspClientCSeq = CURLINFO_LONG + 37,
ciRtspServerCSeq = CURLINFO_LONG + 38,
ciRtspCSeqRecv = CURLINFO_LONG + 39,
ciPrimaryPort = CURLINFO_LONG + 40,
ciLocalIP = CURLINFO_STRING + 41,
ciLocalPort = CURLINFO_LONG + 42,
ciTlsSession = CURLINFO_PTR + 43, // deprecated since v7.48.0, use ciTlsSslPtr
ciActiveSocket = CURLINFO_SOCKET + 44,
ciTlsSslPtr = CURLINFO_PTR + 45,
ciHttpVersion = CURLINFO_LONG + 46,
ciProxySslVerifyResult = CURLINFO_LONG + 47,
ciProtocol = CURLINFO_LONG + 48, // deprecated since v7.85.0, use ciScheme
ciScheme = CURLINFO_STRING + 49,
ciTotalTimeT = CURLINFO_OFF_T + 50, // can be used for calculation "Content download time"
ciNameLookupTimeT = CURLINFO_OFF_T + 51,
ciConnectTimeT = CURLINFO_OFF_T + 52,
ciPreTransferTimeT = CURLINFO_OFF_T + 53,
ciStartTransferTimeT = CURLINFO_OFF_T + 54,
ciRedirectTimeT = CURLINFO_OFF_T + 55,
ciAppConnectTimeT = CURLINFO_OFF_T + 56, // TLS handshake
ciRetryAfter = CURLINFO_OFF_T + 57,
ciEffectiveMethod = CURLINFO_STRING + 58,
ciProxyError = CURLINFO_LONG + 59,
ciReferer = CURLINFO_STRING + 60,
ciCAInfo = CURLINFO_STRING + 61,
ciCAPath = CURLINFO_STRING + 62,
ciXferID = CURLINFO_OFF_T + 63,
ciConnID = CURLINFO_OFF_T + 64
);
/// low-level parameter for coHttpVersion
TCurlHttpVersion = (
chvNone,
chv1_0,
chv1_1,
chv2,
chv2Tls,
chv2PriorKnowledge,
chv3 = 30,
chv3Only = 31
);
/// items of low-level parameter for coHttpAuth
TCurlAuth = (
cauBasic = 0,
cauDigest = 1,
cauNegotiate = 2,
cauNtlm = 3,
cauDigest_IE = 4,
cauNtlm_WB = 5,
cauBearer = 6,
cauAws_SigV4 = 7,
cauOnly = 31);
/// low-level parameter for coHttpAuth
TCurlAuths = set of TCurlAuth;
/// low-level parameter for coUseSsl
TCurlUseSsl = (
cusNone,
cusTry,
cusControl,
cusAll
);
/// low-level argument to the coDebugFunction callback
TCurlDebug = (
cuText,
cuHeaderIn,
cuHeaderOut,
cuDataIn,
cuDataOut,
cuSslDataIn,
cuSslDataOut
);
{$ifdef LIBCURLMULTI}
/// low-level result codes for libcurl library API calls in "multi" mode
TCurlMultiCode = (
cmcCallMultiPerform = -1,
cmcOK = 0,
cmcBadHandle,
cmcBadEasyHandle,
cmcOutOfMemory,
cmcInternalError,
cmcBadSocket,
cmcUnknownOption,
cmcAddedAlready,
cmcRecursiveApiCall,
cmcWakeupFailure,
cmcBadFunctionArgument,
cmcAbortedByCallback,
cmcUnrecoverablePoll
);
/// low-level options for libcurl library API calls in "multi" mode
TCurlMultiOption = (
cmoPipeLining = 3,
cmoMaxConnects = 6,
cmoMaxHostConnections = 7,
cmoMaxPipelineLength = 8,
cmoMaxTotalConnections = 13,
cmoSocketData = 10002,
cmoTimerData = 10005,
cmoPipeliningSiteBL = 10011,
cmoPipeliningServerBL = 10012,
cmoPushData = 10015,
cmoSocketFunction = 20001,
cmoTimerFunction = 20004,
cmoPushFunction = 20014,
cmoContentLengthPenaltySize = 30009,
cmoChunkLengthPenaltySize = 30010
);
{$endif LIBCURLMULTI}
/// low-level version identifier of the libcurl library
TCurlVersion = (
cv1,
cv2,
cv3,
cv4,
cv5,
cv6,
cv7,
cv8,
cv9,
cv10,
cv11
);
/// low-level initialization option for libcurl library API
// - currently, only giSsl is set, since giWin32 is redundant with WinHttp
TCurlGlobalInit = set of (
giNone,
giSsl,
giWin32,
giAll
);
/// low-level message state for libcurl library API
TCurlMsg = (
cmNone,
cmDone
);
/// libcurl multipart/formdata HTTP POST result codes
TCurlFormCode = (
CURL_FORMADD_OK,
CURL_FORMADD_MEMORY,
CURL_FORMADD_OPTION_TWICE,
CURL_FORMADD_NULL,
CURL_FORMADD_UNKNOWN_OPTION,
CURL_FORMADD_INCOMPLETE,
CURL_FORMADD_ILLEGAL_ARRAY,
CURL_FORMADD_DISABLED
);
/// libcurl multipart/formdata HTTP POST options
TCurlFormOption = (
CURLFORM_NOTHING,
CURLFORM_COPYNAME, // followed by a string which will be copied by libcurl
CURLFORM_PTRNAME, // followed by a string which pointer will stay available
CURLFORM_NAMELENGTH, // if CURLFORM_COPYNAME/PTRNAME is not #0 terminated
CURLFORM_COPYCONTENTS, // followed by a pointer to the contents to be copied
CURLFORM_PTRCONTENTS, // followed by a persistent pointer to the contents
CURLFORM_CONTENTSLENGTH, // deprecated - use CURLFORM_CONTENTLEN
CURLFORM_FILECONTENT, // followed by a filename - may not be a file upload
CURLFORM_ARRAY,
CURLFORM_OBSOLETE,
CURLFORM_FILE, // followed by a filename - will be a file upload part
CURLFORM_BUFFER, // followed by a filename - file upload without CURLFORM_FILE
CURLFORM_BUFFERPTR, // CURLFORM_BUFFER persistent pointer
CURLFORM_BUFFERLENGTH, // CURLFORM_BUFFER persistent size
CURLFORM_CONTENTTYPE, // followed by a pointer to a string, for CURLFORM_FILE
CURLFORM_CONTENTHEADER, // followed by a curl_slist_append() list of headers
CURLFORM_FILENAME, // followed by a pointer to a string, for CURLFORM_FILE
CURLFORM_END,
CURLFORM_OBSOLETE2,
CURLFORM_STREAM,
CURLFORM_CONTENTLEN // added in 7.46.0, provide a curl_off_t 64-bit size
);
/// low-level items for TCurlVersionInfo.features
TCurlVersionFeature = (
cvfIPv6,
cvfKerberos4,
cvfSsl,
cvfLibz,
cvfNtlm,
cvfGssNegotiate,
cvfDebug,
cvfAsynchDns,
cvfSpNego,
cvfLargefile,
cvfIDN,
cvfSspi,
cvfConv,
cvfCurlDebug,
cvfTlsAuthSrp,
cvfNtlmWB,
cvfHttp2,
cvfGssApi,
cvfKerberos5,
cvfUnixSockets,
cvfPsl,
cvfHttpSProxy,
cvfMultiSsl,
cvfBrotli,
cvfAltSvc,
cvfHttp3,
cvfZstd,
cvfUnicode,
cvfHsts,
cvfGSasl,
cvfThreadsafe
);
/// low-level set for TCurlVersionInfo.features
TCurlVersionFeatures = set of TCurlVersionFeature;
/// low-level version information for libcurl library (in its cv11 layout)
// - you need to check the actual version before accessing any of its members
TCurlVersionInfo = record
/// define the actual available fields
age: TCurlVersion;
/// human readable string of the library version
version: PAnsiChar;
/// numerical representation of the library version
version_num: cardinal;
/// human readable string of the recognized running system
host: PAnsiChar;
/// flags to identify the main library features
features: TCurlVersionFeatures;
/// human readable string of the associated OpenSSL library version
ssl_version: PAnsiChar;
/// not used, always nil
ssl_version_num: PAnsiChar;
/// human readable string of the associated libz library version
libz_version: PAnsiChar;
/// list of known protocols
protocols: PPAnsiCharArray;
// requires age >= cv2
ares: PAnsiChar;
ares_num: integer;
// requires age >= cv3
libidn: PAnsiChar;
// requires age >= cv4
iconv_ver_num: integer;
libssh_version: PAnsiChar;
// requires age >= cv5
brotli_ver_num: cardinal;
brotli_version: PAnsiChar;
// requires age >= cv6
nghttp2_ver_num: cardinal;
nghttp2_version: PAnsiChar;
quic_version: PAnsiChar;
// requires age >= cv7
cainfo: PAnsiChar;
capath: PAnsiChar;
// requires age >= cv8
zstd_ver_num: integer;
zstd_version: PAnsiChar;
// requires age >= cv9
hyper_version: PAnsiChar;
// requires age >= cv10
gsasl_version: PAnsiChar;
// requires age >= cv11
feature_names: PPAnsiCharArray;
end;
PCurlVersionInfo = ^TCurlVersionInfo;
/// low-level access to the libcurl library instance
TCurl = type pointer;
/// low-level string list type for libcurl library API
TCurlSList = type pointer;
PCurlSList = ^TCurlSList;
PPCurlSListArray = ^PCurlSListArray;
PCurlSListArray = array[0 .. (MaxInt div SizeOf(PCurlSList)) - 1] of PCurlSList;
/// low-level access to the libcurl share interface
TCurlShare = type pointer;
/// low-level access to the libcurl mime interface
TCurlMime = type pointer;
/// low-level access to the libcurl mime part interface
TCurlMimePart = type pointer;
/// low-level access to the libcurl library instance in "multi" mode
TCurlMulti = type pointer;
/// low-level access to one libcurl library socket instance
TCurlSocket = type TNetSocket;
/// low-level certificate information for libcurl library API
TCurlCertInfo = packed record
/// count of items in certinfo[]
num_of_certs: integer;
{$ifdef CPU64} _align: array[0..3] of byte; {$endif}
/// actual list of certificates
certinfo: PPCurlSListArray;
end;
PCurlCertInfo = ^TCurlCertInfo;
/// pointer reference to the next multipart/formdata HTTP POST section
PCurlHttpPost = ^TCurlHttpPost;
/// defines a multipart/formdata HTTP POST section
// - formadd() is deprecated since 7.56 - use mime_init() instead
TCurlHttpPost = record
/// next entry in the list
next: PCurlHttpPost;
/// pointer to allocated name
name: PAnsiChar;
/// length of name length
namelength: integer;
/// pointer to allocated data contents
contents: PAnsiChar;
/// length of contents field
// - see also CURL_HTTPPOST_LARGE / 64-bit contentlen
contentslength: integer;
/// pointer to allocated buffer contents
buffer: PAnsiChar;
/// length of buffer field
bufferlength: integer;
/// Content-Type text
contenttype: PAnsiChar;
/// list of extra headers for this form
contentheader: PPCurlSListArray;
/// if one field name has more than one file, this link should link to following files
more: PCurlHttpPost;
/// some associated flags
flags: integer;
/// file name to show. If not set, the actual file name will be used (if this is a file part)
showfilename: PAnsiChar;
/// custom pointer used for HTTPPOST_CALLBACK posts
userp: pointer;
/// alternative length of contents field - used if CURL_HTTPPOST_LARGE is set
// - added in 7.46.0 - is defined as POSIX off_t
contentlen: Int64;
end;
/// low-level message information for libcurl library API
TCurlMsgRec = packed record
msg: TCurlMsg;
{$ifdef CPU64} _align: array[0..3] of byte; {$endif}
easy_handle: TCurl;
data: packed record case byte of
0: (whatever: pointer);
1: (result: TCurlResult);
end;
end;
PCurlMsgRec = ^TCurlMsgRec;
/// low-level file description event handler for libcurl library API
TCurlWaitFD = packed record
/// the socket to watch
// - curl_socket_t is a pointer-sized SOCKET on Windows, but a plain int
// on POSIX, so this field is not TCurlSocket on all platforms
{$ifdef OSWINDOWS}
fd: TCurlSocket;
{$else}
fd: integer;
{$endif OSWINDOWS}
events: SmallInt;
revents: SmallInt;
{$ifdef OSWINDOWS}
{$ifdef CPU64} _align: array[0..3] of byte; {$endif}
{$endif OSWINDOWS}
end;
PCurlWaitFD = ^TCurlWaitFD;
/// low-level write callback function signature for libcurl library API
curl_write_callback = function (buffer: PAnsiChar; size,nitems: integer;
outstream: pointer): integer; cdecl;
/// low-level read callback function signature for libcurl library API
curl_read_callback = function (buffer: PAnsiChar; size,nitems: integer;
instream: pointer): integer; cdecl;
curl_lock_data = (
CURL_LOCK_DATA_NONE = 0,
CURL_LOCK_DATA_SHARE,
CURL_LOCK_DATA_COOKIE,
CURL_LOCK_DATA_DNS,
CURL_LOCK_DATA_SSL_SESSION,
CURL_LOCK_DATA_CONNECT,
CURL_LOCK_DATA_PSL,
CURL_LOCK_DATA_HSTS
);
curl_lock_access = (
CURL_LOCK_ACCESS_NONE = 0,
CURL_LOCK_ACCESS_SHARED = 1,
CURL_LOCK_ACCESS_SINGLE = 2
);
/// lock function signature for csoLockFunc
curl_lock_function = procedure (handle: TCurl; data: curl_lock_data;
locktype: curl_lock_access; userptr: pointer); cdecl;
/// unlock function signature for csoUnLockFunc
curl_unlock_function = procedure (handle: TCurl; data: curl_lock_data;
userptr: pointer); cdecl;
{$Z1}
const
// coErrorBuffer must be at least CURL_ERROR_SIZE bytes big
CURL_ERROR_SIZE = 256;
cauNone: TCurlAuths = [];
cauAll = [low(TCurlAuth) .. high(TCurlAuth)];
cauAny = cauAll - [cauDigest_IE];
cauAnySafe = cauAll - [cauBasic, cauDigest_IE];
// aliases for removed/repurposed/obsolete values
crURLMalformatUser = crNotBuiltIn;
crFtpWeirdServerReply = crWeirdServerReply;
crFtpAccessDenied = crRemoteAccessDenied;
crFtpUserPasswordIncorrect = crFtpAccessFailed;
crFtpWeirdUSERReply = crFtpAcceptTimeout;
crFtpCantGetHost = crFtpCannotGetHost;
crFtpCantReconnect = crHttp2;
crFtpCouldNotSetBinary = crFtpCouldNotSetType;
crFtpWriteError = crObsolete20;
crFtpQuoteError = crQuoteError;
crMalFormatUser = crObsolete24;
crFtpCouldNotStorFile = crUploadFailed;
crFtpCouldNotSetAscii = crObsolete29;
crFtpCouldNotGetSize = crObsolete32;
crHttpRangeError = crRangeError;
crLibraryNotFound = crObsolete40;
crBadCallingOrder = crObsolete44;
crBadPasswordEntered = crObsolete46;
crUnknownTelnetOption = crUnknownOption;
crTelnetOptionSyntax = crSetOptOptionSyntax;
crSslPeerCertificate = crObsolete51;
crShareInUse = crObsolete57;
crSslCACert = crPeerFailedVerification;
crLdapInvalidURL = crObsolete62;
crFtpSslFailed = crUseSslFailed;
crTFtpDiskFull = crRemoteDiskFull;
crTFtpExists = crRemoteFileExists;