Compare commits
501 Commits
curl-7_9_7
...
curl-7_10_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bf9b9ca29d | ||
![]() |
64f224bb22 | ||
![]() |
285a8fe4d0 | ||
![]() |
3773d76dfd | ||
![]() |
94c5c7bd6d | ||
![]() |
12cfc4c0b0 | ||
![]() |
9a2de6e6ee | ||
![]() |
2ede47b8c8 | ||
![]() |
76e107506f | ||
![]() |
6f35ed51dc | ||
![]() |
c94ba66310 | ||
![]() |
a15133f5cf | ||
![]() |
cc09e9d4c2 | ||
![]() |
16e0da2c4b | ||
![]() |
ed22f75241 | ||
![]() |
ba25cad6e2 | ||
![]() |
abb01123cb | ||
![]() |
e2d249f8c5 | ||
![]() |
4a2ac166fa | ||
![]() |
5fab55383d | ||
![]() |
f152f23a68 | ||
![]() |
24e78b3571 | ||
![]() |
9a239edb52 | ||
![]() |
abcc5c5a82 | ||
![]() |
cb5ba675a7 | ||
![]() |
2288086695 | ||
![]() |
61421b7a8f | ||
![]() |
6a7e53a7c7 | ||
![]() |
ca134d5522 | ||
![]() |
ec24efda74 | ||
![]() |
7f0f10e498 | ||
![]() |
aa5af100b4 | ||
![]() |
37ae32f688 | ||
![]() |
d0cffdec5d | ||
![]() |
0f34521612 | ||
![]() |
e69362df22 | ||
![]() |
3de8f6f38e | ||
![]() |
5359bc8083 | ||
![]() |
eb6a14fe10 | ||
![]() |
2912537533 | ||
![]() |
cfb32da198 | ||
![]() |
9b4f92130f | ||
![]() |
5a2ab686a6 | ||
![]() |
3b8583b014 | ||
![]() |
ed29552b1e | ||
![]() |
a2ada3cf96 | ||
![]() |
88825a1187 | ||
![]() |
264e7fc58b | ||
![]() |
1698015e3c | ||
![]() |
39dc14c002 | ||
![]() |
04c499a5fc | ||
![]() |
efbe930a69 | ||
![]() |
747f87f61e | ||
![]() |
5a4c56fc44 | ||
![]() |
81f45ba92a | ||
![]() |
a5dc4e32f2 | ||
![]() |
2b839853ec | ||
![]() |
66b6cd68ed | ||
![]() |
0ef3d90838 | ||
![]() |
5cc50f9b27 | ||
![]() |
e879e26a5b | ||
![]() |
96d84150e1 | ||
![]() |
2aa0c6c488 | ||
![]() |
811138386f | ||
![]() |
c433cf7459 | ||
![]() |
e0d6ebc2f2 | ||
![]() |
4938991ab8 | ||
![]() |
13722f536e | ||
![]() |
57f0e3292d | ||
![]() |
da5ae565ab | ||
![]() |
87c5066242 | ||
![]() |
b528bde470 | ||
![]() |
57572e550f | ||
![]() |
3aea0d3d68 | ||
![]() |
9ae920c1b6 | ||
![]() |
dff406a360 | ||
![]() |
d346ba5c3c | ||
![]() |
978541adc2 | ||
![]() |
637bce2707 | ||
![]() |
07e3dc2ee2 | ||
![]() |
ead065d803 | ||
![]() |
0150bff7b4 | ||
![]() |
0f493b6038 | ||
![]() |
f26b709c50 | ||
![]() |
ae10d9cf22 | ||
![]() |
81af9674ed | ||
![]() |
b63df7991a | ||
![]() |
a79990465c | ||
![]() |
ad6bd530ac | ||
![]() |
c1b369fd4c | ||
![]() |
01fcd3c2d5 | ||
![]() |
7196d784d3 | ||
![]() |
0f0aaf51e0 | ||
![]() |
b5f493c55a | ||
![]() |
0aa031beb9 | ||
![]() |
db6ff224f8 | ||
![]() |
b3c7cd61f3 | ||
![]() |
9ae05c4d91 | ||
![]() |
264e6f6efd | ||
![]() |
ec7bccf671 | ||
![]() |
49f75ee8ce | ||
![]() |
4bcc866c52 | ||
![]() |
c65e088caf | ||
![]() |
6ca4116555 | ||
![]() |
f6cdb820af | ||
![]() |
081e5a82ff | ||
![]() |
2ad2a4bd9f | ||
![]() |
645e700da3 | ||
![]() |
92aea29a30 | ||
![]() |
e1c01af929 | ||
![]() |
7ef749497d | ||
![]() |
d72aa49126 | ||
![]() |
e92bd312ec | ||
![]() |
b097c2cfb0 | ||
![]() |
a39cdc80b7 | ||
![]() |
a47250810e | ||
![]() |
1f50f3031f | ||
![]() |
75145dd753 | ||
![]() |
d0b97f7e1f | ||
![]() |
199a0311e2 | ||
![]() |
fa446f860f | ||
![]() |
7a74303f3c | ||
![]() |
7d9eabb981 | ||
![]() |
ff5308a5af | ||
![]() |
3f8ba3a986 | ||
![]() |
4a555de1b2 | ||
![]() |
d27e4a08f9 | ||
![]() |
bf678a1ca9 | ||
![]() |
13a903de28 | ||
![]() |
a3c14c031e | ||
![]() |
e90d528026 | ||
![]() |
d64dd77993 | ||
![]() |
113850a748 | ||
![]() |
1c49a00d64 | ||
![]() |
eef6c83503 | ||
![]() |
ceb5648eb7 | ||
![]() |
a0eadb76ea | ||
![]() |
065852e46c | ||
![]() |
e5e2fb8274 | ||
![]() |
0210b3c893 | ||
![]() |
7df5677b46 | ||
![]() |
2e71876b28 | ||
![]() |
11576b1142 | ||
![]() |
ce011b8a2d | ||
![]() |
12cfb4f7ee | ||
![]() |
9e1123debe | ||
![]() |
c7354142c0 | ||
![]() |
dee84f448f | ||
![]() |
1607711603 | ||
![]() |
8bca5e05b8 | ||
![]() |
f68505ee23 | ||
![]() |
d2174da641 | ||
![]() |
255b1e68d0 | ||
![]() |
fbee6b87f5 | ||
![]() |
3836a70f97 | ||
![]() |
e0ec9fa294 | ||
![]() |
80fe50590f | ||
![]() |
ae18d1c55a | ||
![]() |
75194373e0 | ||
![]() |
f3875048f6 | ||
![]() |
210af986ad | ||
![]() |
c03044f492 | ||
![]() |
522b85ae21 | ||
![]() |
208e56dbe9 | ||
![]() |
42acb00c81 | ||
![]() |
ca6e770837 | ||
![]() |
775968003c | ||
![]() |
323d3e9b5d | ||
![]() |
16f9755e73 | ||
![]() |
66eb98bb0a | ||
![]() |
299546f5c0 | ||
![]() |
7be9b4c418 | ||
![]() |
03c22b4576 | ||
![]() |
ef749fa9ce | ||
![]() |
a23c92596e | ||
![]() |
abb1497c98 | ||
![]() |
7a8594da43 | ||
![]() |
cbf28daed9 | ||
![]() |
0ff1ca30c3 | ||
![]() |
2cff251863 | ||
![]() |
73d996bf26 | ||
![]() |
5bc78cb724 | ||
![]() |
cdba92ac3c | ||
![]() |
6d28f92ffe | ||
![]() |
01387f42c5 | ||
![]() |
8f52b731f4 | ||
![]() |
d442088ed3 | ||
![]() |
22a323890a | ||
![]() |
163bba1410 | ||
![]() |
db1c618fcf | ||
![]() |
01bdfa7b6d | ||
![]() |
6a88c8d845 | ||
![]() |
b8a6913e09 | ||
![]() |
744d8c1006 | ||
![]() |
c2e2c98d81 | ||
![]() |
3fa353a2d3 | ||
![]() |
c27c9f80d2 | ||
![]() |
b5a74715cf | ||
![]() |
13ee2901f4 | ||
![]() |
32c03eadd6 | ||
![]() |
0fa512f26d | ||
![]() |
219d88518c | ||
![]() |
ecf3aee43a | ||
![]() |
7f08cab73e | ||
![]() |
c4e9ef199e | ||
![]() |
9e612b5550 | ||
![]() |
203633d34d | ||
![]() |
45bd009bb1 | ||
![]() |
ee656415c4 | ||
![]() |
156aad198f | ||
![]() |
b1ffb79a50 | ||
![]() |
d6654bfe00 | ||
![]() |
eefdd67d22 | ||
![]() |
86a86d7afd | ||
![]() |
b6dac2b484 | ||
![]() |
e6367abae9 | ||
![]() |
fc4d1d9a60 | ||
![]() |
94bae20776 | ||
![]() |
bb8c8d273c | ||
![]() |
ee600ace37 | ||
![]() |
da86e32eb4 | ||
![]() |
b5bbc04ad1 | ||
![]() |
265c58611f | ||
![]() |
25c973a39e | ||
![]() |
123c7b32db | ||
![]() |
e2d8e2c4ae | ||
![]() |
701509d322 | ||
![]() |
c3cc616264 | ||
![]() |
91b84b89e4 | ||
![]() |
017ec204a9 | ||
![]() |
8dbfecd153 | ||
![]() |
512db1bc54 | ||
![]() |
e157aabd4d | ||
![]() |
db2fea448c | ||
![]() |
dd82d69b8c | ||
![]() |
27328281b7 | ||
![]() |
51d205b267 | ||
![]() |
84800914f6 | ||
![]() |
9b296e65bd | ||
![]() |
5f649a1649 | ||
![]() |
daea056210 | ||
![]() |
30c0db06bd | ||
![]() |
91168c005c | ||
![]() |
cfa0054077 | ||
![]() |
3d5820648b | ||
![]() |
d08df97fe5 | ||
![]() |
fd6624a058 | ||
![]() |
8aa41dd04b | ||
![]() |
e890113fc6 | ||
![]() |
e2e64798b5 | ||
![]() |
b9b6a6566a | ||
![]() |
dc9e415602 | ||
![]() |
84fa12c885 | ||
![]() |
296b35fe9b | ||
![]() |
0ff89b9c3c | ||
![]() |
3b33540c99 | ||
![]() |
29d0174253 | ||
![]() |
cc7f2a0d08 | ||
![]() |
b1579aed2f | ||
![]() |
9247daf953 | ||
![]() |
9031e33b66 | ||
![]() |
1ee1f5f427 | ||
![]() |
a5874a5393 | ||
![]() |
969217c9d9 | ||
![]() |
e399502c7a | ||
![]() |
6883f0c49f | ||
![]() |
3fc2c813cc | ||
![]() |
9de4b99fc7 | ||
![]() |
24e7036822 | ||
![]() |
ec9acbcda7 | ||
![]() |
c0460660d5 | ||
![]() |
b03f4919fb | ||
![]() |
08620743b9 | ||
![]() |
41362f063a | ||
![]() |
5b3069e265 | ||
![]() |
b466924717 | ||
![]() |
cbc0f65fa3 | ||
![]() |
35089a4289 | ||
![]() |
aef3131e92 | ||
![]() |
342fce97af | ||
![]() |
fb5d267bd0 | ||
![]() |
c19844a0a3 | ||
![]() |
22cf05519a | ||
![]() |
511ce35631 | ||
![]() |
e9b7548dd6 | ||
![]() |
010cde0a4a | ||
![]() |
cac5251a98 | ||
![]() |
3b825bcbfb | ||
![]() |
31959fb24b | ||
![]() |
5e9675ad1e | ||
![]() |
084b7675b2 | ||
![]() |
ed8be5bc55 | ||
![]() |
efca2943a0 | ||
![]() |
371da7132f | ||
![]() |
9a3ff5c46a | ||
![]() |
b36c654a3d | ||
![]() |
ddeb2613ec | ||
![]() |
2d02d20911 | ||
![]() |
b2563b9f9f | ||
![]() |
fccf6925b1 | ||
![]() |
4a7cf65064 | ||
![]() |
56587e2821 | ||
![]() |
33b8e71583 | ||
![]() |
1c96128695 | ||
![]() |
ca516b1b26 | ||
![]() |
ba4e69bebc | ||
![]() |
de5e9f100c | ||
![]() |
955da86a3e | ||
![]() |
8d85be4c5e | ||
![]() |
93eadfb10f | ||
![]() |
f8e0b18439 | ||
![]() |
64bbe9dfaf | ||
![]() |
2e8a9416af | ||
![]() |
5dd40bd0bb | ||
![]() |
1822dd0549 | ||
![]() |
751e49fb0a | ||
![]() |
56c43604d0 | ||
![]() |
7438c378be | ||
![]() |
0e0caf7c06 | ||
![]() |
5644f4a295 | ||
![]() |
98e1605b17 | ||
![]() |
73f0e32d1a | ||
![]() |
713cb56fea | ||
![]() |
bd3bb70ee8 | ||
![]() |
8aa3f14303 | ||
![]() |
ac285b453e | ||
![]() |
daf55705e4 | ||
![]() |
7140baae72 | ||
![]() |
27a2e590cd | ||
![]() |
7172fa058a | ||
![]() |
c0790ccf08 | ||
![]() |
87c43517cd | ||
![]() |
6561ec524b | ||
![]() |
982c5460f0 | ||
![]() |
2a3a8848f3 | ||
![]() |
752520e428 | ||
![]() |
8095b776fe | ||
![]() |
e504103e2c | ||
![]() |
904183262a | ||
![]() |
2a0bc64226 | ||
![]() |
6b975c308c | ||
![]() |
74be55a477 | ||
![]() |
394832c2d6 | ||
![]() |
f636c12255 | ||
![]() |
03e4a8214c | ||
![]() |
6d7785a35b | ||
![]() |
904f579332 | ||
![]() |
a72d789b08 | ||
![]() |
87ad7ace18 | ||
![]() |
35153eb524 | ||
![]() |
c8ee1fa62e | ||
![]() |
5c1a6ed719 | ||
![]() |
9d68fde148 | ||
![]() |
c7d517f6d2 | ||
![]() |
183f1531d3 | ||
![]() |
6dfe0ec31e | ||
![]() |
8b3f1cebda | ||
![]() |
086daf913c | ||
![]() |
6a3e2272e9 | ||
![]() |
d0e0bf53a6 | ||
![]() |
0009e4dfb9 | ||
![]() |
30b7a9f172 | ||
![]() |
c74cb59e08 | ||
![]() |
c1f29a8e08 | ||
![]() |
cb895ec335 | ||
![]() |
2df4866cfa | ||
![]() |
423a1cf486 | ||
![]() |
7aeb63c817 | ||
![]() |
476fa1f4d2 | ||
![]() |
0bea215560 | ||
![]() |
3c20b98d99 | ||
![]() |
8bcdda29d4 | ||
![]() |
c88036405f | ||
![]() |
60cddab4f2 | ||
![]() |
411ca1c050 | ||
![]() |
d1be3a4a1d | ||
![]() |
b5dd257427 | ||
![]() |
4cf953678d | ||
![]() |
ca5678c8c1 | ||
![]() |
9e4594be53 | ||
![]() |
d16c757c28 | ||
![]() |
312bcafd05 | ||
![]() |
be24652d4d | ||
![]() |
6ab44d9439 | ||
![]() |
108cb14d1f | ||
![]() |
b98308b524 | ||
![]() |
215c445583 | ||
![]() |
20d8e32a58 | ||
![]() |
33306b2749 | ||
![]() |
94eeeba79a | ||
![]() |
ecd29a289a | ||
![]() |
e7d0af72e3 | ||
![]() |
fcb1d3521a | ||
![]() |
890bf3bd27 | ||
![]() |
dafd81178f | ||
![]() |
99dfdebc64 | ||
![]() |
c1cfdd6323 | ||
![]() |
264a9bc6ed | ||
![]() |
f79f5cbf82 | ||
![]() |
7313501e30 | ||
![]() |
d8b2c819e7 | ||
![]() |
69f6d14b81 | ||
![]() |
9f3856e646 | ||
![]() |
a46e2e9900 | ||
![]() |
14f0dd2dd0 | ||
![]() |
c051438fa1 | ||
![]() |
52e32ac1d3 | ||
![]() |
7f8ad34ba2 | ||
![]() |
a9c0302454 | ||
![]() |
a33e89b44a | ||
![]() |
e203ecebee | ||
![]() |
2f8e7f56b3 | ||
![]() |
2443e1f38c | ||
![]() |
eb164098b7 | ||
![]() |
62527fa98a | ||
![]() |
b9f8e80b14 | ||
![]() |
b79e250ed2 | ||
![]() |
fc5c9d8f17 | ||
![]() |
72d57a8ee6 | ||
![]() |
23262e30bc | ||
![]() |
8b4ad40ed6 | ||
![]() |
d7e9797365 | ||
![]() |
e54e0c7877 | ||
![]() |
5cb06d8fd6 | ||
![]() |
2b34d4e1f7 | ||
![]() |
c7aa095fac | ||
![]() |
93f1784526 | ||
![]() |
559dc503c2 | ||
![]() |
414afe0935 | ||
![]() |
4ad4f3fc70 | ||
![]() |
67273eed9b | ||
![]() |
3c63e1d8d9 | ||
![]() |
cae555c977 | ||
![]() |
407583e8e2 | ||
![]() |
131645dc31 | ||
![]() |
dafd644fe7 | ||
![]() |
73cc1742af | ||
![]() |
87afd7686f | ||
![]() |
8ce10b5dfa | ||
![]() |
943e31b35c | ||
![]() |
20f85b94df | ||
![]() |
17b784381e | ||
![]() |
e3031fddb9 | ||
![]() |
38c994a7ae | ||
![]() |
85e2e96fb6 | ||
![]() |
be35b3ad03 | ||
![]() |
dbbd871ea1 | ||
![]() |
813911db59 | ||
![]() |
3c49b405de | ||
![]() |
4cfffd6c4a | ||
![]() |
e9f1c12f0f | ||
![]() |
4fe252847c | ||
![]() |
109cbbe9c5 | ||
![]() |
fd3881eaa6 | ||
![]() |
08ef208fb7 | ||
![]() |
8c45e2a641 | ||
![]() |
25dc520163 | ||
![]() |
fc37ef9e4b | ||
![]() |
11ba367fc9 | ||
![]() |
78473f71eb | ||
![]() |
8b77f40f99 | ||
![]() |
d866716565 | ||
![]() |
307d0effe2 | ||
![]() |
b47b053e54 | ||
![]() |
b79f01caf3 | ||
![]() |
0db227f55e | ||
![]() |
ac48b38842 | ||
![]() |
0cbb9365c6 | ||
![]() |
798b8c522b | ||
![]() |
15bc7e19f9 | ||
![]() |
0be3f1a063 | ||
![]() |
c0257c6721 | ||
![]() |
9aec0fc7de | ||
![]() |
bce5e0d82c | ||
![]() |
62032ee248 | ||
![]() |
775645f29b | ||
![]() |
99c0456872 | ||
![]() |
0236bee5de | ||
![]() |
59c11b82d5 | ||
![]() |
98871d1e9e | ||
![]() |
b40dc5d742 | ||
![]() |
17b0723713 | ||
![]() |
ec585e8907 | ||
![]() |
0aeb25ff3b | ||
![]() |
a928f2c4aa | ||
![]() |
51fcee6f81 | ||
![]() |
654be65590 | ||
![]() |
105ec79b2b | ||
![]() |
c759d8427a | ||
![]() |
c7b03d6479 | ||
![]() |
2080738883 | ||
![]() |
48bc73c271 | ||
![]() |
3d0969d1d1 | ||
![]() |
323f195036 | ||
![]() |
c3c392fc98 | ||
![]() |
5d2944c211 | ||
![]() |
fe3ba1dd11 | ||
![]() |
0c00eb93a0 | ||
![]() |
baa77ec13b | ||
![]() |
9263652c6d | ||
![]() |
bc74375543 |
11
.cvsignore
Normal file
11
.cvsignore
Normal file
@@ -0,0 +1,11 @@
|
||||
config.log
|
||||
Makefile
|
||||
libtool
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
configure
|
||||
config.h
|
||||
config.status
|
||||
curl-config
|
||||
autom4te.cache
|
||||
depcomp
|
785
CHANGES
785
CHANGES
@@ -4,7 +4,790 @@
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
History of Changes
|
||||
Changelog
|
||||
|
||||
|
||||
Version 7.10.3 (14 Jan 2003)
|
||||
|
||||
Daniel (10 Jan 2003)
|
||||
- Steve Oliphant pointed out that test case 105 did not work anymore and this
|
||||
was due to a missing fix for the password prompting.
|
||||
|
||||
Version 7.10.3-pre6 (10 Jan 2003)
|
||||
|
||||
Daniel (9 Jan 2003)
|
||||
- Bryan Kemp pointed out that curl -u could not provide a blank password
|
||||
without prompting the user. It can now. -u username: makes the password
|
||||
empty, while -u username makes curl prompt the user for a password.
|
||||
|
||||
- Kjetil Jacobsen found a remaining connect problem in the multi interface on
|
||||
ipv4 systems (Linux only?), that I fixed and Kjetil verified that it fixed
|
||||
his problems.
|
||||
|
||||
- memanalyze.pl now reads a file name from the command line, and no longer
|
||||
takes the data on stdin as before.
|
||||
|
||||
Version 7.10.3-pre5 (9 Jan 2003)
|
||||
|
||||
Daniel (9 Jan 2003)
|
||||
- Fixed tests/memanalyze.pl to work with file names that contain colons (as on
|
||||
Windows).
|
||||
|
||||
- Kjetil Jacobsen quickly pointed out that lib/share.h was missing...
|
||||
|
||||
Version 7.10.3-pre4 (9 Jan 2003)
|
||||
|
||||
Daniel (9 Jan 2003)
|
||||
- Updated lib/share.c quite a bit to match the design document at
|
||||
http://curl.haxx.se/dev/sharing.txt a lot more.
|
||||
|
||||
I'll try to update the document soonish. share.c is still not actually used
|
||||
by libcurl, but the API is slowly getting there and we can start
|
||||
implementing code that takes advantage of this system.
|
||||
|
||||
Daniel (8 Jan 2003)
|
||||
- Updated share stuff in curl/curl.h, including data types, structs and
|
||||
function prototypes. The corresponding files in lib/ were also modified
|
||||
of course to remain compilable. Based on input from Jean-Philippe and also
|
||||
to make it more in line with the design document.
|
||||
|
||||
- Jean-Philippe Barrette-LaPierre patched a very trivial memory leak in
|
||||
curl_escape() that would happen when realloc() returns NULL...
|
||||
|
||||
- Matthew Blain provided feedback to make the --create-dirs stuff build
|
||||
properly on Windows.
|
||||
|
||||
- Fixed the #include in tests/libtest/first.c as Legoff Vincent pointed out.
|
||||
|
||||
Daniel (7 Jan 2003)
|
||||
- Philippe Raoult provided a patch that now makes libcurl properly support
|
||||
wildcard checks for certificate names.
|
||||
|
||||
- Simon Liu added CURLOPT_HTTP200ALIASES, to let an application set other
|
||||
strings recognized as "HTTP 200" to allow http-like protocols to get
|
||||
downloaded fine by curl.
|
||||
|
||||
- Now using autoconf 2.57 and automake 1.7.2
|
||||
|
||||
- Doing "curl -I ftp://domain/non-existing-file" still outputed a date!
|
||||
Wayne Haigh reported.
|
||||
|
||||
- The error message is now written properly with a newline in the --trace
|
||||
file.
|
||||
|
||||
Daniel (6 Jan 2003)
|
||||
- Sterling Hughes fixed a possible bug: previously, if you called
|
||||
curl_easy_perform and then set the global dns cache, the global cache
|
||||
wouldn't be used. Pointed out by Jean-Philippe Barrette-LaPierre.
|
||||
|
||||
- Matthew Blain's fixed the VC6 libcurl makefile to include better debug data
|
||||
on debug builds.
|
||||
|
||||
Daniel (27 Dec 2002)
|
||||
- Philippe Raoult reported a bug with HTTPS connections which I evidently
|
||||
added in my 19 dec fix. I corrected it.
|
||||
|
||||
Daniel (20 Dec)
|
||||
- Idea from the Debian latest patch: use AM_MAINTAINER_MODE in the configure
|
||||
script to make the default makefile less confusing "to the casual
|
||||
installer".
|
||||
|
||||
Version 7.10.3-pre3 (20 Dec)
|
||||
|
||||
Daniel (19 Dec)
|
||||
- Matthew Blain patched the Curl_base64_decode() function.
|
||||
|
||||
- Evan Jordan reported in bug report #653022 that the SSL_read() usage was
|
||||
wrong, and it certainly was. It could lead to curl using too much CPU due to
|
||||
a stupid loop.
|
||||
|
||||
Daniel (18 Dec)
|
||||
- As suggested by Margus Freudenthal, CURLE_HTTP_NOT_FOUND was renamed to
|
||||
CURLE_HTTP_RETURNED_ERROR since it is returned on any >= 400 code when
|
||||
CURLOPT_FAILONERROR is set.
|
||||
|
||||
Daniel (17 Dec)
|
||||
- Bug reported #651464, reported by Christopher Palmer, provided an example
|
||||
source code using the multi interface that hang when trying to connect to a
|
||||
proxy on a localhost port where no proxy was listening. This bug was not
|
||||
repeatable on libcurls that were IPv6-enabled.
|
||||
|
||||
Daniel (16 Dec)
|
||||
- Christopher Palmer also noticed what Vojtech Janota already was
|
||||
experiencing: The attempted name resolve fix for glibc 2.2.93 caused libcurl
|
||||
to crash when used on some older glibc versions. The problem is of course
|
||||
the silliness of the 2.2.93. I committed a fix that hopefully should make
|
||||
the binary run fine on either one of the versions, even though the solution
|
||||
is not as nice as I'd like it to be.
|
||||
|
||||
Daniel (13 Dec)
|
||||
- Bug report #651460 by Christopher R. Palmer showed that when using libcurl
|
||||
to for example go over a proxy on localhost, it would attempt to connect
|
||||
through the proxy TWICE.
|
||||
|
||||
I added test case 503 with which I managed to repeat this problem and I
|
||||
fixed the code to not re-attempt any connects (which also made it a nicer
|
||||
fix for the #650941 bug mentioned below).
|
||||
|
||||
The sws server was extended to deal with CONNECT in order to make test
|
||||
case 503 do good.
|
||||
|
||||
- Evan Jordan posted bug report #650989 about a memory leak in the public key
|
||||
retrieving code. He provided a suggested fix and I merely applied it!
|
||||
|
||||
- Bug report #650941, posted by Christopher R. Palmer identified a problem
|
||||
with the multi interface and getting file:// URLs. This was now fixed and
|
||||
test case 502 was added to verify this.
|
||||
|
||||
Daniel (12 Dec)
|
||||
- Test case 500 and 501 are the first ever libcurl test cases that run.
|
||||
|
||||
- Made "configure --enable-debug" cut off all -O* options to the compiler
|
||||
|
||||
- Finally fixed the test suite's ftp server so that test case 402 doesn't
|
||||
cause the following test case to fail anymore!
|
||||
|
||||
Daniel (11 Dec)
|
||||
- CURL_MAX_WRITE_SIZE is now decreased to 16KB since it makes the Windows
|
||||
version perform uploads much faster!!! RBramante did lots of research on
|
||||
this topic.
|
||||
|
||||
- Fixed the #include in curl/curl.h to include the other files outside the
|
||||
extern "C" scope.
|
||||
|
||||
Daniel (10 Dec)
|
||||
- Moved around and added more logic:
|
||||
|
||||
First, POST data is never sent as part of the request headers in the http.c
|
||||
code. It is always sent the "normal" read callback then send() way. This now
|
||||
enables a plain HTTP POST to be sent chunked if we want to. This also
|
||||
reduces the risk of having very big POSTs causing problems.
|
||||
|
||||
Further, sending off the initial HTTP request is not done using a loop
|
||||
anymore. If it wasn't all sent off in the first send(), the rest of the
|
||||
request is sent off in the normal transfer select() loop. This makes several
|
||||
things possible, but mainly it makes libcurl block less when used from the
|
||||
multi interface and it also reduces the risk of problems with issuing very
|
||||
large requests.
|
||||
|
||||
Daniel (9 Dec)
|
||||
- Moved the read callback pointer and data within the structs to a more
|
||||
suitable place. This in preparation for a better HTTP-request sending code
|
||||
without (a silly) loop.
|
||||
|
||||
- The Dodds fix seems not to work.
|
||||
|
||||
- Vojtech Janota tests proved that the resolve fix from oct 21st is not good
|
||||
enough since obviously older glibcs might return EAGAIN without this meaning
|
||||
that the buffer was too small.
|
||||
|
||||
- [the other day] Made libcurl loop on recv() and send() now until done, and
|
||||
then get back to select(). Previously it went back to select() more often
|
||||
which really was a slight overhead. This was due to the reported performance
|
||||
problems on HTTP PUT on Windows. I couldn't see any notable difference on
|
||||
Linux...
|
||||
|
||||
Version 7.10.3-pre2 (4 Dec 2002)
|
||||
|
||||
Daniel (4 Dec 2002)
|
||||
- Lots of work with Malcolm Dodds made me add a temporary code fix that now
|
||||
shortens the timeout waiting for the 226 or 250 line after a completed
|
||||
FTP transfer.
|
||||
|
||||
If no data is received within 60 seconds, this is taken as a sign of a dead
|
||||
control connection and we bail out.
|
||||
|
||||
Daniel (3 Dec 2002)
|
||||
- Ralph's bug report #644841 identified a problem in which curl returned a
|
||||
timeout error code when in fact the problem was not a timeout. The proper
|
||||
error should now be propagated better when they're detected in the FTP
|
||||
response reading function.
|
||||
|
||||
- Updated the Borland Makefiles.
|
||||
|
||||
Daniel (2 Dec 2002)
|
||||
- Nicolas Berloquin provided a patch that introduced --create-dirs to the
|
||||
command line tool. When used in combination with -o, it lets curl create
|
||||
[non-existing] directories used in -o, suitably used with #-combinations
|
||||
such as:
|
||||
|
||||
curl "www.images.com/{flowers,cities,parks,mountains}/pic_[1-100].jpg \
|
||||
-o "dir_#1/pic#2.jpg" --create-dirs
|
||||
|
||||
Version 7.10.3-pre1
|
||||
|
||||
Daniel (28 Nov 2002)
|
||||
- I visited Lars Nordgren and had a go with his problem, which lead me to
|
||||
implement this fix. If libcurl detects the added custom header
|
||||
"Transfer-Encoding: chunked", it will now enable a chunked transfer.
|
||||
|
||||
Also, chunked transfer didn't quite work before but seems to do so now.
|
||||
|
||||
- Kjetil Jacobsen pointed out that ./configure --disable-ipv6 --without-zlib
|
||||
didn't work on any platform...
|
||||
|
||||
Daniel (26 Nov 2002)
|
||||
- Fixed a bad addrinfo free in the hostip.c code, hardly exposed anywhere
|
||||
|
||||
- Dan Becker found and fixed a minor memory leak on persistent connnections
|
||||
using CURLOPT_USERPWD.
|
||||
|
||||
Daniel (22 Nov 2002)
|
||||
- Based on Ralph Mitchell's excellent analysis I found a bug in the test suite
|
||||
web server (sws) which now lets test case 306 run fine even in combination
|
||||
with the other test cases.
|
||||
|
||||
- Juan Ignacio Herv<72>s found a crash in the verbose connect message that is
|
||||
used on persistent connections. This bug was added in 7.10.2 due to the
|
||||
rearranged name resolve code.
|
||||
|
||||
Daniel (20 Nov 2002)
|
||||
- Kjetil Jacobsen provided a patch that introduces:
|
||||
|
||||
CURLOPT_PRIVATE stores a private pointer in the curl handle.
|
||||
|
||||
CURLINFO_PRIVATE retrieves the private pointer from the curl handle.
|
||||
|
||||
- Karol Pietrzak pointed out how curl-config --cflags didn't output a good
|
||||
include dir so I've removed that for now.
|
||||
|
||||
Version 7.10.2 (18 Nov 2002)
|
||||
|
||||
Daniel (11 Nov 2002)
|
||||
- Dave Halbakken added curl_version_info to lib/libcurl.def to make libcurl
|
||||
properly build with MSVC on Windows.
|
||||
|
||||
Daniel (8 Nov 2002)
|
||||
- Doing HTTP PUT without a specified file size now makes libcurl use
|
||||
Transfer-Encoding: chunked.
|
||||
|
||||
Daniel (7 Nov 2002)
|
||||
- Bug report #634625 identified how curl returned timeout immediately when
|
||||
CURLOPT_CONNECTTIMEOUT was used and provided a fix.
|
||||
|
||||
Version 7.10.2-pre4 (6 Nov 2002)
|
||||
|
||||
Daniel (5 Nov 2002)
|
||||
- Lehel Bernadt found out and fixed. libcurl sent error message to the debug
|
||||
output when it stored the error message.
|
||||
|
||||
- Avery Fay found some problems with the DNS cache (when the cache time was
|
||||
set to 0 we got a memory leak, but when the leak was fixed he got a crash
|
||||
when he used the CURLOPT_INTERFACE with that) that had me do some real
|
||||
restructuring so that we now have a reference counter in the dns cache
|
||||
entries to prevent an entry to get flushed while still actually in use.
|
||||
|
||||
I also detected that we previously didn't update the time stamp when we
|
||||
extracted an entry from the cache so that must've been a reason for some
|
||||
very weird dns cache bugs.
|
||||
|
||||
Version 7.10.2-pre3
|
||||
|
||||
Daniel (31 Oct 2002)
|
||||
- Downgraded automake to 1.6.3 in an attempt to fix cygwin problems. (It
|
||||
turned out this didn't help though.)
|
||||
|
||||
- Disable the DNS cache (by setting the timeout to 0) made libcurl leak
|
||||
memory. Avery Fay brought the example code that proved this.
|
||||
|
||||
Version 7.10.2-pre2
|
||||
|
||||
Daniel (28 Oct 2002)
|
||||
- Upgraded to autoconf 2.54 and automake 1.7 on the release-build host.
|
||||
|
||||
- Kevin Roth made the command line tool check for a CURL_CA_BUNDLE environment
|
||||
variable (if --cacert isn't used) and if not set, the Windows version will
|
||||
check for a file named "curl-ca-bundle.crt" in the current directory or the
|
||||
directory where curl is located. That file is then used as CA root cert
|
||||
bundle.
|
||||
|
||||
- Avery Fay pointed out that curl's configure scrip didn't get right if you
|
||||
used autoconf newer than 2.52. This was due to some badly quoted code.
|
||||
|
||||
Version 7.10.2-pre1
|
||||
|
||||
Daniel (23 Oct 2002)
|
||||
- Emiliano Ida confirmed that we now build properly with the Borland C++
|
||||
compiler too. We needed yet another fix for the ISO cpp check in the curl.h
|
||||
header file.
|
||||
|
||||
- Yet another fix was needed to get the HTTP download without headers to work.
|
||||
This time it was needed if the first "believed header" was read all in the
|
||||
first read. Test 306 has not run properly since the 11th october fix.
|
||||
|
||||
Daniel (21 Oct 2002)
|
||||
- Zvi Har'El pointed out a problem with curl's name resolving on Redhat 8
|
||||
machines (running IPv6 disabled). Mats Lidell let me use an account on his
|
||||
machine and I could verify that gethostbyname_r() has been changed to return
|
||||
EAGAIN instead of ERANGE when the given buffer size is too small. This is
|
||||
glibc 2.2.93.
|
||||
|
||||
- Albert Chin helped me get the -no-undefined option corrected in
|
||||
lib/Makefile.am since Cygwin builds want it there while Solaris builds don't
|
||||
want it present. Kevin Roth helped me try it out on cygwin.
|
||||
|
||||
- Nikita Schmidt provided a bug fix for a FOLLOWLOCATION bug introduced when
|
||||
the ../ support got in (7.10.1).
|
||||
|
||||
Daniel (18 Oct 2002)
|
||||
- Fabrizio Ammollo pointed out a remaining problem with FOLLOWLOCATION in
|
||||
the multi interface.
|
||||
|
||||
Daniel (17 Oct 2002)
|
||||
- Richard Cooper's experimenting proved that -j (CURLOPT_COOKIESESSION) didn't
|
||||
work quite as supposed. You needed to set it *before* you use
|
||||
CURLOPT_COOKIEFILE, and we dont' want that kind of dependencies.
|
||||
|
||||
Daniel (15 Oct 2002)
|
||||
- Andr<64>s Garc<72>a provided corrections for erratas in four libcurl man pages.
|
||||
|
||||
Daniel (13 Oct 2002)
|
||||
- Starting now, we generate and include PDF versions of all the docs in the
|
||||
release archives.
|
||||
|
||||
Daniel (12 Oct 2002)
|
||||
- Trying to connect to a host on a bad port number caused the multi interface
|
||||
to never return failure and it appeared to keep on trying forever (it just
|
||||
didn't do anything).
|
||||
|
||||
Daniel (11 Oct 2002)
|
||||
- Downloading HTTP without headers didn't work 100%, some of the initial data
|
||||
got written twice. Kevin Roth reported.
|
||||
|
||||
- Kevin Roth found out the "config file" parser in the client code could
|
||||
segfault, like if DOS newlines were used.
|
||||
|
||||
Version 7.10.1 (11 Oct 2002)
|
||||
|
||||
Daniel (10 Oct 2002)
|
||||
- Jeff Lawson fixed a few problems with connection re-use that remained when
|
||||
you set CURLOPT_PROXY to "".
|
||||
|
||||
Daniel (9 Oct 2002)
|
||||
- Craig Davison found a terrible flaw and Cris Bailiff helped out in the
|
||||
search. Getting HTTP data from servers when the headers are split up in
|
||||
multiple reads, could cause junk data to get inserted among the saved
|
||||
headers. This only concerns HTTP(S) headers.
|
||||
|
||||
Daniel (8 Oct 2002)
|
||||
- Vincent Penquerc'h gave us the good suggestion that when the ERRRORBUFFER
|
||||
is set internally, the error text is sent to the debug function as well.
|
||||
|
||||
- I fixed the telnet code to timeout properly as the option tells it to. On
|
||||
non-windows platforms.
|
||||
|
||||
Daniel (7 Oct 2002)
|
||||
- John Crow pointed out that libcurl-the-guide wasn't included in the release
|
||||
tarball!
|
||||
|
||||
- Kevin Roth pointed out that make install didn't do right if build outside
|
||||
the source tree (ca-bundle wise).
|
||||
|
||||
- FOLLOWLOCATION bugfix for the multi interface
|
||||
|
||||
Daniel (4 Oct 2002)
|
||||
- Kevin Roth got problems with his cygwin build with -no-undefined was not
|
||||
present in lib/Makefile.am so I put it back in there again. The poor one who
|
||||
needs to remove it again must write a configure script to detect that need.
|
||||
|
||||
- Ralph Mitchell pointed out that curl was a bit naive and didn't deal with ./
|
||||
or ../ stuff in the string passed back in a Location: header when following
|
||||
locations.
|
||||
|
||||
- Albert Chin helped me to work out a better configure.in check for zlib, and
|
||||
both --without-zlib and -with-zlib seem to work rather well right now.
|
||||
|
||||
- Zvi Har'El improvied the OpenSSL ENGINE check in the configure script to
|
||||
become more accurate.
|
||||
|
||||
Daniel (1 Oct 2002)
|
||||
- Detlef Schmier pointed out the lack of a --without-libz option to configure,
|
||||
so I added one.
|
||||
|
||||
Version 7.10 (1 Oct 2002)
|
||||
|
||||
Daniel (30 Sep 2002)
|
||||
- Modified the curl_version_info() proto and returned struct once again, and
|
||||
updated the man page accordingly.
|
||||
|
||||
- Cris Bailiff found out that the pre-releases crashed on name lookups on
|
||||
names such as "a:" or "baz:" (on Linux versions not being ipv6-enabled) due
|
||||
to some weird return codes from gethostbyname_r(). I'll blame the complete
|
||||
lack of docs in that department. Cris provided a fix, which I modified only
|
||||
slightly.
|
||||
|
||||
Daniel (27 Sep 2002)
|
||||
- After a suggestion from Christian Kurz to Debian curl package maintainer
|
||||
Domenico Andreoli, I made it possible to override the proxy environment
|
||||
variables better. Now, by setting -x "" you can explicitly tell libcurl to
|
||||
not use a proxy, no matter whan the environment variables say.
|
||||
|
||||
Version 7.10-pre4
|
||||
|
||||
Daniel (26 Sep 2002)
|
||||
- Extended curl_version_info() more and wrote a man page for it.
|
||||
|
||||
Daniel (25 Sep 2002)
|
||||
- libcurl could leak memory when downloading multiple files using http ranges,
|
||||
reported and fixed by Jean-Luc Guevel.
|
||||
|
||||
- Walter J. Mack provided code and docs for the new curl_free() function that
|
||||
shall be used to free memory that is allocated by libcurl and returned back
|
||||
to the application, as curl_escape() and curl_unescape() do.
|
||||
|
||||
- Yarram Sunil pointed out a flaw in the multi interface where a failed
|
||||
connection didn't close down properly and thus a second transfer using the
|
||||
same handle failed.
|
||||
|
||||
- Andr<64>s Garc<72>a fixed a flaw that made (among other things) dict-fetches
|
||||
return a random value.
|
||||
|
||||
Daniel (24 Sep 2002)
|
||||
- Wez Furlong brought his initial patch that introduced curl_version_info().
|
||||
We might need to tweak it somewhat before release.
|
||||
|
||||
Daniel (20 Sep 2002)
|
||||
- Craig Markwardt fixed another Tru64 IP resolve problem.
|
||||
|
||||
Daniel (19 Sep 2002)
|
||||
- Dolbneff A.V and Spiridonoff A.V made the file:// code work with resumes
|
||||
in the same style other code does.
|
||||
|
||||
- Ilguiz Latypov fixed a flaw in the client code when fetching multiple URLs
|
||||
and -C - was used. The first file's resume position was then accidentally
|
||||
reused on all the other files too.
|
||||
|
||||
Daniel (18 Sep 2002)
|
||||
- The curl_easy_setopt.3 man page was greatly modified and the options have
|
||||
now been grouped in logical groups so that it should be somewhat easier to
|
||||
read it and find things you search for.
|
||||
|
||||
Daniel (13 Sep 2002)
|
||||
- Kevin Roth pinpointed a scary flaw in libcurl, when the HTTP server doesn't
|
||||
send any headers back, only raw content. Right, that is a violation of the
|
||||
standard but still happens at times and we need to deal with it. Test case
|
||||
306 was added to verify that we do right now.
|
||||
|
||||
Version 7.10-pre3
|
||||
|
||||
Daniel (11 Sep 2002)
|
||||
- Lukasz Czekierda found out that curl didn't send a correct HTTP Host: header
|
||||
when you specified the URL with an IPv6 IP-address.
|
||||
|
||||
Daniel (4 Sep 2002)
|
||||
- Sven Neuhaus made --silent being acknowledged even when multiple URLs
|
||||
were used. It used to output "[1/2]: http://host/a.html.de --> a.html.d" etc
|
||||
even when told to shut up.
|
||||
|
||||
Daniel (3 Sep 2002)
|
||||
- Updated all source code headers to use MIT-license references only, and
|
||||
point to the COPYING file and the http://curl.haxx.se/docs/copyright.html
|
||||
URL. I've cut out all references to MPL that I could find.
|
||||
|
||||
- Corected the makefiles to not always use -lz when linking
|
||||
|
||||
Version 7.10-pre2
|
||||
|
||||
Daniel (2 Sep 2002)
|
||||
- James Gallagher added Content-Encoding support to libcurl so now curl and
|
||||
libcurl-using apps can request compressed contents using the 'deflate'
|
||||
method. See the special file lib/README.encoding for details.
|
||||
|
||||
curl --compressed is now used to request compressed contents.
|
||||
|
||||
curl-config --feature will include 'libz' if this feature was around when
|
||||
the library was built.
|
||||
|
||||
Daniel (30 Aug 2002)
|
||||
- Applied an anonymous SOCKS5-proxy patch. Not properly working in all
|
||||
situations though, as all getaddrinfo()-using libcurls will fail on this.
|
||||
This is because of the somewhat naive way the current code tries to extract
|
||||
the IP address of the proxy.
|
||||
|
||||
- Fixed up the SSL cert fixes from the other day even more after more inputs
|
||||
from Cris. Added three new SSL error codes to make the
|
||||
CURLE_SSL_CONNECT_ERROR slightly less overloaded.
|
||||
|
||||
Daniel (27 Aug 2002)
|
||||
- After lots of talk with Tom Zerucha, Nick Gimbrone and Cris Bailiff I
|
||||
decided to talk the bold path and I now made libcurl do CA certificate
|
||||
verification by default. Thus library users need to explicitly turn this off
|
||||
if you want to connect to sites without proper checking. We also install a
|
||||
CA cert bundle on 'make install' now.
|
||||
|
||||
The curl tool now requires the -k/--insecure option in order to allow
|
||||
connections and operations on SSL sites that aren't properly verified with
|
||||
-cafile or --capath.
|
||||
|
||||
curl-config --ca displays the built-in path to the CA cert bundle.
|
||||
|
||||
Daniel (26 Aug 2002)
|
||||
- Andrew Francis cleaned up some code that now compiles fine without the need
|
||||
for ugly MSVC pragmas.
|
||||
|
||||
- Keith MacDonald found a minor bug in src/main.c that made it close stdin
|
||||
instead of the actual file handle. It shouldn't have resulted in much
|
||||
trouble as most operating systems close all file handles on process exit
|
||||
anyway.
|
||||
|
||||
Daniel (22 Aug 2002)
|
||||
- Markus Oberhumer provided some documentation for his previously provided
|
||||
CURLOPT_NOSIGNAL fix.
|
||||
|
||||
- Patched the lib/Makefile.am to hopefully no longer complain on undefined
|
||||
symbols that seemed to occur on builds with shared OpenSSL libraries on
|
||||
Solaris lately...
|
||||
|
||||
Daniel (20 Aug 2002)
|
||||
- Fixed compiler warnings on MSCV++ compiles. We're looking for help here:
|
||||
remove the pragmas from lib/config-win32.h and adjust the sources where
|
||||
the warnings occur. Hiding them with pragmas like this is not the correct
|
||||
way of dealing with compiler warnings.
|
||||
|
||||
Daniel (13 Aug 2002)
|
||||
- Ulrich Zadow made the global include files in curl/* include themselves
|
||||
using "curl.h" instead of <curl/curl.h> which thus allows people to more
|
||||
freely decide how to include curl and how to setup their include paths.
|
||||
|
||||
- Sterling Hughes added the curl_share* interface, somewhat as discussed
|
||||
previously.
|
||||
|
||||
- J<>rn Hartroth pointed out that poll() was used in the pre1 source code and
|
||||
it isn't very portable, so now I check for it in the configure script and
|
||||
work around it.
|
||||
|
||||
Version 7.9.9-pre1
|
||||
|
||||
Daniel (12 Aug 2002)
|
||||
- Applied my initial take on making the multi stuff more asynchronous. Connects
|
||||
should now return back without "hanging" until it has connected for real.
|
||||
This should also be the case for FTP-PASV connects.
|
||||
|
||||
Daniel (9 Aug 2002)
|
||||
- Applied Markus F.X.J. Oberhumer's patch that introduces CURLOPT_NOSIGNAL,
|
||||
which effectively prevents libcurl from doing anything that may cause
|
||||
signals to get sent. This is basicly for multi-threaded applications that
|
||||
now can use timeouts properly, without risking any signals to burst in and
|
||||
ruin the party.
|
||||
|
||||
Daniel (5 Aug 2002)
|
||||
- Lukasz Czekierda reported that RFC2732-style literal IPv6 addresses didn't
|
||||
work. When did that code vanish? Anyway, it's back again now and seems to
|
||||
work!
|
||||
|
||||
- Jonatan Lander found out that POSTing an empty string didn't work with the
|
||||
command line tool.
|
||||
|
||||
Daniel (3 Aug 2002)
|
||||
- J<>rn Hartroth fixed the libcurl.def file to build the windows DLL with
|
||||
the multi interface enabled.
|
||||
|
||||
Daniel (1 Aug 2002)
|
||||
- The ftp PORT command now uses a better default IP address, as it will
|
||||
extract and use the local IP address used by the control connection.
|
||||
|
||||
- Modified the #include lines in curl/multi.h to work better on more
|
||||
platforms.
|
||||
|
||||
Daniel (31 Jul 2002)
|
||||
- Attempted a fix for Ray DeGennaro's reported HP-UX host name resolve
|
||||
problems.
|
||||
|
||||
Daniel (30 Jul 2002)
|
||||
- Priya Ramakrishnan and Ryan Jones compiles curl/curl.h with a C++ compiler
|
||||
and don't get __STDC__ defined, which required us to extend the preprocessor
|
||||
check for the ## operator usage.
|
||||
|
||||
- Correct the description for CURLOPT_PASSWDFUNCTION, if set to NULL the
|
||||
internal default function will be put back.
|
||||
|
||||
- danfuzz at milk.com found out that libcurl badly assumed a space after
|
||||
'Set-Cookie:' so if it wasn't present, it caused the first letter of the
|
||||
cookie name to fall off!
|
||||
|
||||
Daniel (29 Jul 2002)
|
||||
- The password prompt asking for user password used stdout and now uses
|
||||
stderr instead to better allow redirecting. It also leaked a fopen() file
|
||||
handle that is now fixed.
|
||||
|
||||
Daniel (28 Jul 2002)
|
||||
- HAVE_SETVBUF was left out from src/main.c which made -N not work. Found out
|
||||
by M T.
|
||||
|
||||
Daniel (26 Jun 2002)
|
||||
- Glen Nakamura solved a crash in the name resolving function for IP-only
|
||||
addresses on Alpha Linux (at least).
|
||||
|
||||
- T. Bharath corrected the high resolution timer introduced in 7.9.8.
|
||||
|
||||
Daniel (22 Jun 2002)
|
||||
- Andr<64>s Garc<72>a pointed out man page errors in curl_formadd.3. I fixed.
|
||||
|
||||
Daniel (19 Jun 2002)
|
||||
- Chris Combes pointed out a flaw in curl_escape(). I fixed. We no longer
|
||||
tries to generate nor parse '+' in URLs. Spaces become %20, and only %-codes
|
||||
are translated by curl_unescape().
|
||||
|
||||
Daniel (15 Jun 2002)
|
||||
- Added --limit-rate to the curl tool. Allows the user to set a maxmimum
|
||||
upper limit to how much bandwidth to use for transfers.
|
||||
|
||||
- CURLOPT_BUFFERSIZE was added to libcurl. This sets a prefered size for the
|
||||
receive buffer in libcurl. The main point of this would be that the write
|
||||
callback gets called more often and with smaller chunks.
|
||||
|
||||
Daniel (14 Jun 2002)
|
||||
- Yarram Sunil found out that the SocketIsDead() function performed a lot
|
||||
faster on Windows when removing the 1 microsecond timeout.
|
||||
|
||||
- Hanno L. Kranzhoff fixed the VC++ project files.
|
||||
|
||||
- Tom Mattison found out that ftp transfers closed the connection a little
|
||||
too often.
|
||||
|
||||
- Miklos Nemeth posted a VC++ makefile fix and some INSTALL comments on how
|
||||
to disable specific protocols when building for Windows.
|
||||
|
||||
Version 7.9.8
|
||||
|
||||
Daniel (13 Jun 2002)
|
||||
- Time to let this baby go.
|
||||
|
||||
Daniel (12 Jun 2002)
|
||||
- Chris Combes added three new options for curl_formadd(): CURLFORM_BUFFER,
|
||||
CURLFORM_BUFFERPTR, CURLFORM_BUFFERLENGTH. They are used to create a
|
||||
multipart that appears as a regular file upload, but the data is provided
|
||||
with a pointer and length.
|
||||
|
||||
- Nico Baggus made the VMS version use sigsetjmp() too.
|
||||
|
||||
- J<>rn Hartroth fixed the mingw32 build using the mm lib.
|
||||
|
||||
- Applied patches by Kris Kennaway that correct format string problems in
|
||||
lib/ftp.c and lib/ldap.c.
|
||||
|
||||
Version 7.9.8-pre3
|
||||
|
||||
Daniel (11 Jun 2002)
|
||||
- James Cone brought the idea of using sigsetjmp() in the signal handler to
|
||||
make the time-out of name lookups to work, even when the underlying name
|
||||
resolver library traps EINTR. The use of sigsetjmp() and siglongjmp() for
|
||||
this may be a bit drastic, and also not likely to exist on all platforms. I
|
||||
added careful checking for this in the configure script, even checks for it
|
||||
being a macro (which seems to be the case in for example Linux).
|
||||
|
||||
sigsetjmp() seems to be mentioned in the Single Unix specification.
|
||||
|
||||
- Miklos Nemeth brought a patch that allows libcurl to get built with specific
|
||||
protocols disabled. This is done by running ./configure
|
||||
--disable-[protocol].
|
||||
|
||||
- FTP range downloads could make CURLE_FTP_WRITE_ERROR get returned. We now
|
||||
make precautions to not return this for range downloads.
|
||||
|
||||
Added test case 135 that makes an ftp range download. Had to tweak the
|
||||
runtests.pl script a bit too.
|
||||
|
||||
- Bug report #566835 identified a strlen() on a NULL pointer. Added additional
|
||||
check to prevent this.
|
||||
|
||||
Daniel (10 Jun 2002)
|
||||
- Found and corrected a connect failure problem that didn't create a human
|
||||
error text.
|
||||
|
||||
- Added code to compile with OpenSSL 0.9.7. Based on patch from Jacob Meuser
|
||||
and comments from G<>tz Babin-Ebell.
|
||||
|
||||
- Gautam Mani found a socket descriptor leak that happened when FTP transfers
|
||||
failed and you reinvoked curl_easy_perform().
|
||||
|
||||
Daniel (5 Jun 2002)
|
||||
- Gustaf Hui corrected curl_multi_remove_handle() so that it won't crash no
|
||||
matter when you decide to remove the CURL handle.
|
||||
|
||||
- HAVE_RAND_STATUS was added to lib/config-win32.h by Andreas Olsson, as it
|
||||
makes windows builds stop complaining about "weak seeding" when it in fact
|
||||
isn't.
|
||||
|
||||
- Another 64bit architecture crash that was introduced in 7.9.7 was now
|
||||
removed, as bug report #564585 clarified. This happened due to our attempts
|
||||
to only allocate only as much memory as is actually needed for name
|
||||
resolving (using realloc) which called for a function that could 'move' a
|
||||
hostent struct in memory.
|
||||
|
||||
Version 7.9.8-pre2
|
||||
|
||||
Daniel (3 Jun 2002)
|
||||
- T. Bharath fixed the CURLINFO_REDIRECT_TIME to return a correct time and
|
||||
made the CURLINFO_REQUEST_SIZE return the correct total request size. He
|
||||
also made the win32 timers use higher resolution than before.
|
||||
|
||||
Daniel (29 May 2002)
|
||||
- Renaud Chaillat made me aware of the fact that libcurl returned an error if
|
||||
you tried to get an empty FTP file. This seemed like a wrong thing to do, so
|
||||
now it no longer does that! I just hope that no one built anything fancy
|
||||
upon this unexpected behavior...
|
||||
|
||||
Daniel (28 May 2002)
|
||||
- Cris Bailiff brought CURLOPT_CAPATH that works like CURLOPT_CAINFO but
|
||||
specifies a path to a directory with certificates rather than a single file
|
||||
with them all concatenated. --capath was added to the command line tool
|
||||
for the same function.
|
||||
|
||||
Windows users need to pay attention that the directory should be setup with
|
||||
the c_rehash tool of the OpenSSL package, and that creates symlinks by
|
||||
default that need to be replaced with actual copies to work on Windows.
|
||||
|
||||
- Gustaf Hui provided new code that changes how curl_multi_info_read()
|
||||
messages are stored, so that they don't have to be kept around for the multi
|
||||
handle's entire life time. He also made it return failure codes properly
|
||||
which it didn't do before.
|
||||
|
||||
Daniel (27 May 2002)
|
||||
- Gustaf Hui pointed out that running curl_multi_perform() without doing
|
||||
curl_multi_fdset() first was not really a working combo. I added an internal
|
||||
check for this and have some extra select() code without timeout to make the
|
||||
library internals work identically nevertheless. We might need to somehow
|
||||
either document that once you've used the *_fdset() you should remain using
|
||||
them in select() or you should blank them somehow so that libcurl won't go
|
||||
crazy.
|
||||
|
||||
Version 7.9.8-pre1
|
||||
|
||||
Daniel (22 May 2002)
|
||||
- James Cone brought an excellent patch, including several tests and docs!
|
||||
CURLOPT_NETRC now takes an enum as argument instead of the previous boolean.
|
||||
--netrc-optional was introduced as an addition to --netrc to allow the
|
||||
command line client to take use of all that new netrc stuff.
|
||||
|
||||
- Bug report #558888 showed a case where libcurl re-used the previous host
|
||||
name when a connection over a proxy was re-used but to a different target
|
||||
host.
|
||||
|
||||
Daniel (21 May 2002)
|
||||
- Edin Kadribasic helped me sort out a problem to made libcurl crash when
|
||||
trying to HTTP POST an empty string.
|
||||
|
||||
- Clarified that Juergen Wilke donated the original tests/server/sws.c code.
|
||||
|
||||
- Jean-Philippe Barrette-LaPierre made curl_formadd() return a typedef named
|
||||
CURLFORMcode instead of the previous 'int', and the various return codes are
|
||||
now globally exported. It allows applications to better figure out what goes
|
||||
wrong when curl_formadd() returns errors.
|
||||
|
||||
Daniel (20 May 2002)
|
||||
- Roland Zimmermann pointed out that SSL_CTX_use_certificate_chain_file()
|
||||
is prefered to SSL_CTX_use_certificate_file().
|
||||
|
||||
Daniel (17 May 2002)
|
||||
- Bug report #556869 pointed out that src/writeout.c didn't compile on freebsd
|
||||
after my AIX fixes the other week.
|
||||
|
||||
- Bug report #556930 pointed out a FreeBSD core dump introduced in 7.9.7 in
|
||||
the DNS struct realloc stuff. Actually, this crash could happen on all
|
||||
systems that made the pack_hostent() function get invoked.
|
||||
|
||||
- I removed several compiler warnings in the test suite's HTTP server.
|
||||
|
||||
Version 7.9.7
|
||||
|
||||
|
21
COPYING
Normal file
21
COPYING
Normal file
@@ -0,0 +1,21 @@
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright (c) 1996 - 2002, Daniel Stenberg, <daniel@haxx.se>.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software for any purpose
|
||||
with or without fee is hereby granted, provided that the above copyright
|
||||
notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
||||
OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of a copyright holder shall not
|
||||
be used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization of the copyright holder.
|
9
CVS-INFO
9
CVS-INFO
@@ -30,6 +30,11 @@ To build after having extracted everything from CVS, do this:
|
||||
./configure
|
||||
make
|
||||
|
||||
Daniel uses a ./configure line similar to this for easier development:
|
||||
|
||||
./configure --disable-shared --enable-debug --enable-maintainer-mode
|
||||
|
||||
|
||||
REQUIREMENTS
|
||||
|
||||
You need the following software installed:
|
||||
@@ -48,7 +53,9 @@ REQUIREMENTS
|
||||
|
||||
MAC OS X
|
||||
|
||||
For Mac OS X users, Guido Neitzer write down the following step-by-step guide:
|
||||
With Mac OS X 10.2 and the associated Developer Tools, the installed versions
|
||||
of the build tools are adequate. For Mac OS X 10.1 users, Guido Neitzer
|
||||
wrote the following step-by-step guide:
|
||||
|
||||
1. Install fink (http://fink.sourceforge.net)
|
||||
2. Update fink to the newest version (with the installed fink)
|
||||
|
2
LEGAL
2
LEGAL
@@ -1,4 +1,4 @@
|
||||
Copyright (C) 1998-2001, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
Copyright (C) 1998-2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license
|
||||
document, but changing it is not allowed.
|
||||
|
27
MITX.txt
27
MITX.txt
@@ -1,27 +0,0 @@
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright (c) 1996 - 2001, Daniel Stenberg, <daniel@haxx.se>.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, and/or sell copies of the
|
||||
Software, and to permit persons to whom the Software is furnished to do so,
|
||||
provided that the above copyright notice(s) and this permission notice appear
|
||||
in all copies of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
|
||||
NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE
|
||||
LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY
|
||||
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of a copyright holder shall not
|
||||
be used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization of the copyright holder.
|
||||
|
470
MPL-1.1.txt
470
MPL-1.1.txt
@@ -1,470 +0,0 @@
|
||||
MOZILLA PUBLIC LICENSE
|
||||
Version 1.1
|
||||
|
||||
---------------
|
||||
|
||||
1. Definitions.
|
||||
|
||||
1.0.1. "Commercial Use" means distribution or otherwise making the
|
||||
Covered Code available to a third party.
|
||||
|
||||
1.1. "Contributor" means each entity that creates or contributes to
|
||||
the creation of Modifications.
|
||||
|
||||
1.2. "Contributor Version" means the combination of the Original
|
||||
Code, prior Modifications used by a Contributor, and the Modifications
|
||||
made by that particular Contributor.
|
||||
|
||||
1.3. "Covered Code" means the Original Code or Modifications or the
|
||||
combination of the Original Code and Modifications, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.4. "Electronic Distribution Mechanism" means a mechanism generally
|
||||
accepted in the software development community for the electronic
|
||||
transfer of data.
|
||||
|
||||
1.5. "Executable" means Covered Code in any form other than Source
|
||||
Code.
|
||||
|
||||
1.6. "Initial Developer" means the individual or entity identified
|
||||
as the Initial Developer in the Source Code notice required by Exhibit
|
||||
A.
|
||||
|
||||
1.7. "Larger Work" means a work which combines Covered Code or
|
||||
portions thereof with code not governed by the terms of this License.
|
||||
|
||||
1.8. "License" means this document.
|
||||
|
||||
1.8.1. "Licensable" means having the right to grant, to the maximum
|
||||
extent possible, whether at the time of the initial grant or
|
||||
subsequently acquired, any and all of the rights conveyed herein.
|
||||
|
||||
1.9. "Modifications" means any addition to or deletion from the
|
||||
substance or structure of either the Original Code or any previous
|
||||
Modifications. When Covered Code is released as a series of files, a
|
||||
Modification is:
|
||||
A. Any addition to or deletion from the contents of a file
|
||||
containing Original Code or previous Modifications.
|
||||
|
||||
B. Any new file that contains any part of the Original Code or
|
||||
previous Modifications.
|
||||
|
||||
1.10. "Original Code" means Source Code of computer software code
|
||||
which is described in the Source Code notice required by Exhibit A as
|
||||
Original Code, and which, at the time of its release under this
|
||||
License is not already Covered Code governed by this License.
|
||||
|
||||
1.10.1. "Patent Claims" means any patent claim(s), now owned or
|
||||
hereafter acquired, including without limitation, method, process,
|
||||
and apparatus claims, in any patent Licensable by grantor.
|
||||
|
||||
1.11. "Source Code" means the preferred form of the Covered Code for
|
||||
making modifications to it, including all modules it contains, plus
|
||||
any associated interface definition files, scripts used to control
|
||||
compilation and installation of an Executable, or source code
|
||||
differential comparisons against either the Original Code or another
|
||||
well known, available Covered Code of the Contributor's choice. The
|
||||
Source Code can be in a compressed or archival form, provided the
|
||||
appropriate decompression or de-archiving software is widely available
|
||||
for no charge.
|
||||
|
||||
1.12. "You" (or "Your") means an individual or a legal entity
|
||||
exercising rights under, and complying with all of the terms of, this
|
||||
License or a future version of this License issued under Section 6.1.
|
||||
For legal entities, "You" includes any entity which controls, is
|
||||
controlled by, or is under common control with You. For purposes of
|
||||
this definition, "control" means (a) the power, direct or indirect,
|
||||
to cause the direction or management of such entity, whether by
|
||||
contract or otherwise, or (b) ownership of more than fifty percent
|
||||
(50%) of the outstanding shares or beneficial ownership of such
|
||||
entity.
|
||||
|
||||
2. Source Code License.
|
||||
|
||||
2.1. The Initial Developer Grant.
|
||||
The Initial Developer hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license, subject to third party intellectual property
|
||||
claims:
|
||||
(a) under intellectual property rights (other than patent or
|
||||
trademark) Licensable by Initial Developer to use, reproduce,
|
||||
modify, display, perform, sublicense and distribute the Original
|
||||
Code (or portions thereof) with or without Modifications, and/or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patents Claims infringed by the making, using or
|
||||
selling of Original Code, to make, have made, use, practice,
|
||||
sell, and offer for sale, and/or otherwise dispose of the
|
||||
Original Code (or portions thereof).
|
||||
|
||||
(c) the licenses granted in this Section 2.1(a) and (b) are
|
||||
effective on the date Initial Developer first distributes
|
||||
Original Code under the terms of this License.
|
||||
|
||||
(d) Notwithstanding Section 2.1(b) above, no patent license is
|
||||
granted: 1) for code that You delete from the Original Code; 2)
|
||||
separate from the Original Code; or 3) for infringements caused
|
||||
by: i) the modification of the Original Code or ii) the
|
||||
combination of the Original Code with other software or devices.
|
||||
|
||||
2.2. Contributor Grant.
|
||||
Subject to third party intellectual property claims, each Contributor
|
||||
hereby grants You a world-wide, royalty-free, non-exclusive license
|
||||
|
||||
(a) under intellectual property rights (other than patent or
|
||||
trademark) Licensable by Contributor, to use, reproduce, modify,
|
||||
display, perform, sublicense and distribute the Modifications
|
||||
created by such Contributor (or portions thereof) either on an
|
||||
unmodified basis, with other Modifications, as Covered Code
|
||||
and/or as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims infringed by the making, using, or
|
||||
selling of Modifications made by that Contributor either alone
|
||||
and/or in combination with its Contributor Version (or portions
|
||||
of such combination), to make, use, sell, offer for sale, have
|
||||
made, and/or otherwise dispose of: 1) Modifications made by that
|
||||
Contributor (or portions thereof); and 2) the combination of
|
||||
Modifications made by that Contributor with its Contributor
|
||||
Version (or portions of such combination).
|
||||
|
||||
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
|
||||
effective on the date Contributor first makes Commercial Use of
|
||||
the Covered Code.
|
||||
|
||||
(d) Notwithstanding Section 2.2(b) above, no patent license is
|
||||
granted: 1) for any code that Contributor has deleted from the
|
||||
Contributor Version; 2) separate from the Contributor Version;
|
||||
3) for infringements caused by: i) third party modifications of
|
||||
Contributor Version or ii) the combination of Modifications made
|
||||
by that Contributor with other software (except as part of the
|
||||
Contributor Version) or other devices; or 4) under Patent Claims
|
||||
infringed by Covered Code in the absence of Modifications made by
|
||||
that Contributor.
|
||||
|
||||
3. Distribution Obligations.
|
||||
|
||||
3.1. Application of License.
|
||||
The Modifications which You create or to which You contribute are
|
||||
governed by the terms of this License, including without limitation
|
||||
Section 2.2. The Source Code version of Covered Code may be
|
||||
distributed only under the terms of this License or a future version
|
||||
of this License released under Section 6.1, and You must include a
|
||||
copy of this License with every copy of the Source Code You
|
||||
distribute. You may not offer or impose any terms on any Source Code
|
||||
version that alters or restricts the applicable version of this
|
||||
License or the recipients' rights hereunder. However, You may include
|
||||
an additional document offering the additional rights described in
|
||||
Section 3.5.
|
||||
|
||||
3.2. Availability of Source Code.
|
||||
Any Modification which You create or to which You contribute must be
|
||||
made available in Source Code form under the terms of this License
|
||||
either on the same media as an Executable version or via an accepted
|
||||
Electronic Distribution Mechanism to anyone to whom you made an
|
||||
Executable version available; and if made available via Electronic
|
||||
Distribution Mechanism, must remain available for at least twelve (12)
|
||||
months after the date it initially became available, or at least six
|
||||
(6) months after a subsequent version of that particular Modification
|
||||
has been made available to such recipients. You are responsible for
|
||||
ensuring that the Source Code version remains available even if the
|
||||
Electronic Distribution Mechanism is maintained by a third party.
|
||||
|
||||
3.3. Description of Modifications.
|
||||
You must cause all Covered Code to which You contribute to contain a
|
||||
file documenting the changes You made to create that Covered Code and
|
||||
the date of any change. You must include a prominent statement that
|
||||
the Modification is derived, directly or indirectly, from Original
|
||||
Code provided by the Initial Developer and including the name of the
|
||||
Initial Developer in (a) the Source Code, and (b) in any notice in an
|
||||
Executable version or related documentation in which You describe the
|
||||
origin or ownership of the Covered Code.
|
||||
|
||||
3.4. Intellectual Property Matters
|
||||
(a) Third Party Claims.
|
||||
If Contributor has knowledge that a license under a third party's
|
||||
intellectual property rights is required to exercise the rights
|
||||
granted by such Contributor under Sections 2.1 or 2.2,
|
||||
Contributor must include a text file with the Source Code
|
||||
distribution titled "LEGAL" which describes the claim and the
|
||||
party making the claim in sufficient detail that a recipient will
|
||||
know whom to contact. If Contributor obtains such knowledge after
|
||||
the Modification is made available as described in Section 3.2,
|
||||
Contributor shall promptly modify the LEGAL file in all copies
|
||||
Contributor makes available thereafter and shall take other steps
|
||||
(such as notifying appropriate mailing lists or newsgroups)
|
||||
reasonably calculated to inform those who received the Covered
|
||||
Code that new knowledge has been obtained.
|
||||
|
||||
(b) Contributor APIs.
|
||||
If Contributor's Modifications include an application programming
|
||||
interface and Contributor has knowledge of patent licenses which
|
||||
are reasonably necessary to implement that API, Contributor must
|
||||
also include this information in the LEGAL file.
|
||||
|
||||
(c) Representations.
|
||||
Contributor represents that, except as disclosed pursuant to
|
||||
Section 3.4(a) above, Contributor believes that Contributor's
|
||||
Modifications are Contributor's original creation(s) and/or
|
||||
Contributor has sufficient rights to grant the rights conveyed by
|
||||
this License.
|
||||
|
||||
3.5. Required Notices.
|
||||
You must duplicate the notice in Exhibit A in each file of the Source
|
||||
Code. If it is not possible to put such notice in a particular Source
|
||||
Code file due to its structure, then You must include such notice in a
|
||||
location (such as a relevant directory) where a user would be likely
|
||||
to look for such a notice. If You created one or more Modification(s)
|
||||
You may add your name as a Contributor to the notice described in
|
||||
Exhibit A. You must also duplicate this License in any documentation
|
||||
for the Source Code where You describe recipients' rights or ownership
|
||||
rights relating to Covered Code. You may choose to offer, and to
|
||||
charge a fee for, warranty, support, indemnity or liability
|
||||
obligations to one or more recipients of Covered Code. However, You
|
||||
may do so only on Your own behalf, and not on behalf of the Initial
|
||||
Developer or any Contributor. You must make it absolutely clear than
|
||||
any such warranty, support, indemnity or liability obligation is
|
||||
offered by You alone, and You hereby agree to indemnify the Initial
|
||||
Developer and every Contributor for any liability incurred by the
|
||||
Initial Developer or such Contributor as a result of warranty,
|
||||
support, indemnity or liability terms You offer.
|
||||
|
||||
3.6. Distribution of Executable Versions.
|
||||
You may distribute Covered Code in Executable form only if the
|
||||
requirements of Section 3.1-3.5 have been met for that Covered Code,
|
||||
and if You include a notice stating that the Source Code version of
|
||||
the Covered Code is available under the terms of this License,
|
||||
including a description of how and where You have fulfilled the
|
||||
obligations of Section 3.2. The notice must be conspicuously included
|
||||
in any notice in an Executable version, related documentation or
|
||||
collateral in which You describe recipients' rights relating to the
|
||||
Covered Code. You may distribute the Executable version of Covered
|
||||
Code or ownership rights under a license of Your choice, which may
|
||||
contain terms different from this License, provided that You are in
|
||||
compliance with the terms of this License and that the license for the
|
||||
Executable version does not attempt to limit or alter the recipient's
|
||||
rights in the Source Code version from the rights set forth in this
|
||||
License. If You distribute the Executable version under a different
|
||||
license You must make it absolutely clear that any terms which differ
|
||||
from this License are offered by You alone, not by the Initial
|
||||
Developer or any Contributor. You hereby agree to indemnify the
|
||||
Initial Developer and every Contributor for any liability incurred by
|
||||
the Initial Developer or such Contributor as a result of any such
|
||||
terms You offer.
|
||||
|
||||
3.7. Larger Works.
|
||||
You may create a Larger Work by combining Covered Code with other code
|
||||
not governed by the terms of this License and distribute the Larger
|
||||
Work as a single product. In such a case, You must make sure the
|
||||
requirements of this License are fulfilled for the Covered Code.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation.
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Code due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description
|
||||
must be included in the LEGAL file described in Section 3.4 and must
|
||||
be included with all distributions of the Source Code. Except to the
|
||||
extent prohibited by statute or regulation, such description must be
|
||||
sufficiently detailed for a recipient of ordinary skill to be able to
|
||||
understand it.
|
||||
|
||||
5. Application of this License.
|
||||
|
||||
This License applies to code to which the Initial Developer has
|
||||
attached the notice in Exhibit A and to related Covered Code.
|
||||
|
||||
6. Versions of the License.
|
||||
|
||||
6.1. New Versions.
|
||||
Netscape Communications Corporation ("Netscape") may publish revised
|
||||
and/or new versions of the License from time to time. Each version
|
||||
will be given a distinguishing version number.
|
||||
|
||||
6.2. Effect of New Versions.
|
||||
Once Covered Code has been published under a particular version of the
|
||||
License, You may always continue to use it under the terms of that
|
||||
version. You may also choose to use such Covered Code under the terms
|
||||
of any subsequent version of the License published by Netscape. No one
|
||||
other than Netscape has the right to modify the terms applicable to
|
||||
Covered Code created under this License.
|
||||
|
||||
6.3. Derivative Works.
|
||||
If You create or use a modified version of this License (which you may
|
||||
only do in order to apply it to code which is not already Covered Code
|
||||
governed by this License), You must (a) rename Your license so that
|
||||
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
|
||||
"MPL", "NPL" or any confusingly similar phrase do not appear in your
|
||||
license (except to note that your license differs from this License)
|
||||
and (b) otherwise make it clear that Your version of the license
|
||||
contains terms which differ from the Mozilla Public License and
|
||||
Netscape Public License. (Filling in the name of the Initial
|
||||
Developer, Original Code or Contributor in the notice described in
|
||||
Exhibit A shall not of themselves be deemed to be modifications of
|
||||
this License.)
|
||||
|
||||
7. DISCLAIMER OF WARRANTY.
|
||||
|
||||
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
||||
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
|
||||
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
|
||||
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
|
||||
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
|
||||
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
|
||||
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
|
||||
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
|
||||
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||
|
||||
8. TERMINATION.
|
||||
|
||||
8.1. This License and the rights granted hereunder will terminate
|
||||
automatically if You fail to comply with terms herein and fail to cure
|
||||
such breach within 30 days of becoming aware of the breach. All
|
||||
sublicenses to the Covered Code which are properly granted shall
|
||||
survive any termination of this License. Provisions which, by their
|
||||
nature, must remain in effect beyond the termination of this License
|
||||
shall survive.
|
||||
|
||||
8.2. If You initiate litigation by asserting a patent infringement
|
||||
claim (excluding declatory judgment actions) against Initial Developer
|
||||
or a Contributor (the Initial Developer or Contributor against whom
|
||||
You file such action is referred to as "Participant") alleging that:
|
||||
|
||||
(a) such Participant's Contributor Version directly or indirectly
|
||||
infringes any patent, then any and all rights granted by such
|
||||
Participant to You under Sections 2.1 and/or 2.2 of this License
|
||||
shall, upon 60 days notice from Participant terminate prospectively,
|
||||
unless if within 60 days after receipt of notice You either: (i)
|
||||
agree in writing to pay Participant a mutually agreeable reasonable
|
||||
royalty for Your past and future use of Modifications made by such
|
||||
Participant, or (ii) withdraw Your litigation claim with respect to
|
||||
the Contributor Version against such Participant. If within 60 days
|
||||
of notice, a reasonable royalty and payment arrangement are not
|
||||
mutually agreed upon in writing by the parties or the litigation claim
|
||||
is not withdrawn, the rights granted by Participant to You under
|
||||
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
|
||||
the 60 day notice period specified above.
|
||||
|
||||
(b) any software, hardware, or device, other than such Participant's
|
||||
Contributor Version, directly or indirectly infringes any patent, then
|
||||
any rights granted to You by such Participant under Sections 2.1(b)
|
||||
and 2.2(b) are revoked effective as of the date You first made, used,
|
||||
sold, distributed, or had made, Modifications made by that
|
||||
Participant.
|
||||
|
||||
8.3. If You assert a patent infringement claim against Participant
|
||||
alleging that such Participant's Contributor Version directly or
|
||||
indirectly infringes any patent where such claim is resolved (such as
|
||||
by license or settlement) prior to the initiation of patent
|
||||
infringement litigation, then the reasonable value of the licenses
|
||||
granted by such Participant under Sections 2.1 or 2.2 shall be taken
|
||||
into account in determining the amount or value of any payment or
|
||||
license.
|
||||
|
||||
8.4. In the event of termination under Sections 8.1 or 8.2 above,
|
||||
all end user license agreements (excluding distributors and resellers)
|
||||
which have been validly granted by You or any distributor hereunder
|
||||
prior to termination shall survive termination.
|
||||
|
||||
9. LIMITATION OF LIABILITY.
|
||||
|
||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
|
||||
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
|
||||
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
|
||||
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
|
||||
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
|
||||
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
|
||||
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
|
||||
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
|
||||
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
|
||||
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
|
||||
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
|
||||
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
|
||||
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
|
||||
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
10. U.S. GOVERNMENT END USERS.
|
||||
|
||||
The Covered Code is a "commercial item," as that term is defined in
|
||||
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
|
||||
software" and "commercial computer software documentation," as such
|
||||
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
|
||||
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
|
||||
all U.S. Government End Users acquire Covered Code with only those
|
||||
rights set forth herein.
|
||||
|
||||
11. MISCELLANEOUS.
|
||||
|
||||
This License represents the complete agreement concerning subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. This License shall be governed by
|
||||
California law provisions (except to the extent applicable law, if
|
||||
any, provides otherwise), excluding its conflict-of-law provisions.
|
||||
With respect to disputes in which at least one party is a citizen of,
|
||||
or an entity chartered or registered to do business in the United
|
||||
States of America, any litigation relating to this License shall be
|
||||
subject to the jurisdiction of the Federal Courts of the Northern
|
||||
District of California, with venue lying in Santa Clara County,
|
||||
California, with the losing party responsible for costs, including
|
||||
without limitation, court costs and reasonable attorneys' fees and
|
||||
expenses. The application of the United Nations Convention on
|
||||
Contracts for the International Sale of Goods is expressly excluded.
|
||||
Any law or regulation which provides that the language of a contract
|
||||
shall be construed against the drafter shall not apply to this
|
||||
License.
|
||||
|
||||
12. RESPONSIBILITY FOR CLAIMS.
|
||||
|
||||
As between Initial Developer and the Contributors, each party is
|
||||
responsible for claims and damages arising, directly or indirectly,
|
||||
out of its utilization of rights under this License and You agree to
|
||||
work with Initial Developer and Contributors to distribute such
|
||||
responsibility on an equitable basis. Nothing herein is intended or
|
||||
shall be deemed to constitute any admission of liability.
|
||||
|
||||
13. MULTIPLE-LICENSED CODE.
|
||||
|
||||
Initial Developer may designate portions of the Covered Code as
|
||||
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
|
||||
Developer permits you to utilize portions of the Covered Code under
|
||||
Your choice of the NPL or the alternative licenses, if any, specified
|
||||
by the Initial Developer in the file described in Exhibit A.
|
||||
|
||||
EXHIBIT A -Mozilla Public License.
|
||||
|
||||
``The contents of this file are subject to the Mozilla Public License
|
||||
Version 1.1 (the "License"); you may not use this file except in
|
||||
compliance with the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS"
|
||||
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing rights and limitations
|
||||
under the License.
|
||||
|
||||
The Original Code is ______________________________________.
|
||||
|
||||
The Initial Developer of the Original Code is ________________________.
|
||||
Portions created by ______________________ are Copyright (C) ______
|
||||
_______________________. All Rights Reserved.
|
||||
|
||||
Contributor(s): ______________________________________.
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the _____ license (the "[___] License"), in which case the
|
||||
provisions of [______] License are applicable instead of those
|
||||
above. If you wish to allow use of your version of this file only
|
||||
under the terms of the [____] License and not to allow others to use
|
||||
your version of this file under the MPL, indicate your decision by
|
||||
deleting the provisions above and replace them with the notice and
|
||||
other provisions required by the [___] License. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file
|
||||
under either the MPL or the [___] License."
|
||||
|
||||
[NOTE: The text of this Exhibit A may differ slightly from the text of
|
||||
the notices in the Source Code files of the Original Code. You should
|
||||
use the text of this Exhibit A rather than the text found in the
|
||||
Original Code Source Code for Your Modifications.]
|
||||
|
10
Makefile.am
10
Makefile.am
@@ -4,9 +4,8 @@
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
EXTRA_DIST = \
|
||||
CHANGES LEGAL maketgz MITX.txt MPL-1.1.txt \
|
||||
reconf Makefile.dist curl-config.in build_vms.com curl-mode.el
|
||||
EXTRA_DIST = CHANGES COPYING maketgz SSLCERTS reconf Makefile.dist \
|
||||
curl-config.in build_vms.com curl-mode.el
|
||||
|
||||
bin_SCRIPTS = curl-config
|
||||
|
||||
@@ -19,6 +18,9 @@ dist-hook:
|
||||
html:
|
||||
cd docs; make html
|
||||
|
||||
pdf:
|
||||
cd docs; make pdf
|
||||
|
||||
check: test
|
||||
|
||||
test:
|
||||
@@ -63,7 +65,7 @@ rpm:
|
||||
pkgadd:
|
||||
umask 022 ; \
|
||||
make install DESTDIR=`/bin/pwd`/packages/Solaris/root ; \
|
||||
cat LEGAL MITX.txt MPL-1.1.txt > $(srcdir)/packages/Solaris/copyright ; \
|
||||
cat COPYING > $(srcdir)/packages/Solaris/copyright ; \
|
||||
cd $(srcdir)/packages/Solaris && $(MAKE) package
|
||||
|
||||
#
|
||||
|
@@ -34,12 +34,12 @@ borland:
|
||||
cd src & make -f Makefile.b32
|
||||
|
||||
mingw32:
|
||||
cd lib & make -f Makefile.m32
|
||||
cd src & make -f Makefile.m32
|
||||
cd lib & make -f Makefile.m32 ZLIB=1
|
||||
cd src & make -f Makefile.m32 ZLIB=1
|
||||
|
||||
mingw32-ssl:
|
||||
cd lib & make -f Makefile.m32 SSL=1
|
||||
cd src & make -f Makefile.m32 SSL=1
|
||||
cd lib & make -f Makefile.m32 SSL=1 ZLIB=1
|
||||
cd src & make -f Makefile.m32 SSL=1 ZLIB=1
|
||||
|
||||
vc:
|
||||
cd lib
|
||||
|
6
README
6
README
@@ -19,16 +19,20 @@ README
|
||||
|
||||
Study the LEGAL file for distribution terms and similar.
|
||||
|
||||
Visit the curl web site or mirror for the latest news:
|
||||
Visit the curl web site or mirrors for the latest news:
|
||||
|
||||
http://curl.haxx.se/
|
||||
http://curl.sf.net/
|
||||
http://curl.planetmirror.com/
|
||||
|
||||
The official download mirror sites are:
|
||||
|
||||
Sweden -- ftp://ftp.sunet.se/pub/www/utilities/curl/
|
||||
Sweden -- http://cool.haxx.se/curl/
|
||||
Germany -- ftp://ftp.fu-berlin.de/pub/unix/network/curl/
|
||||
Australia -- http://curl.planetmirror.com/download/
|
||||
US -- http://curl.sourceforge.net/download/
|
||||
Hongkong -- http://www.execve.net/curl/
|
||||
|
||||
To download the very latest source off the CVS server do this:
|
||||
|
||||
|
35
SSLCERTS
Normal file
35
SSLCERTS
Normal file
@@ -0,0 +1,35 @@
|
||||
Peer SSL Certificate Verification
|
||||
=================================
|
||||
|
||||
Starting in 7.10, libcurl performs peer SSL certificate verification by
|
||||
default. This is done by installing a default CA cert bundle on 'make install'
|
||||
(or similar), that CA bundle package is used by default on operations against
|
||||
SSL servers.
|
||||
|
||||
Alas, if you communicate with HTTPS servers using certifcates that are signed
|
||||
by CAs present in the bundle, you will not notice any changed behavior and you
|
||||
will seeminglessly get a higher security level on your SSL connections since
|
||||
can be sure that the remote server really is the one it claims to be.
|
||||
|
||||
If the remote server uses a self-signed certificate, or if you don't install
|
||||
curl's CA cert bundle or if it uses a certificate signed by a CA that isn't
|
||||
included in the bundle, then you need to do one of the following:
|
||||
|
||||
1. Tell libcurl to *not* verify the peer. With libcurl you disable with with
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
|
||||
With the curl command tool, you disable this with -k/--insecure.
|
||||
|
||||
2. Get a CA certificate that can verify the remote server and use the proper
|
||||
option to point out this CA cert for verification when connecting. For
|
||||
libcurl hackers: curl_easy_setopt(curl, CURLOPT_CAPATH, capath);
|
||||
|
||||
With the curl command tool: --cacert [file]
|
||||
|
||||
This upgrade procedure has been deemed The Right Thing even though it adds
|
||||
this extra trouble for some users, since it adds security to a majority of the
|
||||
SSL connections that previously weren't really secure.
|
||||
|
||||
It turned out many people were using previous versions of curl/libcurl without
|
||||
realizing the need for the CA cert options to get truly secure SSL
|
||||
connections.
|
24
acconfig.h
24
acconfig.h
@@ -64,3 +64,27 @@
|
||||
|
||||
/* Define this to 'int' if in_addr_t is not an available typedefed type */
|
||||
#undef in_addr_t
|
||||
|
||||
/* Define to disable DICT */
|
||||
#undef CURL_DISABLE_DICT
|
||||
|
||||
/* Define to disable FILE */
|
||||
#undef CURL_DISABLE_FILE
|
||||
|
||||
/* Define to disable FTP */
|
||||
#undef CURL_DISABLE_FTP
|
||||
|
||||
/* Define to disable GOPHER */
|
||||
#undef CURL_DISABLE_GOPHER
|
||||
|
||||
/* Define to disable HTTP */
|
||||
#undef CURL_DISABLE_HTTP
|
||||
|
||||
/* Define to disable LDAP */
|
||||
#undef CURL_DISABLE_LDAP
|
||||
|
||||
/* Define to disable TELNET */
|
||||
#undef CURL_DISABLE_TELNET
|
||||
|
||||
/* Define if you have zlib present */
|
||||
#undef HAVE_LIBZ
|
||||
|
321
configure.in
321
configure.in
@@ -8,7 +8,8 @@ AC_PREREQ(2.50)
|
||||
dnl First some basic init macros
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([lib/urldata.h])
|
||||
AM_CONFIG_HEADER(lib/config.h src/config.h tests/server/config.h)
|
||||
AM_CONFIG_HEADER(lib/config.h src/config.h tests/server/config.h lib/ca-bundle.h)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
dnl figure out the libcurl version
|
||||
VERSION=`sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curl.h`
|
||||
@@ -34,7 +35,7 @@ dnl
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
dnl Get system canonical name
|
||||
AC_DEFINE_UNQUOTED(OS, "${host}")
|
||||
AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
|
||||
|
||||
dnl Check for AIX weirdos
|
||||
AC_AIX
|
||||
@@ -51,29 +52,133 @@ AC_LIBTOOL_WIN32_DLL
|
||||
dnl libtool setup
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
case $host in
|
||||
*-*-cygwin | *-*-mingw* | *-*-pw32*)
|
||||
need_no_undefined=yes
|
||||
;;
|
||||
*)
|
||||
need_no_undefined=no
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
|
||||
|
||||
dnl The install stuff has already been taken care of by the automake stuff
|
||||
dnl AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
dnl ************************************************************
|
||||
dnl lame option to switch on debug options
|
||||
dnl switch off particular protocols
|
||||
dnl
|
||||
AC_MSG_CHECKING([whether to enable debug options])
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug Enable pedantic debug options
|
||||
--disable-debug Disable debug options],
|
||||
AC_MSG_CHECKING([whether to support http])
|
||||
AC_ARG_ENABLE(http,
|
||||
[ --enable-http Enable HTTP support
|
||||
--disable-http Disable HTTP support],
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
|
||||
AC_MSG_WARN([disable HTTP disables FTP over proxy and GOPHER too])
|
||||
AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
|
||||
AC_SUBST(CURL_DISABLE_HTTP)
|
||||
AC_SUBST(CURL_DISABLE_GOPHER)
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -DMALLOCDEBUG"
|
||||
CFLAGS="-W -Wall -Wwrite-strings -pedantic -Wundef -Wpointer-arith -Wcast-align -Wnested-externs -g"
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
AC_MSG_CHECKING([whether to support ftp])
|
||||
AC_ARG_ENABLE(ftp,
|
||||
[ --enable-ftp Enable FTP support
|
||||
--disable-ftp Disable FTP support],
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
|
||||
AC_SUBST(CURL_DISABLE_FTP)
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
AC_MSG_CHECKING([whether to support gopher])
|
||||
AC_ARG_ENABLE(gopher,
|
||||
[ --enable-gopher Enable GOPHER support
|
||||
--disable-gopher Disable GOPHER support],
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable GOPHER])
|
||||
AC_SUBST(CURL_DISABLE_GOPHER)
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
AC_MSG_CHECKING([whether to support file])
|
||||
AC_ARG_ENABLE(file,
|
||||
[ --enable-file Enable FILE support
|
||||
--disable-file Disable FILE support],
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
|
||||
AC_SUBST(CURL_DISABLE_FILE)
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
AC_MSG_CHECKING([whether to support ldap])
|
||||
AC_ARG_ENABLE(ldap,
|
||||
[ --enable-ldap Enable LDAP support
|
||||
--disable-ldap Disable LDAP support],
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
|
||||
AC_SUBST(CURL_DISABLE_LDAP)
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
AC_MSG_CHECKING([whether to support dict])
|
||||
AC_ARG_ENABLE(dict,
|
||||
[ --enable-dict Enable DICT support
|
||||
--disable-dict Disable DICT support],
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_DICT, 1 [to disable DICT])
|
||||
AC_SUBST(CURL_DISABLE_DICT)
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
AC_MSG_CHECKING([whether to support telnet])
|
||||
AC_ARG_ENABLE(telnet,
|
||||
[ --enable-telnet Enable TELNET support
|
||||
--disable-telnet Disable TELNET support],
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
|
||||
AC_SUBST(CURL_DISABLE_TELNET)
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Checks for IPv6
|
||||
@@ -82,7 +187,7 @@ dnl **********************************************************************
|
||||
AC_MSG_CHECKING([whether to enable ipv6])
|
||||
AC_ARG_ENABLE(ipv6,
|
||||
[ --enable-ipv6 Enable ipv6 (with ipv4) support
|
||||
--disable-ipv6 Disable ipv6 support],
|
||||
--disable-ipv6 Disable ipv6 support],
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
@@ -122,11 +227,11 @@ dnl Checks for libraries.
|
||||
dnl **********************************************************************
|
||||
|
||||
dnl gethostbyname in the nsl lib?
|
||||
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
|
||||
AC_CHECK_FUNC(gethostbyname, , [ AC_CHECK_LIB(nsl, gethostbyname) ])
|
||||
|
||||
if test "$ac_cv_lib_nsl_gethostbyname" != "yes" -a "$ac_cv_func_gethostbyname" != "yes"; then
|
||||
dnl gethostbyname in the socket lib?
|
||||
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(socket, gethostbyname))
|
||||
AC_CHECK_FUNC(gethostbyname, , [ AC_CHECK_LIB(socket, gethostbyname) ])
|
||||
fi
|
||||
|
||||
dnl At least one system has been identified to require BOTH nsl and
|
||||
@@ -151,7 +256,7 @@ if test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname"; then
|
||||
fi
|
||||
|
||||
dnl resolve lib?
|
||||
AC_CHECK_FUNC(strcasecmp, , AC_CHECK_LIB(resolve, strcasecmp))
|
||||
AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
|
||||
|
||||
if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
|
||||
AC_CHECK_LIB(resolve, strcasecmp,
|
||||
@@ -161,13 +266,10 @@ if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
|
||||
fi
|
||||
|
||||
dnl socket lib?
|
||||
AC_CHECK_FUNC(connect, , AC_CHECK_LIB(socket, connect))
|
||||
|
||||
dnl ucb lib?
|
||||
AC_CHECK_FUNC(gethostname, , AC_CHECK_LIB(ucb, gethostname))
|
||||
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
|
||||
|
||||
dnl dl lib?
|
||||
AC_CHECK_FUNC(dlclose, , AC_CHECK_LIB(dl, dlopen))
|
||||
AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ])
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check how non-blocking sockets are set
|
||||
@@ -178,7 +280,8 @@ AC_ARG_ENABLE(nonblocking,
|
||||
[
|
||||
if test "$enableval" = "no" ; then
|
||||
AC_MSG_WARN([non-blocking sockets disabled])
|
||||
AC_DEFINE(HAVE_DISABLED_NONBLOCKING)
|
||||
AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
|
||||
[to disable NON-BLOCKING connections])
|
||||
else
|
||||
CURL_CHECK_NONBLOCKING_SOCKET
|
||||
fi
|
||||
@@ -196,7 +299,8 @@ AC_ARG_WITH(egd-socket,
|
||||
[ EGD_SOCKET="$withval" ]
|
||||
)
|
||||
if test -n "$EGD_SOCKET" ; then
|
||||
AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET")
|
||||
AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
|
||||
[your Entropy Gathering Daemon socket pathname] )
|
||||
fi
|
||||
|
||||
dnl Check for user-specified random device
|
||||
@@ -205,16 +309,13 @@ AC_ARG_WITH(random,
|
||||
[ RANDOM_FILE="$withval" ],
|
||||
[
|
||||
dnl Check for random device
|
||||
AC_CHECK_FILE("/dev/urandom",
|
||||
[
|
||||
RANDOM_FILE="/dev/urandom";
|
||||
]
|
||||
)
|
||||
AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
|
||||
]
|
||||
)
|
||||
if test -n "$RANDOM_FILE" ; then
|
||||
AC_SUBST(RANDOM_FILE)
|
||||
AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE")
|
||||
AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
|
||||
[a suitable file to read random data from])
|
||||
fi
|
||||
|
||||
dnl **********************************************************************
|
||||
@@ -276,7 +377,7 @@ then
|
||||
AC_CHECK_HEADERS(des.h)
|
||||
|
||||
dnl resolv lib?
|
||||
AC_CHECK_FUNC(res_search, , AC_CHECK_LIB(resolv, res_search))
|
||||
AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
|
||||
|
||||
dnl Check for the Kerberos4 library
|
||||
AC_CHECK_LIB(krb, krb_net_read,
|
||||
@@ -292,7 +393,8 @@ then
|
||||
AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
|
||||
|
||||
dnl add define KRB4
|
||||
AC_DEFINE(KRB4)
|
||||
AC_DEFINE(KRB4, 1,
|
||||
[if you have the Kerberos4 libraries (including -ldes)])
|
||||
|
||||
dnl substitute it too!
|
||||
KRB4_ENABLED=1
|
||||
@@ -315,10 +417,9 @@ dnl **********************************************************************
|
||||
dnl Default to compiler & linker defaults for SSL files & libraries.
|
||||
OPT_SSL=off
|
||||
AC_ARG_WITH(ssl,dnl
|
||||
[ --with-ssl[=DIR] where to look for SSL [compiler/linker default paths]
|
||||
DIR points to the SSL installation [/usr/local/ssl]],
|
||||
OPT_SSL=$withval
|
||||
)
|
||||
AC_HELP_STRING([--with-ssl=PATH], [where to look for SSL, PATH points to the SSL installation (default: /usr/local/ssl)])
|
||||
AC_HELP_STRING([--without-ssl], [disable SSL]),
|
||||
OPT_SSL=$withval)
|
||||
|
||||
if test X"$OPT_SSL" = Xno
|
||||
then
|
||||
@@ -392,9 +493,9 @@ else
|
||||
OPENSSL_ENABLED=1)
|
||||
fi
|
||||
|
||||
dnl Check for the OpenSSL engine header, it is kind of "separated"
|
||||
dnl from the main SSL check
|
||||
AC_CHECK_HEADERS(openssl/engine.h)
|
||||
dnl If the ENGINE library seems to be around, check for the OpenSSL engine
|
||||
dnl header, it is kind of "separated" from the main SSL check
|
||||
AC_CHECK_FUNC(ENGINE_init, [ AC_CHECK_HEADERS(openssl/engine.h) ])
|
||||
|
||||
AC_SUBST(OPENSSL_ENABLED)
|
||||
|
||||
@@ -418,34 +519,43 @@ dnl **********************************************************************
|
||||
dnl Check for the presence of ZLIB libraries and headers
|
||||
dnl **********************************************************************
|
||||
|
||||
dnl Default to compiler & linker defaults for files & libraries.
|
||||
dnl OPT_ZLIB=no
|
||||
dnl AC_ARG_WITH(zlib,dnl
|
||||
dnl [ --with-zlib[=DIR] where to look for ZLIB [compiler/linker default paths]
|
||||
dnl DIR points to the ZLIB installation prefix [/usr/local]],
|
||||
dnl OPT_ZLIB=$withval,
|
||||
dnl )
|
||||
|
||||
dnl Check for & handle argument to --with-zlib.
|
||||
dnl
|
||||
dnl NOTE: We *always* look for ZLIB headers & libraries, all this option
|
||||
dnl does is change where we look (by adjusting LIBS and CPPFLAGS.)
|
||||
dnl
|
||||
|
||||
dnl AC_MSG_CHECKING(where to look for ZLIB)
|
||||
dnl if test X"$OPT_ZLIB" = Xno
|
||||
dnl then
|
||||
dnl AC_MSG_RESULT([defaults (or given in environment)])
|
||||
dnl else
|
||||
dnl test X"$OPT_ZLIB" = Xyes && OPT_ZLIB=/usr/local
|
||||
dnl LIBS="$LIBS -L$OPT_ZLIB/lib"
|
||||
dnl CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
|
||||
dnl AC_MSG_RESULT([$OPT_ZLIB])
|
||||
dnl fi
|
||||
_cppflags=$CPPFLAGS
|
||||
_ldflags=$LDFLAGS
|
||||
OPT_ZLIB="/usr/local"
|
||||
AC_ARG_WITH(zlib,
|
||||
AC_HELP_STRING([--with-zlib=PATH], [search for zlib in PATH])
|
||||
AC_HELP_STRING([--without-zlib], [disable use of zlib]),
|
||||
[OPT_ZLIB="$withval"])
|
||||
|
||||
dnl z lib?
|
||||
dnl AC_CHECK_FUNC(gzread, , AC_CHECK_LIB(z, gzread))
|
||||
case "$OPT_ZLIB" in
|
||||
no)
|
||||
AC_MSG_WARN([zlib disabled]) ;;
|
||||
*)
|
||||
dnl check for the lib first without setting any new path, since many
|
||||
dnl people have it in the default path
|
||||
|
||||
AC_CHECK_LIB(z, inflateEnd, ,
|
||||
[if test -d "$OPT_ZLIB"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
|
||||
LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib"
|
||||
fi])
|
||||
|
||||
AC_CHECK_HEADER(zlib.h,[
|
||||
AC_CHECK_LIB(z, gzread,
|
||||
[HAVE_LIBZ="1"
|
||||
AC_SUBST(HAVE_LIBZ)
|
||||
LIBS="$LIBS -lz"
|
||||
AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
|
||||
AC_DEFINE(HAVE_LIBZ, 1, [If zlib is available])],
|
||||
[ CPPFLAGS=$_cppflags
|
||||
LDFLAGS=$_ldflags])],
|
||||
[ CPPFLAGS=$_cppflags
|
||||
LDFLAGS=$_ldflags]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Default is to try the thread-safe versions of a few functions
|
||||
OPT_THREAD=on
|
||||
@@ -510,12 +620,11 @@ AC_CHECK_HEADERS( \
|
||||
io.h \
|
||||
pwd.h \
|
||||
utime.h \
|
||||
sys/utime.h
|
||||
sys/utime.h \
|
||||
sys/poll.h \
|
||||
setjmp.h
|
||||
)
|
||||
|
||||
dnl Check for libz header
|
||||
dnl AC_CHECK_HEADERS(zlib.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIZE_T
|
||||
@@ -548,7 +657,6 @@ AC_CHECK_FUNCS( socket \
|
||||
strcasecmp \
|
||||
stricmp \
|
||||
strcmpi \
|
||||
gethostname \
|
||||
gethostbyaddr \
|
||||
gettimeofday \
|
||||
inet_addr \
|
||||
@@ -565,9 +673,24 @@ AC_CHECK_FUNCS( socket \
|
||||
getpwuid \
|
||||
geteuid \
|
||||
dlopen \
|
||||
utime
|
||||
utime \
|
||||
sigsetjmp \
|
||||
poll
|
||||
)
|
||||
|
||||
dnl sigsetjmp() might be a macro and no function so if it isn't found already
|
||||
dnl we make an extra check here!
|
||||
if test "$ac_cv_func_sigsetjmp" != "yes"; then
|
||||
AC_MSG_CHECKING([for sigsetjmp defined as macro])
|
||||
AC_TRY_LINK( [#include <setjmp.h>],
|
||||
[sigjmp_buf jmpenv;
|
||||
sigsetjmp(jmpenv, 1);],
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
fi
|
||||
|
||||
dnl removed 'getpass' check on October 26, 2000
|
||||
|
||||
if test "$ac_cv_func_select" != "yes"; then
|
||||
@@ -585,12 +708,74 @@ AC_PATH_PROGS( NROFF, gnroff nroff, ,
|
||||
$PATH:/usr/bin/:/usr/local/bin )
|
||||
AC_SUBST(NROFF)
|
||||
|
||||
|
||||
AC_MSG_CHECKING([CA cert bundle install path])
|
||||
|
||||
AC_ARG_WITH(ca-bundle,
|
||||
AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
|
||||
AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
|
||||
[ ca="$withval" ],
|
||||
[
|
||||
if test "x$prefix" != xNONE; then
|
||||
ca="$prefix/share/curl/curl-ca-bundle.crt"
|
||||
else
|
||||
ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
|
||||
fi
|
||||
] )
|
||||
|
||||
if test "x$ca" = "xno"; then
|
||||
dnl let's not keep "no" as path name, blank it instead
|
||||
ca=""
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(CURL_CA_BUNDLE, "$ca", [CA bundle full path name])
|
||||
fi
|
||||
|
||||
CURL_CA_BUNDLE="$ca"
|
||||
AC_SUBST(CURL_CA_BUNDLE)
|
||||
AC_MSG_RESULT([$ca])
|
||||
|
||||
AC_PROG_YACC
|
||||
|
||||
dnl AC_PATH_PROG( RANLIB, ranlib, /usr/bin/ranlib,
|
||||
dnl $PATH:/usr/bin/:/usr/local/bin )
|
||||
dnl AC_SUBST(RANLIB)
|
||||
|
||||
dnl ************************************************************
|
||||
dnl lame option to switch on debug options
|
||||
dnl
|
||||
AC_MSG_CHECKING([whether to enable debug options])
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug Enable pedantic debug options
|
||||
--disable-debug Disable debug options],
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -DMALLOCDEBUG"
|
||||
CFLAGS="$CFLAGS -g"
|
||||
if test "$GCC" = "yes"; then
|
||||
CFLAGS="$CFLAGS -W -Wall -Wwrite-strings -pedantic -Wundef -Wpointer-arith -Wcast-align -Wnested-externs"
|
||||
fi
|
||||
dnl strip off optimizer flags
|
||||
NEWFLAGS=""
|
||||
for flag in $CFLAGS; do
|
||||
case "$flag" in
|
||||
-O*)
|
||||
dnl echo "cut off $flag"
|
||||
;;
|
||||
*)
|
||||
NEWFLAGS="$NEWFLAGS $flag"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
CFLAGS=$NEWFLAGS
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
AC_CONFIG_FILES([Makefile \
|
||||
docs/Makefile \
|
||||
docs/examples/Makefile \
|
||||
@@ -602,6 +787,7 @@ AC_CONFIG_FILES([Makefile \
|
||||
tests/Makefile \
|
||||
tests/data/Makefile \
|
||||
tests/server/Makefile \
|
||||
tests/libtest/Makefile \
|
||||
packages/Makefile \
|
||||
packages/Win32/Makefile \
|
||||
packages/Win32/cygwin/Makefile \
|
||||
@@ -615,4 +801,3 @@ AC_CONFIG_FILES([Makefile \
|
||||
curl-config
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
|
@@ -16,6 +16,7 @@ Usage: curl-config [OPTION]
|
||||
|
||||
Available values for OPTION include:
|
||||
|
||||
--ca ca bundle install path
|
||||
--cc compiler
|
||||
--cflags pre-processor and compiler flags
|
||||
--feature newline separated list of enabled features
|
||||
@@ -43,6 +44,10 @@ while test $# -gt 0; do
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
--ca)
|
||||
echo @CURL_CA_BUNDLE@
|
||||
;;
|
||||
|
||||
--cc)
|
||||
echo @CC@
|
||||
;;
|
||||
@@ -61,6 +66,30 @@ while test $# -gt 0; do
|
||||
if test "@IPV6_ENABLED@" = "1"; then
|
||||
echo "IPv6"
|
||||
fi
|
||||
if test "@HAVE_LIBZ@" = "1"; then
|
||||
echo "libz"
|
||||
fi
|
||||
if test "@CURL_DISABLE_HTTP@" = "1"; then
|
||||
echo "HTTP-disabled"
|
||||
fi
|
||||
if test "@CURL_DISABLE_FTP@" = "1"; then
|
||||
echo "FTP-disabled"
|
||||
fi
|
||||
if test "@CURL_DISABLE_GOPHER@" = "1"; then
|
||||
echo "GOPHER-disabled"
|
||||
fi
|
||||
if test "@CURL_DISABLE_FILE@" = "1"; then
|
||||
echo "FILE-disabled"
|
||||
fi
|
||||
if test "@CURL_DISABLE_TELNET@" = "1"; then
|
||||
echo "TELNET-disabled"
|
||||
fi
|
||||
if test "@CURL_DISABLE_LDAP@" = "1"; then
|
||||
echo "LDAP-disabled"
|
||||
fi
|
||||
if test "@CURL_DISABLE_DICT@" = "1"; then
|
||||
echo "DICT-disabled"
|
||||
fi
|
||||
;;
|
||||
|
||||
--version)
|
||||
@@ -78,7 +107,8 @@ while test $# -gt 0; do
|
||||
;;
|
||||
|
||||
--cflags)
|
||||
echo -I@includedir@
|
||||
#echo -I@includedir@
|
||||
echo ""
|
||||
;;
|
||||
|
||||
--libs)
|
||||
|
5
docs/.cvsignore
Normal file
5
docs/.cvsignore
Normal file
@@ -0,0 +1,5 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
*html
|
||||
*ps
|
||||
*pdf
|
@@ -45,9 +45,14 @@ Lua
|
||||
Written by Steve Dekorte.
|
||||
http://curl.haxx.se/libcurl/lua/
|
||||
|
||||
Object-Pascal
|
||||
|
||||
Free Pascal, Delphi and Kylix binding written by Christophe Espern.
|
||||
http://www.tekool.com/opcurl
|
||||
|
||||
Pascal
|
||||
|
||||
Free Pascal binding written by Jeffrey Pohlmeyer.
|
||||
Free Pascal, Delphi and Kylix binding written by Jeffrey Pohlmeyer.
|
||||
http://houston.quik.com/jkp/curlpas/
|
||||
|
||||
Perl
|
||||
|
@@ -6,15 +6,16 @@
|
||||
|
||||
To Think About When Contributing Source Code
|
||||
|
||||
This document is intended to offer some guidelines that can be useful to keep
|
||||
in mind when you decide to write a contribution to the project. This concerns
|
||||
This document is intended to offer some simple guidelines that can be useful
|
||||
to keep in mind when you decide to contribute to the project. This concerns
|
||||
new features as well as corrections to existing flaws or bugs.
|
||||
|
||||
Join the Community
|
||||
|
||||
Skip over to http://curl.haxx.se/mail/ and join the appropriate mailing
|
||||
list(s). Read up on details before you post questions. Read this file before
|
||||
you start sending patches!
|
||||
you start sending patches! We prefer patches and discussions being held on
|
||||
the mailing list(s), not sent to individuals.
|
||||
|
||||
The License Issue
|
||||
|
||||
@@ -29,9 +30,9 @@ The License Issue
|
||||
|
||||
What To Read
|
||||
|
||||
Source code, the man pages, the INTERALS document, the TODO, the most recent
|
||||
Source code, the man pages, the INTERNALS document, the TODO, the most recent
|
||||
CHANGES. Just lurking on the libcurl mailing list is gonna give you a lot of
|
||||
insights on what's going on right now.
|
||||
insights on what's going on right now. Asking there is a good idea too.
|
||||
|
||||
Naming
|
||||
|
||||
@@ -39,26 +40,32 @@ Naming
|
||||
names. It doesn't necessarily have to mean that you should use the same as in
|
||||
other places of the code, just that the names should be logical,
|
||||
understandable and be named according to what they're used for. File-local
|
||||
functions should be made static.
|
||||
functions should be made static. We like lower case names.
|
||||
|
||||
See the INTERNALS document on how we name non-exported library-global
|
||||
symbols.
|
||||
|
||||
Indenting
|
||||
|
||||
Please try using the same indenting levels and bracing method as all the
|
||||
other code already does. It makes the source code a lot easier to follow if
|
||||
all of it is written using the same style. We don't ask you to like it, we
|
||||
just ask you to follow the tradition! ;-)
|
||||
just ask you to follow the tradition! ;-) This mainly means: 2-level indents,
|
||||
using spaces only (no tabs) and having the opening brace ({) on the same line
|
||||
as the if() or while().
|
||||
|
||||
Commenting
|
||||
|
||||
Comment your source code extensively. Commented code is quality code and
|
||||
enables future modifications much more. Uncommented code much more risk being
|
||||
Comment your source code extensively using C comments (/* comment */), DO NOT
|
||||
use C++ comments (// this style). Commented code is quality code and enables
|
||||
future modifications much more. Uncommented code much more risk being
|
||||
completely replaced when someone wants to extend things, since other persons'
|
||||
source code can get quite hard to read.
|
||||
|
||||
General Style
|
||||
|
||||
Keep your functions small. If they're small you avoid a lot of mistakes and
|
||||
you don't accidentally mix up variables.
|
||||
you don't accidentally mix up variables etc.
|
||||
|
||||
Non-clobbering All Over
|
||||
|
||||
@@ -69,7 +76,14 @@ Non-clobbering All Over
|
||||
functionality, try writing it in a new source file. If you fix bugs, try to
|
||||
fix one bug at a time and send them as separate patches.
|
||||
|
||||
Separate Patches Doing Different Things
|
||||
Platform Dependent Code
|
||||
|
||||
Use #ifdef HAVE_FEATURE to do conditional code. We avoid checking for
|
||||
particular operating systems or hardware in the #ifdef lines. The
|
||||
HAVE_FEATURE shall be generated by the configure script for unix-like systems
|
||||
and they are hard-coded in the config-[system].h files for the others.
|
||||
|
||||
Separate Patches
|
||||
|
||||
It is annoying when you get a huge patch from someone that is said to fix 511
|
||||
odd problems, but discussions and opinions don't agree with 510 of them - or
|
||||
@@ -94,6 +108,10 @@ Document
|
||||
small description of your fix or your new features with every contribution so
|
||||
that it can be swiftly added to the package documentation.
|
||||
|
||||
The documentation is always made in man pages (nroff formatted) or plain
|
||||
ASCII files. All HTML files on the web site and in the release archives are
|
||||
generated from the nroff/ASCII versions.
|
||||
|
||||
Write Access to CVS Repository
|
||||
|
||||
If you are a frequent contributor, or have another good reason, you can of
|
||||
@@ -111,3 +129,21 @@ Test Cases
|
||||
in the test suite. Every feature that is added should get at least one valid
|
||||
test case that verifies that it works as documented. If every submitter also
|
||||
post a few test cases, it won't end up as a heavy burden on a single person!
|
||||
|
||||
How To Make a Patch
|
||||
|
||||
Keep a copy of the unmodified curl sources. Make your changes in a separate
|
||||
source tree. When you think you have something that you want to offer the
|
||||
curl community, use GNU diff to generate patches.
|
||||
|
||||
If you have modified a single file, try something like:
|
||||
|
||||
diff -u undmodified-file.c my-changed-one.c > my-fixes.diff
|
||||
|
||||
If you have modified several files, possibly in different directories, you
|
||||
can use diff recursively:
|
||||
|
||||
diff -ur curl-original-dir curl-modfied-sources-dir > my-fixes.diff
|
||||
|
||||
GNU diff exists for virtually all platforms, including all kinds of unixes
|
||||
and Windows.
|
||||
|
147
docs/FAQ
147
docs/FAQ
@@ -1,4 +1,4 @@
|
||||
Updated: April 27, 2002 (http://curl.haxx.se/docs/faq.shtml)
|
||||
Updated: January 13, 2003 (http://curl.haxx.se/docs/faq.html)
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
@@ -31,14 +31,15 @@ FAQ
|
||||
3.3 Why doesn't my posting using -F work?
|
||||
3.4 How do I tell curl to run custom FTP commands?
|
||||
3.5 How can I disable the Pragma: nocache header?
|
||||
3.6 Does curl support javascript, ASP, XML, XHTML or HTML version Y?
|
||||
3.6 Does curl support ASP, XML, XHTML or HTML version Y?
|
||||
3.7 Can I use curl to delete/rename a file through FTP?
|
||||
3.8 How do I tell curl to follow HTTP redirects?
|
||||
3.9 How do I use curl in my favourite programming language?
|
||||
3.9 How do I use curl in my favorite programming language?
|
||||
3.10 What about SOAP, WebDAV, XML-RPC or similar protocols over HTTP?
|
||||
3.11 How do I POST with a different Content-Type?
|
||||
3.12 Why do FTP specific features over HTTP proxy fail?
|
||||
3.13 Why does my single/double quotes fail?
|
||||
3.14 Does curl support javascript or pac (automated proxy config)?
|
||||
|
||||
4. Running Problems
|
||||
4.1 Problems connecting to SSL servers.
|
||||
@@ -56,6 +57,9 @@ FAQ
|
||||
4.7 How do I keep user names and passwords secret in Curl command lines?
|
||||
4.8 I found a bug!
|
||||
4.9 Curl can't authenticate to the server that requires NTLM?
|
||||
4.10 My HTTP request using HEAD, PUT or DELETE doesn't work!
|
||||
4.11 Why does my HTTP range requests return the full document?
|
||||
4.12 Why do I get "certificate verify failed" ?
|
||||
|
||||
5. libcurl Issues
|
||||
5.1 Is libcurl thread-safe?
|
||||
@@ -64,6 +68,7 @@ FAQ
|
||||
5.4 Does libcurl do Winsock initing on win32 systems?
|
||||
5.5 Does CURLOPT_FILE and CURLOPT_INFILE work on win32 ?
|
||||
5.6 What about Keep-Alive or persistent connections?
|
||||
5.7 Link errors when building libcurl on Windows!
|
||||
|
||||
6. License Issues
|
||||
6.1 I have a GPL program, can I use the libcurl library?
|
||||
@@ -82,7 +87,9 @@ FAQ
|
||||
cURL (or simply just 'curl') is a command line tool for getting or sending
|
||||
files using URL syntax. The name is a play on 'Client for URLs', originally
|
||||
with URL spelled in uppercase to make it obvious it deals with URLs. The
|
||||
fact it can also be pronounced 'see URL' also helped.
|
||||
fact it can also be pronounced 'see URL' also helped, it works as an
|
||||
abbrivation for "Client URL Request Library" or why not the recursive
|
||||
version: "Curl is a URL Request Library".
|
||||
|
||||
Curl supports a range of common Internet protocols, currently including
|
||||
HTTP, HTTPS, FTP, FTPS, GOPHER, LDAP, DICT, TELNET and FILE.
|
||||
@@ -152,10 +159,10 @@ FAQ
|
||||
1.5 Who makes cURL?
|
||||
|
||||
cURL and libcurl are not made by any single individual. Sure, Daniel
|
||||
Stenberg writes the major parts, but various people's submissions are
|
||||
important and crucial. Anyone can post their changes and improvements and
|
||||
have them inserted in the main sources (of course on the condition that
|
||||
developers agree on that the fixes are good).
|
||||
Stenberg writes the major parts, but other persons' submissions are
|
||||
important and crucial. Anyone can contribute and post their changes and
|
||||
improvements and have them inserted in the main sources (of course on the
|
||||
condition that developers agree on that the fixes are good).
|
||||
|
||||
The list of contributors in the docs/THANKS file is only a small part of all
|
||||
the people that every day provide us with bug reports, suggestions, ideas
|
||||
@@ -165,8 +172,8 @@ FAQ
|
||||
|
||||
1.6 What do you get for making cURL?
|
||||
|
||||
Project cURL is entirely free and open. No person gets paid in any way for
|
||||
developing curl. We all do this voluntarily on our spare time.
|
||||
Project cURL is entirely free and open. No person gets paid for developing
|
||||
curl. We do this voluntarily on our spare time.
|
||||
|
||||
We get some help from companies. Contactor Data hosts the curl web site and
|
||||
the main mailing list, Haxx owns the curl web site's domain and
|
||||
@@ -176,8 +183,8 @@ FAQ
|
||||
If you want to support our project with a donation or similar, one way of
|
||||
doing that would be to buy "gift certificates" at useful online shopping
|
||||
sites, such as amazon.com or thinkgeek.com. Another way would be to sponsor
|
||||
us through a banner-program or by simply helping us coding, documenting,
|
||||
testing etc.
|
||||
us through a banner-program or even better: by helping us coding,
|
||||
documenting, testing etc.
|
||||
|
||||
1.7 What about CURL from curl.com?
|
||||
|
||||
@@ -201,7 +208,7 @@ FAQ
|
||||
mailing lists are listed in the MANUAL document and online at
|
||||
http://curl.haxx.se/mail/
|
||||
|
||||
Keeping curl-related questions and dicussions on mailing lists allows others
|
||||
Keeping curl-related questions and discussions on mailing lists allows others
|
||||
to join in and help, to share their ideas, contribute their suggestions and
|
||||
spread their wisdom. Keeping discussions on public mailing lists also allows
|
||||
for others to learn from this (both current and future users thanks to the
|
||||
@@ -268,8 +275,8 @@ FAQ
|
||||
|
||||
2.4. Does cURL support Socks (RFC 1928) ?
|
||||
|
||||
No. Nobody has wanted it that badly yet. We appreciate patches that bring
|
||||
this functionality.
|
||||
There is limited support for SOCKS5 for curl built with IPv6 support
|
||||
disabled.
|
||||
|
||||
|
||||
3. Usage problems
|
||||
@@ -324,16 +331,14 @@ FAQ
|
||||
the -H/--header option. By adding a header with empty contents you safely
|
||||
disable that one. Use -H "Pragma:" to disable that specific header.
|
||||
|
||||
3.6. Does curl support javascript, ASP, XML, XHTML or HTML version Y?
|
||||
3.6. Does curl support ASP, XML, XHTML or HTML version Y?
|
||||
|
||||
To curl, all contents are alike. It doesn't matter how the page was
|
||||
generated. It may be ASP, PHP, Perl, shell-script, SSI or plain
|
||||
HTML-files. There's no difference to curl and it doesn't even know what kind
|
||||
of language that generated the page.
|
||||
|
||||
Javascript is slightly different since that is code embedded in the HTML
|
||||
that is sent for the client to interpret and curl has no javascript
|
||||
interpreter.
|
||||
See also item 3.14 regarding javascript.
|
||||
|
||||
3.7. Can I use curl to delete/rename a file through FTP?
|
||||
|
||||
@@ -351,7 +356,7 @@ FAQ
|
||||
|
||||
curl -L http://redirector.com
|
||||
|
||||
3.9 How do I use curl in my favourite programming language?
|
||||
3.9 How do I use curl in my favorite programming language?
|
||||
|
||||
There exist many language interfaces/bindings for curl that integrates it
|
||||
better with various languages. If you are fluid in a script language, you
|
||||
@@ -388,7 +393,7 @@ FAQ
|
||||
|
||||
Because when you use a HTTP proxy, the protocol spoken on the network will
|
||||
be HTTP, even if you specify a FTP URL. This effectively means that you
|
||||
normally can't use FTP specific features such as ftp upload and ftp quote
|
||||
normally can't use FTP specific features such as FTP upload and FTP quote
|
||||
etc.
|
||||
|
||||
There is one exception to this rule, and that is if you can "tunnel through"
|
||||
@@ -408,17 +413,41 @@ FAQ
|
||||
curl -d ' with spaces ' url.com
|
||||
|
||||
Exactly what kind of quotes and how to do this is entirely up to the shell
|
||||
or command line interepreter that you are using. For most unix shells, you
|
||||
or command line interpreter that you are using. For most unix shells, you
|
||||
can more or less pick either single (') or double (") quotes. For
|
||||
Windows/DOS prompts I believe you're forced to use double (") quotes.
|
||||
|
||||
Please study the documentaion for your particular environment. Examples in
|
||||
Please study the documentation for your particular environment. Examples in
|
||||
the curl docs will use a mix of both these ones as shown above. You must
|
||||
adjust them to work in your environment.
|
||||
|
||||
Remember that curl works and runs on more operating systems than most single
|
||||
individuals have ever tried.
|
||||
|
||||
3.14 Does curl support javascript or pac (automated proxy config)?
|
||||
|
||||
Many web pages do magic stuff using embedded javascript. Curl and libcurl
|
||||
have no built-in support for that, so it will be treated just like any other
|
||||
contents.
|
||||
|
||||
.pac files are a netscape invention and are sometimes used by organizations
|
||||
to allow them to differentiate which proxies to use. The .pac contents is
|
||||
just a javascript program that gets invoked by the browser and that returns
|
||||
the name of the proxy to connect to. Since curl doesn't support javascript,
|
||||
it can't support .pac proxy configuration either.
|
||||
|
||||
Some work-arounds usually suggested to overcome this javascript dependency:
|
||||
|
||||
- Depending on the javascript complexity, write up a script that
|
||||
translates it to another language and execute that.
|
||||
|
||||
- Read the javascript code and rewrite the same logic in another language.
|
||||
|
||||
- Implement a javascript interpreted, people have successfully used the
|
||||
Mozilla javascript engine in the past.
|
||||
|
||||
- Ask your admins to stop this, for a static proxy setup or similar.
|
||||
|
||||
|
||||
4. Running Problems
|
||||
|
||||
@@ -448,11 +477,12 @@ FAQ
|
||||
|
||||
curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl'
|
||||
|
||||
In win32, the standard DOS shell treats the %-letter specially and you may
|
||||
need to quote the string properly when % is used in it.
|
||||
In Windows, the standard DOS shell treats the %-letter specially and you
|
||||
need to use TWO %-letters for each single one you want to use in the URL.
|
||||
|
||||
Also note that if you want the literal %-letter to be part of the data you
|
||||
pass in a POST using -d/--data you must encode it as '%25'.
|
||||
pass in a POST using -d/--data you must encode it as '%25' (which then also
|
||||
needs the %-letter doubled on Windows machines).
|
||||
|
||||
4.3. How can I use {, }, [ or ] to specify multiple URLs?
|
||||
|
||||
@@ -511,7 +541,7 @@ FAQ
|
||||
|
||||
4.5.6 "301 Moved Permanently"
|
||||
|
||||
If you get this return code and an HTML outpt similar to this:
|
||||
If you get this return code and an HTML output similar to this:
|
||||
|
||||
<H1>Moved Permanently</H1> The document has moved <A
|
||||
HREF="http://same_url_now_with_a_trailing_slash/">here</A>.
|
||||
@@ -562,6 +592,46 @@ FAQ
|
||||
currently support that. Proprietary formats are evil. You should not use
|
||||
such ones.
|
||||
|
||||
4.10 My HTTP request using HEAD, PUT or DELETE doesn't work!
|
||||
|
||||
Many web servers allow or demand that the administrator configures the
|
||||
server properly for these requests to work on the web server.
|
||||
|
||||
Some servers seem to support HEAD only on certain kinds of URLs.
|
||||
|
||||
To fully grasp this, try the documentation for the particular server
|
||||
software you're trying to interact with. This is not anything curl can do
|
||||
anything about.
|
||||
|
||||
4.11 Why does my HTTP range requests return the full document?
|
||||
|
||||
Because the range may not be supported by the server, or the server may
|
||||
choose to ignore it and return the full document anyway.
|
||||
|
||||
4.12 Why do I get "certificate verify failed" ?
|
||||
|
||||
You invoke curl 7.10 or later to communicate on a https:// URL and get an
|
||||
error back looking something similar to this:
|
||||
|
||||
curl: (35) SSL: error:14090086:SSL routines:
|
||||
SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
|
||||
|
||||
Then it means that curl couldn't verify that the server's certificate was
|
||||
good. Curl verifies the certificate using the CA cert bundle that comes with
|
||||
the curl installation.
|
||||
|
||||
To disable the verification (which makes it act like curl did before 7.10),
|
||||
use -k. This does however enable man-in-the-middle attacks.
|
||||
|
||||
If you get this failure but are having a CA cert bundle installed and used,
|
||||
the server's certificate is not signed by one of the CA's in the bundle. It
|
||||
might for example be self-signed. You then correct this problem by obtaining
|
||||
a valid CA cert for the server. Or again, decrease the security by disabling
|
||||
this check.
|
||||
|
||||
Details are also in the SSLCERTS file in the release archives, found online
|
||||
here: http://curl.haxx.se/lxr/source/SSLCERTS
|
||||
|
||||
5. libcurl Issues
|
||||
|
||||
5.1. Is libcurl thread-safe?
|
||||
@@ -647,14 +717,25 @@ FAQ
|
||||
|
||||
Previous versions had no persistent connection support.
|
||||
|
||||
5.7 Link errors when building libcurl on Windows!
|
||||
|
||||
You need to make sure that your project, and all the libraries (both static
|
||||
and dynamic) that it links against, are compiled/linked against the same run
|
||||
time library.
|
||||
|
||||
This is determined by the /MD, /ML, /MT (and their corresponding /M?d)
|
||||
options to the command line compiler. /MD (linking against MSVCRT dll) seems
|
||||
to be the most commonly used option.
|
||||
|
||||
(Provided by Andrew Francis)
|
||||
|
||||
|
||||
6. License Issues
|
||||
|
||||
Curl and libcurl are released under a MIT/X derivate license *or* the MPL,
|
||||
the Mozilla Public License. To get a really good answer to your license
|
||||
conflict questions, you should study the MPL and MIT/X licenses and the
|
||||
license you are about to use and check for clashes yourself. This section is
|
||||
just a brief summary for the cases we get the most questions. (Parts of this
|
||||
section was much enhanced by Bjorn Reese.)
|
||||
Curl and libcurl are released under a MIT/X derivate license. The license is
|
||||
very liberal and should not impose a problem for your project. This section
|
||||
is just a brief summary for the cases we get the most questions. (Parts of
|
||||
this section was much enhanced by Bjorn Reese.)
|
||||
|
||||
6.1. I have a GPL program, can I use the libcurl library?
|
||||
|
||||
|
113
docs/HISTORY
Normal file
113
docs/HISTORY
Normal file
@@ -0,0 +1,113 @@
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
How cURL Became Like This
|
||||
|
||||
|
||||
In the second half of 1997, Daniel Stenberg came up with the idea to make
|
||||
currency-exchange calculations available to Internet Relay Chat (IRC)
|
||||
users. All the necessary data are published on the Web; he just needed to
|
||||
automate their retrieval.
|
||||
|
||||
Daniel simply adopted an existing command-line open-source tool, httpget, that
|
||||
Brazilian Rafael Sagula had written. After a few minor adjustments, it did
|
||||
just what he needed.
|
||||
|
||||
Soon, he found currencies on a GOPHER site, so support for that had to go in,
|
||||
and not before long FTP download support was added as well. The name of the
|
||||
project was changed to urlget to better fit what it actually did now, since
|
||||
the http-only days were already passed.
|
||||
|
||||
The project slowly grew bigger. When upload capabilities were added and the
|
||||
name once again was misleading, a second name change was made and on March 20,
|
||||
1998 curl 4 was released. (The version numbering from the previous names were
|
||||
kept.)
|
||||
|
||||
(Unrelated to this project a company called Curl Corporation filed a US
|
||||
trademark on the name "CURL" on May 18 1998. That company had then already
|
||||
registered the curl.com domain back in November of the previous year. All this
|
||||
was much later brought into the lights.)
|
||||
|
||||
SSL support was added, powered by the SSLeay library.
|
||||
|
||||
August 1998, added project curl to freshmeat.net.
|
||||
|
||||
October 1998, with the curl 4.9 release and the introduction of cookie
|
||||
support, curl was no longer released under the GPL license. Now we're at 4000
|
||||
lines of code, we switched over to the MPL license to restrict the effects of
|
||||
"copyleft".
|
||||
|
||||
November 1998, configure script and reported successful compiles on several
|
||||
major operating systems. The never-quite-understood -F option was added and
|
||||
curl could now simulate quite a lot of a browser.
|
||||
|
||||
Curl 5 was released in December 1998 and introduced the first ever curl man
|
||||
page. People started making Linux RPM packages out of it.
|
||||
|
||||
January 1999, DICT support added.
|
||||
|
||||
OpenSSL took over where SSLeay was abandoned.
|
||||
|
||||
May 1999, first Debian package.
|
||||
|
||||
August 1999, LDAP:// and FILE:// support added. The curl web site gets 1300
|
||||
visits daily.
|
||||
|
||||
Released curl 6.0 in September. 15000 lines of code.
|
||||
|
||||
December 28 1999, added the project on Sourceforge and started using its
|
||||
services for managing the project.
|
||||
|
||||
Spring 2000, major internal overhaul to provide a suitable library interface.
|
||||
The first non-beta release was named 7.1 and arrived in August. This offered
|
||||
the easy interface and turned out to be the beginning of actually getting
|
||||
other software and programs to get based on and powered by libcurl. Almost
|
||||
20000 lines of code.
|
||||
|
||||
August 2000, the curl web site gets 4000 visits daily.
|
||||
|
||||
The PHP guys adopted libcurl already the same month, when the first ever third
|
||||
party libcurl binding showed up. CURL has been a supported module in PHP since
|
||||
the release of PHP 4.0.2. This would soon get followers. More than 16
|
||||
different bindings exist at the time of this writing.
|
||||
|
||||
September 2000, kerberos4 support was added.
|
||||
|
||||
In November 2000 started the work on a test suite for curl. It was later
|
||||
re-written from scratch again.
|
||||
|
||||
January 2001, Daniel released curl 7.5.2 under a new license again: MIT (or
|
||||
MPL). The MIT license is extremely liberal and can be used combined with GPL
|
||||
in other projects. This would finally put an end to the "complaints" from
|
||||
people involved in GPLed projects that previously were prohibited from using
|
||||
libcurl while it was released under MPL only. (Due to the fact that MPL is
|
||||
deemed "GPL incompatible".)
|
||||
|
||||
curl supports HTTP 1.1 starting with the release of 7.7, March 22 2001. This
|
||||
also introduced libcurl's ability to do persistent connections. 24000 lines of
|
||||
code.
|
||||
|
||||
August 2001. curl is bundled in Mac OS X, 10.1. It was already becoming more
|
||||
and more of a standard utility of Linux distributions and a regular in the BSD
|
||||
ports collections. The curl web site gets 8000 visits daily. Curl Corporation
|
||||
contacted Daniel to discuss "the name issue". After Daniel's reply, they have
|
||||
never since got in touch again.
|
||||
|
||||
September 2001, libcurl 7.9 introduces cookie jar and curl_formadd(). During
|
||||
the forthcoming 7.9.x releases, we introduced the multi interface slowly and
|
||||
without much whistles.
|
||||
|
||||
June 2002, the curl web site gets 13000 visits daily. curl and libcurl is
|
||||
35000 lines of code. Reported successful compiles on more than 40 combinations
|
||||
of CPUs and operating systems.
|
||||
|
||||
To estimate number of users of the curl tool or libcurl library is next to
|
||||
impossible. Around 5000 downloaded packages each week from the main site gives
|
||||
a hint, but the packages are mirrored extensively, bundled with numerous OS
|
||||
distributions and otherwise retrieved as part of other software.
|
||||
|
||||
September 2002, with the release of curl 7.10 it is released under the MIT
|
||||
license only.
|
63
docs/INSTALL
63
docs/INSTALL
@@ -28,11 +28,22 @@ UNIX
|
||||
|
||||
You probably need to be root when doing the last command.
|
||||
|
||||
If you have checked out the sources from the CVS repository, read the
|
||||
CVS-INFO on how to proceed.
|
||||
|
||||
If you want to install curl in a different file hierarchy than /usr/local,
|
||||
you need to specify that already when running configure:
|
||||
|
||||
./configure --prefix=/path/to/curl/tree
|
||||
|
||||
If you happen to have write permission in that directory, you can do 'make
|
||||
install' without being root. An example of this would be to make a local
|
||||
install in your own home directory:
|
||||
|
||||
./configure --prefix=$HOME
|
||||
make
|
||||
make install
|
||||
|
||||
The configure script always tries to find a working SSL library unless
|
||||
explicitly told not to. If you have OpenSSL installed in the default search
|
||||
path for your compiler/linker, you don't need to do anything special. If
|
||||
@@ -71,33 +82,6 @@ UNIX
|
||||
LIBS=-lRSAglue -lrsaref
|
||||
(as suggested by Doug Kaufman)
|
||||
|
||||
KNOWN PROBLEMS (these ones should not happen anymore)
|
||||
|
||||
If you happen to have autoconf installed, but a version older than 2.12
|
||||
you will get into trouble. Then you can still build curl by issuing these
|
||||
commands (note that this requires curl to be built staticly): (from Ralph
|
||||
Beckmann)
|
||||
|
||||
./configure [...]
|
||||
cd lib; make; cd ..
|
||||
cd src; make; cd ..
|
||||
cp src/curl elsewhere/bin/
|
||||
|
||||
As suggested by David West, you can make a faked version of autoconf and
|
||||
autoheader:
|
||||
|
||||
----start of autoconf----
|
||||
#!/bin/bash
|
||||
#fake autoconf for building curl
|
||||
if [ "$1" = "--version" ] then
|
||||
echo "Autoconf version 2.13"
|
||||
fi
|
||||
----end of autoconf----
|
||||
|
||||
Then make autoheader a symbolic link to the same script and make sure
|
||||
they're executable and set to appear in the path *BEFORE* the actual (but
|
||||
obsolete) autoconf and autoheader scripts.
|
||||
|
||||
MORE OPTIONS
|
||||
|
||||
To force configure to use the standard cc compiler if both cc and gcc are
|
||||
@@ -236,6 +220,30 @@ Win32
|
||||
project properties to use the SSL include path, link with the SSL libs
|
||||
and define the USE_SSLEAY symbol.
|
||||
|
||||
Disabling Specific Protocols:
|
||||
|
||||
The configure utility, unfortunately, is not available for the Windows
|
||||
environment, therefore, you cannot use the various disable-protocol
|
||||
options of the configure utility on this platform.
|
||||
|
||||
However, you can use the following defines to disable specific
|
||||
protocols:
|
||||
|
||||
HTTP_ONLY disables all protocols except HTTP
|
||||
CURL_DISABLE_FTP disables FTP
|
||||
CURL_DISABLE_LDAP disables LDAP
|
||||
CURL_DISABLE_TELNET disables TELNET
|
||||
CURL_DISABLE_DICT disables DICT
|
||||
CURL_DISABLE_FILE disables FILE
|
||||
CURL_DISABLE_GOPHER disables GOPHER
|
||||
|
||||
If you want to set any of these defines you have the following
|
||||
possibilities:
|
||||
|
||||
- Modify lib/setup.h
|
||||
- Modify lib/Makefile.vc6
|
||||
- Add defines to Project/Settings/C/C++/General/Preprocessor Definitions
|
||||
in the curllib.dsw/curllib.dsp Visual C++ 6 IDE project.
|
||||
|
||||
IBM OS/2
|
||||
========
|
||||
@@ -434,6 +442,7 @@ PORTS
|
||||
- i386 SCO unix
|
||||
- i386 Solaris 2.7
|
||||
- i386 Windows 95, 98, ME, NT, 2000
|
||||
- i386 QNX 6
|
||||
- ia64 Linux 2.3.99
|
||||
- m68k AmigaOS 3
|
||||
- m68k Linux
|
||||
|
@@ -12,6 +12,19 @@ may have been fixed since this was written!
|
||||
|
||||
* GOPHER transfers seem broken
|
||||
|
||||
* configure --disable-http is not fully supported. All other protocols seem
|
||||
to work to disable.
|
||||
|
||||
* If a HTTP server responds to a HEAD request and includes a body (thus
|
||||
violating the RFC2616), curl won't wait to read the response but just stop
|
||||
reading and return back. If a second request (let's assume a GET) is then
|
||||
immediately made to the same server again, the connection will be re-used
|
||||
fine of course, and the second request will be sent off but when the
|
||||
response is to get read, the previous response-body is what curl will read
|
||||
and havoc is what happens.
|
||||
More details on this is found in this libcurl mailing list thread:
|
||||
http://curl.haxx.se/mail/lib-2002-08/0000.html
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
Q: My program blows up when I run lots of curl_easy_perform() calls on a
|
||||
|
36
docs/MANUAL
36
docs/MANUAL
@@ -404,12 +404,28 @@ SPEED LIMIT
|
||||
To have curl abort the download if the speed is slower than 3000 bytes per
|
||||
second for 1 minute, run:
|
||||
|
||||
curl -y 3000 -Y 60 www.far-away-site.com
|
||||
curl -Y 3000 -y 60 www.far-away-site.com
|
||||
|
||||
This can very well be used in combination with the overall time limit, so
|
||||
that the above operatioin must be completed in whole within 30 minutes:
|
||||
|
||||
curl -m 1800 -y 3000 -Y 60 www.far-away-site.com
|
||||
curl -m 1800 -Y 3000 -y 60 www.far-away-site.com
|
||||
|
||||
Forcing curl not to transfer data faster than a given rate is also possible,
|
||||
which might be useful if you're using a limited bandwidth connection and you
|
||||
don't want your transfer to use all of it.
|
||||
|
||||
Make curl transfer data no faster than 10 kilobytes per second:
|
||||
|
||||
curl --limit-rate 10K www.far-away-site.com
|
||||
|
||||
or
|
||||
|
||||
curl --limit-rate 10240 www.far-away-site.com
|
||||
|
||||
Or prevent curl from uploading data faster than 1 megabyte per second:
|
||||
|
||||
curl -T upload --limit-rate 1M ftp://uploadshereplease.com
|
||||
|
||||
CONFIG FILE
|
||||
|
||||
@@ -548,7 +564,7 @@ HTTPS
|
||||
from sites that require valid certificates. The only drawback is that the
|
||||
certificate needs to be in PEM-format. PEM is a standard and open format to
|
||||
store certificates with, but it is not used by the most commonly used
|
||||
browsers (Netscape and MSEI both use the so called PKCS#12 format). If you
|
||||
browsers (Netscape and MSIE both use the so called PKCS#12 format). If you
|
||||
want curl to use the certificates you use with your (favourite) browser, you
|
||||
may need to download/compile a converter that can convert your browser's
|
||||
formatted certificates to PEM formatted ones. This kind of converter is
|
||||
@@ -567,8 +583,8 @@ HTTPS
|
||||
|
||||
Many older SSL-servers have problems with SSLv3 or TLS, that newer versions
|
||||
of OpenSSL etc is using, therefore it is sometimes useful to specify what
|
||||
SSL-version curl should use. Use -3 or -2 to specify that exact SSL version
|
||||
to use:
|
||||
SSL-version curl should use. Use -3, -2 or -1 to specify that exact SSL
|
||||
version to use (for SSLv3, SSLv2 or TLSv1 respectively):
|
||||
|
||||
curl -2 https://secure.site.com/
|
||||
|
||||
@@ -716,9 +732,9 @@ NETRC
|
||||
passwords, so therefor most unix programs won't read this file unless it is
|
||||
only readable by yourself (curl doesn't care though).
|
||||
|
||||
Curl supports .netrc files if told so (using the -n/--netrc option). This is
|
||||
not restricted to only ftp, but curl can use it for all protocols where
|
||||
authentication is used.
|
||||
Curl supports .netrc files if told so (using the -n/--netrc and
|
||||
--netrc-optional options). This is not restricted to only ftp,
|
||||
but curl can use it for all protocols where authentication is used.
|
||||
|
||||
A very simple .netrc file could look something like:
|
||||
|
||||
@@ -826,13 +842,13 @@ MAILING LISTS
|
||||
|
||||
Receives notifications on all CVS commits done to the curl source module.
|
||||
This can become quite a large amount of mails during intense development,
|
||||
be aware. This is for us who liks email...
|
||||
be aware. This is for us who like email...
|
||||
|
||||
curl-www-commits
|
||||
|
||||
Receives notifications on all CVS commits done to the curl www module
|
||||
(basicly the web site). This can become quite a large amount of mails
|
||||
during intense changing, be aware. This is for us who liks email...
|
||||
during intense changing, be aware. This is for us who like email...
|
||||
|
||||
Please direct curl questions, feature requests and trouble reports to one of
|
||||
these mailing lists instead of mailing any individual.
|
||||
|
@@ -12,15 +12,20 @@ HTMLPAGES = \
|
||||
curl.html \
|
||||
curl-config.html
|
||||
|
||||
PDFPAGES = \
|
||||
curl.pdf \
|
||||
curl-config.pdf
|
||||
|
||||
SUBDIRS = examples libcurl
|
||||
|
||||
EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS \
|
||||
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS \
|
||||
VERSIONS KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES)
|
||||
VERSIONS KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) \
|
||||
HISTORY INSTALL libcurl-the-guide $(PDFPAGES)
|
||||
|
||||
MAN2HTML= gnroff -man $< | man2html >$@
|
||||
|
||||
SUFFIXES = .1 .3 .html
|
||||
SUFFIXES = .1 .3 .html .pdf
|
||||
|
||||
html: $(HTMLPAGES)
|
||||
cd libcurl; make html
|
||||
@@ -30,3 +35,13 @@ html: $(HTMLPAGES)
|
||||
|
||||
.1.html:
|
||||
$(MAN2HTML)
|
||||
|
||||
MAN2PDF = groff -Tps -man curl.1 $< >$@
|
||||
|
||||
pdf:
|
||||
for file in $(man_MANS); do \
|
||||
foo=`echo $$file | sed -e 's/\.[0-9]$$//g'`; \
|
||||
groff -Tps -man $$file >$$foo.ps; \
|
||||
ps2pdf $$foo.ps $$foo.pdf; \
|
||||
done
|
||||
cd libcurl; make pdf
|
||||
|
@@ -81,3 +81,4 @@ that have contributed with non-trivial parts:
|
||||
- G<>tz Babin-Ebell <babin<69>ebell@trustcenter.de>
|
||||
- Andreas Damm <andreas-sourceforge@radab.org>
|
||||
- Jacky Lam <sylam@emsoftltd.com>
|
||||
- James Gallagher <jgallagher@gso.uri.edu>
|
||||
|
74
docs/TODO
74
docs/TODO
@@ -6,30 +6,27 @@
|
||||
|
||||
TODO
|
||||
|
||||
Things to do in project cURL. Please tell me what you think, contribute and
|
||||
send me patches that improve things! Also check the http://curl.haxx.se/dev
|
||||
web section for various development notes.
|
||||
Things to do in project cURL. Please tell us what you think, contribute and
|
||||
send us patches that improve things! Also check the http://curl.haxx.se/dev
|
||||
web section for various technical development notes.
|
||||
|
||||
LIBCURL
|
||||
|
||||
* Consider an interface to libcurl that allows applications to easier get to
|
||||
know what cookies that are sent back in the response headers.
|
||||
* Introduce an interface to libcurl that allows applications to easier get to
|
||||
know what cookies that are received. Pushing interface that calls a
|
||||
callback on each received cookie? Querying interface that asks about
|
||||
existing cookies? We probably need both. Enable applications to modify
|
||||
existing cookies as well.
|
||||
|
||||
* Make content encoding/decoding internally be made using a filter system.
|
||||
|
||||
* Test the 'multi' interface more.
|
||||
|
||||
* Introduce another callback interface for upload/download that makes one
|
||||
less copy of data and thus a faster operation.
|
||||
[http://curl.haxx.se/dev/no_copy_callbacks.txt]
|
||||
|
||||
* Add configure options that disables certain protocols in libcurl to
|
||||
decrease footprint. '--disable-[protocol]' where protocol is http, ftp,
|
||||
telnet, ldap, dict or file.
|
||||
|
||||
* Add asynchronous name resolving. http://curl.haxx.se/dev/async-resolver.txt
|
||||
This should be made to work on most of the supported platforms, or
|
||||
otherwise it isn't really interesting.
|
||||
* Add asynchronous name resolving (http://daniel.haxx.se/resolver/). This
|
||||
should be made to work on most of the supported platforms, or otherwise it
|
||||
isn't really interesting.
|
||||
|
||||
* Data sharing. Tell which easy handles within a multi handle that should
|
||||
share cookies, connection cache, dns cache, ssl session cache. Full
|
||||
@@ -41,26 +38,35 @@ TODO
|
||||
implement, libcurl will merely call 'getmutex' and 'leavemutex' callbacks.
|
||||
Part of the sharing suggestion at: http://curl.haxx.se/dev/sharing.txt
|
||||
|
||||
* No-faster-then-this transfers. Many people have limited bandwidth and they
|
||||
want the ability to make sure their transfers never use more bandwith than
|
||||
they think is good.
|
||||
|
||||
* Set the SO_KEEPALIVE socket option to make libcurl notice and disconnect
|
||||
very long time idle connections.
|
||||
|
||||
* Make sure we don't ever loop because of non-blocking sockets return
|
||||
EWOULDBLOCK or similar. This concerns the HTTP request sending (and
|
||||
especially regular HTTP POST), the FTP command sending etc.
|
||||
|
||||
* Go through the code and verify that libcurl deals with big files >2GB and
|
||||
>4GB all over. Bug reports (and source reviews) indicate that it doesn't
|
||||
currently work properly.
|
||||
|
||||
* Make the built-in progress meter use its own dedicated output stream, and
|
||||
make it possible to set it. Use stderr by default.
|
||||
* CURLOPT_MAXFILESIZE. Prevent downloads that are larger than the specified
|
||||
size. CURLE_FILESIZE_EXCEEDED would then be returned. Gautam Mani
|
||||
requested. That is, the download should not even begin but be aborted
|
||||
immediately.
|
||||
|
||||
* Allow the http_proxy (and other) environment variables to contain user and
|
||||
password as well in the style: http://proxyuser:proxypasswd@proxy:port
|
||||
Berend Reitsma suggested.
|
||||
|
||||
LIBCURL - multi interface
|
||||
|
||||
* Make sure we don't ever loop because of non-blocking sockets return
|
||||
EWOULDBLOCK or similar. This FTP command sending etc.
|
||||
|
||||
* Make uploads treated better. We need a way to tell libcurl we have data to
|
||||
write, as the current system expects us to upload data each time the socket
|
||||
is writable and there is no way to say that we want to upload data soon
|
||||
just not right now, without that aborting the upload.
|
||||
|
||||
DOCUMENTATION
|
||||
|
||||
* More and better
|
||||
|
||||
FTP
|
||||
|
||||
@@ -70,6 +76,9 @@ TODO
|
||||
receiver will convert the data from the standard form to his own internal
|
||||
form."
|
||||
|
||||
* Since USERPWD always override the user and password specified in URLs, we
|
||||
might need another way to specify user+password for anonymous ftp logins.
|
||||
|
||||
* An option to only download remote FTP files if they're newer than the local
|
||||
one is a good idea, and it would fit right into the same syntax as the
|
||||
already working http dito works. It of course requires that 'MDTM' works,
|
||||
@@ -81,23 +90,12 @@ TODO
|
||||
|
||||
HTTP
|
||||
|
||||
* HTTP PUT for files passed on stdin *OR* when the --crlf option is
|
||||
used. Requires libcurl to send the file with chunked content
|
||||
encoding. [http://curl.haxx.se/dev/HTTP-PUT-stdin.txt] When the filter
|
||||
system mentioned above gets real, it'll be a piece of cake to add.
|
||||
|
||||
* Pass a list of host name to libcurl to which we allow the user name and
|
||||
password to get sent to. Currently, it only get sent to the host name that
|
||||
the first URL uses (to prevent others from being able to read it), but this
|
||||
also prevents the authentication info from getting sent when following
|
||||
locations to legitimate other host names.
|
||||
|
||||
* "Content-Encoding: compress/gzip/zlib" HTTP 1.1 clearly defines how to get
|
||||
and decode compressed documents. There is the zlib that is pretty good at
|
||||
decompressing stuff. This work was started in October 1999 but halted again
|
||||
since it proved more work than we thought. It is still a good idea to
|
||||
implement though. This requires the filter system mentioned above.
|
||||
|
||||
* Authentication: NTLM. Support for that MS crap called NTLM
|
||||
authentication. MS proxies and servers sometime require that. Since that
|
||||
protocol is a proprietary one, it involves reverse engineering and network
|
||||
@@ -170,6 +168,12 @@ TODO
|
||||
|
||||
CLIENT
|
||||
|
||||
* Add an option that prevents cURL from overwiting existing local files. When
|
||||
used, and there already is an existing file with the target file name
|
||||
(either -O or -o), a number should be appended (and increased if already
|
||||
existing). So that index.html becomes first index.html.1 and then
|
||||
index.html.2 etc. Jeff Pohlmeyer suggested.
|
||||
|
||||
* "curl ftp://site.com/*.txt"
|
||||
|
||||
* Several URLs can be specified to get downloaded. We should be able to use
|
||||
|
@@ -2,7 +2,7 @@
|
||||
.\" nroff -man curl-config.1
|
||||
.\" Written by Daniel Stenberg
|
||||
.\"
|
||||
.TH curl-config 1 "21 January 2002" "Curl 7.9.3" "curl-config manual"
|
||||
.TH curl-config 1 "8 Oct 2002" "Curl 7.10" "curl-config manual"
|
||||
.SH NAME
|
||||
curl-config \- Get information about a libcurl installation
|
||||
.SH SYNOPSIS
|
||||
@@ -11,6 +11,8 @@ curl-config \- Get information about a libcurl installation
|
||||
.B curl-config
|
||||
displays information about a previous curl and libcurl installation.
|
||||
.SH OPTIONS
|
||||
.IP "--ca"
|
||||
Displays the built-in path to the CA cert bundle this libcurl uses.
|
||||
.IP "--cc"
|
||||
Displays the compiler used to build libcurl.
|
||||
.IP "--cflags"
|
||||
|
83
docs/curl.1
83
docs/curl.1
@@ -2,7 +2,7 @@
|
||||
.\" nroff -man curl.1
|
||||
.\" Written by Daniel Stenberg
|
||||
.\"
|
||||
.TH curl 1 "7 May 2002" "Curl 7.9.7" "Curl Manual"
|
||||
.TH curl 1 "11 Sep 2002" "Curl 7.10" "Curl Manual"
|
||||
.SH NAME
|
||||
curl \- transfer a URL
|
||||
.SH SYNOPSIS
|
||||
@@ -95,7 +95,7 @@ If this option is used twice, the second one will disable ASCII usage.
|
||||
must be using valid ciphers. Read up on SSL cipher list details on this URL:
|
||||
.I http://www.openssl.org/docs/apps/ciphers.html (Option added in curl 7.9)
|
||||
|
||||
If this option is used severl times, the last one will override the others.
|
||||
If this option is used several times, the last one will override the others.
|
||||
.IP "--connect-timeout <seconds>"
|
||||
Maximum time in seconds that you allow the connection to the server to take.
|
||||
This only limits the connection phase, once curl has connected this option is
|
||||
@@ -122,6 +122,9 @@ Use "-C -" to tell curl to automatically find out where/how to resume the
|
||||
transfer. It then uses the given output/input files to figure that out.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "---create-dirs"
|
||||
When used in conjunction with the -o option, curl will create the necessary
|
||||
local directory hierarchy as needed.
|
||||
.IP "--crlf"
|
||||
(FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
|
||||
|
||||
@@ -211,7 +214,17 @@ certificate concatenated!
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--cacert <CA certificate>"
|
||||
(HTTPS) Tells curl to use the specified certificate file to verify the
|
||||
peer. The certificate must be in PEM format.
|
||||
peer. The file may contain multiple CA certificates. The certificate(s) must
|
||||
be in PEM format.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--capath <CA certificate directory>"
|
||||
(HTTPS) Tells curl to use the specified certificate directory to verify the
|
||||
peer. The certificates must be in PEM format, and the directory must have been
|
||||
processed using the c_rehash utility supplied with openssl. Certificate directories
|
||||
are not supported under Windows (because c_rehash uses symbolink links to
|
||||
create them). Using --capath can allow curl to make https connections much
|
||||
more efficiently than using --cacert if the --cacert file contains many CA certificates.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-f/--fail"
|
||||
@@ -298,6 +311,16 @@ as if a new session is started. Typical browsers always discard session
|
||||
cookies when they're closed down. (Added in 7.9.7)
|
||||
|
||||
If this option is used several times, each occurrence will toggle this on/off.
|
||||
.IP "-k/--insecure"
|
||||
(SSL) This option explicitly allows curl to perform "insecure" SSL connections
|
||||
and transfers. Starting with curl 7.10, all SSL connections will be attempted
|
||||
to be made secure by using the CA certificate bundle installed by
|
||||
default. This makes all connections considered "insecure" to fail unless
|
||||
-k/--insecure is used.
|
||||
|
||||
This option is ignored if --cacert or --capath is used!
|
||||
|
||||
If this option is used twice, the second time will again disable it.
|
||||
.IP "--krb4 <level>"
|
||||
(FTP) Enable kerberos4 authentication and use. The level must be entered and
|
||||
should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use
|
||||
@@ -322,6 +345,19 @@ line. So, it could look similar to this:
|
||||
url = "http://curl.haxx.se/docs/"
|
||||
|
||||
This option can be used multiple times.
|
||||
.IP "--limit-rate <speed>"
|
||||
Specify the maximum transfer rate you want curl to use. This feature is useful
|
||||
if you have a limited pipe and you'd prefer you have your transfer not use
|
||||
your entire bandwidth.
|
||||
|
||||
The given speed is measured in bytes/second, unless a suffix is
|
||||
appended. Appending 'k' or 'K' will count the number as kilobytes, 'm' or M'
|
||||
makes it megabytes while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and
|
||||
1G.
|
||||
|
||||
This option was introduced in curl 7.10.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-l/--list-only"
|
||||
(FTP)
|
||||
When listing an FTP directory, this switch forces a name-only view.
|
||||
@@ -394,6 +430,8 @@ or use several variables like:
|
||||
curl http://{site,host}.host[1-5].com -o "#1_#2"
|
||||
|
||||
You may use this option as many times as you have number of URLs.
|
||||
|
||||
See also the --create-dirs option to create the local directories dynamically.
|
||||
.IP "-O/--remote-name"
|
||||
Write output to a local file named like the remote file we get. (Only
|
||||
the file part of the remote file is used, the path is cut off.)
|
||||
@@ -568,10 +606,13 @@ or the
|
||||
.I -O
|
||||
options.
|
||||
.IP "-v/--verbose"
|
||||
Makes the fetching more verbose/talkative. Mostly usable for
|
||||
debugging. Lines starting with '>' means data sent by curl, '<'
|
||||
means data received by curl that is hidden in normal cases and lines
|
||||
starting with '*' means additional info provided by curl.
|
||||
Makes the fetching more verbose/talkative. Mostly usable for debugging. Lines
|
||||
starting with '>' means data sent by curl, '<' means data received by curl
|
||||
that is hidden in normal cases and lines starting with '*' means additional
|
||||
info provided by curl.
|
||||
|
||||
Note that if you want to see HTTP headers in the output, \fI-i/--include\fP
|
||||
might be option you're looking for.
|
||||
|
||||
If this option is used twice, the second will again disable verbose.
|
||||
.IP "-V/--version"
|
||||
@@ -653,6 +694,10 @@ If this option is used several times, the last one will be used.
|
||||
Use specified HTTP proxy. If the port number is not specified, it is assumed
|
||||
at port 1080.
|
||||
|
||||
This option overrides existing environment variables that sets proxy to
|
||||
use. If there's an environment variable setting a proxy, you can set proxy to
|
||||
"" to override it.
|
||||
|
||||
\fBNote\fP that all operations that are performed over a HTTP proxy will
|
||||
transparantly be converted to HTTP. It means that certain protocol specific
|
||||
operations might not be available. This is not the case if you can tunnel
|
||||
@@ -675,6 +720,9 @@ If a download is slower than speed-limit bytes per second during a speed-time
|
||||
period, the download gets aborted. If speed-time is used, the default
|
||||
speed-limit will be 1 unless set with -y.
|
||||
|
||||
This option controls transfers and thus will not affect slow connects etc. If
|
||||
this is a concern for you, try the \fI--connect-timeout\fP option.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-Y/--speed-limit <speed>"
|
||||
If a download is slower than this given speed, in bytes per second, for
|
||||
@@ -779,7 +827,8 @@ FTP couldn't set binary. Couldn't change transfer method to binary.
|
||||
.IP 18
|
||||
Partial file. Only a part of the file was transfered.
|
||||
.IP 19
|
||||
FTP couldn't RETR file. The RETR command failed.
|
||||
FTP couldn't download/access the given file, the RETR (or similar) command
|
||||
failed.
|
||||
.IP 20
|
||||
FTP write error. The transfer was reported bad by the server.
|
||||
.IP 21
|
||||
@@ -847,6 +896,24 @@ Malformed telnet option.
|
||||
The remote peer's SSL certificate wasn't ok
|
||||
.IP 52
|
||||
The server didn't reply anything, which here is considered an error.
|
||||
.IP 53
|
||||
SSL crypto engine not found
|
||||
.IP 54
|
||||
Cannot set SSL crypto engine as default
|
||||
.IP 55
|
||||
Failed sending network data
|
||||
.IP 56
|
||||
Failure in receiving network data
|
||||
.IP 57
|
||||
Share is in use (internal error)
|
||||
.IP 58
|
||||
Problem with the local certificate
|
||||
.IP 59
|
||||
Couldn't use specified SSL cipher
|
||||
.IP 60
|
||||
Problem with the CA cert (path? permission?)
|
||||
.IP 61
|
||||
Unrecognized transfer encoding
|
||||
.IP XX
|
||||
There will appear more error codes here in future releases. The existing ones
|
||||
are meant to never change.
|
||||
|
2
docs/examples/.cvsignore
Normal file
2
docs/examples/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
@@ -9,7 +9,7 @@ EXTRA_DIST = README curlgtk.c sepheaders.c simple.c postit2.c \
|
||||
multithread.c getinmemory.c ftpupload.c httpput.c \
|
||||
simplessl.c ftpgetresp.c http-post.c post-callback.c \
|
||||
multi-app.c multi-double.c multi-single.c multi-post.c \
|
||||
fopen.c
|
||||
fopen.c simplepost.c
|
||||
|
||||
all:
|
||||
@echo "done"
|
||||
|
@@ -35,7 +35,7 @@ LIBS = -lcurl -lsocket -lnsl -lssl -lcrypto -dl
|
||||
|
||||
# Link the target with all objects and libraries
|
||||
$(TARGET) : $(OBJS)
|
||||
$(CC) $(LDFLAGS) $(LIBS) -o $(TARGET) $(OBJS)
|
||||
$(CC) -o $(TARGET) $(OBJS) $(LDFLAGS) $(LIBS)
|
||||
|
||||
# Compile the source files into object files
|
||||
ftpget.o : ftpget.c
|
||||
|
@@ -1,7 +1,7 @@
|
||||
EXAMPLES
|
||||
|
||||
This directory is for tiny libcurl programming examples. They are meant to
|
||||
show some simple steps on how you can build your own application to take full
|
||||
This directory is for libcurl programming examples. They are meant to show
|
||||
some simple steps on how you can build your own application to take full
|
||||
advantage of libcurl.
|
||||
|
||||
If you end up with other small but still useful example sources, please mail
|
||||
@@ -12,11 +12,14 @@ examples. Just edit the file according to your system and requirements first.
|
||||
|
||||
Most examples should build fine using a command line like this:
|
||||
|
||||
$ gcc `curl-config --cflags` `curl-config --libs` -o example example.c
|
||||
$ `curl-config --cc --cflags --libs` -o example example.c
|
||||
|
||||
Try the php/examples/ directory for PHP programming snippets!
|
||||
Some compilers don't like having the arguments in this order but instead
|
||||
want you do reorganize them like:
|
||||
|
||||
*PLEASE* do not use the curl.haxx.se site as a test target for your libcurl
|
||||
applications/experiments. Even if the examples in this directory use that
|
||||
site as an example URL at some places, it doesn't mean that the URLs work or
|
||||
that we expect you to actually torture our web site with your tests! Thanks.
|
||||
$ `curl-config --cc` -o example example.c `curl-config --cflags --libs`
|
||||
|
||||
*PLEASE* do not use the curl.haxx.se site as a test target for your libcurl
|
||||
applications/experiments. Even if the examples in this directory use that site
|
||||
as an example URL at some places, it doesn't mean that the URLs work or that
|
||||
we expect you to actually torture our web site with your tests! Thanks.
|
||||
|
@@ -83,7 +83,8 @@ int main(int argc, char **argv)
|
||||
default:
|
||||
/* one or more of curl's file descriptors say there's data to read
|
||||
or write */
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
while(CURLM_CALL_MULTI_PERFORM ==
|
||||
curl_multi_perform(multi_handle, &still_running));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -80,7 +80,8 @@ int main(int argc, char **argv)
|
||||
case 0:
|
||||
default:
|
||||
/* timeout or readable/writable sockets */
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
while(CURLM_CALL_MULTI_PERFORM ==
|
||||
curl_multi_perform(multi_handle, &still_running));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -74,7 +74,8 @@ int main(int argc, char **argv)
|
||||
case 0:
|
||||
default:
|
||||
/* timeout or readable/writable sockets */
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
while(CURLM_CALL_MULTI_PERFORM ==
|
||||
curl_multi_perform(multi_handle, &still_running));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -63,6 +63,10 @@ int main(int argc, char **argv)
|
||||
/* we want the headers to this file handle */
|
||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER ,headerfile);
|
||||
|
||||
/*
|
||||
* Notice here that if you want the actual data sent anywhere else but
|
||||
* stdout, you should consider using the CURLOPT_WRITEDATA option. */
|
||||
|
||||
/* get it! */
|
||||
curl_easy_perform(curl_handle);
|
||||
|
||||
|
36
docs/examples/simplepost.c
Normal file
36
docs/examples/simplepost.c
Normal file
@@ -0,0 +1,36 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
||||
char *postthis="moo mooo moo moo";
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://posthere.com");
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postthis);
|
||||
|
||||
/* if we don't provide POSTFIELDSIZE, libcurl will strlen() by
|
||||
itself */
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(postthis));
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
return 0;
|
||||
}
|
@@ -66,7 +66,7 @@ int main(int argc, char **argv)
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
/* what call to write: */
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "HTTPS://curl.haxx.se");
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "HTTPS://your.favourite.ssl.site");
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEHEADER, headerfile);
|
||||
|
||||
while(1) /* do some ugly short cut... */
|
||||
|
21
docs/index.html
Normal file
21
docs/index.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<TITLE>Index to Curl documentation</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY>
|
||||
<H1 ALIGN="CENTER">Index to Curl documentation</H1>
|
||||
|
||||
<H2>Programs</H2>
|
||||
<a href="curl-config.html">curl-config</A>
|
||||
<br><a href="curl.html">curl</A>
|
||||
|
||||
<h2>Tutorial</h2>
|
||||
<a href="TheArtOfHttpScripting">The Art Of Scripting HTTP Requests Using Curl</a> (plain text)
|
||||
|
||||
<h2>libcurl</h2>
|
||||
See the <a href="libcurl/index.html">libcurl section</a>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
@@ -116,6 +116,7 @@ Global Preparation
|
||||
Repeated calls to curl_global_init() and curl_global_cleanup() should be
|
||||
avoided. They should only be called once each.
|
||||
|
||||
|
||||
Handle the Easy libcurl
|
||||
|
||||
libcurl version 7 is oriented around the so called easy interface. All
|
||||
@@ -215,6 +216,24 @@ Handle the Easy libcurl
|
||||
previous
|
||||
|
||||
|
||||
Multi-threading issues
|
||||
|
||||
libcurl is completely thread safe, except for two issues: signals and alarm
|
||||
handlers. Signals are needed for a SIGPIPE handler, and the alarm() syscall
|
||||
is used to catch timeouts (mostly during DNS lookup).
|
||||
|
||||
So when using multiple threads you should first ignore SIGPIPE in your main
|
||||
thread and set the CURLOPT_NOSIGNAL option to TRUE for all handles.
|
||||
|
||||
Everything will work fine except that timeouts are not honored during the DNS
|
||||
lookup - this would require some sort of asynchronous DNS lookup (which is
|
||||
planned for a future libcurl version).
|
||||
|
||||
For SIGPIPE info see the UNIX Socket FAQ at
|
||||
http://www.unixguide.net/network/socketfaq/2.22.shtml
|
||||
|
||||
Also, note that CURLOPT_DNS_USE_GLOBAL_CACHE is not thread-safe.
|
||||
|
||||
When It Doesn't Work
|
||||
|
||||
There will always be times when the transfer fails for some reason. You might
|
||||
@@ -237,6 +256,9 @@ When It Doesn't Work
|
||||
possible of your code that uses libcurl, operating system name and version,
|
||||
compiler name and version etc.
|
||||
|
||||
If CURLOPT_VERBOSE is not enough, you increase the level of debug data your
|
||||
application receive by using the CURLOPT_DEBUGFUNCTION.
|
||||
|
||||
Getting some in-depth knowledge about the protocols involved is never wrong,
|
||||
and if you're trying to do funny things, you might very well understand
|
||||
libcurl and how to use it better if you study the appropriate RFC documents
|
||||
@@ -275,8 +297,8 @@ Upload Data to a Remote Site
|
||||
curl_easy_setopt(easyhandle, CURLOPT_UPLOAD, TRUE);
|
||||
|
||||
A few protocols won't behave properly when uploads are done without any prior
|
||||
knowledge of the expected file size. HTTP PUT is one example [1]. So, set the
|
||||
upload file size using the CURLOPT_INFILESIZE like this:
|
||||
knowledge of the expected file size. So, set the upload file size using the
|
||||
CURLOPT_INFILESIZE for all known file sizes like this[1]:
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_INFILESIZE, file_size);
|
||||
|
||||
@@ -386,7 +408,7 @@ HTTP POSTing
|
||||
headers = curl_slist_append(headers, "Content-Type: text/xml");
|
||||
|
||||
/* post binary data */
|
||||
curl_easy_setopt(easyhandle, CURLOPT_POSTFIELD, binaryptr);
|
||||
curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDS, binaryptr);
|
||||
|
||||
/* set the size of the postfields data */
|
||||
curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDSIZE, 23);
|
||||
@@ -708,6 +730,35 @@ Persistancy Is The Way to Happiness
|
||||
CURLOPT_FORBID_REUSE to TRUE.
|
||||
|
||||
|
||||
HTTP Headers Used by libcurl
|
||||
|
||||
When you use libcurl to do HTTP requeests, it'll pass along a series of
|
||||
headers automaticly. It might be good for you to know and understand these
|
||||
ones.
|
||||
|
||||
Host
|
||||
|
||||
This header is required by HTTP 1.1 and even many 1.0 servers and should
|
||||
be the name of the server we want to talk to. This includes the port
|
||||
number if anything but default.
|
||||
|
||||
Pragma
|
||||
|
||||
"no-cache". Tells a possible proxy to not grap a copy from the cache but
|
||||
to fetch a fresh one.
|
||||
|
||||
Accept:
|
||||
|
||||
"image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*". Cloned from a
|
||||
browser once a hundred years ago.
|
||||
|
||||
Expect:
|
||||
|
||||
When doing multi-part formposts, libcurl will set this header to
|
||||
"100-continue" to ask the server for an "OK" message before it proceeds
|
||||
with sending the data part of the post.
|
||||
|
||||
|
||||
Customizing Operations
|
||||
|
||||
There is an ongoing development today where more and more protocols are built
|
||||
@@ -720,101 +771,129 @@ Customizing Operations
|
||||
|
||||
libcurl is your friend here too.
|
||||
|
||||
If just changing the actual HTTP request keyword is what you want, like when
|
||||
GET, HEAD or POST is not good enough for you, CURLOPT_CUSTOMREQUEST is there
|
||||
for you. It is very simple to use:
|
||||
CUSTOMREQUEST
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_CUSTOMREQUEST, "MYOWNRUQUEST");
|
||||
If just changing the actual HTTP request keyword is what you want, like
|
||||
when GET, HEAD or POST is not good enough for you, CURLOPT_CUSTOMREQUEST
|
||||
is there for you. It is very simple to use:
|
||||
|
||||
When using the custom request, you change the request keyword of the actual
|
||||
request you are performing. Thus, by default you make GET request but you can
|
||||
also make a POST operation (as described before) and then replace the POST
|
||||
keyword if you want to. You're the boss.
|
||||
curl_easy_setopt(easyhandle, CURLOPT_CUSTOMREQUEST, "MYOWNRUQUEST");
|
||||
|
||||
HTTP-like protocols pass a series of headers to the server when doing the
|
||||
request, and you're free to pass any amount of extra headers that you think
|
||||
fit. Adding headers are this easy:
|
||||
When using the custom request, you change the request keyword of the
|
||||
actual request you are performing. Thus, by default you make GET request
|
||||
but you can also make a POST operation (as described before) and then
|
||||
replace the POST keyword if you want to. You're the boss.
|
||||
|
||||
struct curl_slist *headers;
|
||||
Modify Headers
|
||||
|
||||
headers = curl_slist_append(headers, "Hey-server-hey: how are you?");
|
||||
headers = curl_slist_append(headers, "X-silly-content: yes");
|
||||
HTTP-like protocols pass a series of headers to the server when doing the
|
||||
request, and you're free to pass any amount of extra headers that you
|
||||
think fit. Adding headers are this easy:
|
||||
|
||||
/* pass our list of custom made headers */
|
||||
curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, headers);
|
||||
struct curl_slist *headers=NULL; /* init to NULL is important */
|
||||
|
||||
curl_easy_perform(easyhandle); /* transfer http */
|
||||
headers = curl_slist_append(headers, "Hey-server-hey: how are you?");
|
||||
headers = curl_slist_append(headers, "X-silly-content: yes");
|
||||
|
||||
curl_slist_free_all(headers); /* free the header list */
|
||||
/* pass our list of custom made headers */
|
||||
curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, headers);
|
||||
|
||||
... and if you think some of the internally generated headers, such as
|
||||
User-Agent:, Accept: or Host: don't contain the data you want them to
|
||||
contain, you can replace them by simply setting them too:
|
||||
curl_easy_perform(easyhandle); /* transfer http */
|
||||
|
||||
headers = curl_slist_append(headers, "User-Agent: 007");
|
||||
headers = curl_slist_append(headers, "Host: munged.host.line");
|
||||
curl_slist_free_all(headers); /* free the header list */
|
||||
|
||||
If you replace an existing header with one with no contents, you will prevent
|
||||
the header from being sent. Like if you want to completely prevent the
|
||||
"Accept:" header to be sent, you can disable it with code similar to this:
|
||||
... and if you think some of the internally generated headers, such as
|
||||
Accept: or Host: don't contain the data you want them to contain, you can
|
||||
replace them by simply setting them too:
|
||||
|
||||
headers = curl_slist_append(headers, "Accept:");
|
||||
headers = curl_slist_append(headers, "Accept: Agent-007");
|
||||
headers = curl_slist_append(headers, "Host: munged.host.line");
|
||||
|
||||
Both replacing and cancelling internal headers should be done with careful
|
||||
consideration and you should be aware that you may violate the HTTP protocol
|
||||
when doing so.
|
||||
Delete Headers
|
||||
|
||||
There's only one aspect left in the HTTP requests that we haven't yet
|
||||
mentioned how to modify: the version field. All HTTP requests includes the
|
||||
version number to tell the server which version we support. libcurl speak
|
||||
HTTP 1.1 by default. Some very old servers don't like getting 1.1-requests
|
||||
and when dealing with stubborn old things like that, you can tell libcurl to
|
||||
use 1.0 instead by doing something like this:
|
||||
If you replace an existing header with one with no contents, you will
|
||||
prevent the header from being sent. Like if you want to completely prevent
|
||||
the "Accept:" header to be sent, you can disable it with code similar to
|
||||
this:
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_HTTP_VERSION, CURLHTTP_VERSION_1_0);
|
||||
headers = curl_slist_append(headers, "Accept:");
|
||||
|
||||
Not all protocols are HTTP-like, and thus the above may not help you when you
|
||||
want to make for example your FTP transfers to behave differently.
|
||||
Both replacing and cancelling internal headers should be done with careful
|
||||
consideration and you should be aware that you may violate the HTTP
|
||||
protocol when doing so.
|
||||
|
||||
Sending custom commands to a FTP server means that you need to send the
|
||||
comands exactly as the FTP server expects them (RFC959 is a good guide here),
|
||||
and you can only use commands that work on the control-connection alone. All
|
||||
kinds of commands that requires data interchange and thus needs a
|
||||
data-connection must be left to libcurl's own judgement. Also be aware that
|
||||
libcurl will do its very best to change directory to the target directory
|
||||
before doing any transfer, so if you change directory (with CWD or similar)
|
||||
you might confuse libcurl and then it might not attempt to transfer the file
|
||||
in the correct remote directory.
|
||||
Enforcing chunked transfer-encoding
|
||||
|
||||
A little example that deletes a given file before an operation:
|
||||
By making sure a request uses the custom header "Transfer-Encoding:
|
||||
chunked" when doing a non-GET HTTP operation, libcurl will switch over to
|
||||
"chunked" upload, even though the size of the data to upload might be
|
||||
known. By default, libcurl usually switches over to chunked upload
|
||||
automaticly if the upload data size is unknown.
|
||||
|
||||
headers = curl_slist_append(headers, "DELE file-to-remove");
|
||||
HTTP Version
|
||||
|
||||
/* pass the list of custom commands to the handle */
|
||||
curl_easy_setopt(easyhandle, CURLOPT_QUOTE, headers);
|
||||
There's only one aspect left in the HTTP requests that we haven't yet
|
||||
mentioned how to modify: the version field. All HTTP requests includes the
|
||||
version number to tell the server which version we support. libcurl speak
|
||||
HTTP 1.1 by default. Some very old servers don't like getting 1.1-requests
|
||||
and when dealing with stubborn old things like that, you can tell libcurl
|
||||
to use 1.0 instead by doing something like this:
|
||||
|
||||
curl_easy_perform(easyhandle); /* transfer ftp data! */
|
||||
curl_easy_setopt(easyhandle, CURLOPT_HTTP_VERSION,
|
||||
CURLHTTP_VERSION_1_0);
|
||||
|
||||
curl_slist_free_all(headers); /* free the header list */
|
||||
FTP Custom Commands
|
||||
|
||||
If you would instead want this operation (or chain of operations) to happen
|
||||
_after_ the data transfer took place the option to curl_easy_setopt() would
|
||||
instead be called CURLOPT_POSTQUOTE and used the exact same way.
|
||||
Not all protocols are HTTP-like, and thus the above may not help you when
|
||||
you want to make for example your FTP transfers to behave differently.
|
||||
|
||||
The custom FTP command will be issued to the server in the same order they
|
||||
are added to the list, and if a command gets an error code returned back from
|
||||
the server, no more commands will be issued and libcurl will bail out with an
|
||||
error code (CURLE_FTP_QUOTE_ERROR). Note that if you use CURLOPT_QUOTE to
|
||||
send commands before a transfer, no transfer will actually take place when a
|
||||
quote command has failed.
|
||||
Sending custom commands to a FTP server means that you need to send the
|
||||
comands exactly as the FTP server expects them (RFC959 is a good guide
|
||||
here), and you can only use commands that work on the control-connection
|
||||
alone. All kinds of commands that requires data interchange and thus needs
|
||||
a data-connection must be left to libcurl's own judgement. Also be aware
|
||||
that libcurl will do its very best to change directory to the target
|
||||
directory before doing any transfer, so if you change directory (with CWD
|
||||
or similar) you might confuse libcurl and then it might not attempt to
|
||||
transfer the file in the correct remote directory.
|
||||
|
||||
If you set the CURLOPT_HEADER to true, you will tell libcurl to get
|
||||
information about the target file and output "headers" about it. The headers
|
||||
will be in "HTTP-style", looking like they do in HTTP.
|
||||
A little example that deletes a given file before an operation:
|
||||
|
||||
The option to enable headers or to run custom FTP commands may be useful to
|
||||
combine with CURLOPT_NOBODY. If this option is set, no actual file content
|
||||
transfer will be performed.
|
||||
headers = curl_slist_append(headers, "DELE file-to-remove");
|
||||
|
||||
/* pass the list of custom commands to the handle */
|
||||
curl_easy_setopt(easyhandle, CURLOPT_QUOTE, headers);
|
||||
|
||||
curl_easy_perform(easyhandle); /* transfer ftp data! */
|
||||
|
||||
curl_slist_free_all(headers); /* free the header list */
|
||||
|
||||
If you would instead want this operation (or chain of operations) to
|
||||
happen _after_ the data transfer took place the option to
|
||||
curl_easy_setopt() would instead be called CURLOPT_POSTQUOTE and used the
|
||||
exact same way.
|
||||
|
||||
The custom FTP command will be issued to the server in the same order they
|
||||
are added to the list, and if a command gets an error code returned back
|
||||
from the server, no more commands will be issued and libcurl will bail out
|
||||
with an error code (CURLE_FTP_QUOTE_ERROR). Note that if you use
|
||||
CURLOPT_QUOTE to send commands before a transfer, no transfer will
|
||||
actually take place when a quote command has failed.
|
||||
|
||||
If you set the CURLOPT_HEADER to true, you will tell libcurl to get
|
||||
information about the target file and output "headers" about it. The
|
||||
headers will be in "HTTP-style", looking like they do in HTTP.
|
||||
|
||||
The option to enable headers or to run custom FTP commands may be useful
|
||||
to combine with CURLOPT_NOBODY. If this option is set, no actual file
|
||||
content transfer will be performed.
|
||||
|
||||
FTP Custom CUSTOMREQUEST
|
||||
|
||||
If you do what list the contents of a FTP directory using your own defined
|
||||
FTP command, CURLOPT_CUSTOMREQUEST will do just that. "NLST" is the
|
||||
default one for listing directories but you're free to pass in your idea
|
||||
of a good alternative.
|
||||
|
||||
|
||||
Cookies Without Chocolate Chips
|
||||
@@ -989,19 +1068,30 @@ SSL, Certificates and Other Tricks
|
||||
|
||||
[ seeding, passwords, keys, certificates, ENGINE, ca certs ]
|
||||
|
||||
Multiple Transfers Using the multi Interface
|
||||
|
||||
The easy interface as described in detail in this document is a synchronous
|
||||
interface that transfers one file at a time and doesn't return until its
|
||||
done.
|
||||
|
||||
The multi interface on the other hand, allows your program to transfer
|
||||
multiple files in both directions at the same time, without forcing you to
|
||||
use multiple threads.
|
||||
|
||||
[fill in lots of more multi stuff here]
|
||||
|
||||
Future
|
||||
|
||||
[ multi interface, sharing between handles, mutexes, pipelining ]
|
||||
[ sharing between handles, mutexes, pipelining ]
|
||||
|
||||
|
||||
-----
|
||||
Footnotes:
|
||||
|
||||
[1] = HTTP PUT without knowing the size prior to transfer is indeed possible,
|
||||
but libcurl does not support the chunked transfers on uploading that is
|
||||
necessary for this feature to work. We'd gratefully appreciate patches
|
||||
that bring this functionality...
|
||||
[1] = libcurl 7.10.3 and later have the ability to switch over to chunked
|
||||
Tranfer-Encoding in cases were HTTP uploads are done with data of an
|
||||
unknown size.
|
||||
|
||||
|
||||
[2] = This happens on Windows machines when libcurl is built and used as a
|
||||
DLL. However, you can still do this on Windows if you link with a static
|
||||
|
5
docs/libcurl/.cvsignore
Normal file
5
docs/libcurl/.cvsignore
Normal file
@@ -0,0 +1,5 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
*html
|
||||
*ps
|
||||
*pdf
|
@@ -19,8 +19,10 @@ man_MANS = \
|
||||
curl_slist_append.3 \
|
||||
curl_slist_free_all.3 \
|
||||
curl_version.3 \
|
||||
curl_version_info.3 \
|
||||
curl_escape.3 \
|
||||
curl_unescape.3 \
|
||||
curl_free.3 \
|
||||
curl_strequal.3 \
|
||||
curl_strnequal.3 \
|
||||
curl_mprintf.3 \
|
||||
@@ -52,8 +54,10 @@ HTMLPAGES = \
|
||||
curl_slist_append.html \
|
||||
curl_slist_free_all.html \
|
||||
curl_version.html \
|
||||
curl_version_info.html \
|
||||
curl_escape.html \
|
||||
curl_unescape.html \
|
||||
curl_free.html \
|
||||
curl_strequal.html \
|
||||
curl_strnequal.html \
|
||||
curl_mprintf.html \
|
||||
@@ -71,7 +75,42 @@ HTMLPAGES = \
|
||||
libcurl-errors.html \
|
||||
index.html
|
||||
|
||||
EXTRA_DIST = $(man_MANS) $(HTMLPAGES)
|
||||
PDFPAGES = \
|
||||
curl_easy_cleanup.pdf \
|
||||
curl_easy_getinfo.pdf \
|
||||
curl_easy_init.pdf \
|
||||
curl_easy_perform.pdf \
|
||||
curl_easy_setopt.pdf \
|
||||
curl_easy_duphandle.pdf \
|
||||
curl_formadd.pdf \
|
||||
curl_formparse.pdf \
|
||||
curl_formfree.pdf \
|
||||
curl_getdate.pdf \
|
||||
curl_getenv.pdf \
|
||||
curl_slist_append.pdf \
|
||||
curl_slist_free_all.pdf \
|
||||
curl_version.pdf \
|
||||
curl_version_info.pdf \
|
||||
curl_escape.pdf \
|
||||
curl_unescape.pdf \
|
||||
curl_free.pdf \
|
||||
curl_strequal.pdf \
|
||||
curl_strnequal.pdf \
|
||||
curl_mprintf.pdf \
|
||||
curl_global_init.pdf \
|
||||
curl_global_cleanup.pdf \
|
||||
libcurl.pdf \
|
||||
curl_multi_add_handle.pdf \
|
||||
curl_multi_cleanup.pdf \
|
||||
curl_multi_fdset.pdf \
|
||||
curl_multi_info_read.pdf \
|
||||
curl_multi_init.pdf \
|
||||
curl_multi_perform.pdf \
|
||||
curl_multi_remove_handle.pdf \
|
||||
libcurl-multi.pdf \
|
||||
libcurl-errors.pdf
|
||||
|
||||
EXTRA_DIST = $(man_MANS) $(HTMLPAGES) $(PDFPAGES)
|
||||
|
||||
MAN2HTML= gnroff -man $< | man2html >$@
|
||||
|
||||
@@ -84,3 +123,10 @@ html: $(HTMLPAGES)
|
||||
|
||||
.1.html:
|
||||
$(MAN2HTML)
|
||||
|
||||
pdf:
|
||||
for file in $(man_MANS); do \
|
||||
foo=`echo $$file | sed -e 's/\.[0-9]$$//g'`; \
|
||||
groff -Tps -man $$file >$$foo.ps; \
|
||||
ps2pdf $$foo.ps $$foo.pdf; \
|
||||
done
|
||||
|
@@ -2,7 +2,7 @@
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_easy_cleanup 3 "4 March 2002" "libcurl 7.7" "libcurl Manual"
|
||||
.TH curl_easy_cleanup 3 "13 Nov 2002" "libcurl 7.7" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_cleanup - End a libcurl easy session
|
||||
.SH SYNOPSIS
|
||||
@@ -18,6 +18,9 @@ opposite of the \fIcurl_easy_init\fP function and must be called with the same
|
||||
This will effectively close all connections this handle has used and possibly
|
||||
has kept open until now. Don't call this function if you intend to transfer
|
||||
more files.
|
||||
|
||||
When you've called this, you can safely remove all the strings you've
|
||||
previously told libcurl to use, as it won't use them anymore now.
|
||||
.SH RETURN VALUE
|
||||
None
|
||||
.SH "SEE ALSO"
|
||||
|
@@ -115,8 +115,12 @@ Pass a pointer to a 'char *' to receive the content-type of the downloaded
|
||||
object. This is the value read from the Content-Type: field. If you get NULL,
|
||||
it means that the server didn't send a valid Content-Type header or that the
|
||||
protocol used doesn't support this. (Added in 7.9.4)
|
||||
.TP
|
||||
.B CURLINFO_PRIVATE
|
||||
Pass a pointer to a 'char *' to receive the pointer to the private data
|
||||
associated with the curl handle (set with the CURLOPT_PRIVATE option to curl_easy_setopt).
|
||||
(Added in 7.10.3)
|
||||
.PP
|
||||
|
||||
.SH RETURN VALUE
|
||||
If the operation was successful, CURLE_OK is returned. Otherwise an
|
||||
appropriate error code will be returned.
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,26 +1,26 @@
|
||||
.\" You can view this file with:
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_escape 3 "6 March 2002" "libcurl 7.9" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_escape - URL encodes the given string
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
.BI "char *curl_escape( char *" url ", int "length " );"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
This function will convert the given input string to an URL encoded string and
|
||||
return that as a new allocated string. All input characters that are not a-z,
|
||||
A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a
|
||||
two-digit hexadecimal number).
|
||||
|
||||
If the 'length' argument is set to 0, curl_escape() will use strlen() on the
|
||||
input 'url' string to find out the size.
|
||||
|
||||
You must free() the returned string when you're done with it.
|
||||
.SH RETURN VALUE
|
||||
A pointer to a zero terminated string or NULL if it failed.
|
||||
.SH "SEE ALSO"
|
||||
.I curl_unescape(), RFC 2396
|
||||
.\" You can view this file with:
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_escape 3 "6 March 2002" "libcurl 7.9" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_escape - URL encodes the given string
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
.BI "char *curl_escape( char *" url ", int "length " );"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
This function will convert the given input string to an URL encoded string and
|
||||
return that as a new allocated string. All input characters that are not a-z,
|
||||
A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a
|
||||
two-digit hexadecimal number).
|
||||
|
||||
If the 'length' argument is set to 0, curl_escape() will use strlen() on the
|
||||
input 'url' string to find out the size.
|
||||
|
||||
You must curl_free() the returned string when you're done with it.
|
||||
.SH RETURN VALUE
|
||||
A pointer to a zero terminated string or NULL if it failed.
|
||||
.SH "SEE ALSO"
|
||||
.I curl_unescape(), curl_free(), RFC 2396
|
||||
|
@@ -2,13 +2,13 @@
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_formadd 3 "1 Match 2002" "libcurl 7.9.1" "libcurl Manual"
|
||||
.TH curl_formadd 3 "24 June 2002" "libcurl 7.9.8" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_formadd - add a section to a multipart/formdata HTTP POST
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
.BI "int curl_formadd(struct HttpPost ** " firstitem,
|
||||
.BI "CURLFORMcode curl_formadd(struct HttpPost ** " firstitem,
|
||||
.BI "struct HttpPost ** " lastitem, " ...);"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
@@ -19,71 +19,110 @@ the \fIfirstitem\fP pointer as parameter to \fBCURLOPT_HTTPPOST\fP.
|
||||
\fIlastitem\fP is set after each call and on repeated invokes it should be
|
||||
left as set to allow repeated invokes to find the end of the list faster.
|
||||
|
||||
After the \fIlastitem\fP pointer follow the real arguments. (If the following
|
||||
description confuses you, jump directly to the examples):
|
||||
|
||||
\fBCURLFORM_COPYNAME\fP or \fBCURLFORM_PTRNAME\fP followed by a string is used
|
||||
for the name of the section. Optionally one may use \fBCURLFORM_NAMELENGTH\fP
|
||||
to specify the length of the name (allowing null characters within the
|
||||
name). All options that use the word COPY in their names copy the given
|
||||
contents, while the ones with PTR in their names simply points to the (static)
|
||||
data you must make sure remain until curl no longer needs it.
|
||||
|
||||
The four options for providing values are: \fBCURLFORM_COPYCONTENTS\fP,
|
||||
\fBCURLFORM_PTRCONTENTS\fP, \fBCURLFORM_FILE\fP, or \fBCURLFORM_FILECONTENT\fP
|
||||
followed by a char or void pointer (allowed for PTRCONTENTS).
|
||||
|
||||
\fBCURLFORM_FILECONTENT\fP does a normal post like \fBCURLFORM_COPYCONTENTS\fP
|
||||
but the actual value is read from the filename given as a string.
|
||||
|
||||
Other arguments may be \fBCURLFORM_CONTENTTYPE\fP if the user wishes to
|
||||
specify one (for FILE if no type is given the library tries to provide the
|
||||
correct one; for CONTENTS no Content-Type is sent in this case).
|
||||
|
||||
For \fBCURLFORM_PTRCONTENTS\fP or \fBCURLFORM_COPYNAME\fP the user may also
|
||||
add \fBCURLFORM_CONTENTSLENGTH\fP followed by the length as a long (if not
|
||||
given the library will use strlen to determine the length).
|
||||
|
||||
For \fBCURLFORM_FILE\fP the user may send multiple files in one section by
|
||||
providing multiple \fBCURLFORM_FILE\fP arguments each followed by the filename
|
||||
(and each FILE is allowed to have a CONTENTTYPE).
|
||||
|
||||
Another possibility to send single or multiple files in one section is to use
|
||||
\fBCURLFORM_ARRAY\fP that gets a struct curl_forms array pointer as its
|
||||
value. Each structure element has a CURLformoption and a char pointer. For the
|
||||
options only \fBCURLFORM_FILE\fP, \fBCURLFORM_CONTENTTYPE\fP, and
|
||||
\fBCURLFORM_END\fP (that is used to determine the end of the array and thus
|
||||
must be the option of the last and no other element of the curl_forms array)
|
||||
are allowed. The effect of this parameter is the same as giving multiple
|
||||
\fBCURLFORM_FILE\fP options possibly with \fBCURLFORM_CONTENTTYPE\fP after or
|
||||
before each \fBCURLFORM_FILE\fP option.
|
||||
|
||||
Should you need to specify extra headers for the form POST section, use
|
||||
\fBCURLFORM_CONTENTHEADER\fP. This takes a curl_slist prepared in the usual way
|
||||
using \fBcurl_slist_append\fP and appends the list of headers to those Curl
|
||||
automatically generates for \fBCURLFORM_CONTENTTYPE\fP and the content
|
||||
disposition. The list must exist while the POST occurs, if you free it before
|
||||
the post completes you may experience problems.
|
||||
|
||||
The last argument in such an array must always be \fBCURLFORM_END\fP.
|
||||
After the \fIlastitem\fP pointer follow the real arguments.
|
||||
|
||||
The pointers \fI*firstitem\fP and \fI*lastitem\fP should both be pointing to
|
||||
NULL in the first call to this function. All list-data will be allocated by
|
||||
the function itself. You must call \fIcurl_formfree\fP after the form post has
|
||||
been done to free the resources again.
|
||||
|
||||
This function will copy all input data except the data pointed to by the
|
||||
arguments after \fBCURLFORM_PTRNAME\fP and \fBCURLFORM_PTRCONTENTS\fP and keep
|
||||
its own version of it allocated until you call \fIcurl_formfree\fP. When
|
||||
you've passed the pointer to \fIcurl_easy_setopt\fP, you must not free the
|
||||
list until after you've called \fIcurl_easy_cleanup\fP for the curl handle. If
|
||||
you provide a pointer as an arguments after \fBCURLFORM_PTRNAME\fP or
|
||||
\fBCURLFORM_PTRCONTENTS\fP you must ensure that the pointer stays valid until
|
||||
you call \fIcurl_form_free\fP and \fIcurl_easy_cleanup\fP.
|
||||
First, there are some basics you need to understand about multipart/formdata
|
||||
posts. Each part consists of at least a NAME and a CONTENTS part. If the part
|
||||
is made for file upload, there are also a stored CONTENT-TYPE and a
|
||||
FILENAME. Below here, we'll discuss on what options you use to set these
|
||||
properties in the parts you want to add to your post.
|
||||
.SH OPTIONS
|
||||
.B CURLFORM_COPYNAME
|
||||
followed by string is used to set the name of this part. libcurl copies the
|
||||
given data, so your application doesn't need to keep it around after this
|
||||
function call. If the name isn't zero terminated properly, or if you'd like it
|
||||
to contain zero bytes, you need to set the length of the name with
|
||||
\fBCURLFORM_NAMELENGTH\fP.
|
||||
|
||||
.B CURLFORM_PTRNAME
|
||||
followed by a string is used for the name of this part. libcurl will use the
|
||||
pointer and refer to the data in your application, you must make sure it
|
||||
remains until curl no longer needs it. If the name isn't zero terminated
|
||||
properly, or if you'd like it to contain zero bytes, you need to set the
|
||||
length of the name with \fBCURLFORM_NAMELENGTH\fP.
|
||||
|
||||
.B CURLFORM_COPYCONTENTS
|
||||
followed by a string is used for the contents of this part, the actual data to
|
||||
send away. libcurl copies the given data, so your application doesn't need to
|
||||
keep it around after this function call. If the data isn't zero terminated
|
||||
properly, or if you'd like it to contain zero bytes, you need to set the
|
||||
length of the name with \fBCURLFORM_CONTENTSLENGTH\fP.
|
||||
|
||||
.B CURLFORM_PTRCONTENTS
|
||||
followed by a string is used for the contents of this part, the actual data to
|
||||
send away. libcurl will use the pointer and refer to the data in your
|
||||
application, you must make sure it remains until curl no longer needs it. If
|
||||
the data isn't zero terminated properly, or if you'd like it to contain zero
|
||||
bytes, you need to set the length of the name with
|
||||
\fBCURLFORM_CONTENTSLENGTH\fP.
|
||||
|
||||
.B CURLFORM_FILECONTENT
|
||||
followed by a file name, makes that file read and the contents will be used in
|
||||
as data in this part.
|
||||
|
||||
.B CURLFORM_FILE
|
||||
followed by a file name, makes this part a file upload part. It sets the file
|
||||
name field to the actual file name used here, it gets the contents of the file
|
||||
and passes as data and sets the content-type if the given file match one of
|
||||
the new internally known file extension. For \fBCURLFORM_FILE\fP the user may
|
||||
send one or more files in one part by providing multiple \fBCURLFORM_FILE\fP
|
||||
arguments each followed by the filename (and each CURLFORM_FILE is allowed to
|
||||
have a CURLFORM_CONTENTTYPE).
|
||||
|
||||
.B CURLFORM_CONTENTTYPE
|
||||
followed by a pointer to a string with a content-type will make curl use this
|
||||
given content-type for this file upload part, possibly instead of an
|
||||
internally chosen one.
|
||||
|
||||
.B CURLFORM_FILENAME
|
||||
followed by a pointer to a string to a name, will make libcurl use the given
|
||||
name in the file upload part, intead of the actual file name given to
|
||||
\fICURLFORM_FILE\fP.
|
||||
|
||||
.B BCURLFORM_BUFFER
|
||||
followed by a string, tells libcurl that a buffer is to be used to upload data
|
||||
instead of using a file. The given string is used as the value of the file
|
||||
name field in the content header.
|
||||
|
||||
.B CURLFORM_BUFFERPTR
|
||||
followed by a pointer to a data area, tells libcurl the address of the buffer
|
||||
containing data to upload (as indicated with \fICURLFORM_BUFFER\fP). The
|
||||
buffer containing this data must not be freed until after curl_easy_cleanup is
|
||||
called.
|
||||
|
||||
.B CURLFORM_BUFFERLENGTH
|
||||
followed by a long with the size of the \fICURLFORM_BUFFERPTR\fP data area,
|
||||
tells libcurl the length of the buffer to upload.
|
||||
|
||||
.B CURLFORM_ARRAY
|
||||
Another possibility to send options to curl_formadd() is the
|
||||
\fBCURLFORM_ARRAY\fP option, that passes a struct curl_forms array pointer as
|
||||
its value. Each curl_forms structure element has a CURLformoption and a char
|
||||
pointer. The final element in the array must be a CURLFORM_END. All available
|
||||
options can be used in an array, except the CURLFORM_ARRAY option itself! The
|
||||
last argument in such an array must always be \fBCURLFORM_END\fP.
|
||||
|
||||
.B CURLFORM_CONTENTHEADER
|
||||
specifies extra headers for the form POST section. This takes a curl_slist
|
||||
prepared in the usual way using \fBcurl_slist_append\fP and appends the list
|
||||
of headers to those libcurl automatically generates. The list must exist while
|
||||
the POST occurs, if you free it before the post completes you may experience
|
||||
problems.
|
||||
|
||||
When you've passed the HttpPost pointer to \fIcurl_easy_setopt\fP (using the
|
||||
\fICURLOPT_HTTPPOST\fP option), you must not free the list until after you've
|
||||
called \fIcurl_easy_cleanup\fP for the curl handle.
|
||||
|
||||
See example below.
|
||||
.SH RETURN VALUE
|
||||
Returns non-zero if an error occurs.
|
||||
0 means everything was ok, non-zero means an error occurred as
|
||||
.I <curl/curl.h>
|
||||
defines.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
|
||||
@@ -147,6 +186,14 @@ Returns non-zero if an error occurs.
|
||||
forms[1].value = file2;
|
||||
forms[2].option = CURLFORM_END;
|
||||
|
||||
/* Add a buffer to upload */
|
||||
curl_formadd(&post, &last,
|
||||
CURLFORM_COPYNAME, "name",
|
||||
CURLFORM_BUFFER, "data",
|
||||
CURLFORM_BUFFERPTR, record,
|
||||
CURLFORM_BUFFERLENGTH, record_length,
|
||||
CURLFORM_END);
|
||||
|
||||
/* no option needed for the end marker */
|
||||
curl_formadd(&post, &last, CURLFORM_COPYNAME, "pictures",
|
||||
CURLFORM_ARRAY, forms, CURLFORM_END);
|
||||
|
17
docs/libcurl/curl_free.3
Normal file
17
docs/libcurl/curl_free.3
Normal file
@@ -0,0 +1,17 @@
|
||||
.\" You can view this file with:
|
||||
.\" nroff -man [file]
|
||||
.\" $Id:
|
||||
.\"
|
||||
.TH curl_free 3 "24 Sept 2002" "libcurl 7.10" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_free - reclaim memory that has been obtained through a libcurl call
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
.BI "void *curl_free( char *" ptr " );"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
curl_free reclaims memory that has been obtained through a libcurl call.
|
||||
Use curl_free() instead of free() to avoid anomalies that can result from differences in memory management between your application and libcurl.
|
||||
.SH "SEE ALSO"
|
||||
.I curl_unescape(), curl_free()
|
@@ -2,7 +2,7 @@
|
||||
.\"
|
||||
.TH curl_multi_fdset 3 "3 May 2002" "libcurl 7.9.5" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_multi_fdset - add an easy handle to a multi session
|
||||
curl_multi_fdset - extracts file descriptor information from a multi handle
|
||||
.SH SYNOPSIS
|
||||
#include <curl/curl.h>
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
.\"
|
||||
.TH curl_multi_perform 3 "1 March 2002" "libcurl 7.9.5" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_multi_perform - add an easy handle to a multi session
|
||||
curl_multi_perform - reads/writes available data from each easy handle
|
||||
.SH SYNOPSIS
|
||||
#include <curl/curl.h>
|
||||
|
||||
@@ -19,6 +19,12 @@ integer-pointer.
|
||||
.SH "RETURN VALUE"
|
||||
CURLMcode type, general libcurl multi interface error code.
|
||||
|
||||
If you receive \fICURLM_CALL_MULTI_PERFORM\fP, this basicly means that you
|
||||
should call \fIcurl_multi_perform\fP again, before you select() on more
|
||||
actions. You don't have to do it immediately, but the return code means that
|
||||
libcurl may have more data available to return or that there may be more data
|
||||
to send off before it is "satisfied".
|
||||
|
||||
NOTE that this only returns errors etc regarding the whole multi stack. There
|
||||
might still have occurred problems on invidual transfers even when this
|
||||
function returns OK.
|
||||
|
@@ -2,7 +2,7 @@
|
||||
.\"
|
||||
.TH curl_multi_remove_handle 3 "6 March 2002" "libcurl 7.9.5" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_multi_remove_handle - add an easy handle to a multi session
|
||||
curl_multi_remove_handle - remove an easy handle from a multi session
|
||||
.SH SYNOPSIS
|
||||
#include <curl/curl.h>
|
||||
|
||||
|
@@ -1,27 +1,27 @@
|
||||
.\" You can view this file with:
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_unescape 3 "22 March 2001" "libcurl 7.7" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_unescape - URL decodes the given string
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
.BI "char *curl_unescape( char *" url ", int "length " );"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
This function will convert the given URL encoded input string to a "plain
|
||||
string" and return that as a new allocated string. All input characters that
|
||||
are URL encoded (%XX where XX is a two-digit hexadecimal number, or +) will be
|
||||
converted to their plain text versions (up to a ? letter, no + letters to the
|
||||
right of a ? letter will be converted).
|
||||
|
||||
If the 'length' argument is set to 0, curl_unescape() will use strlen() on the
|
||||
input 'url' string to find out the size.
|
||||
|
||||
You must free() the returned string when you're done with it.
|
||||
.SH RETURN VALUE
|
||||
A pointer to a zero terminated string or NULL if it failed.
|
||||
.SH "SEE ALSO"
|
||||
.I curl_escape(), RFC 2396
|
||||
.\" You can view this file with:
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_unescape 3 "22 March 2001" "libcurl 7.7" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_unescape - URL decodes the given string
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
.BI "char *curl_unescape( char *" url ", int "length " );"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
This function will convert the given URL encoded input string to a "plain
|
||||
string" and return that as a new allocated string. All input characters that
|
||||
are URL encoded (%XX where XX is a two-digit hexadecimal number, or +) will be
|
||||
converted to their plain text versions (up to a ? letter, no + letters to the
|
||||
right of a ? letter will be converted).
|
||||
|
||||
If the 'length' argument is set to 0, curl_unescape() will use strlen() on the
|
||||
input 'url' string to find out the size.
|
||||
|
||||
You must curl_free() the returned string when you're done with it.
|
||||
.SH RETURN VALUE
|
||||
A pointer to a zero terminated string or NULL if it failed.
|
||||
.SH "SEE ALSO"
|
||||
.I curl_escape(), curl_free(), RFC 2396
|
||||
|
93
docs/libcurl/curl_version_info.3
Normal file
93
docs/libcurl/curl_version_info.3
Normal file
@@ -0,0 +1,93 @@
|
||||
.\" You can view this file with:
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_version_info 3 "30 Sep 2002" "libcurl 7.10" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_version_info - returns run-time libcurl version info
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
.BI "curl_version_info_data *curl_version_info( CURLversion "type ");"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
Returns a pointer to a filled in struct with information about various
|
||||
run-time features in libcurl. \fItype\fP should be set to the version of this
|
||||
functionality by the time you write your program. This way, libcurl will
|
||||
always return a proper struct that your program understands, while programs in
|
||||
the future might get an different struct. CURLVERSION_NOW will be the most
|
||||
recent one for the library you have installed:
|
||||
|
||||
data = curl_version_info(CURLVERSION_NOW);
|
||||
|
||||
Applications should use this information to judge if things are possible to do
|
||||
or not, instead of using compile-time checks, as dynamic/DLL libraries can be
|
||||
changed independent of applications.
|
||||
|
||||
The curl_version_info_data struct looks like this
|
||||
|
||||
.nf
|
||||
typedef struct {
|
||||
CURLversion age; /* 0 - this kind of struct */
|
||||
const char *version; /* human readable string */
|
||||
unsigned int version_num; /* numeric representation */
|
||||
const char *host; /* human readable string */
|
||||
int features; /* bitmask, see below */
|
||||
char *ssl_version; /* human readable string */
|
||||
long ssl_version_num; /* number */
|
||||
char *libz_version; /* human readable string */
|
||||
const char *protocols[]; /* list of protocols */
|
||||
} curl_version_info_data;
|
||||
.fi
|
||||
|
||||
\fIage\fP describes what kind of struct this is. It is always 0 now. In a
|
||||
future libcurl, if this struct changes, this age counter may be increased, and
|
||||
then the struct for number 1 will look different (except for this first struct
|
||||
field).
|
||||
|
||||
\fIversion\fP is just an ascii string for the libcurl version.
|
||||
|
||||
\fIversion_num\fP is a 6 digit hexadecimal number created like this: <2 digits
|
||||
major number> | <2 digits minor number> | <2 digits patch number>. Version
|
||||
7.9.8 is therefore returned as 0x070908.
|
||||
|
||||
\fIhost\fP is an ascii string showing what host information that this libcurl
|
||||
was built for. As discovered by a configure script or set by the build
|
||||
environment.
|
||||
|
||||
\fIfeatures\fP can have none, one or more bits set, and the currently defined
|
||||
bits are:
|
||||
.TP 5.5
|
||||
.B CURL_VERSION_IPV6
|
||||
supports IPv6
|
||||
.TP
|
||||
.B CURL_VERSION_KERBEROS4
|
||||
supports kerberos4 (when using FTP)
|
||||
.TP
|
||||
.B CURL_VERSION_SSL
|
||||
supports SSL (HTTPS/FTPS)
|
||||
.TP
|
||||
.B CURL_VERSION_LIBZ
|
||||
supports HTTP deflate using libz
|
||||
.PP
|
||||
\fIssl_version\fP is an ascii string for the OpenSSL version used. If libcurl
|
||||
has no SSL support, this is NULL.
|
||||
|
||||
\fIssl_version_num\fP is the numerical OpenSSL version value as defined by the
|
||||
OpenSSL project. If libcurl has no SSL support, this is 0.
|
||||
|
||||
\fIlibz_version\fP is an ascii string (there is no numerical version). If
|
||||
libcurl has no libz support, this is NULL.
|
||||
|
||||
\fIprotocols\fP is a pointer to an array of char * pointers, containing the
|
||||
names protocols that libcurl supports (using lowercase letters). The protocol
|
||||
names are the same as would be used in URLs. The array is terminated by a NULL
|
||||
entry.
|
||||
|
||||
|
||||
.SH RETURN VALUE
|
||||
A pointer to a curl_version_info_data struct.
|
||||
.SH "SEE ALSO"
|
||||
\fIcurl_version(3)\fP
|
||||
.SH BUGS
|
||||
No known bugs.
|
@@ -1,48 +1,52 @@
|
||||
HTML>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<TITLE>Index to Curl documentation</TITLE>
|
||||
<TITLE>Index to libcurl documentation</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY>
|
||||
<H1 ALIGN="CENTER">Index to Curl documentation</H1>
|
||||
<H1 ALIGN="CENTER">Index to libcurl documentation</H1>
|
||||
|
||||
<H2>Programs</H2>
|
||||
<P><A HREF="curl-config.html">curl-config.html</A>
|
||||
<P><A HREF="curl.html">curl.html</A>
|
||||
<P><A HREF="../index.html">curl and tools</A>
|
||||
|
||||
<H2>Library routines</H2>
|
||||
<P><A HREF="libcurl.html">libcurl.html</A>
|
||||
<P><A HREF="curl_easy_cleanup.html">curl_easy_cleanup.html</A>
|
||||
<P><A HREF="curl_easy_duphandle.html">curl_easy_duphandle.html</A>
|
||||
<P><A HREF="curl_easy_getinfo.html">curl_easy_getinfo.html</A>
|
||||
<P><A HREF="curl_easy_init.html">curl_easy_init.html</A>
|
||||
<P><A HREF="curl_easy_perform.html">curl_easy_perform.html</A>
|
||||
<P><A HREF="curl_easy_setopt.html">curl_easy_setopt.html</A>
|
||||
<P><A HREF="curl_escape.html">curl_escape.html</A>
|
||||
<P><A HREF="curl_formadd.html">curl_formadd.html</A>
|
||||
<P><A HREF="curl_formfree.html">curl_formfree.html</A>
|
||||
<P><A HREF="curl_formparse.html">curl_formparse.html</A>
|
||||
<P><A HREF="curl_getdate.html">curl_getdate.html</A>
|
||||
<P><A HREF="curl_getenv.html">curl_getenv.html</A>
|
||||
<P><A HREF="curl_global_cleanup.html">curl_global_cleanup.html</A>
|
||||
<P><A HREF="curl_global_init.html">curl_global_init.html</A>
|
||||
<P><A HREF="curl_mprintf.html">curl_mprintf.html</A>
|
||||
<P><A HREF="curl_slist_append.html">curl_slist_append.html</A>
|
||||
<P><A HREF="curl_slist_free_all.html">curl_slist_free_all.html</A>
|
||||
<P><A HREF="curl_strequal.html">curl_strequal.html</A>
|
||||
<P><A HREF="curl_strnequal.html">curl_strnequal.html</A>
|
||||
<P><A HREF="curl_unescape.html">curl_unescape.html</A>
|
||||
<P><A HREF="curl_version.html">curl_version.html</A>
|
||||
<hr>
|
||||
<p><a href="curl_multi_add_handle.html">curl_multi_add_handle.html</a>
|
||||
<p><a href="curl_multi_cleanup.html">curl_multi_cleanup.html</a>
|
||||
<p><a href="curl_multi_fdset.html">curl_multi_fdset.html</a>
|
||||
<p><a href="curl_multi_info_read.html">curl_multi_info_read.html</a>
|
||||
<p><a href="curl_multi_init.html">curl_multi_init.html</a>
|
||||
<p><a href="curl_multi_perform.html">curl_multi_perform.html</a>
|
||||
<p><a href="curl_multi_remove_handle.html">curl_multi_remove_handle.html</a>
|
||||
<p><a href="libcurl-multi.html">libcurl-multi.html</a>
|
||||
<h2>Overviews</h2>
|
||||
<A HREF="libcurl.html">libcurl</A>
|
||||
<br><a href="libcurl-multi.html">libcurl-multi</a>
|
||||
<br><a href="libcurl-errors.html">libcurl-errors</a>
|
||||
<br><a href="../libcurl-the-guide">libcurl-the-guide</a> (plain text)
|
||||
|
||||
<H2>Library Functions (A-Z)</H2>
|
||||
<a href="curl_easy_cleanup.html">curl_easy_cleanup</A>
|
||||
<br><a href="curl_easy_duphandle.html">curl_easy_duphandle</A>
|
||||
<br><a href="curl_easy_getinfo.html">curl_easy_getinfo</A>
|
||||
<br><a href="curl_easy_init.html">curl_easy_init</A>
|
||||
<br><a href="curl_easy_perform.html">curl_easy_perform</A>
|
||||
<br><a href="curl_easy_setopt.html">curl_easy_setopt</A>
|
||||
<br><a href="curl_escape.html">curl_escape</A>
|
||||
<br><a href="curl_formadd.html">curl_formadd</A>
|
||||
<br><a href="curl_formfree.html">curl_formfree</A>
|
||||
<br><a href="curl_formparse.html">curl_formparse</A>
|
||||
<br><a href="curl_free.html">curl_free</A>
|
||||
<br><a href="curl_getdate.html">curl_getdate</A>
|
||||
<br><a href="curl_getenv.html">curl_getenv</A>
|
||||
<br><a href="curl_global_cleanup.html">curl_global_cleanup</A>
|
||||
<br><a href="curl_global_init.html">curl_global_init</A>
|
||||
<br><a href="curl_mprintf.html">curl_mprintf</A>
|
||||
<br><a href="curl_multi_add_handle.html">curl_multi_add_handle</a>
|
||||
<br><a href="curl_multi_cleanup.html">curl_multi_cleanup</a>
|
||||
<br><a href="curl_multi_fdset.html">curl_multi_fdset</a>
|
||||
<br><a href="curl_multi_info_read.html">curl_multi_info_read</a>
|
||||
<br><a href="curl_multi_init.html">curl_multi_init</a>
|
||||
<br><a href="curl_multi_perform.html">curl_multi_perform</a>
|
||||
<br><a href="curl_multi_remove_handle.html">curl_multi_remove_handle</a>
|
||||
<br><a href="curl_slist_append.html">curl_slist_append</A>
|
||||
<br><a href="curl_slist_free_all.html">curl_slist_free_all</A>
|
||||
<br><a href="curl_strequal.html">curl_strequal</A>
|
||||
<br><a href="curl_strnequal.html">curl_strnequal</A>
|
||||
<br><a href="curl_unescape.html">curl_unescape</A>
|
||||
<br><a href="curl_version.html">curl_version</A>
|
||||
<br><a href="curl_version_info.html">curl_version_info</A>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH libcurl-errors 3 "10 April 2002" "libcurl 7.9.6" "libcurl errors"
|
||||
.TH libcurl-errors 3 "18 Dec 2002" "libcurl 7.10.3" "libcurl errors"
|
||||
.SH NAME
|
||||
error codes in libcurl
|
||||
.SH DESCRIPTION
|
||||
@@ -104,7 +104,7 @@ After a completed file transfer, the FTP server did not respond a proper
|
||||
When sending custom "QUOTE" commands to the remote server, one of the commands
|
||||
returned an error code that was 400 or higher.
|
||||
.TP
|
||||
.B CURLE_HTTP_NOT_FOUND (22)
|
||||
.B CURLE_HTTP_RETURNED_ERROR (22)
|
||||
This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server
|
||||
returns an error code that is >= 400.
|
||||
.TP
|
||||
|
@@ -2,7 +2,7 @@
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH libcurl-multi 5 "20 March 2001" "libcurl 7.9.5" "libcurl multi interface"
|
||||
.TH libcurl-multi 5 "13 Oct 2001" "libcurl 7.10.1" "libcurl multi interface"
|
||||
.SH NAME
|
||||
libcurl-multi \- how to use the multi interface
|
||||
.SH DESCRIPTION
|
||||
@@ -37,7 +37,7 @@ curl_multi_* functions.
|
||||
|
||||
Each single transfer is built up with an easy handle. You must create them,
|
||||
and setup the appropriate options for each easy handle, as outlined in the
|
||||
\fIlibcurl(3)\fP man page.
|
||||
\fIlibcurl(3)\fP man page, using \fIcurl_easy_setopt(3)\fP.
|
||||
|
||||
When the easy handle is setup for a transfer, then instead of using
|
||||
\fIcurl_easy_perform\fP (as when using the easy interface for transfers), you
|
||||
@@ -49,11 +49,11 @@ handles.
|
||||
Should you change your mind, the easy handle is again removed from the multi
|
||||
stack using \fIcurl_multi_remove_handle\fP. Once removed from the multi
|
||||
handle, you can again use other easy interface functions like
|
||||
curl_easy_perform or whatever you think is necessary.
|
||||
\fIcurl_easy_perform\fP on the handle or whatever you think is necessary.
|
||||
|
||||
Adding the easy handles to the multi handle does not start any
|
||||
transfer. Remember that one of the main ideas with this interface is to let
|
||||
your application drive. You drive the transfers by invoking
|
||||
Adding the easy handle to the multi handle does not start the transfer.
|
||||
Remember that one of the main ideas with this interface is to let your
|
||||
application drive. You drive the transfers by invoking
|
||||
\fIcurl_multi_perform\fP. libcurl will then transfer data if there is anything
|
||||
available to transfer. It'll use the callbacks and everything else you have
|
||||
setup in the individual easy handles. It'll transfer data on all current
|
||||
@@ -62,24 +62,39 @@ all, it may be none.
|
||||
|
||||
Your application can acquire knowledge from libcurl when it would like to get
|
||||
invoked to transfer data, so that you don't have to busy-loop and call that
|
||||
\fIcurl_multi_perform\fP like a mad man! \fIcurl_multi_fdset\fP offers an
|
||||
\fIcurl_multi_perform\fP like crazy. \fIcurl_multi_fdset\fP offers an
|
||||
interface using which you can extract fd_sets from libcurl to use in select()
|
||||
or poll() calls in order to get to know when the transfers in the multi stack
|
||||
might need attention. This also makes it very easy for your program to wait
|
||||
for input on your own private file descriptors at the same time or perhaps
|
||||
timeout every now and then, should you want that.
|
||||
|
||||
A little note here about the return codes from the multi functions, and
|
||||
especially the \fIcurl_multi_perform\fP: if you receive
|
||||
\fICURLM_CALL_MULTI_PERFORM\fP, this basicly means that you should call
|
||||
\fIcurl_multi_perform\fP again, before you select() on more actions. You don't
|
||||
have to do it immediately, but the return code means that libcurl may have
|
||||
more data available to return or that there may be more data to send off
|
||||
before it is "satisfied".
|
||||
|
||||
\fIcurl_multi_perform\fP stores the number of still running transfers in one
|
||||
of its input arguments, and by reading that you can figure out when all the
|
||||
transfers in the multi handles are done. 'done' does not mean successful. One
|
||||
or more of the transfers may have failed.
|
||||
or more of the transfers may have failed. Tracking when this number changes,
|
||||
you know when one or more transfers are done.
|
||||
|
||||
To get information about completed transfers, to figure out success or not and
|
||||
similar, \fIcurl_multi_info_read\fP should be called. It can return a message
|
||||
about a current or previous transfer. Repeated invokes of the function get
|
||||
more messages until the message queue is empty.
|
||||
more messages until the message queue is empty. The information you receive
|
||||
there includes an easy handle pointer which you may use to identify which easy
|
||||
handle the information regards.
|
||||
|
||||
When all transfers in the multi stack are done, cleanup the multi handle with
|
||||
\fIcurl_multi_cleanup\fP. Be careful and please note that you \fBMUST\fP
|
||||
invoke separate \fIcurl_easy_cleanup\fP calls on every single easy handle to
|
||||
clean them up properly.
|
||||
|
||||
If you want to re-use an easy handle that was added to the multi handle for
|
||||
transfer, you must first remove it from the multi stack and then re-add it
|
||||
again (possbily after having altered some options at your own choice).
|
||||
|
2
include/.cvsignore
Normal file
2
include/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
2
include/curl/.cvsignore
Normal file
2
include/curl/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
@@ -1,6 +1,6 @@
|
||||
#ifndef __CURL_CURL_H
|
||||
#define __CURL_CURL_H
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -9,19 +9,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
/* The include stuff here is mainly for time_t! */
|
||||
@@ -49,7 +49,7 @@
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#include <curl/types.h>
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -65,6 +65,11 @@ struct curl_httppost {
|
||||
long namelength; /* length of name length */
|
||||
char *contents; /* pointer to allocated data contents */
|
||||
long contentslength; /* length of contents field */
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
char *buffer; /* pointer to allocated buffer contents */
|
||||
long bufferlength; /* length of buffer field */
|
||||
|
||||
char *contenttype; /* Content-Type */
|
||||
struct curl_slist* contentheader; /* list of extra headers for this form */
|
||||
struct curl_httppost *more; /* if one field name has more than one file, this
|
||||
@@ -76,6 +81,11 @@ struct curl_httppost {
|
||||
do not free in formfree */
|
||||
#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer
|
||||
do not free in formfree */
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
#define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */
|
||||
#define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */
|
||||
|
||||
char *showfilename; /* The file name to show. If not set, the actual
|
||||
file name will be used (if this is a file part) */
|
||||
};
|
||||
@@ -86,7 +96,9 @@ typedef int (*curl_progress_callback)(void *clientp,
|
||||
double ultotal,
|
||||
double ulnow);
|
||||
|
||||
#define CURL_MAX_WRITE_SIZE 20480
|
||||
/* Tests have proven that 20K is a very bad buffer size for uploads on
|
||||
Windows, while 16K for some odd reason performed a lot better. */
|
||||
#define CURL_MAX_WRITE_SIZE 16384
|
||||
|
||||
typedef size_t (*curl_write_callback)(char *buffer,
|
||||
size_t size,
|
||||
@@ -150,7 +162,7 @@ typedef enum {
|
||||
CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
|
||||
CURLE_FTP_WRITE_ERROR, /* 20 */
|
||||
CURLE_FTP_QUOTE_ERROR, /* 21 */
|
||||
CURLE_HTTP_NOT_FOUND, /* 22 */
|
||||
CURLE_HTTP_RETURNED_ERROR, /* 22 */
|
||||
CURLE_WRITE_ERROR, /* 23 */
|
||||
CURLE_MALFORMAT_USER, /* 24 - user name is illegally specified */
|
||||
CURLE_FTP_COULDNT_STOR_FILE, /* 25 - failed FTP upload */
|
||||
@@ -164,7 +176,7 @@ typedef enum {
|
||||
CURLE_HTTP_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
|
||||
CURLE_HTTP_POST_ERROR, /* 34 */
|
||||
CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
|
||||
CURLE_FTP_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
|
||||
CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
|
||||
CURLE_FILE_COULDNT_READ_FILE, /* 37 */
|
||||
CURLE_LDAP_CANNOT_BIND, /* 38 */
|
||||
CURLE_LDAP_SEARCH_FAILED, /* 39 */
|
||||
@@ -182,13 +194,29 @@ typedef enum {
|
||||
CURLE_SSL_PEER_CERTIFICATE, /* 51 - peer's certificate wasn't ok */
|
||||
CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
|
||||
CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
|
||||
CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as default */
|
||||
CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
|
||||
default */
|
||||
CURLE_SEND_ERROR, /* 55 - failed sending network data */
|
||||
CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
|
||||
CURLE_SHARE_IN_USE, /* 57 - share is in use */
|
||||
CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
|
||||
CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
|
||||
CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
|
||||
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
|
||||
|
||||
CURL_LAST /* never use! */
|
||||
} CURLcode;
|
||||
|
||||
/* Make a spelling correction for the operation timed-out define */
|
||||
#define CURLE_OPERATION_TIMEDOUT CURLE_OPERATION_TIMEOUTED
|
||||
#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
|
||||
|
||||
typedef enum {
|
||||
CURLPROXY_HTTP = 0,
|
||||
CURLPROXY_SOCKS4 = 4,
|
||||
CURLPROXY_SOCKS5 = 5
|
||||
} curl_proxytype;
|
||||
|
||||
/* this was the error code 50 in 7.7.3 and a few earlier versions, this
|
||||
is no longer used by libcurl but is instead #defined here only to not
|
||||
make programs break */
|
||||
@@ -196,6 +224,7 @@ typedef enum {
|
||||
|
||||
/* This is just to make older programs not break: */
|
||||
#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
|
||||
#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
|
||||
|
||||
#define CURL_ERROR_SIZE 256
|
||||
|
||||
@@ -211,7 +240,23 @@ typedef enum {
|
||||
#ifdef CINIT
|
||||
#undef CINIT
|
||||
#endif
|
||||
#if defined(__STDC__) || defined(_MSC_VER)
|
||||
/*
|
||||
* Figure out if we can use the ## operator, which is supported by ISO/ANSI C
|
||||
* and C++. Some compilers support it without setting __STDC__ or __cplusplus
|
||||
* so we need to carefully check for them too. We don't use configure-checks
|
||||
* for these since we want these headers to remain generic and working for all
|
||||
* platforms.
|
||||
*/
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
|
||||
defined(__HP_aCC) || defined(__BORLANDC__)
|
||||
/* This compiler is believed to have an ISO compatible preprocessor */
|
||||
#define CURL_ISOCPP
|
||||
#else
|
||||
/* This compiler is believed NOT to have an ISO compatible preprocessor */
|
||||
#undef CURL_ISOCPP
|
||||
#endif
|
||||
|
||||
#ifdef CURL_ISOCPP
|
||||
#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number
|
||||
#else
|
||||
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
|
||||
@@ -379,7 +424,11 @@ typedef enum {
|
||||
CINIT(FTPLISTONLY, LONG, 48), /* Use NLST when listing ftp dir */
|
||||
|
||||
CINIT(FTPAPPEND, LONG, 50), /* Append instead of overwrite on upload! */
|
||||
CINIT(NETRC, LONG, 51), /* read user+password from .netrc */
|
||||
|
||||
/* Specify whether to read the user+password from the .netrc or the URL.
|
||||
* This must be one of the CURL_NETRC_* enums below. */
|
||||
CINIT(NETRC, LONG, 51),
|
||||
|
||||
CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
|
||||
|
||||
/* This FTPASCII name is now obsolete, to be removed, use the TRANSFERTEXT
|
||||
@@ -540,13 +589,43 @@ typedef enum {
|
||||
|
||||
/* mark this as start of a cookie session */
|
||||
CINIT(COOKIESESSION, LONG, 96),
|
||||
|
||||
/* The CApath directory used to validate the peer certificate
|
||||
this option is used only if SSL_VERIFYPEER is true */
|
||||
CINIT(CAPATH, OBJECTPOINT, 97),
|
||||
|
||||
/* Instruct libcurl to use a smaller receive buffer */
|
||||
CINIT(BUFFERSIZE, LONG, 98),
|
||||
|
||||
/* Instruct libcurl to not use any signal/alarm handlers, even when using
|
||||
timeouts. This option is useful for multi-threaded applications.
|
||||
See libcurl-the-guide for more background information. */
|
||||
CINIT(NOSIGNAL, LONG, 99),
|
||||
|
||||
CURLOPT_LASTENTRY /* the last unusued */
|
||||
/* Provide a CURLShare for mutexing non-ts data */
|
||||
CINIT(SHARE, OBJECTPOINT, 100),
|
||||
|
||||
/* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
|
||||
CURLPROXY_SOCKS4 and CURLPROXY_SOCKS5. */
|
||||
CINIT(PROXYTYPE, LONG, 101),
|
||||
|
||||
/* Set the Accept-Encoding string. Use this to tell a server you would like
|
||||
the response to be compressed. */
|
||||
CINIT(ENCODING, OBJECTPOINT, 102),
|
||||
|
||||
/* Set pointer to private data */
|
||||
CINIT(PRIVATE, OBJECTPOINT, 103),
|
||||
|
||||
/* Set aliases for HTTP 200 in the HTTP Response header */
|
||||
CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
|
||||
|
||||
CURLOPT_LASTENTRY /* the last unused */
|
||||
} CURLoption;
|
||||
|
||||
/* two convenient "aliases" that follow the name scheme better */
|
||||
#define CURLOPT_WRITEDATA CURLOPT_FILE
|
||||
#define CURLOPT_READDATA CURLOPT_INFILE
|
||||
#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
|
||||
|
||||
|
||||
/* These enums are for use with the CURLOPT_HTTP_VERSION option. */
|
||||
@@ -560,6 +639,18 @@ enum {
|
||||
CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
|
||||
};
|
||||
|
||||
/* These enums are for use with the CURLOPT_NETRC option. */
|
||||
enum CURL_NETRC_OPTION {
|
||||
CURL_NETRC_IGNORED, /* The .netrc will never be read.
|
||||
* This is the default. */
|
||||
CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
|
||||
* to one in the .netrc. */
|
||||
CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
|
||||
* Unless one is set programmatically, the .netrc
|
||||
* will be queried. */
|
||||
CURL_NETRC_LAST
|
||||
};
|
||||
|
||||
enum {
|
||||
CURL_SSLVERSION_DEFAULT,
|
||||
CURL_SSLVERSION_TLSv1,
|
||||
@@ -617,7 +708,7 @@ int curl_formparse(char *, struct curl_httppost **,
|
||||
#undef CFINIT
|
||||
#endif
|
||||
|
||||
#if defined(__STDC__) || defined(_MSC_VER)
|
||||
#ifdef CURL_ISOCPP
|
||||
#define CFINIT(name) CURLFORM_ ## name
|
||||
#else
|
||||
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
|
||||
@@ -638,6 +729,11 @@ typedef enum {
|
||||
CFINIT(ARRAY),
|
||||
CFINIT(OBSOLETE),
|
||||
CFINIT(FILE),
|
||||
|
||||
CFINIT(BUFFER),
|
||||
CFINIT(BUFFERPTR),
|
||||
CFINIT(BUFFERLENGTH),
|
||||
|
||||
CFINIT(CONTENTTYPE),
|
||||
CFINIT(CONTENTHEADER),
|
||||
CFINIT(FILENAME),
|
||||
@@ -656,7 +752,35 @@ struct curl_forms {
|
||||
};
|
||||
|
||||
/* use this for multipart formpost building */
|
||||
int curl_formadd(struct curl_httppost **httppost,
|
||||
/* Returns code for curl_formadd()
|
||||
*
|
||||
* Returns:
|
||||
* CURL_FORMADD_OK on success
|
||||
* CURL_FORMADD_MEMORY if the FormInfo allocation fails
|
||||
* CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form
|
||||
* CURL_FORMADD_NULL if a null pointer was given for a char
|
||||
* CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed
|
||||
* CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
|
||||
* CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error)
|
||||
* CURL_FORMADD_MEMORY if a HttpPost struct cannot be allocated
|
||||
* CURL_FORMADD_MEMORY if some allocation for string copying failed.
|
||||
* CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array
|
||||
*
|
||||
***************************************************************************/
|
||||
typedef enum {
|
||||
CURL_FORMADD_OK, /* first, no error */
|
||||
|
||||
CURL_FORMADD_MEMORY,
|
||||
CURL_FORMADD_OPTION_TWICE,
|
||||
CURL_FORMADD_NULL,
|
||||
CURL_FORMADD_UNKNOWN_OPTION,
|
||||
CURL_FORMADD_INCOMPLETE,
|
||||
CURL_FORMADD_ILLEGAL_ARRAY,
|
||||
|
||||
CURL_FORMADD_LAST /* last */
|
||||
} CURLFORMcode;
|
||||
|
||||
CURLFORMcode curl_formadd(struct curl_httppost **httppost,
|
||||
struct curl_httppost **last_post,
|
||||
...);
|
||||
|
||||
@@ -674,6 +798,9 @@ char *curl_version(void);
|
||||
* allocated string or NULL if an error occurred. */
|
||||
char *curl_escape(const char *string, int length);
|
||||
char *curl_unescape(const char *string, int length);
|
||||
/* 20020912 WJM. Provide for a de-allocation in the same translation unit
|
||||
that did the allocation. Added in libcurl 7.10 */
|
||||
void curl_free(void *p);
|
||||
|
||||
/* curl_global_init() should be invoked exactly once for each application that
|
||||
uses libcurl */
|
||||
@@ -684,8 +811,8 @@ CURLcode curl_global_init(long flags);
|
||||
void curl_global_cleanup(void);
|
||||
|
||||
/* This is the version number */
|
||||
#define LIBCURL_VERSION "7.9.7"
|
||||
#define LIBCURL_VERSION_NUM 0x070907
|
||||
#define LIBCURL_VERSION "7.10.3"
|
||||
#define LIBCURL_VERSION_NUM 0x070a03
|
||||
|
||||
/* linked-list structure for the CURLOPT_QUOTE option (and other) */
|
||||
struct curl_slist {
|
||||
@@ -742,16 +869,13 @@ typedef enum {
|
||||
CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
|
||||
CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
|
||||
|
||||
CURLINFO_PRIVATE = CURLINFO_STRING + 21,
|
||||
|
||||
/* Fill in new entries here! */
|
||||
|
||||
CURLINFO_LASTONE = 21
|
||||
CURLINFO_LASTONE = 22
|
||||
} CURLINFO;
|
||||
|
||||
/* unfortunately, the easy.h and multi.h include files need options and info
|
||||
stuff before they can be included! */
|
||||
#include <curl/easy.h> /* nothing in curl is fun without the easy stuff */
|
||||
#include <curl/multi.h>
|
||||
|
||||
typedef enum {
|
||||
CURLCLOSEPOLICY_NONE, /* first, never use this */
|
||||
|
||||
@@ -770,8 +894,106 @@ typedef enum {
|
||||
#define CURL_GLOBAL_NOTHING 0
|
||||
#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Setup defines, protos etc for the sharing stuff.
|
||||
*/
|
||||
|
||||
/* Different data locks for a single share */
|
||||
typedef enum {
|
||||
CURL_LOCK_DATA_NONE = 0,
|
||||
CURL_LOCK_DATA_COOKIE = 1,
|
||||
CURL_LOCK_DATA_DNS = 2,
|
||||
CURL_LOCK_DATA_SSL_SESSION = 3,
|
||||
CURL_LOCK_DATA_CONNECT = 4,
|
||||
CURL_LOCK_DATA_LAST
|
||||
} curl_lock_data;
|
||||
|
||||
/* Different lock access types */
|
||||
typedef enum {
|
||||
CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
|
||||
CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
|
||||
CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
|
||||
CURL_LOCK_ACCESS_LAST /* never use */
|
||||
} curl_lock_access;
|
||||
|
||||
typedef void (*curl_lock_function)(CURL *handle,
|
||||
curl_lock_data data,
|
||||
curl_lock_access access,
|
||||
void *userptr);
|
||||
typedef void (*curl_unlock_function)(CURL *handle,
|
||||
curl_lock_data data,
|
||||
void *userptr);
|
||||
|
||||
typedef void CURLSH;
|
||||
|
||||
typedef enum {
|
||||
CURLSHE_OK, /* all is fine */
|
||||
CURLSHE_BAD_OPTION, /* 1 */
|
||||
CURLSHE_IN_USE, /* 2 */
|
||||
CURLSHE_INVALID, /* 3 */
|
||||
CURLSHE_LAST /* never use */
|
||||
} CURLSHcode;
|
||||
|
||||
typedef enum {
|
||||
CURLSHOPT_NONE, /* don't use */
|
||||
CURLSHOPT_SHARE, /* specify a data type to share */
|
||||
CURLSHOPT_UNSHARE, /* specify shich data type to stop sharing */
|
||||
CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
|
||||
CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
|
||||
CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
|
||||
callback functions */
|
||||
CURLSHOPT_LAST /* never use */
|
||||
} CURLSHoption;
|
||||
|
||||
CURLSH *curl_share_init(void);
|
||||
CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
|
||||
CURLSHcode curl_share_cleanup(CURLSH *);
|
||||
|
||||
/****************************************************************************
|
||||
* Structures for querying information about the curl library at runtime.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
CURLVERSION_FIRST,
|
||||
CURLVERSION_LAST /* never actually use this */
|
||||
} CURLversion;
|
||||
|
||||
/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
|
||||
basicly all programs ever, that want to get version information. It is
|
||||
meant to be a built-in version number for what kind of struct the caller
|
||||
expects. If the struct ever changes, we redfine the NOW to another enum
|
||||
from above. */
|
||||
#define CURLVERSION_NOW CURLVERSION_FIRST
|
||||
|
||||
typedef struct {
|
||||
CURLversion age; /* age of the returned struct */
|
||||
const char *version; /* LIBCURL_VERSION */
|
||||
unsigned int version_num; /* LIBCURL_VERSION_NUM */
|
||||
const char *host; /* OS/host/cpu/machine when configured */
|
||||
int features; /* bitmask, see defines below */
|
||||
char *ssl_version; /* human readable string */
|
||||
long ssl_version_num; /* number */
|
||||
const char *libz_version; /* human readable string */
|
||||
/* protocols is terminated by an entry with a NULL protoname */
|
||||
const char **protocols;
|
||||
} curl_version_info_data;
|
||||
|
||||
#define CURL_VERSION_IPV6 (1<<0)
|
||||
#define CURL_VERSION_KERBEROS4 (1<<1)
|
||||
#define CURL_VERSION_SSL (1<<2)
|
||||
#define CURL_VERSION_LIBZ (1<<3)
|
||||
|
||||
/* returns a pointer to a static copy of the version info struct */
|
||||
curl_version_info_data *curl_version_info(CURLversion);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* unfortunately, the easy.h and multi.h include files need options and info
|
||||
stuff before they can be included! */
|
||||
#include "easy.h" /* nothing in curl is fun without the easy stuff */
|
||||
#include "multi.h"
|
||||
|
||||
#endif /* __CURL_CURL_H */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -9,19 +9,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#ifndef __CURL_MULTI_H
|
||||
#define __CURL_MULTI_H
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -9,19 +9,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
/*
|
||||
This is meant to be the "external" header file. Don't give away any
|
||||
internals here!
|
||||
@@ -47,14 +47,15 @@
|
||||
Example sources using this interface is here: ../multi/
|
||||
|
||||
*/
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include "curl.h"
|
||||
|
||||
typedef void CURLM;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#ifndef __STDC_HEADERS_H
|
||||
#define __STDC_HEADERS_H
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -9,19 +9,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#ifndef __CURL_TYPES_H
|
||||
#define __CURL_TYPES_H
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -9,19 +9,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
typedef void CURL;
|
||||
typedef void CURLconnect;
|
||||
|
||||
|
@@ -1,6 +1,9 @@
|
||||
*.la
|
||||
*.lo
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.in
|
||||
.deps
|
||||
.libs
|
||||
config.h
|
||||
stamp-*
|
||||
ca-bundle.h
|
||||
|
@@ -5,9 +5,9 @@
|
||||
AUTOMAKE_OPTIONS = foreign nostdinc
|
||||
|
||||
EXTRA_DIST = getdate.y Makefile.b32 Makefile.b32.resp Makefile.m32 \
|
||||
Makefile.vc6 Makefile.riscos libcurl.def dllinit.c curllib.dsp \
|
||||
Makefile.vc6 Makefile.riscos libcurl.def curllib.dsp \
|
||||
curllib.dsw config-vms.h config-win32.h config-riscos.h config-mac.h \
|
||||
config.h.in
|
||||
config.h.in ca-bundle.crt README.encoding README.memoryleak
|
||||
|
||||
lib_LTLIBRARIES = libcurl.la
|
||||
|
||||
@@ -16,7 +16,8 @@ lib_LTLIBRARIES = libcurl.la
|
||||
# we use srcdir/lib for the lib-private header files
|
||||
INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/lib -I$(top_srcdir)/lib
|
||||
|
||||
libcurl_la_LDFLAGS = -no-undefined -version-info 2:2:0
|
||||
VERSION=-version-info 2:2:0
|
||||
|
||||
# This flag accepts an argument of the form current[:revision[:age]]. So,
|
||||
# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
|
||||
# 1.
|
||||
@@ -45,23 +46,27 @@ libcurl_la_LDFLAGS = -no-undefined -version-info 2:2:0
|
||||
# set age to 0.
|
||||
#
|
||||
|
||||
libcurl_la_SOURCES = \
|
||||
arpa_telnet.h file.c getpass.h netrc.h timeval.c \
|
||||
base64.c file.h hostip.c progress.c timeval.h \
|
||||
base64.h formdata.c hostip.h progress.h \
|
||||
cookie.c formdata.h http.c sendf.c \
|
||||
cookie.h ftp.c http.h sendf.h url.c \
|
||||
dict.c ftp.h if2ip.c speedcheck.c url.h \
|
||||
dict.h getdate.c if2ip.h speedcheck.h urldata.h \
|
||||
getdate.h ldap.c ssluse.c version.c \
|
||||
getenv.c ldap.h ssluse.h \
|
||||
escape.c mprintf.c telnet.c \
|
||||
escape.h getpass.c netrc.c telnet.h \
|
||||
getinfo.c getinfo.h transfer.c strequal.c strequal.h easy.c \
|
||||
security.h security.c krb4.c krb4.h memdebug.c memdebug.h inet_ntoa_r.h \
|
||||
http_chunks.c http_chunks.h strtok.c strtok.h connect.c connect.h \
|
||||
llist.c llist.h hash.c hash.h multi.c
|
||||
if NO_UNDEFINED
|
||||
# The -no-undefined flag is CRUCIAL for this to build fine on Cygwin. If we
|
||||
# find a case in which we need to remove this flag, we should most likely
|
||||
# write a configure check that detects when this flag is needed and when its
|
||||
# not.
|
||||
libcurl_la_LDFLAGS = -no-undefined $(VERSION)
|
||||
else
|
||||
libcurl_la_LDFLAGS = $(VERSION)
|
||||
endif
|
||||
|
||||
libcurl_la_SOURCES = arpa_telnet.h file.c getpass.h netrc.h timeval.c \
|
||||
base64.c file.h hostip.c progress.c timeval.h base64.h formdata.c \
|
||||
hostip.h progress.h cookie.c formdata.h http.c sendf.c cookie.h ftp.c \
|
||||
http.h sendf.h url.c dict.c ftp.h if2ip.c speedcheck.c url.h dict.h \
|
||||
getdate.c if2ip.h speedcheck.h urldata.h getdate.h ldap.c ssluse.c \
|
||||
version.c getenv.c ldap.h ssluse.h escape.c mprintf.c telnet.c escape.h \
|
||||
getpass.c netrc.c telnet.h getinfo.c getinfo.h transfer.c strequal.c \
|
||||
strequal.h easy.c security.h security.c krb4.c krb4.h memdebug.c \
|
||||
memdebug.h inet_ntoa_r.h http_chunks.c http_chunks.h strtok.c strtok.h \
|
||||
connect.c connect.h llist.c llist.h hash.c hash.h multi.c \
|
||||
content_encoding.c content_encoding.h share.h
|
||||
|
||||
noinst_HEADERS = setup.h transfer.h
|
||||
|
||||
@@ -70,3 +75,14 @@ $(srcdir)/getdate.c: getdate.y
|
||||
cd $(srcdir) && \
|
||||
$(YACC) $(YFLAGS) getdate.y; \
|
||||
mv -f y.tab.c getdate.c
|
||||
|
||||
install-data-hook:
|
||||
@if test -n "@CURL_CA_BUNDLE@"; then \
|
||||
$(mkinstalldirs) `dirname $(DESTDIR)@CURL_CA_BUNDLE@`; \
|
||||
@INSTALL_DATA@ $(srcdir)/ca-bundle.crt $(DESTDIR)@CURL_CA_BUNDLE@; \
|
||||
fi
|
||||
|
||||
# this hook is mainly for non-unix systems to build even if configure
|
||||
# isn't run
|
||||
dist-hook:
|
||||
cp $(srcdir)/ca-bundle.h.in $(distdir)/ca-bundle.h
|
||||
|
@@ -59,7 +59,11 @@ SOURCES = \
|
||||
easy.c \
|
||||
strequal.c \
|
||||
strtok.c \
|
||||
connect.c
|
||||
connect.c \
|
||||
hash.c \
|
||||
llist.c \
|
||||
multi.c \
|
||||
content_encoding.c
|
||||
|
||||
OBJECTS = $(SOURCES:.c=.obj)
|
||||
|
||||
|
@@ -28,4 +28,8 @@
|
||||
+easy.obj &
|
||||
+strequal.obj &
|
||||
+strtok.obj &
|
||||
+connect.obj
|
||||
+connect.obj &
|
||||
+hash.obj &
|
||||
+llist.obj &
|
||||
+multi.obj &
|
||||
+content_encoding.obj
|
||||
|
179
lib/Makefile.m32
179
lib/Makefile.m32
@@ -1,84 +1,95 @@
|
||||
#############################################################
|
||||
#
|
||||
## Makefile for building libcurl.a with MingW32 (GCC-2.95) and
|
||||
## optionally OpenSSL (0.9.6)
|
||||
## Use: make -f Makefile.m32
|
||||
##
|
||||
## Comments to: Troy Engel <tengel@sonic.net> or
|
||||
## Joern Hartroth <hartroth@acm.org>
|
||||
|
||||
CC = gcc
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
STRIP = strip -g
|
||||
OPENSSL_PATH = ../../openssl-0.9.6b
|
||||
|
||||
########################################################
|
||||
## Nothing more to do below this line!
|
||||
|
||||
INCLUDES = -I. -I.. -I../include -I../src
|
||||
CFLAGS = -g -O2 -DMINGW32
|
||||
ifdef SSL
|
||||
INCLUDES += -I"$(OPENSSL_PATH)/outinc" -I"$(OPENSSL_PATH)/outinc/openssl"
|
||||
CFLAGS += -DUSE_SSLEAY
|
||||
DLL_LIBS = -leay32 -lssl32 -lRSAglue
|
||||
endif
|
||||
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
|
||||
|
||||
libcurl_a_LIBRARIES = libcurl.a
|
||||
|
||||
libcurl_a_SOURCES = arpa_telnet.h file.c getpass.h netrc.h timeval.c base64.c \
|
||||
file.h hostip.c progress.c timeval.h base64.h formdata.c hostip.h progress.h \
|
||||
cookie.c formdata.h http.c sendf.c cookie.h ftp.c http.h sendf.h url.c dict.c \
|
||||
ftp.h if2ip.c speedcheck.c url.h dict.h getdate.c if2ip.h speedcheck.h \
|
||||
urldata.h transfer.c getdate.h ldap.c ssluse.c version.c transfer.h getenv.c \
|
||||
ldap.h ssluse.h escape.c getenv.h mprintf.c telnet.c escape.h getpass.c netrc.c \
|
||||
telnet.h getinfo.c strequal.c strequal.h easy.c security.h \
|
||||
security.c krb4.h krb4.c memdebug.h memdebug.c inet_ntoa_r.h http_chunks.h http_chunks.c \
|
||||
strtok.c connect.c hash.c llist.c
|
||||
|
||||
libcurl_a_OBJECTS = file.o timeval.o base64.o hostip.o progress.o \
|
||||
formdata.o cookie.o http.o sendf.o ftp.o url.o dict.o if2ip.o \
|
||||
speedcheck.o getdate.o transfer.o ldap.o ssluse.o version.o \
|
||||
getenv.o escape.o mprintf.o telnet.o getpass.o netrc.o getinfo.o \
|
||||
strequal.o easy.o security.o krb4.o memdebug.o http_chunks.o \
|
||||
strtok.o connect.o hash.o llist.o
|
||||
|
||||
LIBRARIES = $(libcurl_a_LIBRARIES)
|
||||
SOURCES = $(libcurl_a_SOURCES)
|
||||
OBJECTS = $(libcurl_a_OBJECTS)
|
||||
|
||||
|
||||
all: libcurl.a libcurl.dll libcurldll.a
|
||||
|
||||
libcurl.a: $(libcurl_a_OBJECTS) $(libcurl_a_DEPENDENCIES)
|
||||
-@erase libcurl.a
|
||||
$(AR) cru libcurl.a $(libcurl_a_OBJECTS)
|
||||
$(RANLIB) libcurl.a
|
||||
$(STRIP) $@
|
||||
|
||||
# remove the last line above to keep debug info
|
||||
|
||||
libcurl.dll libcurldll.a: libcurl.a libcurl.def dllinit.o
|
||||
-@erase $@
|
||||
dllwrap --dllname $@ --output-lib libcurldll.a --export-all --def libcurl.def $(libcurl_a_LIBRARIES) dllinit.o -L$(OPENSSL_PATH)/out $(DLL_LIBS) -lwsock32 -lws2_32
|
||||
$(STRIP) $@
|
||||
|
||||
# remove the last line above to keep debug info
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
clean:
|
||||
-@erase $(libcurl_a_OBJECTS)
|
||||
|
||||
distrib: clean
|
||||
|
||||
-@erase $(libcurl_a_LIBRARIES)
|
||||
|
||||
#############################################################
|
||||
#
|
||||
## Makefile for building libcurl.a with MingW32 (GCC-3.2) and
|
||||
## optionally OpenSSL (0.9.6)
|
||||
## Use: make -f Makefile.m32
|
||||
##
|
||||
## Comments to: Troy Engel <tengel@sonic.net> or
|
||||
## Joern Hartroth <hartroth@acm.org>
|
||||
|
||||
CC = gcc
|
||||
AR = ar
|
||||
RM = rm -f
|
||||
RANLIB = ranlib
|
||||
STRIP = strip -g
|
||||
OPENSSL_PATH = ../../openssl-0.9.6g
|
||||
ZLIB_PATH = ../../zlib-1.1.3
|
||||
|
||||
########################################################
|
||||
## Nothing more to do below this line!
|
||||
|
||||
INCLUDES = -I. -I.. -I../include -I../src
|
||||
CFLAGS = -g -O2 -DMINGW32
|
||||
ifdef SSL
|
||||
INCLUDES += -I"$(OPENSSL_PATH)/outinc" -I"$(OPENSSL_PATH)/outinc/openssl"
|
||||
CFLAGS += -DUSE_SSLEAY
|
||||
DLL_LIBS = -L$(OPENSSL_PATH)/out -leay32 -lssl32 -lRSAglue
|
||||
endif
|
||||
ifdef ZLIB
|
||||
INCLUDES += -I"$(ZLIB_PATH)"
|
||||
CFLAGS += -DHAVE_ZLIB
|
||||
DLL_LIBS += -L$(ZLIB_PATH) -lz
|
||||
endif
|
||||
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
|
||||
|
||||
libcurl_a_LIBRARIES = libcurl.a
|
||||
|
||||
libcurl_a_SOURCES = arpa_telnet.h file.c getpass.h netrc.h timeval.c base64.c \
|
||||
file.h hostip.c progress.c timeval.h base64.h formdata.c hostip.h progress.h \
|
||||
cookie.c formdata.h http.c sendf.c cookie.h ftp.c http.h sendf.h url.c dict.c \
|
||||
ftp.h if2ip.c speedcheck.c url.h dict.h getdate.c if2ip.h speedcheck.h \
|
||||
urldata.h transfer.c getdate.h ldap.c ssluse.c version.c transfer.h getenv.c \
|
||||
ldap.h ssluse.h escape.c getenv.h mprintf.c telnet.c escape.h getpass.c netrc.c \
|
||||
telnet.h getinfo.c strequal.c strequal.h easy.c security.h \
|
||||
security.c krb4.h krb4.c memdebug.h memdebug.c inet_ntoa_r.h http_chunks.h http_chunks.c \
|
||||
strtok.c connect.c hash.c llist.c multi.c \
|
||||
content_encoding.h content_encoding.c
|
||||
|
||||
libcurl_a_OBJECTS = file.o timeval.o base64.o hostip.o progress.o \
|
||||
formdata.o cookie.o http.o sendf.o ftp.o url.o dict.o if2ip.o \
|
||||
speedcheck.o getdate.o transfer.o ldap.o ssluse.o version.o \
|
||||
getenv.o escape.o mprintf.o telnet.o getpass.o netrc.o getinfo.o \
|
||||
strequal.o easy.o security.o krb4.o memdebug.o http_chunks.o \
|
||||
strtok.o connect.o hash.o llist.o multi.o \
|
||||
content_encoding.o
|
||||
|
||||
LIBRARIES = $(libcurl_a_LIBRARIES)
|
||||
SOURCES = $(libcurl_a_SOURCES)
|
||||
OBJECTS = $(libcurl_a_OBJECTS)
|
||||
|
||||
|
||||
all: libcurl.a libcurl.dll libcurldll.a
|
||||
|
||||
libcurl.a: $(libcurl_a_OBJECTS) $(libcurl_a_DEPENDENCIES)
|
||||
$(RM) libcurl.a
|
||||
$(AR) cru libcurl.a $(libcurl_a_OBJECTS)
|
||||
$(RANLIB) libcurl.a
|
||||
$(STRIP) $@
|
||||
|
||||
DLLINITOBJ =
|
||||
|
||||
# remove the last line above to keep debug info
|
||||
|
||||
libcurl.dll libcurldll.a: libcurl.a libcurl.def $(DLLINITOBJ)
|
||||
$(RM) $@
|
||||
dllwrap --dllname $@ --output-lib libcurldll.a --export-all --def libcurl.def $(libcurl_a_LIBRARIES) $(DLLINITOBJ) $(DLL_LIBS) -lwsock32 -lws2_32 -lwinmm
|
||||
$(STRIP) $@
|
||||
|
||||
# remove the last line above to keep debug info
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
clean:
|
||||
$(RM) $(libcurl_a_OBJECTS)
|
||||
|
||||
distrib: clean
|
||||
|
||||
$(RM) $(libcurl_a_LIBRARIES)
|
||||
|
||||
|
@@ -47,7 +47,7 @@ CFLAGS = /I "../include" /nologo /W3 /GX /D "WIN32" /D "VC6" /D "_MBCS" /D "_LIB
|
||||
LNKDLL = link.exe /DLL /def:libcurl.def
|
||||
LNKLIB = link.exe -lib
|
||||
LFLAGS = /nologo
|
||||
LINKLIBS = ws2_32.lib
|
||||
LINKLIBS = ws2_32.lib winmm.lib
|
||||
SSLLIBS = libeay32.lib ssleay32.lib RSAglue.lib
|
||||
CFGSET = FALSE
|
||||
|
||||
@@ -116,7 +116,7 @@ CFGSET = TRUE
|
||||
!IF "$(CFG)" == "debug-dll"
|
||||
TARGET =$(LIB_NAME_DEBUG).dll
|
||||
DIROBJ =.\$(CFG)
|
||||
LNK = $(LNKDLL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib"
|
||||
LNK = $(LNKDLL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
|
||||
CC = $(CCDEBUG)
|
||||
CFGSET = TRUE
|
||||
!ENDIF
|
||||
@@ -139,7 +139,8 @@ CFGSET = TRUE
|
||||
!IF "$(CFG)" == "debug-ssl-dll"
|
||||
TARGET =$(LIB_NAME_DEBUG).dll
|
||||
DIROBJ =.\$(CFG)
|
||||
LNK = $(LNKDLL) $(LFLAGSSSL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib"
|
||||
LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)/out32dll
|
||||
LNK = $(LNKDLL) $(LFLAGSSSL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
|
||||
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
|
||||
CC = $(CCDEBUG) $(CFLAGSSSL)
|
||||
CFGSET = TRUE
|
||||
@@ -198,7 +199,8 @@ X_OBJS= \
|
||||
$(DIROBJ)\strtok.obj \
|
||||
$(DIROBJ)\connect.obj \
|
||||
$(DIROBJ)\hash.obj \
|
||||
$(DIROBJ)\llist.obj
|
||||
$(DIROBJ)\llist.obj \
|
||||
$(DIROBJ)\multi.obj
|
||||
|
||||
all : $(TARGET)
|
||||
|
||||
|
53
lib/README.encoding
Normal file
53
lib/README.encoding
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
Content Encoding Support for libcurl
|
||||
|
||||
* About content encodings:
|
||||
|
||||
HTTP/1.1 [RFC 2616] specifies that a client may request that a server encode
|
||||
its response. This is usually used to compress a response using one of a set
|
||||
of commonly available compression techniques. These schemes are `deflate'
|
||||
(the zlib algorithm), `gzip' and `compress' [sec 3.5, RFC 2616]. A client
|
||||
requests that the sever perform an encoding by including an Accept-Encoding
|
||||
header in the request document. The value of the header should be one of the
|
||||
recognized tokens `deflate', ... (there's a way to register new
|
||||
schemes/tokens, see sec 3.5 of the spec). A server MAY honor the client's
|
||||
encoding request. When a response is encoded, the server includes a
|
||||
Content-Encoding header in the response. The value of the Content-Encoding
|
||||
header indicates which scheme was used to encode the data.
|
||||
|
||||
A client may tell a server that it can understand several different encoding
|
||||
schemes. In this case the server may choose any one of those and use it to
|
||||
encode the response (indicating which one using the Content-Encoding header).
|
||||
It's also possible for a client to attach priorities to different schemes so
|
||||
that the server knows which it prefers. See sec 14.3 of RFC 2616 for more
|
||||
information on the Accept-Encoding header.
|
||||
|
||||
* Current support for content encoding:
|
||||
|
||||
I added support for the 'deflate' content encoding to both libcurl and curl.
|
||||
Both regular and chunked transfers should work although I've tested only the
|
||||
former. The library zlib is required for this feature. Places where I
|
||||
modified the source code are commented and typically include my initials and
|
||||
the date (e.g., 08/29/02 jhrg).
|
||||
|
||||
* The libcurl interface:
|
||||
|
||||
To cause libcurl to request a content encoding use:
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_ENCODING, <string>)
|
||||
|
||||
where <string> is the intended value of the Accept-Encoding header.
|
||||
|
||||
Currently, libcurl only understands how to process responses that use the
|
||||
`deflate' Content-Encoding, so the only value for CURLOPT_ENCODING that will
|
||||
work (besides "identity," which does nothing) is "deflate." If a response is
|
||||
encoded using either the `gzip' or `compress' methods, libcurl will return an
|
||||
error indicating that the response could not be decoded. If <string> is null
|
||||
or empty no Accept-Encoding header is generated.
|
||||
|
||||
* The curl interface:
|
||||
|
||||
Use the --compressed option with curl to cause it to ask servers to compress
|
||||
responses using deflate.
|
||||
|
||||
James Gallagher <jgallagher@gso.uri.edu>
|
56
lib/README.memoryleak
Normal file
56
lib/README.memoryleak
Normal file
@@ -0,0 +1,56 @@
|
||||
$Id$
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
How To Track Down Suspected Memory Leaks in libcurl
|
||||
===================================================
|
||||
|
||||
Single-threaded
|
||||
|
||||
Please note that this memory leak system is not adjusted to work in more
|
||||
than one thread. If you want/need to use it in a multi-threaded app. Please
|
||||
adjust accordingly.
|
||||
|
||||
|
||||
Build
|
||||
|
||||
Rebuild libcurl with -DMALLOCDEBUG (usually, rerunning configure with
|
||||
--enable-debug fixes this). 'make clean' first, then 'make' so that all
|
||||
files actually are rebuilt properly. It will also make sense to build
|
||||
libcurl with the debug option (usually -g to the compiler) so that debugging
|
||||
it will be easier if you actually do find a leak in the library.
|
||||
|
||||
This will create a library that has memory debugging enabled.
|
||||
|
||||
Modify Your Application
|
||||
|
||||
Add a line in your application code:
|
||||
|
||||
curl_memdebug("filename");
|
||||
|
||||
This will make the malloc debug system output a full trace of all resource
|
||||
using functions to the given file name. Make sure you rebuild your program
|
||||
and that you link with the same libcurl you built for this purpose as
|
||||
described above.
|
||||
|
||||
Run Your Application
|
||||
|
||||
Run your program as usual. Watch the specified memory trace file grow.
|
||||
|
||||
Make your program exit and use the proper libcurl cleanup functions etc. So
|
||||
that all non-leaks are returned/freed properly.
|
||||
|
||||
Analyze the Flow
|
||||
|
||||
Use the tests/memanalyze.pl perl script to analyze the memdump file:
|
||||
|
||||
tests/memanalyze.pl < memdump
|
||||
|
||||
This now outputs a report on what resources that were allocated but never
|
||||
freed etc. This report is very fine for posting to the list!
|
||||
|
||||
If this doesn't produce any output, no leak was detected in libcurl. Then
|
||||
the leak is mostly likely to be in your code.
|
@@ -1,6 +1,6 @@
|
||||
#ifndef __ARPA_TELNET_H
|
||||
#define __ARPA_TELNET_H
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -9,20 +9,20 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
|
||||
***************************************************************************/
|
||||
#ifndef CURL_DISABLE_TELNET
|
||||
/*
|
||||
* Telnet option defines. Add more here if in need.
|
||||
*/
|
||||
@@ -97,5 +97,5 @@ static const char *telnetcmds[]=
|
||||
#define TELCMD_OK(x) ( ((unsigned int)(x) >= TELCMD_MINIMUM) && \
|
||||
((unsigned int)(x) <= TELCMD_MAXIMUM) )
|
||||
#define TELCMD(x) telnetcmds[(x)-TELCMD_MINIMUM]
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
112
lib/base64.c
112
lib/base64.c
@@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -7,19 +7,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
/* Base64 encoding/decoding
|
||||
*
|
||||
@@ -61,6 +61,8 @@ static void decodeQuantum(unsigned char *dest, char *src)
|
||||
x = (x << 6) + 62;
|
||||
else if(src[i] == '/')
|
||||
x = (x << 6) + 63;
|
||||
else if(src[i] == '=')
|
||||
x = (x << 6);
|
||||
}
|
||||
|
||||
dest[2] = (unsigned char)(x & 255); x >>= 8;
|
||||
@@ -78,6 +80,7 @@ static void base64Decode(unsigned char *dest, char *src, int *rawLength)
|
||||
int length = 0;
|
||||
int equalsTerm = 0;
|
||||
int i;
|
||||
int numQuantums;
|
||||
unsigned char lastQuantum[3];
|
||||
|
||||
while((src[length] != '=') && src[length])
|
||||
@@ -85,16 +88,18 @@ static void base64Decode(unsigned char *dest, char *src, int *rawLength)
|
||||
while(src[length+equalsTerm] == '=')
|
||||
equalsTerm++;
|
||||
|
||||
numQuantums = (length + equalsTerm) / 4;
|
||||
if(rawLength)
|
||||
*rawLength = (length * 3 / 4) - equalsTerm;
|
||||
*rawLength = (numQuantums * 3) - equalsTerm;
|
||||
|
||||
for(i = 0; i < length/4 - 1; i++) {
|
||||
for(i = 0; i < numQuantums - 1; i++) {
|
||||
decodeQuantum(dest, src);
|
||||
dest += 3; src += 4;
|
||||
}
|
||||
|
||||
decodeQuantum(lastQuantum, src);
|
||||
for(i = 0; i < 3 - equalsTerm; i++) dest[i] = lastQuantum[i];
|
||||
for(i = 0; i < 3 - equalsTerm; i++)
|
||||
dest[i] = lastQuantum[i];
|
||||
|
||||
}
|
||||
|
||||
@@ -194,20 +199,21 @@ int Curl_base64_decode(const char *str, void *data)
|
||||
#define TEST_NEED_SUCK
|
||||
void *suck(int *);
|
||||
|
||||
int main(int argc, char **argv, char **envp) {
|
||||
char *base64;
|
||||
int base64Len;
|
||||
unsigned char *data;
|
||||
int dataLen;
|
||||
int main(int argc, char **argv, char **envp)
|
||||
{
|
||||
char *base64;
|
||||
int base64Len;
|
||||
unsigned char *data;
|
||||
int dataLen;
|
||||
|
||||
data = (unsigned char *)suck(&dataLen);
|
||||
base64Len = Curl_base64_encode(data, dataLen, &base64);
|
||||
data = (unsigned char *)suck(&dataLen);
|
||||
base64Len = Curl_base64_encode(data, dataLen, &base64);
|
||||
|
||||
fprintf(stderr, "%d\n", base64Len);
|
||||
fprintf(stdout, "%s", base64);
|
||||
|
||||
free(base64); free(data);
|
||||
return 0;
|
||||
fprintf(stderr, "%d\n", base64Len);
|
||||
fprintf(stdout, "%s", base64);
|
||||
|
||||
free(base64); free(data);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -220,47 +226,47 @@ int main(int argc, char **argv, char **envp) {
|
||||
#define TEST_NEED_SUCK
|
||||
void *suck(int *);
|
||||
|
||||
int main(int argc, char **argv, char **envp) {
|
||||
char *base64;
|
||||
int base64Len;
|
||||
unsigned char *data;
|
||||
int dataLen;
|
||||
int main(int argc, char **argv, char **envp)
|
||||
{
|
||||
char *base64;
|
||||
int base64Len;
|
||||
unsigned char *data;
|
||||
int dataLen;
|
||||
|
||||
base64 = (char *)suck(&base64Len);
|
||||
data = (unsigned char *)malloc(base64Len * 3/4 + 8);
|
||||
dataLen = Curl_base64_decode(base64, data);
|
||||
|
||||
fprintf(stderr, "%d\n", dataLen);
|
||||
fwrite(data,1,dataLen,stdout);
|
||||
|
||||
|
||||
free(base64); free(data);
|
||||
return 0;
|
||||
base64 = (char *)suck(&base64Len);
|
||||
data = (unsigned char *)malloc(base64Len * 3/4 + 8);
|
||||
dataLen = Curl_base64_decode(base64, data);
|
||||
|
||||
fprintf(stderr, "%d\n", dataLen);
|
||||
fwrite(data,1,dataLen,stdout);
|
||||
|
||||
free(base64); free(data);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TEST_NEED_SUCK
|
||||
/* this function 'sucks' in as much as possible from stdin */
|
||||
void *suck(int *lenptr) {
|
||||
int cursize = 8192;
|
||||
unsigned char *buf = NULL;
|
||||
int lastread;
|
||||
int len = 0;
|
||||
void *suck(int *lenptr)
|
||||
{
|
||||
int cursize = 8192;
|
||||
unsigned char *buf = NULL;
|
||||
int lastread;
|
||||
int len = 0;
|
||||
|
||||
do {
|
||||
cursize *= 2;
|
||||
buf = (unsigned char *)realloc(buf, cursize);
|
||||
memset(buf + len, 0, cursize - len);
|
||||
lastread = fread(buf + len, 1, cursize - len, stdin);
|
||||
len += lastread;
|
||||
} while(!feof(stdin));
|
||||
|
||||
lenptr[0] = len;
|
||||
return (void *)buf;
|
||||
do {
|
||||
cursize *= 2;
|
||||
buf = (unsigned char *)realloc(buf, cursize);
|
||||
memset(buf + len, 0, cursize - len);
|
||||
lastread = fread(buf + len, 1, cursize - len, stdin);
|
||||
len += lastread;
|
||||
} while(!feof(stdin));
|
||||
|
||||
lenptr[0] = len;
|
||||
return (void *)buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* local variables:
|
||||
* eval: (load-file "../curl-mode.el")
|
||||
|
14
lib/base64.h
14
lib/base64.h
@@ -1,6 +1,6 @@
|
||||
#ifndef __BASE64_H
|
||||
#define __BASE64_H
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -9,19 +9,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
int Curl_base64_encode(const void *data, int size, char **str);
|
||||
int Curl_base64_decode(const char *str, void *data);
|
||||
#endif
|
||||
|
4447
lib/ca-bundle.crt
Normal file
4447
lib/ca-bundle.crt
Normal file
File diff suppressed because it is too large
Load Diff
31
lib/ca-bundle.h.in
Normal file
31
lib/ca-bundle.h.in
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef __CA_BUNDLE_H
|
||||
#define __CA_BUNDLE_H
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef CURL_CA_BUNDLE
|
||||
/* Set this to the full path file name of the ca cert bundle */
|
||||
#undef CURL_CA_BUNDLE
|
||||
#endif
|
||||
|
||||
#endif /* __CA_BUNDLE_H */
|
@@ -366,3 +366,6 @@
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
#define HAVE_FIONBIO 1
|
||||
|
||||
/* Define if you have the `sigsetjmp' function. */
|
||||
#define HAVE_SIGSETJMP 1
|
||||
|
@@ -170,6 +170,9 @@
|
||||
/* Define if you have the <winsock.h> header file. */
|
||||
#define HAVE_WINSOCK_H 1
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define if you have the closesocket function. */
|
||||
#define HAVE_CLOSESOCKET 1
|
||||
|
||||
@@ -179,6 +182,9 @@
|
||||
/* Define if you have the RAND_screen function when using SSL */
|
||||
#define HAVE_RAND_SCREEN 1
|
||||
|
||||
/* Define if you have the `RAND_status' function. */
|
||||
#define HAVE_RAND_STATUS 1
|
||||
|
||||
/* Define this to if in_addr_t is not an available typedefed type */
|
||||
#define in_addr_t unsigned long
|
||||
|
||||
@@ -196,7 +202,7 @@
|
||||
*This is to eliminate the warnings when compiled *
|
||||
* using MS VC++ compiler *
|
||||
**************************************************/
|
||||
#ifdef _MSC_VER
|
||||
#if 0
|
||||
|
||||
#pragma warning (disable: 4244) /* truncation from 'const int' to 'char' */
|
||||
#pragma warning (disable: 4127) /* conditional expression is constant */
|
||||
@@ -215,4 +221,7 @@
|
||||
been initialized */
|
||||
#pragma warning (disable: 4715) /* ToHour' : not all control paths return a
|
||||
value */
|
||||
#pragma warning (disable: 4115) /* warning C4115: '_RPC_ASYNC_STATE' : named
|
||||
type definition in parentheses */
|
||||
#pragma warning (disable: 4206) /* this does what? */
|
||||
#endif
|
||||
|
158
lib/connect.c
158
lib/connect.c
@@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -7,19 +7,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
@@ -176,10 +176,9 @@ int waitconnect(int sockfd, /* socket */
|
||||
/* timeout, no connect today */
|
||||
return 1;
|
||||
|
||||
if(FD_ISSET(sockfd, &errfd)) {
|
||||
if(FD_ISSET(sockfd, &errfd))
|
||||
/* error condition caught */
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* we have a connect! */
|
||||
return 0;
|
||||
@@ -206,7 +205,7 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
*************************************************************/
|
||||
if (strlen(data->set.device)<255) {
|
||||
struct sockaddr_in sa;
|
||||
Curl_addrinfo *h=NULL;
|
||||
struct Curl_dns_entry *h=NULL;
|
||||
size_t size;
|
||||
char myhost[256] = "";
|
||||
in_addr_t in;
|
||||
@@ -247,12 +246,17 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
if (INADDR_NONE != in) {
|
||||
|
||||
if ( h ) {
|
||||
Curl_addrinfo *addr = h->addr;
|
||||
|
||||
Curl_resolv_unlock(h);
|
||||
/* we don't need it anymore after this function has returned */
|
||||
|
||||
memset((char *)&sa, 0, sizeof(sa));
|
||||
#ifdef ENABLE_IPV6
|
||||
memcpy((char *)&sa.sin_addr, h->ai_addr, h->ai_addrlen);
|
||||
sa.sin_family = h->ai_family;
|
||||
memcpy((char *)&sa.sin_addr, addr->ai_addr, addr->ai_addrlen);
|
||||
sa.sin_family = addr->ai_family;
|
||||
#else
|
||||
memcpy((char *)&sa.sin_addr, h->h_addr, h->h_length);
|
||||
memcpy((char *)&sa.sin_addr, addr->h_addr, addr->h_length);
|
||||
sa.sin_family = AF_INET;
|
||||
#endif
|
||||
sa.sin_addr.s_addr = in;
|
||||
@@ -337,6 +341,77 @@ int socketerror(int sockfd)
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_is_connected() is used from the multi interface to check if the
|
||||
* firstsocket has connected.
|
||||
*/
|
||||
|
||||
CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
int sockfd,
|
||||
bool *connected)
|
||||
{
|
||||
int rc;
|
||||
struct SessionHandle *data = conn->data;
|
||||
|
||||
*connected = FALSE; /* a very negative world view is best */
|
||||
|
||||
if(data->set.timeout || data->set.connecttimeout) {
|
||||
/* there is a timeout set */
|
||||
|
||||
/* Evaluate in milliseconds how much time that has passed */
|
||||
long has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.start);
|
||||
|
||||
/* subtract the most strict timeout of the ones */
|
||||
if(data->set.timeout && data->set.connecttimeout) {
|
||||
if (data->set.timeout < data->set.connecttimeout)
|
||||
has_passed -= data->set.timeout*1000;
|
||||
else
|
||||
has_passed -= data->set.connecttimeout*1000;
|
||||
}
|
||||
else if(data->set.timeout)
|
||||
has_passed -= data->set.timeout*1000;
|
||||
else
|
||||
has_passed -= data->set.connecttimeout*1000;
|
||||
|
||||
if(has_passed > 0 ) {
|
||||
/* time-out, bail out, go home */
|
||||
failf(data, "Connection time-out");
|
||||
return CURLE_OPERATION_TIMEOUTED;
|
||||
}
|
||||
}
|
||||
if(conn->bits.tcpconnect) {
|
||||
/* we are connected already! */
|
||||
*connected = TRUE;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* check for connect without timeout as we want to return immediately */
|
||||
rc = waitconnect(sockfd, 0);
|
||||
|
||||
if(0 == rc) {
|
||||
int err = socketerror(sockfd);
|
||||
if ((0 == err) || (EISCONN == err)) {
|
||||
/* we are connected, awesome! */
|
||||
*connected = TRUE;
|
||||
return CURLE_OK;
|
||||
}
|
||||
/* nope, not connected for real */
|
||||
if(err)
|
||||
return CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the connection phase is "done" here, we should attempt to connect
|
||||
* to the "next address" in the Curl_hostaddr structure that we resolved
|
||||
* before. But we don't have that struct around anymore and we can't just
|
||||
* keep a pointer since the cache might in fact have gotten pruned by the
|
||||
* time we want to read this... Alas, we don't do this yet.
|
||||
*/
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* TCP connect to the given host with timeout, proxy or remote doesn't matter.
|
||||
* There might be more than one IP address to try out. Fill in the passed
|
||||
@@ -344,10 +419,11 @@ int socketerror(int sockfd)
|
||||
*/
|
||||
|
||||
CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
Curl_addrinfo *remotehost, /* use one in here */
|
||||
struct Curl_dns_entry *remotehost, /* use this one */
|
||||
int port, /* connect to this */
|
||||
int *sockconn, /* the connected socket */
|
||||
Curl_ipconnect **addr) /* the one we used */
|
||||
Curl_ipconnect **addr, /* the one we used */
|
||||
bool *connected) /* really connected? */
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
int rc;
|
||||
@@ -362,6 +438,9 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
* Figure out what maximum time we have left
|
||||
*************************************************************/
|
||||
long timeout_ms=300000; /* milliseconds, default to five minutes */
|
||||
|
||||
*connected = FALSE; /* default to not connected */
|
||||
|
||||
if(data->set.timeout || data->set.connecttimeout) {
|
||||
double has_passed;
|
||||
|
||||
@@ -395,7 +474,11 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
}
|
||||
|
||||
hostname = data->change.proxy?conn->proxyhost:conn->hostname;
|
||||
infof(data, "About to connect() to %s:%d\n", hostname, port);
|
||||
infof(data, "About to connect() to %s%s%s:%d\n",
|
||||
conn->bits.ipv6_ip?"[":"",
|
||||
hostname,
|
||||
conn->bits.ipv6_ip?"]":"",
|
||||
port);
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
/*
|
||||
@@ -405,7 +488,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
struct addrinfo *ai;
|
||||
port =0; /* prevent compiler warning */
|
||||
|
||||
for (ai = remotehost; ai; ai = ai->ai_next, aliasindex++) {
|
||||
for (ai = remotehost->addr; ai; ai = ai->ai_next, aliasindex++) {
|
||||
sockfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
||||
if (sockfd < 0)
|
||||
continue;
|
||||
@@ -437,8 +520,11 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
case EAGAIN:
|
||||
#endif
|
||||
case EINTR:
|
||||
|
||||
/* asynchronous connect, wait for connect or timeout */
|
||||
if(data->state.used_interface == Curl_if_multi)
|
||||
/* don't hang when doing multi */
|
||||
timeout_ms = 0;
|
||||
|
||||
rc = waitconnect(sockfd, timeout_ms);
|
||||
break;
|
||||
case ECONNREFUSED: /* no one listening */
|
||||
@@ -448,6 +534,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(0 == rc) {
|
||||
/* we might be connected, if the socket says it is OK! Ask it! */
|
||||
int err;
|
||||
@@ -455,10 +542,17 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
err = socketerror(sockfd);
|
||||
if ((0 == err) || (EISCONN == err)) {
|
||||
/* we are connected, awesome! */
|
||||
*connected = TRUE; /* this is truly a connect */
|
||||
break;
|
||||
}
|
||||
failf(data, "socket error: %d", err);
|
||||
/* we are _not_ connected, it was a false alert, continue please */
|
||||
}
|
||||
else if(data->state.used_interface == Curl_if_multi) {
|
||||
/* When running the multi interface, we bail out here */
|
||||
rc = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* connect failed or timed out */
|
||||
sclose(sockfd);
|
||||
@@ -486,7 +580,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
/*
|
||||
* Connecting with IPv4-only support
|
||||
*/
|
||||
if(!remotehost->h_addr_list[0]) {
|
||||
if(!remotehost->addr->h_addr_list[0]) {
|
||||
/* If there is no addresses in the address list, then we return
|
||||
error right away */
|
||||
failf(data, "no address available");
|
||||
@@ -513,17 +607,17 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
/* This is the loop that attempts to connect to all IP-addresses we
|
||||
know for the given host. One by one. */
|
||||
for(rc=-1, aliasindex=0;
|
||||
rc && (struct in_addr *)remotehost->h_addr_list[aliasindex];
|
||||
rc && (struct in_addr *)remotehost->addr->h_addr_list[aliasindex];
|
||||
aliasindex++) {
|
||||
struct sockaddr_in serv_addr;
|
||||
|
||||
/* do this nasty work to do the connect */
|
||||
memset((char *) &serv_addr, '\0', sizeof(serv_addr));
|
||||
memcpy((char *)&(serv_addr.sin_addr),
|
||||
(struct in_addr *)remotehost->h_addr_list[aliasindex],
|
||||
(struct in_addr *)remotehost->addr->h_addr_list[aliasindex],
|
||||
sizeof(struct in_addr));
|
||||
serv_addr.sin_family = remotehost->h_addrtype;
|
||||
serv_addr.sin_port = htons(port);
|
||||
serv_addr.sin_family = remotehost->addr->h_addrtype;
|
||||
serv_addr.sin_port = htons((unsigned short)port);
|
||||
|
||||
rc = connect(sockfd, (struct sockaddr *)&serv_addr,
|
||||
sizeof(serv_addr));
|
||||
@@ -541,8 +635,11 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
*/
|
||||
case EAGAIN:
|
||||
#endif
|
||||
|
||||
/* asynchronous connect, wait for connect or timeout */
|
||||
if(data->state.used_interface == Curl_if_multi)
|
||||
/* don't hang when doing multi */
|
||||
timeout_ms = 0;
|
||||
|
||||
rc = waitconnect(sockfd, timeout_ms);
|
||||
break;
|
||||
default:
|
||||
@@ -553,10 +650,20 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
}
|
||||
}
|
||||
|
||||
/* The '1 == rc' comes from the waitconnect(), and not from connect().
|
||||
We can be sure of this since connect() cannot return 1. */
|
||||
if((1 == rc) && (data->state.used_interface == Curl_if_multi)) {
|
||||
/* Timeout when running the multi interface, we return here with a
|
||||
CURLE_OK return code. */
|
||||
rc = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if(0 == rc) {
|
||||
int err = socketerror(sockfd);
|
||||
if ((0 == err) || (EISCONN == err)) {
|
||||
/* we are connected, awesome! */
|
||||
*connected = TRUE; /* this is a true connect */
|
||||
break;
|
||||
}
|
||||
/* nope, not connected for real */
|
||||
@@ -580,6 +687,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
/* no good connect was made */
|
||||
sclose(sockfd);
|
||||
*sockconn = -1;
|
||||
failf(data, "Connect failed");
|
||||
return CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
|
||||
@@ -587,7 +695,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
|
||||
if(addr)
|
||||
/* this is the address we've connected to */
|
||||
*addr = (struct in_addr *)remotehost->h_addr_list[aliasindex];
|
||||
*addr = (struct in_addr *)remotehost->addr->h_addr_list[aliasindex];
|
||||
#endif
|
||||
|
||||
/* allow NULL-pointers to get passed in */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#ifndef __CONNECT_H
|
||||
#define __CONNECT_H
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -9,27 +9,32 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
int Curl_nonblock(int socket, /* operate on this */
|
||||
int nonblock /* TRUE or FALSE */);
|
||||
|
||||
CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
int sockfd,
|
||||
bool *connected);
|
||||
|
||||
CURLcode Curl_connecthost(struct connectdata *conn,
|
||||
Curl_addrinfo *host, /* connect to this */
|
||||
struct Curl_dns_entry *host, /* connect to this */
|
||||
int port, /* connect to this port number */
|
||||
int *sockconn, /* not set if error is returned */
|
||||
Curl_ipconnect **addr /* the one we used */
|
||||
); /* index we used */
|
||||
Curl_ipconnect **addr, /* the one we used */
|
||||
bool *connected /* truly connected? */
|
||||
);
|
||||
#endif
|
||||
|
122
lib/content_encoding.c
Normal file
122
lib/content_encoding.c
Normal file
@@ -0,0 +1,122 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
|
||||
#include "urldata.h"
|
||||
#include <curl/curl.h>
|
||||
#include <curl/types.h>
|
||||
#include "sendf.h"
|
||||
|
||||
#define DSIZ 4096 /* buffer size for decompressed data */
|
||||
|
||||
|
||||
static CURLcode
|
||||
process_zlib_error(struct SessionHandle *data, z_stream *z)
|
||||
{
|
||||
if (z->msg)
|
||||
failf (data, "Error while processing content unencoding.\n%s",
|
||||
z->msg);
|
||||
else
|
||||
failf (data, "Error while processing content unencoding.\n"
|
||||
"Unknown failure within decompression software.");
|
||||
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
static CURLcode
|
||||
exit_zlib(z_stream *z, bool *zlib_init, CURLcode result)
|
||||
{
|
||||
inflateEnd(z);
|
||||
*zlib_init = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
CURLcode
|
||||
Curl_unencode_deflate_write(struct SessionHandle *data,
|
||||
struct Curl_transfer_keeper *k,
|
||||
ssize_t nread)
|
||||
{
|
||||
int status; /* zlib status */
|
||||
int result; /* Curl_client_write status */
|
||||
char decomp[DSIZ]; /* Put the decompressed data here. */
|
||||
z_stream *z = &k->z; /* zlib state structure */
|
||||
|
||||
/* Initialize zlib? */
|
||||
if (!k->zlib_init) {
|
||||
z->zalloc = (alloc_func)Z_NULL;
|
||||
z->zfree = (free_func)Z_NULL;
|
||||
z->opaque = 0; /* of dubious use 08/27/02 jhrg */
|
||||
if (inflateInit(z) != Z_OK)
|
||||
return process_zlib_error(data, z);
|
||||
k->zlib_init = 1;
|
||||
}
|
||||
|
||||
/* Set the compressed input when this fucntion is called */
|
||||
z->next_in = (Bytef *)k->str;
|
||||
z->avail_in = nread;
|
||||
|
||||
/* because the buffer size is fixed, iteratively decompress
|
||||
and transfer to the client via client_write. */
|
||||
for (;;) {
|
||||
/* (re)set buffer for decompressed output for every iteration */
|
||||
z->next_out = (Bytef *)&decomp[0];
|
||||
z->avail_out = DSIZ;
|
||||
|
||||
status = inflate(z, Z_SYNC_FLUSH);
|
||||
if (status == Z_OK || status == Z_STREAM_END) {
|
||||
result = Curl_client_write(data, CLIENTWRITE_BODY, decomp,
|
||||
DSIZ - z->avail_out);
|
||||
/* if !CURLE_OK, clean up, return */
|
||||
if (result) {
|
||||
return exit_zlib(z, &k->zlib_init, result);
|
||||
}
|
||||
|
||||
/* Done?; clean up, return */
|
||||
if (status == Z_STREAM_END) {
|
||||
if (inflateEnd(z) == Z_OK)
|
||||
return exit_zlib(z, &k->zlib_init, result);
|
||||
else
|
||||
return exit_zlib(z, &k->zlib_init, process_zlib_error(data, z));
|
||||
}
|
||||
|
||||
/* Done with these bytes, exit */
|
||||
if (status == Z_OK && z->avail_in == 0 && z->avail_out > 0)
|
||||
return result;
|
||||
}
|
||||
else { /* Error; exit loop, handle below */
|
||||
return exit_zlib(z, &k->zlib_init, process_zlib_error(data, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_LIBZ */
|
||||
|
||||
/*
|
||||
* local variables:
|
||||
* eval: (load-file "../curl-mode.el")
|
||||
* end:
|
||||
* vim600: fdm=marker
|
||||
* vim: et sw=2 ts=2 sts=2 tw=78
|
||||
*/
|
34
lib/content_encoding.h
Normal file
34
lib/content_encoding.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
***************************************************************************/
|
||||
|
||||
CURLcode Curl_unencode_deflate_write(struct SessionHandle *data,
|
||||
struct Curl_transfer_keeper *k,
|
||||
ssize_t nread);
|
||||
|
||||
/*
|
||||
* local variables:
|
||||
* eval: (load-file "../curl-mode.el")
|
||||
* end:
|
||||
* vim600: fdm=marker
|
||||
* vim: et sw=2 ts=2 sts=2 tw=78
|
||||
*/
|
30
lib/cookie.c
30
lib/cookie.c
@@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -7,19 +7,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
/***
|
||||
|
||||
@@ -79,6 +79,8 @@ Example set of cookies:
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef CURL_DISABLE_HTTP
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
@@ -119,7 +121,7 @@ free_cookiemess(struct Cookie *co)
|
||||
struct Cookie *
|
||||
Curl_cookie_add(struct CookieInfo *c,
|
||||
bool httpheader, /* TRUE if HTTP header-style line */
|
||||
char *lineptr, /* first non-space of the line */
|
||||
char *lineptr, /* first character of the line */
|
||||
char *domain) /* default domain */
|
||||
{
|
||||
struct Cookie *clist;
|
||||
@@ -144,6 +146,10 @@ Curl_cookie_add(struct CookieInfo *c,
|
||||
/* This line was read off a HTTP-header */
|
||||
char *sep;
|
||||
semiptr=strchr(lineptr, ';'); /* first, find a semicolon */
|
||||
|
||||
while(*lineptr && isspace((int)*lineptr))
|
||||
lineptr++;
|
||||
|
||||
ptr = lineptr;
|
||||
do {
|
||||
/* we have a <what>=<this> pair or a 'secure' word here */
|
||||
@@ -513,7 +519,7 @@ struct CookieInfo *Curl_cookie_init(char *file,
|
||||
char *lineptr;
|
||||
bool headerline;
|
||||
while(fgets(line, MAX_COOKIE_LINE, fp)) {
|
||||
if(strnequal("Set-Cookie:", line, 11)) {
|
||||
if(checkprefix("Set-Cookie:", line)) {
|
||||
/* This is a cookie line, get it! */
|
||||
lineptr=&line[11];
|
||||
headerline=TRUE;
|
||||
@@ -581,8 +587,8 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
|
||||
|
||||
/* now check the left part of the path with the cookies path
|
||||
requirement */
|
||||
if(!co->path ||
|
||||
strnequal(path, co->path, strlen(co->path))) {
|
||||
if(!co->path ||
|
||||
checkprefix(co->path, path) ) {
|
||||
|
||||
/* and now, we know this is a match and we should create an
|
||||
entry for the return-linked-list */
|
||||
@@ -761,6 +767,8 @@ int main(int argc, char **argv)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* CURL_DISABLE_HTTP */
|
||||
|
||||
/*
|
||||
* local variables:
|
||||
* eval: (load-file "../curl-mode.el")
|
||||
|
14
lib/cookie.h
14
lib/cookie.h
@@ -1,6 +1,6 @@
|
||||
#ifndef __COOKIE_H
|
||||
#define __COOKIE_H
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -9,19 +9,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef WIN32
|
||||
|
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /FR /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /D "_WINDLL" /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib ws2_32.lib /nologo /dll /map /debug /machine:I386 /out:"Release/libcurl.dll"
|
||||
# ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /map /debug /machine:I386 /out:"Release/libcurl.dll"
|
||||
|
||||
!ELSEIF "$(CFG)" == "curllib - Win32 Debug"
|
||||
|
||||
@@ -70,7 +70,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /FR /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURLLIB_EXPORTS" /FR /FD /GZ /c
|
||||
# SUBTRACT CPP /WX /YX
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
@@ -81,7 +81,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib ws2_32.lib /nologo /dll /incremental:no /map /debug /machine:I386 /out:"Debug/libcurl.dll" /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /incremental:no /map /debug /machine:I386 /out:"Debug/libcurl.dll" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /nodefaultlib
|
||||
|
||||
!ENDIF
|
||||
@@ -111,10 +111,6 @@ SOURCE=.\dict.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dllinit.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\easy.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -195,6 +191,10 @@ SOURCE=.\mprintf.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\multi.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\netrc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
14
lib/dict.c
14
lib/dict.c
@@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -7,19 +7,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
|
17
lib/dict.h
17
lib/dict.h
@@ -1,7 +1,7 @@
|
||||
#ifndef __DICT_H
|
||||
#define __DICT_H
|
||||
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -10,20 +10,21 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
#ifndef CURL_DISABLE_DICT
|
||||
CURLcode Curl_dict(struct connectdata *conn);
|
||||
CURLcode Curl_dict_done(struct connectdata *conn);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -1,96 +0,0 @@
|
||||
#ifdef WIN32
|
||||
/* dllinit.c -- Portable DLL initialization.
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
Contributed by Mumit Khan (khan@xraylith.wisc.edu).
|
||||
|
||||
I've used DllMain as the DLL "main" since that's the most common
|
||||
usage. MSVC and Mingw32 both default to DllMain as the standard
|
||||
callback from the linker entry point. Cygwin, as of b20.1, also
|
||||
uses DllMain as the default callback from the entry point.
|
||||
|
||||
The real entry point is typically always defined by the runtime
|
||||
library, and usually never overridden by (casual) user. What you can
|
||||
override however is the callback routine that the entry point calls,
|
||||
and this file provides such a callback function, DllMain.
|
||||
|
||||
Mingw32: The default entry point for mingw32 is DllMainCRTStartup
|
||||
which is defined in libmingw32.a This in turn calls DllMain which is
|
||||
defined here. If not defined, there is a stub in libmingw32.a which
|
||||
does nothing.
|
||||
|
||||
Cygwin: The default entry point for Cygwin b20.1 or newer is
|
||||
__cygwin_dll_entry which is defined in libcygwin.a. This in turn
|
||||
calls the routine DllMain. If not defined, there is a stub in
|
||||
libcygwin.a which does nothing.
|
||||
|
||||
MSVC: MSVC runtime calls DllMain, just like Mingw32.
|
||||
|
||||
Summary: If you need to do anything special in DllMain, just add it
|
||||
here. Otherwise, the default setup should be just fine for 99%+ of
|
||||
the time. I strongly suggest that you *not* change the entry point,
|
||||
but rather change DllMain as appropriate.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <stdio.h>
|
||||
|
||||
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason,
|
||||
LPVOID reserved /* Not used. */ );
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* DllMain --
|
||||
*
|
||||
* This routine is called by the Mingw32, Cygwin32 or VC++ C run
|
||||
* time library init code, or the Borland DllEntryPoint routine. It
|
||||
* is responsible for initializing various dynamically loaded
|
||||
* libraries.
|
||||
*
|
||||
* Results:
|
||||
* TRUE on sucess, FALSE on failure.
|
||||
*
|
||||
* Side effects:
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
BOOL APIENTRY
|
||||
DllMain (
|
||||
HINSTANCE hInst /* Library instance handle. */ ,
|
||||
DWORD reason /* Reason this function is being called. */ ,
|
||||
LPVOID reserved /* Not used. */ )
|
||||
{
|
||||
|
||||
switch (reason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
|
||||
case DLL_THREAD_ATTACH:
|
||||
break;
|
||||
|
||||
case DLL_THREAD_DETACH:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
#else
|
||||
#ifdef VMS
|
||||
int VOID_VAR_DLLINIT;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* local variables:
|
||||
* eval: (load-file "../curl-mode.el")
|
||||
* end:
|
||||
* vim600: fdm=marker
|
||||
* vim: et sw=2 ts=2 sts=2 tw=78
|
||||
*/
|
28
lib/easy.c
28
lib/easy.c
@@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -7,19 +7,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
@@ -233,15 +233,17 @@ CURLcode curl_easy_perform(CURL *curl)
|
||||
{
|
||||
struct SessionHandle *data = (struct SessionHandle *)curl;
|
||||
|
||||
if (!data->hostcache) {
|
||||
if (Curl_global_host_cache_use(data)) {
|
||||
data->hostcache = Curl_global_host_cache_get();
|
||||
}
|
||||
else {
|
||||
data->hostcache = Curl_hash_alloc(7, Curl_freeaddrinfo);
|
||||
if (Curl_global_host_cache_use(data) && data->hostcache != Curl_global_host_cache_get()) {
|
||||
if (data->hostcache) {
|
||||
Curl_hash_destroy(data->hostcache);
|
||||
}
|
||||
data->hostcache = Curl_global_host_cache_get();
|
||||
}
|
||||
|
||||
if (!data->hostcache) {
|
||||
data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
|
||||
}
|
||||
|
||||
return Curl_perform(data);
|
||||
}
|
||||
|
||||
|
53
lib/escape.c
53
lib/escape.c
@@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -7,19 +7,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
/* Escape and unescape URL encoding in strings. The functions return a new
|
||||
* allocated string or NULL if an error occurred. */
|
||||
@@ -41,6 +41,7 @@ char *curl_escape(const char *string, int length)
|
||||
{
|
||||
int alloc = (length?length:(int)strlen(string))+1;
|
||||
char *ns = malloc(alloc);
|
||||
char *testing_ptr = NULL;
|
||||
unsigned char in;
|
||||
int newlen = alloc;
|
||||
int index=0;
|
||||
@@ -48,18 +49,21 @@ char *curl_escape(const char *string, int length)
|
||||
length = alloc-1;
|
||||
while(length--) {
|
||||
in = *string;
|
||||
if(' ' == in)
|
||||
ns[index++] = '+';
|
||||
else if(!(in >= 'a' && in <= 'z') &&
|
||||
!(in >= 'A' && in <= 'Z') &&
|
||||
!(in >= '0' && in <= '9')) {
|
||||
if(!(in >= 'a' && in <= 'z') &&
|
||||
!(in >= 'A' && in <= 'Z') &&
|
||||
!(in >= '0' && in <= '9')) {
|
||||
/* encode it */
|
||||
newlen += 2; /* the size grows with two, since this'll become a %XX */
|
||||
if(newlen > alloc) {
|
||||
alloc *= 2;
|
||||
ns = realloc(ns, alloc);
|
||||
if(!ns)
|
||||
testing_ptr = realloc(ns, alloc);
|
||||
if(!testing_ptr) {
|
||||
free( ns );
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
ns = testing_ptr;
|
||||
}
|
||||
}
|
||||
sprintf(&ns[index], "%%%02X", in);
|
||||
|
||||
@@ -82,19 +86,14 @@ char *curl_unescape(const char *string, int length)
|
||||
unsigned char in;
|
||||
int index=0;
|
||||
unsigned int hex;
|
||||
char querypart=FALSE; /* everything to the right of a '?' letter is
|
||||
the "query part" where '+' should become ' '.
|
||||
RFC 2316, section 3.10 */
|
||||
|
||||
if( !ns ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while(--alloc > 0) {
|
||||
in = *string;
|
||||
if(querypart && ('+' == in))
|
||||
in = ' ';
|
||||
else if(!querypart && ('?' == in)) {
|
||||
/* we have "walked in" to the query part */
|
||||
querypart=TRUE;
|
||||
}
|
||||
else if('%' == in) {
|
||||
if('%' == in) {
|
||||
/* encoded part */
|
||||
if(sscanf(string+1, "%02X", &hex)) {
|
||||
in = hex;
|
||||
@@ -108,7 +107,11 @@ char *curl_unescape(const char *string, int length)
|
||||
}
|
||||
ns[index]=0; /* terminate it */
|
||||
return ns;
|
||||
|
||||
}
|
||||
|
||||
void curl_free(void *p)
|
||||
{
|
||||
free(p);
|
||||
}
|
||||
|
||||
/*
|
||||
|
14
lib/escape.h
14
lib/escape.h
@@ -1,7 +1,7 @@
|
||||
#ifndef __ESCAPE_H
|
||||
#define __ESCAPE_H
|
||||
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -10,19 +10,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
/* Escape and unescape URL encoding in strings. The functions return a new
|
||||
* allocated string or NULL if an error occurred. */
|
||||
|
||||
|
30
lib/file.c
30
lib/file.c
@@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -7,22 +7,23 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef CURL_DISABLE_FILE
|
||||
/* -- WIN32 approved -- */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -158,6 +159,16 @@ CURLcode Curl_file(struct connectdata *conn)
|
||||
expected_size = (double)statbuf.st_size;
|
||||
}
|
||||
|
||||
/* Added by Dolbneff A.V & Spiridonoff A.V */
|
||||
if (conn->resume_from <= expected_size)
|
||||
expected_size -= conn->resume_from;
|
||||
else
|
||||
/* Is this error code suitable in such situation? */
|
||||
return CURLE_FTP_BAD_DOWNLOAD_RESUME;
|
||||
|
||||
if (expected_size == 0)
|
||||
return CURLE_OK;
|
||||
|
||||
/* The following is a shortcut implementation of file reading
|
||||
this is both more efficient than the former call to download() and
|
||||
it avoids problems with select() and recv() on file descriptors
|
||||
@@ -165,6 +176,10 @@ CURLcode Curl_file(struct connectdata *conn)
|
||||
if(expected_size != -1)
|
||||
Curl_pgrsSetDownloadSize(data, expected_size);
|
||||
|
||||
if(conn->resume_from)
|
||||
/* Added by Dolbneff A.V & Spiridonoff A.V */
|
||||
lseek(fd, conn->resume_from, SEEK_SET);
|
||||
|
||||
while (res == CURLE_OK) {
|
||||
nread = read(fd, buf, BUFSIZE-1);
|
||||
|
||||
@@ -204,3 +219,4 @@ CURLcode Curl_file(struct connectdata *conn)
|
||||
* vim600: fdm=marker
|
||||
* vim: et sw=2 ts=2 sts=2 tw=78
|
||||
*/
|
||||
#endif
|
||||
|
16
lib/file.h
16
lib/file.h
@@ -1,7 +1,7 @@
|
||||
#ifndef __FILE_H
|
||||
#define __FILE_H
|
||||
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -10,19 +10,21 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
#ifndef CURL_DISABLE_FILE
|
||||
CURLcode Curl_file(struct connectdata *conn);
|
||||
CURLcode Curl_file_connect(struct connectdata *conn);
|
||||
#endif
|
||||
#endif
|
||||
|
295
lib/formdata.c
295
lib/formdata.c
@@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -7,19 +7,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
Debug the form generator stand-alone by compiling this source file with:
|
||||
@@ -109,6 +109,8 @@ Content-Disposition: form-data; name="FILECONTENT"
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef CURL_DISABLE_HTTP
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -398,6 +400,10 @@ int curl_formparse(char *input,
|
||||
static struct curl_httppost *
|
||||
AddHttpPost(char * name, long namelength,
|
||||
char * value, long contentslength,
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
char * buffer, long bufferlength,
|
||||
|
||||
char *contenttype,
|
||||
long flags,
|
||||
struct curl_slist* contentHeader,
|
||||
@@ -414,6 +420,11 @@ AddHttpPost(char * name, long namelength,
|
||||
post->namelength = name?(namelength?namelength:(long)strlen(name)):0;
|
||||
post->contents = value;
|
||||
post->contentslength = contentslength;
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
post->buffer = buffer;
|
||||
post->bufferlength = bufferlength;
|
||||
|
||||
post->contenttype = contenttype;
|
||||
post->contentheader = contentHeader;
|
||||
post->showfilename = showfilename;
|
||||
@@ -602,44 +613,31 @@ static int AllocAndCopy (char **buffer, int buffer_length)
|
||||
* CURLFORM_FILE, "filename1", CURLFORM_FILE, "filename2", CURLFORM_END);
|
||||
*
|
||||
* Returns:
|
||||
* FORMADD_OK on success
|
||||
* FORMADD_MEMORY if the FormInfo allocation fails
|
||||
* FORMADD_OPTION_TWICE if one option is given twice for one Form
|
||||
* FORMADD_NULL if a null pointer was given for a char
|
||||
* FORMADD_MEMORY if the allocation of a FormInfo struct failed
|
||||
* FORMADD_UNKNOWN_OPTION if an unknown option was used
|
||||
* FORMADD_INCOMPLETE if the some FormInfo is not complete (or an error)
|
||||
* FORMADD_MEMORY if a HttpPost struct cannot be allocated
|
||||
* FORMADD_MEMORY if some allocation for string copying failed.
|
||||
* FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array
|
||||
* CURL_FORMADD_OK on success
|
||||
* CURL_FORMADD_MEMORY if the FormInfo allocation fails
|
||||
* CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form
|
||||
* CURL_FORMADD_NULL if a null pointer was given for a char
|
||||
* CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed
|
||||
* CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
|
||||
* CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or an error)
|
||||
* CURL_FORMADD_MEMORY if a HttpPost struct cannot be allocated
|
||||
* CURL_FORMADD_MEMORY if some allocation for string copying failed.
|
||||
* CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
typedef enum {
|
||||
FORMADD_OK, /* first, no error */
|
||||
|
||||
FORMADD_MEMORY,
|
||||
FORMADD_OPTION_TWICE,
|
||||
FORMADD_NULL,
|
||||
FORMADD_UNKNOWN_OPTION,
|
||||
FORMADD_INCOMPLETE,
|
||||
FORMADD_ILLEGAL_ARRAY,
|
||||
|
||||
FORMADD_LAST /* last */
|
||||
} FORMcode;
|
||||
|
||||
static
|
||||
FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
struct curl_httppost **last_post,
|
||||
va_list params)
|
||||
CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
struct curl_httppost **last_post,
|
||||
va_list params)
|
||||
{
|
||||
FormInfo *first_form, *current_form, *form;
|
||||
FORMcode return_value = FORMADD_OK;
|
||||
CURLFORMcode return_value = CURL_FORMADD_OK;
|
||||
const char *prevtype = NULL;
|
||||
struct curl_httppost *post = NULL;
|
||||
CURLformoption option;
|
||||
struct curl_forms *forms = NULL;
|
||||
char *array_value; /* value read from an array */
|
||||
char *array_value=NULL; /* value read from an array */
|
||||
|
||||
/* This is a state variable, that if TRUE means that we're parsing an
|
||||
array that we got passed to us. If FALSE we're parsing the input
|
||||
@@ -655,7 +653,7 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
current_form = first_form;
|
||||
}
|
||||
else
|
||||
return FORMADD_MEMORY;
|
||||
return CURL_FORMADD_MEMORY;
|
||||
|
||||
/*
|
||||
* Loop through all the options set.
|
||||
@@ -663,7 +661,7 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
while (1) {
|
||||
|
||||
/* break if we have an error to report */
|
||||
if (return_value != FORMADD_OK)
|
||||
if (return_value != CURL_FORMADD_OK)
|
||||
break;
|
||||
|
||||
/* first see if we have more parts of the array param */
|
||||
@@ -690,13 +688,13 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
case CURLFORM_ARRAY:
|
||||
if(array_state)
|
||||
/* we don't support an array from within an array */
|
||||
return_value = FORMADD_ILLEGAL_ARRAY;
|
||||
return_value = CURL_FORMADD_ILLEGAL_ARRAY;
|
||||
else {
|
||||
forms = va_arg(params, struct curl_forms *);
|
||||
if (forms)
|
||||
array_state = TRUE;
|
||||
else
|
||||
return_value = FORMADD_NULL;
|
||||
return_value = CURL_FORMADD_NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -707,19 +705,19 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
current_form->flags |= HTTPPOST_PTRNAME; /* fall through */
|
||||
case CURLFORM_COPYNAME:
|
||||
if (current_form->name)
|
||||
return_value = FORMADD_OPTION_TWICE;
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else {
|
||||
char *name = array_state?
|
||||
array_value:va_arg(params, char *);
|
||||
if (name)
|
||||
current_form->name = name; /* store for the moment */
|
||||
else
|
||||
return_value = FORMADD_NULL;
|
||||
return_value = CURL_FORMADD_NULL;
|
||||
}
|
||||
break;
|
||||
case CURLFORM_NAMELENGTH:
|
||||
if (current_form->namelength)
|
||||
return_value = FORMADD_OPTION_TWICE;
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
current_form->namelength =
|
||||
array_state?(long)array_value:va_arg(params, long);
|
||||
@@ -732,19 +730,19 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
current_form->flags |= HTTPPOST_PTRCONTENTS; /* fall through */
|
||||
case CURLFORM_COPYCONTENTS:
|
||||
if (current_form->value)
|
||||
return_value = FORMADD_OPTION_TWICE;
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else {
|
||||
char *value =
|
||||
array_state?array_value:va_arg(params, char *);
|
||||
if (value)
|
||||
current_form->value = value; /* store for the moment */
|
||||
else
|
||||
return_value = FORMADD_NULL;
|
||||
return_value = CURL_FORMADD_NULL;
|
||||
}
|
||||
break;
|
||||
case CURLFORM_CONTENTSLENGTH:
|
||||
if (current_form->contentslength)
|
||||
return_value = FORMADD_OPTION_TWICE;
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
current_form->contentslength =
|
||||
array_state?(long)array_value:va_arg(params, long);
|
||||
@@ -753,7 +751,7 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
/* Get contents from a given file name */
|
||||
case CURLFORM_FILECONTENT:
|
||||
if (current_form->flags != 0)
|
||||
return_value = FORMADD_OPTION_TWICE;
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else {
|
||||
char *filename = array_state?
|
||||
array_value:va_arg(params, char *);
|
||||
@@ -762,7 +760,7 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
current_form->flags |= HTTPPOST_READFILE;
|
||||
}
|
||||
else
|
||||
return_value = FORMADD_NULL;
|
||||
return_value = CURL_FORMADD_NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -777,26 +775,80 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
if (filename) {
|
||||
if (!(current_form = AddFormInfo(strdup(filename),
|
||||
NULL, current_form)))
|
||||
return_value = FORMADD_MEMORY;
|
||||
return_value = CURL_FORMADD_MEMORY;
|
||||
}
|
||||
else
|
||||
return_value = FORMADD_NULL;
|
||||
return_value = CURL_FORMADD_NULL;
|
||||
}
|
||||
else
|
||||
return_value = FORMADD_OPTION_TWICE;
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
}
|
||||
else {
|
||||
if (filename)
|
||||
current_form->value = strdup(filename);
|
||||
else
|
||||
return_value = FORMADD_NULL;
|
||||
return_value = CURL_FORMADD_NULL;
|
||||
current_form->flags |= HTTPPOST_FILENAME;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
case CURLFORM_BUFFER:
|
||||
{
|
||||
char *filename = array_state?array_value:
|
||||
va_arg(params, char *);
|
||||
|
||||
if (current_form->value) {
|
||||
if (current_form->flags & HTTPPOST_BUFFER) {
|
||||
if (filename) {
|
||||
if (!(current_form = AddFormInfo(strdup(filename),
|
||||
NULL, current_form)))
|
||||
return_value = CURL_FORMADD_MEMORY;
|
||||
}
|
||||
else
|
||||
return_value = CURL_FORMADD_NULL;
|
||||
}
|
||||
else
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
}
|
||||
else {
|
||||
if (filename)
|
||||
current_form->value = strdup(filename);
|
||||
else
|
||||
return_value = CURL_FORMADD_NULL;
|
||||
current_form->flags |= HTTPPOST_BUFFER;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
case CURLFORM_BUFFERPTR:
|
||||
current_form->flags |= HTTPPOST_PTRBUFFER;
|
||||
if (current_form->buffer)
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else {
|
||||
char *buffer =
|
||||
array_state?array_value:va_arg(params, char *);
|
||||
if (buffer)
|
||||
current_form->buffer = buffer; /* store for the moment */
|
||||
else
|
||||
return_value = CURL_FORMADD_NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
case CURLFORM_BUFFERLENGTH:
|
||||
if (current_form->bufferlength)
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
current_form->bufferlength =
|
||||
array_state?(long)array_value:va_arg(params, long);
|
||||
break;
|
||||
|
||||
case CURLFORM_CONTENTTYPE:
|
||||
{
|
||||
char *contenttype =
|
||||
char *contenttype =
|
||||
array_state?array_value:va_arg(params, char *);
|
||||
if (current_form->contenttype) {
|
||||
if (current_form->flags & HTTPPOST_FILENAME) {
|
||||
@@ -804,19 +856,19 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
if (!(current_form = AddFormInfo(NULL,
|
||||
strdup(contenttype),
|
||||
current_form)))
|
||||
return_value = FORMADD_MEMORY;
|
||||
return_value = CURL_FORMADD_MEMORY;
|
||||
}
|
||||
else
|
||||
return_value = FORMADD_NULL;
|
||||
return_value = CURL_FORMADD_NULL;
|
||||
}
|
||||
else
|
||||
return_value = FORMADD_OPTION_TWICE;
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
}
|
||||
else {
|
||||
if (contenttype)
|
||||
current_form->contenttype = strdup(contenttype);
|
||||
else
|
||||
return_value = FORMADD_NULL;
|
||||
return_value = CURL_FORMADD_NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -829,7 +881,7 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
va_arg(params, struct curl_slist*);
|
||||
|
||||
if( current_form->contentheader )
|
||||
return_value = FORMADD_OPTION_TWICE;
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
current_form->contentheader = list;
|
||||
|
||||
@@ -840,17 +892,17 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
char *filename = array_state?array_value:
|
||||
va_arg(params, char *);
|
||||
if( current_form->showfilename )
|
||||
return_value = FORMADD_OPTION_TWICE;
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
current_form->showfilename = strdup(filename);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return_value = FORMADD_UNKNOWN_OPTION;
|
||||
return_value = CURL_FORMADD_UNKNOWN_OPTION;
|
||||
}
|
||||
}
|
||||
|
||||
if(FORMADD_OK == return_value) {
|
||||
if(CURL_FORMADD_OK == return_value) {
|
||||
/* go through the list, check for copleteness and if everything is
|
||||
* alright add the HttpPost item otherwise set return_value accordingly */
|
||||
|
||||
@@ -863,14 +915,21 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
(form->flags & HTTPPOST_FILENAME) ) ||
|
||||
( (form->flags & HTTPPOST_FILENAME) &&
|
||||
(form->flags & HTTPPOST_PTRCONTENTS) ) ||
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
( (!form->buffer) &&
|
||||
(form->flags & HTTPPOST_BUFFER) &&
|
||||
(form->flags & HTTPPOST_PTRBUFFER) ) ||
|
||||
|
||||
( (form->flags & HTTPPOST_READFILE) &&
|
||||
(form->flags & HTTPPOST_PTRCONTENTS) )
|
||||
) {
|
||||
return_value = FORMADD_INCOMPLETE;
|
||||
return_value = CURL_FORMADD_INCOMPLETE;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
if ( (form->flags & HTTPPOST_FILENAME) &&
|
||||
if ( ((form->flags & HTTPPOST_FILENAME) ||
|
||||
(form->flags & HTTPPOST_BUFFER)) &&
|
||||
!form->contenttype ) {
|
||||
/* our contenttype is missing */
|
||||
form->contenttype
|
||||
@@ -880,28 +939,36 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
(form == first_form) ) {
|
||||
/* copy name (without strdup; possibly contains null characters) */
|
||||
if (AllocAndCopy(&form->name, form->namelength)) {
|
||||
return_value = FORMADD_MEMORY;
|
||||
return_value = CURL_FORMADD_MEMORY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !(form->flags & HTTPPOST_FILENAME) &&
|
||||
!(form->flags & HTTPPOST_READFILE) &&
|
||||
!(form->flags & HTTPPOST_PTRCONTENTS) ) {
|
||||
!(form->flags & HTTPPOST_PTRCONTENTS) &&
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
!(form->flags & HTTPPOST_PTRBUFFER) ) {
|
||||
|
||||
/* copy value (without strdup; possibly contains null characters) */
|
||||
if (AllocAndCopy(&form->value, form->contentslength)) {
|
||||
return_value = FORMADD_MEMORY;
|
||||
return_value = CURL_FORMADD_MEMORY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
post = AddHttpPost(form->name, form->namelength,
|
||||
form->value, form->contentslength,
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
form->buffer, form->bufferlength,
|
||||
|
||||
form->contenttype, form->flags,
|
||||
form->contentheader, form->showfilename,
|
||||
post, httppost,
|
||||
last_post);
|
||||
|
||||
if(!post)
|
||||
return_value = FORMADD_MEMORY;
|
||||
return_value = CURL_FORMADD_MEMORY;
|
||||
|
||||
if (form->contenttype)
|
||||
prevtype = form->contenttype;
|
||||
@@ -922,12 +989,12 @@ FORMcode FormAdd(struct curl_httppost **httppost,
|
||||
return return_value;
|
||||
}
|
||||
|
||||
int curl_formadd(struct curl_httppost **httppost,
|
||||
CURLFORMcode curl_formadd(struct curl_httppost **httppost,
|
||||
struct curl_httppost **last_post,
|
||||
...)
|
||||
{
|
||||
va_list arg;
|
||||
int result;
|
||||
CURLFORMcode result;
|
||||
va_start(arg, last_post);
|
||||
result = FormAdd(httppost, last_post, arg);
|
||||
va_end(arg);
|
||||
@@ -1096,9 +1163,9 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
fileboundary = Curl_FormBoundary();
|
||||
|
||||
size += AddFormDataf(&form,
|
||||
"\r\nContent-Type: multipart/mixed,"
|
||||
" boundary=%s\r\n",
|
||||
fileboundary);
|
||||
"\r\nContent-Type: multipart/mixed,"
|
||||
" boundary=%s\r\n",
|
||||
fileboundary);
|
||||
}
|
||||
|
||||
file = post;
|
||||
@@ -1110,26 +1177,30 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
local file name should be added. */
|
||||
|
||||
if(post->more) {
|
||||
/* if multiple-file */
|
||||
size += AddFormDataf(&form,
|
||||
"\r\n--%s\r\nContent-Disposition: "
|
||||
/* if multiple-file */
|
||||
size += AddFormDataf(&form,
|
||||
"\r\n--%s\r\nContent-Disposition: "
|
||||
"attachment; filename=\"%s\"",
|
||||
fileboundary,
|
||||
fileboundary,
|
||||
(file->showfilename?file->showfilename:
|
||||
file->contents));
|
||||
}
|
||||
else if(post->flags & HTTPPOST_FILENAME) {
|
||||
size += AddFormDataf(&form,
|
||||
"; filename=\"%s\"",
|
||||
(post->showfilename?post->showfilename:
|
||||
else if((post->flags & HTTPPOST_FILENAME) ||
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
(post->flags & HTTPPOST_BUFFER)) {
|
||||
|
||||
size += AddFormDataf(&form,
|
||||
"; filename=\"%s\"",
|
||||
(post->showfilename?post->showfilename:
|
||||
post->contents));
|
||||
}
|
||||
|
||||
if(file->contenttype) {
|
||||
/* we have a specified type */
|
||||
size += AddFormDataf(&form,
|
||||
"\r\nContent-Type: %s",
|
||||
file->contenttype);
|
||||
/* we have a specified type */
|
||||
size += AddFormDataf(&form,
|
||||
"\r\nContent-Type: %s",
|
||||
file->contenttype);
|
||||
}
|
||||
|
||||
curList = file->contentheader;
|
||||
@@ -1147,47 +1218,53 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
*/
|
||||
|
||||
if(file->contenttype &&
|
||||
!strnequal("text/", file->contenttype, 5)) {
|
||||
/* this is not a text content, mention our binary encoding */
|
||||
size += AddFormData(&form, "\r\nContent-Transfer-Encoding: binary", 0);
|
||||
!checkprefix("text/", file->contenttype)) {
|
||||
/* this is not a text content, mention our binary encoding */
|
||||
size += AddFormData(&form, "\r\nContent-Transfer-Encoding: binary", 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
size += AddFormData(&form, "\r\n\r\n", 0);
|
||||
|
||||
if((post->flags & HTTPPOST_FILENAME) ||
|
||||
(post->flags & HTTPPOST_READFILE)) {
|
||||
/* we should include the contents from the specified file */
|
||||
FILE *fileread;
|
||||
char buffer[1024];
|
||||
int nread;
|
||||
(post->flags & HTTPPOST_READFILE)) {
|
||||
/* we should include the contents from the specified file */
|
||||
FILE *fileread;
|
||||
char buffer[1024];
|
||||
int nread;
|
||||
|
||||
fileread = strequal("-", file->contents)?stdin:
|
||||
fileread = strequal("-", file->contents)?stdin:
|
||||
/* binary read for win32 crap */
|
||||
/*VMS??*/ fopen(file->contents, "rb"); /* ONLY ALLOWS FOR STREAM FILES ON VMS */
|
||||
/*VMS?? Stream files are OK, as are FIXED & VAR files WITHOUT implied CC */
|
||||
/*VMS?? For implied CC, every record needs to have a \n appended & 1 added to SIZE */
|
||||
if(fileread) {
|
||||
while((nread = fread(buffer, 1, 1024, fileread)))
|
||||
size += AddFormData(&form, buffer, nread);
|
||||
/*VMS??*/ fopen(file->contents, "rb"); /* ONLY ALLOWS FOR STREAM FILES ON VMS */
|
||||
/*VMS?? Stream files are OK, as are FIXED & VAR files WITHOUT implied CC */
|
||||
/*VMS?? For implied CC, every record needs to have a \n appended & 1 added to SIZE */
|
||||
if(fileread) {
|
||||
while((nread = fread(buffer, 1, 1024, fileread)))
|
||||
size += AddFormData(&form, buffer, nread);
|
||||
|
||||
if(fileread != stdin)
|
||||
fclose(fileread);
|
||||
}
|
||||
}
|
||||
else {
|
||||
#if 0
|
||||
/* File wasn't found, add a nothing field! */
|
||||
size += AddFormData(&form, "", 0);
|
||||
size += AddFormData(&form, "", 0);
|
||||
#endif
|
||||
Curl_formclean(firstform);
|
||||
free(boundary);
|
||||
*finalform = NULL;
|
||||
return CURLE_READ_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
} else if (post->flags & HTTPPOST_BUFFER) {
|
||||
/* include contents of buffer */
|
||||
size += AddFormData(&form, post->buffer, post->bufferlength);
|
||||
}
|
||||
|
||||
else {
|
||||
/* include the contents we got */
|
||||
size += AddFormData(&form, post->contents, post->contentslength);
|
||||
/* include the contents we got */
|
||||
size += AddFormData(&form, post->contents, post->contentslength);
|
||||
}
|
||||
} while((file = file->more)); /* for each specified file for this field */
|
||||
|
||||
@@ -1195,8 +1272,8 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
/* this was a multiple-file inclusion, make a termination file
|
||||
boundary: */
|
||||
size += AddFormDataf(&form,
|
||||
"\r\n--%s--",
|
||||
fileboundary);
|
||||
"\r\n--%s--",
|
||||
fileboundary);
|
||||
free(fileboundary);
|
||||
}
|
||||
|
||||
@@ -1204,8 +1281,8 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
|
||||
/* end-boundary for everything */
|
||||
size += AddFormDataf(&form,
|
||||
"\r\n--%s--\r\n",
|
||||
boundary);
|
||||
"\r\n--%s--\r\n",
|
||||
boundary);
|
||||
|
||||
*sizep = size;
|
||||
|
||||
@@ -1242,7 +1319,7 @@ int Curl_FormReader(char *buffer,
|
||||
wantedsize = size * nitems;
|
||||
|
||||
if(!form->data)
|
||||
return -1; /* nothing, error, empty */
|
||||
return 0; /* nothing, error, empty */
|
||||
|
||||
do {
|
||||
|
||||
@@ -1518,6 +1595,8 @@ int main(int argc, char **argv)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* CURL_DISABLE_HTTP */
|
||||
|
||||
/*
|
||||
* local variables:
|
||||
* eval: (load-file "../curl-mode.el")
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#ifndef __FORMDATA_H
|
||||
#define __FORMDATA_H
|
||||
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -10,19 +10,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
/* plain and simple linked list with lines to send */
|
||||
struct FormData {
|
||||
struct FormData *next;
|
||||
@@ -45,6 +45,10 @@ typedef struct FormInfo {
|
||||
char *contenttype;
|
||||
long flags;
|
||||
|
||||
/* CMC: Added support for buffer uploads */
|
||||
char *buffer; /* pointer to existing buffer used for file upload */
|
||||
long bufferlength;
|
||||
|
||||
char *showfilename; /* The file name to show. If not set, the actual
|
||||
file name will be used */
|
||||
struct curl_slist* contentheader;
|
||||
|
26
lib/ftp.h
26
lib/ftp.h
@@ -1,7 +1,6 @@
|
||||
#ifndef __FTP_H
|
||||
#define __FTP_H
|
||||
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -10,28 +9,29 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef CURL_DISABLE_FTP
|
||||
CURLcode Curl_ftp(struct connectdata *conn);
|
||||
CURLcode Curl_ftp_done(struct connectdata *conn);
|
||||
CURLcode Curl_ftp_connect(struct connectdata *conn);
|
||||
CURLcode Curl_ftp_disconnect(struct connectdata *conn);
|
||||
|
||||
CURLcode Curl_ftpsendf(struct connectdata *, const char *fmt, ...);
|
||||
|
||||
/* The kerberos stuff needs this: */
|
||||
int Curl_GetFTPResponse(char *buf, struct connectdata *conn,
|
||||
int *ftpcode);
|
||||
CURLcode Curl_GetFTPResponse(int *nread, struct connectdata *conn,
|
||||
int *ftpcode);
|
||||
CURLcode Curl_ftp_nextconnect(struct connectdata *conn);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
14
lib/getenv.c
14
lib/getenv.c
@@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -7,19 +7,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -7,19 +7,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
@@ -72,9 +72,9 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
|
||||
CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
|
||||
{
|
||||
va_list arg;
|
||||
long *param_longp;
|
||||
double *param_doublep;
|
||||
char **param_charp;
|
||||
long *param_longp=NULL;
|
||||
double *param_doublep=NULL;
|
||||
char **param_charp=NULL;
|
||||
va_start(arg, info);
|
||||
|
||||
switch(info&CURLINFO_TYPEMASK) {
|
||||
@@ -158,6 +158,9 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
|
||||
case CURLINFO_CONTENT_TYPE:
|
||||
*param_charp = data->info.contenttype;
|
||||
break;
|
||||
case CURLINFO_PRIVATE:
|
||||
*param_charp = data->set.private?data->set.private:(char *)"";
|
||||
break;
|
||||
default:
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#ifndef __GETINFO_H
|
||||
#define __GETINFO_H
|
||||
/*****************************************************************************
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
@@ -9,19 +9,19 @@
|
||||
*
|
||||
* Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* In order to be useful for every potential user, curl and libcurl are
|
||||
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||
* licenses. You may pick one of these licenses.
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
* $Id$
|
||||
*****************************************************************************/
|
||||
***************************************************************************/
|
||||
CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...);
|
||||
CURLcode Curl_initinfo(struct SessionHandle *data);
|
||||
|
||||
|
@@ -93,14 +93,10 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
||||
#include "memdebug.h"
|
||||
#endif
|
||||
|
||||
/* no perror? make an fprintf! */
|
||||
#ifndef HAVE_PERROR
|
||||
# define perror(x) fprintf(stderr, "Error in: %s\n", x)
|
||||
#endif
|
||||
|
||||
char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
||||
{
|
||||
FILE *infp;
|
||||
char infp_fclose = 0;
|
||||
FILE *outfp;
|
||||
RETSIGTYPE (*sigint)();
|
||||
#ifndef __EMX__
|
||||
@@ -127,41 +123,30 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
||||
sigtstp = signal(SIGTSTP, SIG_IGN);
|
||||
#endif
|
||||
|
||||
if( (infp=fopen("/dev/tty", "r")) == NULL )
|
||||
{
|
||||
infp=fopen("/dev/tty", "r");
|
||||
if( NULL == infp )
|
||||
infp = stdin;
|
||||
}
|
||||
if( (outfp=fopen("/dev/tty", "w")) == NULL )
|
||||
{
|
||||
outfp = stderr;
|
||||
}
|
||||
else
|
||||
infp_fclose = 1;
|
||||
|
||||
outfp = stderr;
|
||||
|
||||
infd = fileno(infp);
|
||||
outfd = fileno(outfp);
|
||||
|
||||
/* dissable echo */
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
if(tcgetattr(outfd, &orig) != 0)
|
||||
{
|
||||
; /*perror("tcgetattr");*/
|
||||
}
|
||||
tcgetattr(outfd, &orig);
|
||||
|
||||
noecho = orig;
|
||||
noecho.c_lflag &= ~ECHO;
|
||||
if(tcsetattr(outfd, TCSANOW, &noecho) != 0)
|
||||
{
|
||||
; /*perror("tcgetattr");*/
|
||||
}
|
||||
tcsetattr(outfd, TCSANOW, &noecho);
|
||||
#else
|
||||
# ifdef HAVE_TERMIO_H
|
||||
if(ioctl(outfd, TCGETA, &orig) != 0)
|
||||
{
|
||||
; /*perror("ioctl");*/
|
||||
}
|
||||
ioctl(outfd, TCGETA, &orig);
|
||||
noecho = orig;
|
||||
noecho.c_lflag &= ~ECHO;
|
||||
if(ioctl(outfd, TCSETA, &noecho) != 0)
|
||||
{
|
||||
; /*perror("ioctl");*/
|
||||
}
|
||||
ioctl(outfd, TCSETA, &noecho);
|
||||
# else
|
||||
# endif
|
||||
#endif
|
||||
@@ -187,16 +172,10 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
||||
* user types more than buflen
|
||||
*/
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
if(tcsetattr(outfd, TCSAFLUSH, &orig) != 0)
|
||||
{
|
||||
; /*perror("tcgetattr");*/
|
||||
}
|
||||
tcsetattr(outfd, TCSAFLUSH, &orig);
|
||||
#else
|
||||
# ifdef HAVE_TERMIO_H
|
||||
if(ioctl(outfd, TCSETA, &orig) != 0)
|
||||
{
|
||||
; /*perror("ioctl");*/
|
||||
}
|
||||
ioctl(outfd, TCSETA, &orig);
|
||||
# else
|
||||
# endif
|
||||
#endif
|
||||
@@ -206,6 +185,9 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
|
||||
signal(SIGTSTP, sigtstp);
|
||||
#endif
|
||||
|
||||
if(infp_fclose)
|
||||
fclose(infp);
|
||||
|
||||
return buffer; /* we always return success */
|
||||
}
|
||||
#endif /* VMS */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user