Compare commits
503 Commits
curl-7_27_
...
curl-7_29_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf633a584d | ||
|
|
0f1deac71e | ||
|
|
f206d6c055 | ||
|
|
add37cc49f | ||
|
|
85625c5e28 | ||
|
|
453e821ad7 | ||
|
|
e0c491026f | ||
|
|
12f4ea50f7 | ||
|
|
ae6b5f1772 | ||
|
|
5f8f20f5e6 | ||
|
|
33a182e6c2 | ||
|
|
68de6a0b3e | ||
|
|
25d13822ae | ||
|
|
25f351424b | ||
|
|
cb3e6dfa35 | ||
|
|
1d22407863 | ||
|
|
bb7c2ee37c | ||
|
|
278ab75e9f | ||
|
|
0d1b754376 | ||
|
|
4cd027f17e | ||
|
|
bd1f170a5a | ||
|
|
03577a355e | ||
|
|
022e67294e | ||
|
|
7fd5f680ea | ||
|
|
9ca812f386 | ||
|
|
a94a68a3c1 | ||
|
|
f850abf439 | ||
|
|
e1cd753e4d | ||
|
|
4c26ba9cea | ||
|
|
c0c334b42a | ||
|
|
b4270a9af1 | ||
|
|
6b6bdc83bd | ||
|
|
56b7c87c74 | ||
|
|
32e8467a66 | ||
|
|
e243d80dea | ||
|
|
a33075b8d3 | ||
|
|
ddd40a43aa | ||
|
|
38131d415b | ||
|
|
c7b6e43ef8 | ||
|
|
3d7b7b6b84 | ||
|
|
163a1dca5f | ||
|
|
23a47ef01b | ||
|
|
38ec16d671 | ||
|
|
d411402a65 | ||
|
|
826e1b81fa | ||
|
|
11dde6ac72 | ||
|
|
0494da830b | ||
|
|
5243b18f3d | ||
|
|
0e5e720c19 | ||
|
|
3dbf11d0a1 | ||
|
|
499e30c4bb | ||
|
|
73fae58132 | ||
|
|
44cf225f7a | ||
|
|
d9c3505e83 | ||
|
|
593f242803 | ||
|
|
a76ea8b79a | ||
|
|
c0e8e94ca2 | ||
|
|
eb2e62c0af | ||
|
|
2bfb8b6080 | ||
|
|
fda0f14f73 | ||
|
|
f8ba1273af | ||
|
|
8b275718e2 | ||
|
|
379d63ecc7 | ||
|
|
b1826d81fb | ||
|
|
6a55f25f67 | ||
|
|
f2f897172f | ||
|
|
aa9e72d358 | ||
|
|
c527759701 | ||
|
|
5c28a64e57 | ||
|
|
8c6c42a67f | ||
|
|
045c734e16 | ||
|
|
de991037e4 | ||
|
|
56d4de468c | ||
|
|
2698520aef | ||
|
|
fa176376c8 | ||
|
|
efe4656656 | ||
|
|
0ed4a0923c | ||
|
|
a3e65b1a50 | ||
|
|
1347b3085c | ||
|
|
9d1effad05 | ||
|
|
e5ea45ec2e | ||
|
|
63605d281f | ||
|
|
f4cc54cb47 | ||
|
|
34ae007d4d | ||
|
|
d90b9aee64 | ||
|
|
ece8681a60 | ||
|
|
7b5be79908 | ||
|
|
446afec71a | ||
|
|
e2bfae239f | ||
|
|
ccb34cb46d | ||
|
|
0e1855d9d3 | ||
|
|
c43127414d | ||
|
|
9fd88abb70 | ||
|
|
4ed6b07d8d | ||
|
|
533c31b785 | ||
|
|
7ab3ae0bf0 | ||
|
|
4b401b2d99 | ||
|
|
d7f2c3af5f | ||
|
|
bc682cbd3e | ||
|
|
26613d7817 | ||
|
|
18e7c14f30 | ||
|
|
16abdd4f39 | ||
|
|
99229b74eb | ||
|
|
600cbaca6f | ||
|
|
b36f1d26f8 | ||
|
|
d17f536688 | ||
|
|
b35a176c66 | ||
|
|
a7db42e4f0 | ||
|
|
308cce8231 | ||
|
|
a6848250d2 | ||
|
|
a9ca5e61e5 | ||
|
|
06558695d5 | ||
|
|
dd73c924ac | ||
|
|
5a053ffe80 | ||
|
|
e2bcd2ab9e | ||
|
|
fea3a3d569 | ||
|
|
75fa3542d0 | ||
|
|
4ffb8a6398 | ||
|
|
7a6d8b1b1a | ||
|
|
905d0be509 | ||
|
|
fd3efca164 | ||
|
|
825677ad09 | ||
|
|
561b551deb | ||
|
|
6a4f5e5268 | ||
|
|
f6e33cf669 | ||
|
|
4e6265ea5a | ||
|
|
494b8664da | ||
|
|
d6bebd56f7 | ||
|
|
70dcde78d0 | ||
|
|
89a3086231 | ||
|
|
cfb6f03224 | ||
|
|
11f55a9672 | ||
|
|
5475ac279d | ||
|
|
a77d18efaf | ||
|
|
dd561c3834 | ||
|
|
db20517796 | ||
|
|
4a5aa6682d | ||
|
|
e0ba958e28 | ||
|
|
8f80f412fb | ||
|
|
cc4ac82bb6 | ||
|
|
1795e24176 | ||
|
|
b708a522a1 | ||
|
|
65e8ba8e1d | ||
|
|
0b3180b4f5 | ||
|
|
8f13e3ddb9 | ||
|
|
7d83dfff9c | ||
|
|
dbf93a8973 | ||
|
|
5b6e7927c6 | ||
|
|
13606bbfde | ||
|
|
8f0171bdd4 | ||
|
|
c087374c64 | ||
|
|
dfe4769157 | ||
|
|
404a95b588 | ||
|
|
bc5298e25c | ||
|
|
d86503ea82 | ||
|
|
bd8ae68006 | ||
|
|
c02449ca53 | ||
|
|
1576548428 | ||
|
|
36837c10b2 | ||
|
|
f947de4bb5 | ||
|
|
2424b7ab1b | ||
|
|
c43af566fa | ||
|
|
488245f99c | ||
|
|
27f90c0962 | ||
|
|
ffa62e5bab | ||
|
|
2255ac52f7 | ||
|
|
b3204e6d60 | ||
|
|
f6f6f278e2 | ||
|
|
167717b806 | ||
|
|
8177bc262f | ||
|
|
ffd8e127e7 | ||
|
|
f871de0064 | ||
|
|
ec691ca34b | ||
|
|
709b3506cd | ||
|
|
2ee2693a47 | ||
|
|
431ead1c9a | ||
|
|
e3ed2b82e6 | ||
|
|
311151beab | ||
|
|
ae2a2c9931 | ||
|
|
eb5aa12c8b | ||
|
|
77b5c0b2cf | ||
|
|
b44da5a82a | ||
|
|
219fe7b29c | ||
|
|
d49531dd3a | ||
|
|
4a23b19a13 | ||
|
|
a662f86f6f | ||
|
|
d335aa2cdc | ||
|
|
0aabfd9963 | ||
|
|
14b77db1b9 | ||
|
|
e125eea5a6 | ||
|
|
1649e680f6 | ||
|
|
2897ce7dc2 | ||
|
|
5ed03ebe52 | ||
|
|
3456bbc4cc | ||
|
|
7a09907146 | ||
|
|
a1fc9b80c8 | ||
|
|
dfe382c6ae | ||
|
|
b3d91a147f | ||
|
|
c59c5e8ea2 | ||
|
|
0969045b6e | ||
|
|
c30c557e4d | ||
|
|
d738adc1fb | ||
|
|
c691037517 | ||
|
|
eafccdb315 | ||
|
|
b7a1eccce8 | ||
|
|
c91a6cd78f | ||
|
|
7d49d774fd | ||
|
|
9ab5f9dd8d | ||
|
|
b8dde1cf19 | ||
|
|
57fa576a35 | ||
|
|
f6af9d9886 | ||
|
|
87e8691e7c | ||
|
|
bbb4bbc0f1 | ||
|
|
0e8e340cba | ||
|
|
a0b207164c | ||
|
|
f254c59dc7 | ||
|
|
568befb6aa | ||
|
|
f4b60e7f14 | ||
|
|
85b77209ae | ||
|
|
e880680fb6 | ||
|
|
aee540b831 | ||
|
|
4710d3d969 | ||
|
|
d758234ade | ||
|
|
c07a6f3ff3 | ||
|
|
d021f2e8a0 | ||
|
|
ca5f4e2135 | ||
|
|
3c6ea7ca82 | ||
|
|
8b15c84ea9 | ||
|
|
60edbf65b6 | ||
|
|
fe2b2a3b9d | ||
|
|
7332a7cafb | ||
|
|
23f8dca6fb | ||
|
|
b908376bef | ||
|
|
8b02afd9a9 | ||
|
|
3202cc6162 | ||
|
|
068f7ae264 | ||
|
|
68d2830ee9 | ||
|
|
2ecdd48683 | ||
|
|
6bd6b3a8a1 | ||
|
|
91b57cd6e5 | ||
|
|
d27a46f09b | ||
|
|
4abf4fbaac | ||
|
|
16a8281f71 | ||
|
|
534d2ca1d7 | ||
|
|
79954a1b07 | ||
|
|
b33074d893 | ||
|
|
0683adbf50 | ||
|
|
68e2c9a85f | ||
|
|
616a0099d1 | ||
|
|
665adcd4b7 | ||
|
|
91dc73ef44 | ||
|
|
14dc679ce0 | ||
|
|
ef6f040355 | ||
|
|
c1dd687af6 | ||
|
|
f435d6699d | ||
|
|
ba33665d1f | ||
|
|
67f053b672 | ||
|
|
cfb67752fe | ||
|
|
ba476bb6d8 | ||
|
|
7762192ecf | ||
|
|
b9fdb721f2 | ||
|
|
c830115c48 | ||
|
|
52af6e69f0 | ||
|
|
32be348af2 | ||
|
|
7e87499213 | ||
|
|
7719333f55 | ||
|
|
276452ca10 | ||
|
|
1b10dd7aae | ||
|
|
7aebb3cc42 | ||
|
|
6f444b2761 | ||
|
|
81d96c4421 | ||
|
|
10296ac665 | ||
|
|
ab0fa55780 | ||
|
|
409f2a041f | ||
|
|
dd75cba3ef | ||
|
|
ee588fe088 | ||
|
|
db4215f14a | ||
|
|
32afaaef93 | ||
|
|
0ac827848d | ||
|
|
c277bd6ce7 | ||
|
|
6d8443a245 | ||
|
|
53c83ee3ed | ||
|
|
fa1ae0abcd | ||
|
|
38ed72cd37 | ||
|
|
1099f3a071 | ||
|
|
6a4bdb027b | ||
|
|
7c0cbcf2f6 | ||
|
|
076e1fa348 | ||
|
|
cd5261ea6d | ||
|
|
4b994e14fb | ||
|
|
e62ee60c7a | ||
|
|
e237402c47 | ||
|
|
1c23d2b392 | ||
|
|
7ecd874bce | ||
|
|
49c37e6c1c | ||
|
|
dca8ae5f02 | ||
|
|
cf75a64651 | ||
|
|
0af1a9d270 | ||
|
|
1394cad30f | ||
|
|
18c0e9bd71 | ||
|
|
c70c1a22d2 | ||
|
|
5a4f6413d1 | ||
|
|
6d1b493f3d | ||
|
|
7840c4c70c | ||
|
|
9096f4f451 | ||
|
|
487538e87a | ||
|
|
e1fa945e7e | ||
|
|
cda6d891ab | ||
|
|
473003fbdf | ||
|
|
3f20303702 | ||
|
|
a1be8e7f9b | ||
|
|
8d97bed806 | ||
|
|
13ce9031cc | ||
|
|
95326a40ff | ||
|
|
8e329bb759 | ||
|
|
da82f59b69 | ||
|
|
ab1f80200a | ||
|
|
41eec4efa2 | ||
|
|
2045d83dd3 | ||
|
|
0da6c113ce | ||
|
|
fa6d78829f | ||
|
|
550e403f00 | ||
|
|
f99430d89e | ||
|
|
09a491378a | ||
|
|
9019a0a86c | ||
|
|
b2954e66e8 | ||
|
|
7c0f201075 | ||
|
|
0ecb57056f | ||
|
|
3be96564a8 | ||
|
|
0cb5650386 | ||
|
|
8f61e5cea7 | ||
|
|
34ff881ece | ||
|
|
af121ccad8 | ||
|
|
c81eb7e226 | ||
|
|
74fe1b95fb | ||
|
|
d1c769877a | ||
|
|
94891ff296 | ||
|
|
12a40e17a9 | ||
|
|
8ffc971138 | ||
|
|
f1d2e18508 | ||
|
|
1a02e84589 | ||
|
|
c79c0909d9 | ||
|
|
3fc5779b91 | ||
|
|
ff32546d81 | ||
|
|
99b036c9b2 | ||
|
|
33c02d4771 | ||
|
|
8373ca3641 | ||
|
|
3644a35027 | ||
|
|
542802af23 | ||
|
|
9547be37c2 | ||
|
|
974d5d5921 | ||
|
|
211605f0c5 | ||
|
|
a5b6f91e8d | ||
|
|
fbf3560886 | ||
|
|
07593b2422 | ||
|
|
cd423348d9 | ||
|
|
90821c6202 | ||
|
|
dee2ef8083 | ||
|
|
50a7d32af0 | ||
|
|
a5c6ecba8d | ||
|
|
7a53474f43 | ||
|
|
6b18f18b4c | ||
|
|
971f5bcedd | ||
|
|
42bbc5ce10 | ||
|
|
c01b6f4d09 | ||
|
|
9da2c96039 | ||
|
|
e8ab9a0d27 | ||
|
|
628c4e7af1 | ||
|
|
4ea7a65af7 | ||
|
|
d89861f651 | ||
|
|
0c8ccf7207 | ||
|
|
39dff07a27 | ||
|
|
84e6c7a9e5 | ||
|
|
c1400f6f12 | ||
|
|
889038f668 | ||
|
|
907a9d25e8 | ||
|
|
b3d72a95be | ||
|
|
b78944146a | ||
|
|
9b25b00fa3 | ||
|
|
ba41ecfa17 | ||
|
|
1ab6c35363 | ||
|
|
5162cb8ad6 | ||
|
|
8a2be299f4 | ||
|
|
f73a27cadc | ||
|
|
f332f14102 | ||
|
|
775cc1be66 | ||
|
|
f05e51362f | ||
|
|
ce515e993f | ||
|
|
a34197ef77 | ||
|
|
7f7e2ea72f | ||
|
|
4d384a8714 | ||
|
|
c44e6741ce | ||
|
|
94c3e0f702 | ||
|
|
c8846c0907 | ||
|
|
f9da9a0edb | ||
|
|
6372144be0 | ||
|
|
ef753b710b | ||
|
|
e6ba048701 | ||
|
|
71813f5e46 | ||
|
|
a6df3550cf | ||
|
|
8a57b3c972 | ||
|
|
f665e5d130 | ||
|
|
fa4b4d2033 | ||
|
|
a492632022 | ||
|
|
6c6f1f64c2 | ||
|
|
160312d945 | ||
|
|
badb81769a | ||
|
|
8b5d050267 | ||
|
|
2e7d2c8f74 | ||
|
|
3a0b64489f | ||
|
|
ee3551e45e | ||
|
|
1b0477a5a9 | ||
|
|
4ae2f77ba1 | ||
|
|
0a0f3c63a6 | ||
|
|
da0d15733c | ||
|
|
cb2feb9def | ||
|
|
abb0da9193 | ||
|
|
b6a141ea8a | ||
|
|
ca84361e4b | ||
|
|
09d9dd8873 | ||
|
|
925707c0f8 | ||
|
|
de24d7bd4c | ||
|
|
2f6e1a8cc3 | ||
|
|
40153716a3 | ||
|
|
7735141e73 | ||
|
|
5ede86ae51 | ||
|
|
3b7d31c1ed | ||
|
|
d4af0bb8f6 | ||
|
|
4eec66e479 | ||
|
|
4c070de4fb | ||
|
|
54faab69cb | ||
|
|
8136649e9d | ||
|
|
71358ddffd | ||
|
|
be5fbf7372 | ||
|
|
ba569a27cc | ||
|
|
0f76e492ae | ||
|
|
a90492a083 | ||
|
|
f4b4365c19 | ||
|
|
d792e75f2c | ||
|
|
41a3bff3da | ||
|
|
82b0aebef3 | ||
|
|
23ef5e4ba2 | ||
|
|
44154e0733 | ||
|
|
d22186bbbc | ||
|
|
b8983aa309 | ||
|
|
4dcde5aa3d | ||
|
|
99f0e45b61 | ||
|
|
7520f9f1c3 | ||
|
|
f208bf5a2d | ||
|
|
52b6eda4f2 | ||
|
|
73342f0ee0 | ||
|
|
0774386b23 | ||
|
|
e351972bc8 | ||
|
|
021e89b8c6 | ||
|
|
4dd44d9c20 | ||
|
|
31f39120b7 | ||
|
|
b9fb9c2380 | ||
|
|
14afbf361a | ||
|
|
bf6dc61967 | ||
|
|
1de496cf0f | ||
|
|
154fc29f58 | ||
|
|
52db6e370d | ||
|
|
672f24b1dc | ||
|
|
2f02d825f1 | ||
|
|
15108d6308 | ||
|
|
c771968ab6 | ||
|
|
b61e8b81f5 | ||
|
|
77f72aa6c3 | ||
|
|
b4a558041f | ||
|
|
8bad5f2a61 | ||
|
|
f0d611df9e | ||
|
|
013d043d22 | ||
|
|
382429e760 | ||
|
|
0b08491f83 | ||
|
|
5fbf4e348c | ||
|
|
73b1a965f7 | ||
|
|
42e4c34ff3 | ||
|
|
0df14c8393 | ||
|
|
60a2ee88a5 | ||
|
|
66a77a9b49 | ||
|
|
3b9103e4a6 | ||
|
|
77c66e0247 | ||
|
|
9f304291bd | ||
|
|
986c7949c0 | ||
|
|
69f5fe070d | ||
|
|
5dedda1448 | ||
|
|
24c43e9d34 | ||
|
|
50b87c4e68 | ||
|
|
ce8311c7e4 | ||
|
|
674da8ae07 | ||
|
|
84490052d4 | ||
|
|
19035292d0 | ||
|
|
81656a8466 | ||
|
|
76ba591957 | ||
|
|
1f8518c5d9 | ||
|
|
a52857cb02 | ||
|
|
9e01625779 | ||
|
|
6e1f867523 | ||
|
|
cd350e3829 | ||
|
|
0bededd7c5 | ||
|
|
a797e9efdf | ||
|
|
27893c64f3 | ||
|
|
dd4699c111 |
@@ -1,5 +1,10 @@
|
||||
# Google Android makefile for curl and libcurl
|
||||
#
|
||||
# This file can be used when building curl using the full Android source
|
||||
# release or the NDK. Most users do not want or need to do this; please
|
||||
# instead read the Android section in docs/INSTALL for alternate
|
||||
# methods.
|
||||
#
|
||||
# Place the curl source (including this makefile) into external/curl/ in the
|
||||
# Android source tree. Then build them with 'make curl' or just 'make libcurl'
|
||||
# from the Android root. Tested with Android versions 1.5, 2.1-2.3
|
||||
|
||||
@@ -2,17 +2,19 @@
|
||||
# Adds OPENSSL_INCLUDE_DIRS and libeay32
|
||||
include("${CMAKE_ROOT}/Modules/FindOpenSSL.cmake")
|
||||
|
||||
# Bill Hoffman told that libeay32 is necessary for him:
|
||||
find_library(SSL_LIBEAY NAMES libeay32)
|
||||
# starting 2.8 it is better to use standard modules
|
||||
if(CMAKE_MAJOR_VERSION EQUAL "2" AND CMAKE_MINOR_VERSION LESS "8")
|
||||
# Bill Hoffman told that libeay32 is necessary for him:
|
||||
find_library(SSL_LIBEAY NAMES libeay32)
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
if(SSL_LIBEAY)
|
||||
list(APPEND OPENSSL_LIBRARIES ${SSL_LIBEAY})
|
||||
else()
|
||||
set(OPENSSL_FOUND FALSE)
|
||||
if(OPENSSL_FOUND)
|
||||
if(SSL_LIBEAY)
|
||||
list(APPEND OPENSSL_LIBRARIES ${SSL_LIBEAY})
|
||||
else()
|
||||
set(OPENSSL_FOUND FALSE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif() # if (CMAKE_MAJOR_VERSION EQUAL "2" AND CMAKE_MINOR_VERSION LESS "8")
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# Locate zlib
|
||||
include("${CMAKE_ROOT}/Modules/FindZLIB.cmake")
|
||||
|
||||
find_library(ZLIB_LIBRARY_DEBUG NAMES zd zlibd zdlld zlib1d )
|
||||
|
||||
if(ZLIB_FOUND AND ZLIB_LIBRARY_DEBUG)
|
||||
set( ZLIB_LIBRARIES optimized "${ZLIB_LIBRARY}" debug ${ZLIB_LIBRARY_DEBUG})
|
||||
# starting 2.8 it is better to use standard modules
|
||||
if(CMAKE_MAJOR_VERSION EQUAL "2" AND CMAKE_MINOR_VERSION LESS "8")
|
||||
find_library(ZLIB_LIBRARY_DEBUG NAMES zd zlibd zdlld zlib1d )
|
||||
if(ZLIB_FOUND AND ZLIB_LIBRARY_DEBUG)
|
||||
set( ZLIB_LIBRARIES optimized "${ZLIB_LIBRARY}" debug ${ZLIB_LIBRARY_DEBUG})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -132,22 +132,6 @@ mark_as_advanced(DISABLED_THREADSAFE)
|
||||
option(ENABLE_IPV6 "Define if you want to enable IPv6 support" OFF)
|
||||
mark_as_advanced(ENABLE_IPV6)
|
||||
|
||||
if(WIN32)
|
||||
# Windows standard libraries are located in C:/Program Files/Microsoft SDKs/[...]
|
||||
# They are already included in the default MSVC LIBPATH => no find_library is needed!
|
||||
list_spaces_append_once(CMAKE_C_STANDARD_LIBRARIES wsock32.lib ws2_32.lib) # bufferoverflowu.lib
|
||||
if(CURL_DISABLE_LDAP)
|
||||
# Remove wldap32.lib from space-separated list
|
||||
string(REPLACE " " ";" _LIST ${CMAKE_C_STANDARD_LIBRARIES})
|
||||
list(REMOVE_ITEM _LIST "wldap32.lib")
|
||||
to_list_spaces(_LIST CMAKE_C_STANDARD_LIBRARIES)
|
||||
else()
|
||||
# Append wldap32.lib
|
||||
list_spaces_append_once(CMAKE_C_STANDARD_LIBRARIES wldap32.lib)
|
||||
endif()
|
||||
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}" CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
|
||||
# We need ansi c-flags, especially on HP
|
||||
set(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
|
||||
@@ -249,26 +233,28 @@ if(CURL_ZLIB) # AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE
|
||||
set(HAVE_ZLIB_H ON)
|
||||
set(HAVE_ZLIB ON)
|
||||
set(HAVE_LIBZ ON)
|
||||
list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
|
||||
mark_as_advanced(CMAKE_USE_OPENSSL)
|
||||
if(CMAKE_USE_OPENSSL)
|
||||
if(WIN32)
|
||||
find_package(OpenSSL)
|
||||
if(OPENSSL_FOUND)
|
||||
set(USE_SSLEAY TRUE)
|
||||
set(USE_OPENSSL TRUE)
|
||||
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} )
|
||||
else()
|
||||
set(CMAKE_USE_OPENSSL FALSE)
|
||||
message(STATUS "OpenSSL NOT Found, disabling CMAKE_USE_OPENSSL")
|
||||
endif()
|
||||
else(WIN32)
|
||||
check_library_exists_concat("crypto" CRYPTO_lock HAVE_LIBCRYPTO)
|
||||
check_library_exists_concat("ssl" SSL_connect HAVE_LIBSSL)
|
||||
endif(WIN32)
|
||||
|
||||
set(USE_SSLEAY OFF)
|
||||
set(USE_OPENSSL OFF)
|
||||
set(HAVE_LIBCRYPTO OFF)
|
||||
set(HAVE_LIBSSL OFF)
|
||||
|
||||
find_package(OpenSSL)
|
||||
if(OPENSSL_FOUND)
|
||||
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||
set(USE_SSLEAY ON)
|
||||
set(USE_OPENSSL ON)
|
||||
set(HAVE_LIBCRYPTO ON)
|
||||
set(HAVE_LIBSSL ON)
|
||||
endif(OPENSSL_FOUND)
|
||||
endif(CMAKE_USE_OPENSSL)
|
||||
|
||||
# If we have features.h, then do the _BSD_SOURCE magic
|
||||
@@ -334,14 +320,17 @@ check_include_file_concat("net/if.h" HAVE_NET_IF_H)
|
||||
check_include_file_concat("netdb.h" HAVE_NETDB_H)
|
||||
check_include_file_concat("netinet/in.h" HAVE_NETINET_IN_H)
|
||||
check_include_file_concat("netinet/tcp.h" HAVE_NETINET_TCP_H)
|
||||
check_include_file_concat("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H)
|
||||
check_include_file_concat("openssl/engine.h" HAVE_OPENSSL_ENGINE_H)
|
||||
check_include_file_concat("openssl/err.h" HAVE_OPENSSL_ERR_H)
|
||||
check_include_file_concat("openssl/pem.h" HAVE_OPENSSL_PEM_H)
|
||||
check_include_file_concat("openssl/pkcs12.h" HAVE_OPENSSL_PKCS12_H)
|
||||
check_include_file_concat("openssl/rsa.h" HAVE_OPENSSL_RSA_H)
|
||||
check_include_file_concat("openssl/ssl.h" HAVE_OPENSSL_SSL_H)
|
||||
check_include_file_concat("openssl/x509.h" HAVE_OPENSSL_X509_H)
|
||||
if(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
|
||||
check_include_file_concat("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H)
|
||||
check_include_file_concat("openssl/engine.h" HAVE_OPENSSL_ENGINE_H)
|
||||
check_include_file_concat("openssl/err.h" HAVE_OPENSSL_ERR_H)
|
||||
check_include_file_concat("openssl/pem.h" HAVE_OPENSSL_PEM_H)
|
||||
check_include_file_concat("openssl/pkcs12.h" HAVE_OPENSSL_PKCS12_H)
|
||||
check_include_file_concat("openssl/rsa.h" HAVE_OPENSSL_RSA_H)
|
||||
check_include_file_concat("openssl/ssl.h" HAVE_OPENSSL_SSL_H)
|
||||
check_include_file_concat("openssl/x509.h" HAVE_OPENSSL_X509_H)
|
||||
check_include_file_concat("openssl/rand.h" HAVE_OPENSSL_RAND_H)
|
||||
endif(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
|
||||
check_include_file_concat("pem.h" HAVE_PEM_H)
|
||||
check_include_file_concat("poll.h" HAVE_POLL_H)
|
||||
check_include_file_concat("pwd.h" HAVE_PWD_H)
|
||||
@@ -377,10 +366,6 @@ check_include_file_concat("sockio.h" HAVE_SOCKIO_H)
|
||||
check_include_file_concat("sys/utsname.h" HAVE_SYS_UTSNAME_H)
|
||||
check_include_file_concat("idna.h" HAVE_IDNA_H)
|
||||
|
||||
if(CMAKE_USE_OPENSSL)
|
||||
check_include_file_concat("openssl/rand.h" HAVE_OPENSSL_RAND_H)
|
||||
endif(CMAKE_USE_OPENSSL)
|
||||
|
||||
if(NOT HAVE_LDAP_H)
|
||||
message(STATUS "LDAP_H not found CURL_DISABLE_LDAP set ON")
|
||||
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
|
||||
@@ -816,9 +801,6 @@ endif(MSVC)
|
||||
function(SETUP_CURL_DEPENDENCIES TARGET_NAME)
|
||||
if(CURL_ZLIB AND ZLIB_FOUND)
|
||||
include_directories(${ZLIB_INCLUDE_DIR})
|
||||
endif()
|
||||
if(CURL_ZLIB AND ZLIB_FOUND)
|
||||
target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES})
|
||||
#ADD_DEFINITIONS( -DHAVE_ZLIB_H -DHAVE_ZLIB -DHAVE_LIBZ )
|
||||
endif()
|
||||
|
||||
@@ -826,9 +808,10 @@ function(SETUP_CURL_DEPENDENCIES TARGET_NAME)
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
endif()
|
||||
if(CMAKE_USE_OPENSSL AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||
target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES})
|
||||
#ADD_DEFINITIONS( -DUSE_SSLEAY )
|
||||
endif()
|
||||
|
||||
target_link_libraries(${TARGET_NAME} ${CURL_LIBS})
|
||||
endfunction()
|
||||
|
||||
# Ugly (but functional) way to include "Makefile.inc" by transforming it (= regenerate it).
|
||||
@@ -869,3 +852,13 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/curl"
|
||||
DESTINATION include
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
PATTERN "curlbuild.h" EXCLUDE)
|
||||
|
||||
|
||||
# Workaround for MSVS10 to avoid the Dialog Hell
|
||||
# FIXME: This could be removed with future version of CMake.
|
||||
if(MSVC_VERSION EQUAL 1600)
|
||||
set(CURL_SLN_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/CURL.sln")
|
||||
if(EXISTS "${CURL_SLN_FILENAME}")
|
||||
file(APPEND "${CURL_SLN_FILENAME}" "\n# This should be regenerated!\n")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
2
COPYING
2
COPYING
@@ -1,6 +1,6 @@
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright (c) 1996 - 2012, Daniel Stenberg, <daniel@haxx.se>.
|
||||
Copyright (c) 1996 - 2013, Daniel Stenberg, <daniel@haxx.se>.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
||||
6
GIT-INFO
6
GIT-INFO
@@ -48,9 +48,9 @@ installed:
|
||||
o nroff + perl
|
||||
|
||||
If you don't have nroff and perl and you for some reason don't want to
|
||||
install them, you can rename the source file src/hugehelp.c.cvs to
|
||||
src/hugehelp.c and avoid having to generate this file. This will give you
|
||||
a stubbed version of the file that doesn't contain actual content.
|
||||
install them, you can rename the source file src/tool_hugehelp.c.cvs to
|
||||
src/tool_hugehelp.c and avoid having to generate this file. This will
|
||||
give you a stubbed version of the file that doesn't contain actual content.
|
||||
|
||||
MAC OS X
|
||||
|
||||
|
||||
@@ -81,6 +81,9 @@ test-full:
|
||||
test-torture:
|
||||
@(cd tests; $(MAKE) all torture-test)
|
||||
|
||||
test-am:
|
||||
@(cd tests; $(MAKE) all am-test)
|
||||
|
||||
endif
|
||||
|
||||
examples:
|
||||
|
||||
128
RELEASE-NOTES
128
RELEASE-NOTES
@@ -1,52 +1,66 @@
|
||||
Curl and libcurl 7.27.0
|
||||
Curl and libcurl 7.29.0
|
||||
|
||||
Public curl releases: 128
|
||||
Public curl releases: 131
|
||||
Command line options: 152
|
||||
curl_easy_setopt() options: 199
|
||||
Public functions in libcurl: 58
|
||||
Known libcurl bindings: 39
|
||||
Contributors: 953
|
||||
Contributors: 993
|
||||
|
||||
This release includes the following securify fix:
|
||||
|
||||
o POP3/IMAP/SMTP SASL buffer overflow vulnerability [17]
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o nss: use human-readable error messages provided by NSS
|
||||
o added --metalink for metalink download support [5]
|
||||
o pop3: Added support for sasl plain text authentication
|
||||
o pop3: Added support for sasl login authentication
|
||||
o pop3: Added support for sasl ntlm authentication
|
||||
o pop3: Added support for sasl cram-md5 authentication
|
||||
o pop3: Added support for sasl digest-md5 authentication
|
||||
o pop3: Added support for apop authentication
|
||||
o Added support for Schannel (Native Windows) SSL/TLS encryption [2]
|
||||
o Added support for Darwin SSL (Native Mac OS X and iOS) [6]
|
||||
o http: print reason phrase from HTTP status line on error [8]
|
||||
o test: offer "automake" output and check for perl better
|
||||
o always-multi: always use non-blocking internals [1]
|
||||
o imap: Added support for sasl digest-md5 authentication
|
||||
o imap: Added support for sasl cram-md5 authentication
|
||||
o imap: Added support for sasl ntlm authentication
|
||||
o imap: Added support for sasl login authentication
|
||||
o imap: Added support for sasl plain text authentication
|
||||
o imap: Added support for login disabled server capability
|
||||
o mk-ca-bundle: add -f, support passing to stdout and more [5]
|
||||
o writeout: -w now supports remote_ip/port and local_ip/port
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o pop3: Fixed the issue of having to supply the user name for all requests
|
||||
o configure: fix LDAPS disabling related misplaced closing parenthesis
|
||||
o cmdline: made -D option work with -O and -J
|
||||
o configure: Fix libcurl.pc and curl-config generation for static MingW*
|
||||
cross builds
|
||||
o ssl: fix duplicated SSL handshake with multi interface and proxy [1]
|
||||
o winbuild: Fix Makefile.vc ignoring USE_IPV6 and USE_IDN flags
|
||||
o OpenSSL: support longer certificate subject names [3]
|
||||
o openldap: OOM fixes
|
||||
o log2changes.pl: fix the Version output
|
||||
o lib554.c: use curl_formadd() properly [4]
|
||||
o urldata.h: fix cyassl build clash with wincrypt.h
|
||||
o cookies: changed the URL in the cookiejar headers [7]
|
||||
o http-proxy: keep CONNECT connections alive (for NTLM)
|
||||
o NTLM SSPI: fixed to work with unicode user names and passwords
|
||||
o OOM fix in the curl tool when cloning cmdline options
|
||||
o fixed some examples to use curl_global_init() properly
|
||||
o cmdline: stricter numerical option parser
|
||||
o HTTP HEAD: don't force-close after response-headers
|
||||
o test231: fix wrong -C use
|
||||
o docs: switch to proper UTF-8 for text file encoding
|
||||
o keepalive: DragonFly uses milliseconds [9]
|
||||
o HTTP Digest: Client's "qop" value should not be quoted
|
||||
o make distclean works again
|
||||
o nss: prevent NSS from crashing on client auth hook failure
|
||||
o darwinssl: Fixed inability to disable peer verification on Snow Leopard
|
||||
and Lion
|
||||
o curl_multi_remove_handle: fix memory leak triggered with CURLOPT_RESOLVE
|
||||
o SCP: relative path didn't work as documented [7]
|
||||
o setup_once.h: HP-UX <sys/socket.h> issue workaround
|
||||
o configure: fix cross pkg-config detection
|
||||
o runtests: Do not add undefined values to @INC
|
||||
o build: fix compilation with CURL_DISABLE_CRYPTO_AUTH flag
|
||||
o multi: fix re-sending request on early connection close
|
||||
o HTTP: remove stray CRLF in chunk-encoded content-free request bodies
|
||||
o build: fix AIX compilation and usage of events/revents
|
||||
o VC Makefiles: add missing hostcheck
|
||||
o nss: clear session cache if a client certificate from file is used
|
||||
o nss: fix error messages for CURLE_SSL_{CACERT,CRL}_BADFILE
|
||||
o fix HTTP CONNECT tunnel establishment upon delayed response [2]
|
||||
o --libcurl: fix for non-zero default options
|
||||
o FTP: reject illegal port numbers in EPSV 229 responses
|
||||
o build: use per-target '_CPPFLAGS' for those currently using default
|
||||
o configure: fix automake 1.13 compatibility [6]
|
||||
o curl: ignore SIGPIPE [4]
|
||||
o pop3: Added support for non-blocking SSL upgrade
|
||||
o pop3: Fixed default authentication detection
|
||||
o imap: Fixed usernames and passwords that contain escape characters
|
||||
o packages/DOS/common.dj: remove COFF debug info generation [3]
|
||||
o imap/pop3/smtp: Fixed failure detection during TLS upgrade [8]
|
||||
o pop3: Fixed no known authentication mechanism when fallback is required [9]
|
||||
o formadd: reject trying to read a directory where a file is expected [10]
|
||||
o formpost: support quotes, commas and semicolon in file names [11]
|
||||
o docs: update the comments about loading CA certs with NSS [12]
|
||||
o docs: fix typos in man pages [13]
|
||||
o darwinssl: Fix bug where packets were sometimes transmitted twice [14]
|
||||
o winbuild: include version info for .dll .exe [15]
|
||||
o schannel: Removed extended error connection setup flag [16]
|
||||
o VMS: fix and generate the VMS build config
|
||||
|
||||
This release includes the following known bugs:
|
||||
|
||||
@@ -55,22 +69,32 @@ This release includes the following known bugs:
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Anthony Bryan, Guenter Knauf, Kamil Dudka, Steve Holme, Tatsuhiro Tsujikawa,
|
||||
Yang Tse, Gokhan Sengun, Marc Hoersken, Ghennadi Procopciuc, Gisle Vanem,
|
||||
Mark Salisbury, Anthony G. Basile, Enrico Scholz, Robert B. Harris,
|
||||
Neil Bowers, Marcel Raad, Christian Hägele, Philip Craig, Nick Zitzmann,
|
||||
Eelco Dolstra, Anton Yabchinskiy, Santhana Todatry, John Marino
|
||||
Nick Zitzmann, Colin Watson, Fabian Keil, Kamil Dudka, Lijo Antony,
|
||||
Linus Nielsen Feltzing, Marc Hoersken, Stanislav Ivochkin, Steve Holme,
|
||||
Yang Tse, Balaji Parasuram, Dan Fandrich, Bob Relyea, Gisle Vanem,
|
||||
Yves Arrouye, Kai Engert, Lluís Batlle i Rossell, Jirí Hruka,
|
||||
John E. Malmberg, Tor Arntsen, Matt Arsenault, Sergei Nikulov,
|
||||
Guenter Knauf, Craig Davison, Ulrich Doehner, Jiri Jaburek, Bruno de Carvalho,
|
||||
Eldar Zaitov
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
||||
References to bug reports and discussions on issues:
|
||||
|
||||
[1] = https://bugzilla.redhat.com/788526
|
||||
[2] = http://daniel.haxx.se/blog/2012/06/12/schannel-support-in-libcurl/
|
||||
[3] = http://curl.haxx.se/bug/view.cgi?id=3533045
|
||||
[4] = http://curl.haxx.se/mail/lib-2012-06/0001.html
|
||||
[5] = http://daniel.haxx.se/blog/2012/06/03/curling-the-metalink/
|
||||
[6] = http://daniel.haxx.se/blog/2012/06/28/darwin-native-ssl-for-curl/
|
||||
[7] = http://daniel.haxx.se/blog/2012/07/08/curls-new-http-cookies-docs/
|
||||
[8] = https://bugzilla.redhat.com/676596
|
||||
[9] = http://curl.haxx.se/bug/view.cgi?id=3546257
|
||||
[1] = http://daniel.haxx.se/blog/2013/01/17/internally-were-all-multi-now/
|
||||
[2] = http://curl.haxx.se/mail/lib-2013-01/0191.html
|
||||
[3] = http://curl.haxx.se/mail/lib-2013-01/0130.html
|
||||
[4] = http://curl.haxx.se/bug/view.cgi?id=1180
|
||||
[5] = http://curl.haxx.se/mail/lib-2013-01/0045.html
|
||||
[6] = http://curl.haxx.se/mail/lib-2012-12/0246.html
|
||||
[7] = http://curl.haxx.se/bug/view.cgi?id=1173
|
||||
[8] = http://curl.haxx.se/mail/lib-2013-01/0250.html
|
||||
[9] = http://curl.haxx.se/mail/lib-2013-02/0004.html
|
||||
[10] = http://curl.haxx.se/mail/archive-2013-01/0017.html
|
||||
[11] = http://curl.haxx.se/bug/view.cgi?id=1171
|
||||
[12] = https://bugzilla.redhat.com/696783
|
||||
[13] = https://bugzilla.redhat.com/896544
|
||||
[14] = http://curl.haxx.se/mail/lib-2013-01/0295.html
|
||||
[15] = http://curl.haxx.se/bug/view.cgi?id=1186
|
||||
[16] = http://curl.haxx.se/bug/view.cgi?id=1187
|
||||
[17] = http://curl.haxx.se/docs/adv_20130206.html
|
||||
|
||||
19
TODO-RELEASE
19
TODO-RELEASE
@@ -1,21 +1,14 @@
|
||||
Try to fix in 7.27
|
||||
==================
|
||||
|
||||
313 - host.name vs. host.dispname and "(nil)" outputs
|
||||
|
||||
To be addressed in 7.28
|
||||
To be addressed in 7.29
|
||||
=======================
|
||||
|
||||
310 - a new authentication callback
|
||||
|
||||
312 - custom Content-Length appears in CONNECT, solve it by offering a separate
|
||||
option to provide headers for the CONNECT request
|
||||
|
||||
314 - CURL_SOCKOPTFUNCTION for accept()ed connection
|
||||
|
||||
315 - multiple receivers with SMTP and one fails
|
||||
312 - custom Content-Length appears in CONNECT, solve it by offering a
|
||||
separate option to provide headers for the CONNECT request:
|
||||
http://curl.haxx.se/mail/lib-2012-09/0059.html
|
||||
|
||||
317 - CURLINFO_SSL_TRUST to return SSL-specific data for a darwinssl build
|
||||
|
||||
318 -
|
||||
322 - pipelining improvements
|
||||
|
||||
327 -
|
||||
|
||||
59
acinclude.m4
59
acinclude.m4
@@ -130,7 +130,7 @@ int main (void)
|
||||
]])
|
||||
],[
|
||||
tst_lib_xnet_required="yes"
|
||||
LIBS="$LIBS -lxnet"
|
||||
LIBS="-lxnet $LIBS"
|
||||
])
|
||||
AC_MSG_RESULT([$tst_lib_xnet_required])
|
||||
])
|
||||
@@ -150,6 +150,7 @@ AC_DEFUN([CURL_CHECK_AIX_ALL_SOURCE], [
|
||||
#endif])
|
||||
AC_BEFORE([$0], [AC_SYS_LARGEFILE])dnl
|
||||
AC_BEFORE([$0], [CURL_CONFIGURE_REENTRANT])dnl
|
||||
AC_BEFORE([$0], [CURL_CONFIGURE_PULL_SYS_POLL])dnl
|
||||
AC_MSG_CHECKING([if OS is AIX (to define _ALL_SOURCE)])
|
||||
AC_EGREP_CPP([yes_this_is_aix],[
|
||||
#ifdef _AIX
|
||||
@@ -2153,7 +2154,6 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
|
||||
else
|
||||
LIBS="$curl_cv_gclk_LIBS $curl_cv_save_LIBS"
|
||||
fi
|
||||
CURL_LIBS="$CURL_LIBS $curl_cv_gclk_LIBS"
|
||||
AC_MSG_RESULT([$curl_cv_gclk_LIBS])
|
||||
ac_cv_func_clock_gettime="yes"
|
||||
;;
|
||||
@@ -2310,6 +2310,8 @@ AC_DEFUN([CURL_CONFIGURE_CURL_SOCKLEN_T], [
|
||||
AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
|
||||
AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl
|
||||
#
|
||||
AC_BEFORE([$0], [CURL_CONFIGURE_PULL_SYS_POLL])dnl
|
||||
#
|
||||
AC_MSG_CHECKING([for curl_socklen_t data type])
|
||||
curl_typeof_curl_socklen_t="unknown"
|
||||
for arg1 in int SOCKET; do
|
||||
@@ -2418,6 +2420,45 @@ AC_DEFUN([CURL_CONFIGURE_CURL_SOCKLEN_T], [
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CONFIGURE_PULL_SYS_POLL
|
||||
dnl -------------------------------------------------
|
||||
dnl Find out if system header file sys/poll.h must be included by the
|
||||
dnl external interface, making appropriate definitions for template file
|
||||
dnl include/curl/curlbuild.h.in to properly configure and use the library.
|
||||
dnl
|
||||
dnl The need for the sys/poll.h inclusion arises mainly to properly
|
||||
dnl interface AIX systems which define macros 'events' and 'revents'.
|
||||
|
||||
AC_DEFUN([CURL_CONFIGURE_PULL_SYS_POLL], [
|
||||
AC_REQUIRE([CURL_INCLUDES_POLL])dnl
|
||||
#
|
||||
tst_poll_events_macro_defined="unknown"
|
||||
#
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$curl_includes_poll
|
||||
]],[[
|
||||
#if defined(events) || defined(revents)
|
||||
return 0;
|
||||
#else
|
||||
force compilation error
|
||||
#endif
|
||||
]])
|
||||
],[
|
||||
tst_poll_events_macro_defined="yes"
|
||||
],[
|
||||
tst_poll_events_macro_defined="no"
|
||||
])
|
||||
#
|
||||
if test "$tst_poll_events_macro_defined" = "yes"; then
|
||||
if test "x$ac_cv_header_sys_poll_h" = "xyes"; then
|
||||
CURL_DEFINE_UNQUOTED([CURL_PULL_SYS_POLL_H])
|
||||
fi
|
||||
fi
|
||||
#
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_FUNC_SELECT
|
||||
dnl -------------------------------------------------
|
||||
dnl Test if the socket select() function is available,
|
||||
@@ -3215,8 +3256,8 @@ AC_DEFUN([CURL_EXPORT_PCDIR], [
|
||||
|
||||
dnl CURL_CHECK_PKGCONFIG ($module, [$pcdir])
|
||||
dnl ------------------------
|
||||
dnl search for the pkg-config tool (if not cross-compiling). Set the PKGCONFIG
|
||||
dnl variable to hold the path to it, or 'no' if not found/present.
|
||||
dnl search for the pkg-config tool. Set the PKGCONFIG variable to hold the
|
||||
dnl path to it, or 'no' if not found/present.
|
||||
dnl
|
||||
dnl If pkg-config is present, check that it has info about the $module or
|
||||
dnl return "no" anyway!
|
||||
@@ -3228,15 +3269,7 @@ AC_DEFUN([CURL_CHECK_PKGCONFIG], [
|
||||
|
||||
PKGCONFIG="no"
|
||||
|
||||
if test x$cross_compiling = xyes; then
|
||||
dnl see if there's a pkg-specific for this host setup
|
||||
AC_PATH_PROG( PKGCONFIG, ${host}-pkg-config, no,
|
||||
$PATH:/usr/bin:/usr/local/bin)
|
||||
fi
|
||||
|
||||
if test x$PKGCONFIG = xno; then
|
||||
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
|
||||
fi
|
||||
AC_PATH_TOOL( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
|
||||
|
||||
if test x$PKGCONFIG != xno; then
|
||||
AC_MSG_CHECKING([for $1 options with pkg-config])
|
||||
|
||||
@@ -12,9 +12,9 @@ ECHO ERROR: This file shall only be used with a curl git tree checkout.
|
||||
goto end_all
|
||||
:start_doing
|
||||
|
||||
REM create hugehelp.c
|
||||
if not exist src\hugehelp.c.cvs goto end_hugehelp_c
|
||||
copy /Y src\hugehelp.c.cvs src\hugehelp.c
|
||||
REM create tool_hugehelp.c
|
||||
if not exist src\tool_hugehelp.c.cvs goto end_hugehelp_c
|
||||
copy /Y src\tool_hugehelp.c.cvs src\tool_hugehelp.c
|
||||
:end_hugehelp_c
|
||||
|
||||
REM create Makefile
|
||||
|
||||
351
configure.ac
351
configure.ac
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2013, 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
|
||||
@@ -27,15 +27,16 @@ dnl We don't know the version number "statically" so we use a dash here
|
||||
AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/])
|
||||
|
||||
XC_OVR_ZZ50
|
||||
XC_OVR_ZZ60
|
||||
CURL_OVERRIDE_AUTOCONF
|
||||
|
||||
dnl configure script copyright
|
||||
AC_COPYRIGHT([Copyright (c) 1998 - 2011 Daniel Stenberg, <daniel@haxx.se>
|
||||
AC_COPYRIGHT([Copyright (c) 1998 - 2013 Daniel Stenberg, <daniel@haxx.se>
|
||||
This configure script may be copied, distributed and modified under the
|
||||
terms of the curl license; see COPYING for more details])
|
||||
|
||||
AC_CONFIG_SRCDIR([lib/urldata.h])
|
||||
AM_CONFIG_HEADER(lib/curl_config.h include/curl/curlbuild.h)
|
||||
AC_CONFIG_HEADERS(lib/curl_config.h include/curl/curlbuild.h)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
@@ -47,7 +48,7 @@ CURL_CHECK_OPTION_CURLDEBUG
|
||||
CURL_CHECK_OPTION_SYMBOL_HIDING
|
||||
CURL_CHECK_OPTION_ARES
|
||||
|
||||
CURL_CHECK_PATH_SEPARATOR_REQUIRED
|
||||
XC_CHECK_PATH_SEPARATOR
|
||||
|
||||
#
|
||||
# save the configure arguments
|
||||
@@ -124,6 +125,7 @@ fi
|
||||
|
||||
dnl figure out the libcurl version
|
||||
CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
|
||||
XC_CHECK_PROG_CC
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_MSG_CHECKING([curl version])
|
||||
AC_MSG_RESULT($CURLVERSION)
|
||||
@@ -145,7 +147,7 @@ AC_SUBST(PKGADD_VENDOR)
|
||||
|
||||
dnl
|
||||
dnl initialize all the info variables
|
||||
curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl} )"
|
||||
curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )"
|
||||
curl_ssh_msg="no (--with-libssh2)"
|
||||
curl_zlib_msg="no (--with-zlib)"
|
||||
curl_krb4_msg="no (--with-krb4*)"
|
||||
@@ -168,9 +170,10 @@ curl_verbose_msg="enabled (--disable-verbose)"
|
||||
init_ssl_msg=${curl_ssl_msg}
|
||||
|
||||
dnl
|
||||
dnl Save anything in $LIBS for later
|
||||
dnl Save some initial values the user might have provided
|
||||
dnl
|
||||
ALL_LIBS=$LIBS
|
||||
INITIAL_LDFLAGS=$LDFLAGS
|
||||
INITIAL_LIBS=$LIBS
|
||||
|
||||
dnl
|
||||
dnl Detect the canonical host and target build environment
|
||||
@@ -181,7 +184,6 @@ dnl Get system canonical name
|
||||
AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
|
||||
|
||||
dnl Checks for programs.
|
||||
CURL_CHECK_PROG_CC
|
||||
|
||||
dnl Our curl_off_t internal and external configure settings
|
||||
CURL_CONFIGURE_CURL_OFF_T
|
||||
@@ -273,6 +275,7 @@ else
|
||||
REQUIRE_LIB_DEPS=yes
|
||||
fi
|
||||
AC_SUBST(REQUIRE_LIB_DEPS)
|
||||
AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
|
||||
|
||||
dnl The install stuff has already been taken care of by the automake stuff
|
||||
dnl AC_PROG_INSTALL
|
||||
@@ -305,6 +308,7 @@ fi
|
||||
|
||||
CURL_CHECK_COMPILER_HALT_ON_ERROR
|
||||
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
|
||||
CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
|
||||
CURL_CHECK_COMPILER_SYMBOL_HIDING
|
||||
|
||||
CURL_CHECK_NO_UNDEFINED
|
||||
@@ -681,6 +685,20 @@ dnl **********************************************************************
|
||||
dnl Checks for libraries.
|
||||
dnl **********************************************************************
|
||||
|
||||
AC_MSG_CHECKING([whether to use libgcc])
|
||||
AC_ARG_ENABLE(libgcc,
|
||||
AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
|
||||
[ case "$enableval" in
|
||||
yes)
|
||||
LIBS="-lgcc $LIBS"
|
||||
AC_MSG_RESULT(yes)
|
||||
;;
|
||||
*) AC_MSG_RESULT(no)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
CURL_CHECK_LIB_XNET
|
||||
|
||||
dnl gethostbyname without lib or in the nsl lib?
|
||||
@@ -689,7 +707,7 @@ AC_CHECK_FUNC(gethostbyname,
|
||||
],
|
||||
[ AC_CHECK_LIB(nsl, gethostbyname,
|
||||
[HAVE_GETHOSTBYNAME="1"
|
||||
LIBS="$LIBS -lnsl"
|
||||
LIBS="-lnsl $LIBS"
|
||||
])
|
||||
])
|
||||
|
||||
@@ -698,7 +716,7 @@ then
|
||||
dnl gethostbyname in the socket lib?
|
||||
AC_CHECK_LIB(socket, gethostbyname,
|
||||
[HAVE_GETHOSTBYNAME="1"
|
||||
LIBS="$LIBS -lsocket"
|
||||
LIBS="-lsocket $LIBS"
|
||||
])
|
||||
fi
|
||||
|
||||
@@ -709,7 +727,7 @@ then
|
||||
[HAVE_GETHOSTBYNAME="1"
|
||||
CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
|
||||
LDFLAGS="-L/dev/env/WATT_ROOT/lib"
|
||||
LIBS="$LIBS -lwatt"
|
||||
LIBS="-lwatt $LIBS"
|
||||
])
|
||||
fi
|
||||
|
||||
@@ -828,7 +846,7 @@ then
|
||||
dnl gethostbyname in the network lib - for Haiku OS
|
||||
AC_CHECK_LIB(network, gethostbyname,
|
||||
[HAVE_GETHOSTBYNAME="1"
|
||||
LIBS="$LIBS -lnetwork"
|
||||
LIBS="-lnetwork $LIBS"
|
||||
])
|
||||
fi
|
||||
|
||||
@@ -837,7 +855,7 @@ then
|
||||
dnl gethostbyname in the net lib - for BeOS
|
||||
AC_CHECK_LIB(net, gethostbyname,
|
||||
[HAVE_GETHOSTBYNAME="1"
|
||||
LIBS="$LIBS -lnet"
|
||||
LIBS="-lnet $LIBS"
|
||||
])
|
||||
fi
|
||||
|
||||
@@ -869,25 +887,108 @@ CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl The preceding library checks are all potentially useful for test
|
||||
dnl servers (for providing networking support). Save the list of required
|
||||
dnl libraries at this point for use while linking those test servers.
|
||||
dnl servers and libtest cases which require networking and clock_gettime
|
||||
dnl support. Save the list of required libraries at this point for use
|
||||
dnl while linking those test servers and programs.
|
||||
dnl **********************************************************************
|
||||
TEST_SERVER_LIBS=$LIBS
|
||||
CURL_NETWORK_AND_TIME_LIBS=$LIBS
|
||||
|
||||
dnl **********************************************************************
|
||||
AC_MSG_CHECKING([whether to use libgcc])
|
||||
AC_ARG_ENABLE(libgcc,
|
||||
AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
|
||||
[ case "$enableval" in
|
||||
yes)
|
||||
ALL_LIBS="$ALL_LIBS -lgcc"
|
||||
AC_MSG_RESULT(yes)
|
||||
;;
|
||||
*) AC_MSG_RESULT(no)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
dnl Check for the presence of ZLIB libraries and headers
|
||||
dnl **********************************************************************
|
||||
|
||||
dnl Check for & handle argument to --with-zlib.
|
||||
|
||||
clean_CPPFLAGS=$CPPFLAGS
|
||||
clean_LDFLAGS=$LDFLAGS
|
||||
clean_LIBS=$LIBS
|
||||
ZLIB_LIBS=""
|
||||
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"])
|
||||
|
||||
if test "$OPT_ZLIB" = "no" ; then
|
||||
AC_MSG_WARN([zlib disabled])
|
||||
else
|
||||
if test "$OPT_ZLIB" = "yes" ; then
|
||||
OPT_ZLIB=""
|
||||
fi
|
||||
|
||||
if test -z "$OPT_ZLIB" ; then
|
||||
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,
|
||||
dnl libz found, set the variable
|
||||
[HAVE_LIBZ="1"
|
||||
LIBS="-lz $LIBS"],
|
||||
dnl if no lib found, try /usr/local
|
||||
[OPT_ZLIB="/usr/local"])
|
||||
|
||||
fi
|
||||
|
||||
dnl Add a nonempty path to the compiler flags
|
||||
if test -n "$OPT_ZLIB"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
|
||||
LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADER(zlib.h,
|
||||
[
|
||||
dnl zlib.h was found
|
||||
HAVE_ZLIB_H="1"
|
||||
dnl if the lib wasn't found already, try again with the new paths
|
||||
if test "$HAVE_LIBZ" != "1"; then
|
||||
AC_CHECK_LIB(z, gzread,
|
||||
[
|
||||
dnl the lib was found!
|
||||
HAVE_LIBZ="1"
|
||||
LIBS="-lz $LIBS"
|
||||
],
|
||||
[ CPPFLAGS=$clean_CPPFLAGS
|
||||
LDFLAGS=$clean_LDFLAGS])
|
||||
fi
|
||||
],
|
||||
[
|
||||
dnl zlib.h was not found, restore the flags
|
||||
CPPFLAGS=$clean_CPPFLAGS
|
||||
LDFLAGS=$clean_LDFLAGS]
|
||||
)
|
||||
|
||||
if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
|
||||
then
|
||||
AC_MSG_WARN([configure found only the libz lib, not the header file!])
|
||||
HAVE_LIBZ=""
|
||||
CPPFLAGS=$clean_CPPFLAGS
|
||||
LDFLAGS=$clean_LDFLAGS
|
||||
LIBS=$clean_LIBS
|
||||
elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
|
||||
then
|
||||
AC_MSG_WARN([configure found only the libz header file, not the lib!])
|
||||
CPPFLAGS=$clean_CPPFLAGS
|
||||
LDFLAGS=$clean_LDFLAGS
|
||||
LIBS=$clean_LIBS
|
||||
elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
|
||||
then
|
||||
dnl both header and lib were found!
|
||||
AC_SUBST(HAVE_LIBZ)
|
||||
AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
|
||||
AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
|
||||
|
||||
ZLIB_LIBS="-lz"
|
||||
LIBS="-lz $clean_LIBS"
|
||||
|
||||
dnl replace 'HAVE_LIBZ' in the automake makefile.ams
|
||||
AMFIXLIB="1"
|
||||
AC_MSG_NOTICE([found both libz and libz.h header])
|
||||
curl_zlib_msg="enabled"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl set variable for use in automakefile(s)
|
||||
AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
|
||||
AC_SUBST(ZLIB_LIBS)
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for LDAP
|
||||
@@ -1313,29 +1414,29 @@ if test x"$want_gss" = xyes; then
|
||||
if test -n "$gnu_gss"; then
|
||||
curl_gss_msg="enabled (GNU GSS)"
|
||||
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
|
||||
LIBS="$LIBS -lgss"
|
||||
LIBS="-lgss $LIBS"
|
||||
elif test -z "$GSSAPI_LIB_DIR"; then
|
||||
case $host in
|
||||
*-*-darwin*)
|
||||
LIBS="$LIBS -lgssapi_krb5 -lresolv"
|
||||
LIBS="-lgssapi_krb5 -lresolv $LIBS"
|
||||
;;
|
||||
*)
|
||||
if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
|
||||
dnl krb5-config doesn't have --libs-only-L or similar, put everything
|
||||
dnl into LIBS
|
||||
gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
|
||||
LIBS="$LIBS $gss_libs"
|
||||
LIBS="$gss_libs $LIBS"
|
||||
elif test "$GSSAPI_ROOT" != "yes"; then
|
||||
LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
|
||||
LIBS="$LIBS -lgssapi"
|
||||
LIBS="-lgssapi $LIBS"
|
||||
else
|
||||
LIBS="$LIBS -lgssapi"
|
||||
LIBS="-lgssapi $LIBS"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
|
||||
LIBS="$LIBS -lgssapi"
|
||||
LIBS="-lgssapi $LIBS"
|
||||
fi
|
||||
else
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
@@ -1482,7 +1583,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
||||
dnl the argument to --with-ssl we don't know what
|
||||
dnl additional libs may be necessary. Hope that we
|
||||
dnl don't need any.
|
||||
LIBS="$LIBS $SSL_LIBS"
|
||||
LIBS="$SSL_LIBS $LIBS"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1534,7 +1635,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
||||
dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
|
||||
AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
|
||||
OLIBS=$LIBS
|
||||
LIBS="$LIBS -lRSAglue -lrsaref"
|
||||
LIBS="-lRSAglue -lrsaref $LIBS"
|
||||
AC_CHECK_LIB(ssl, SSL_connect)
|
||||
if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
|
||||
dnl still no SSL_connect
|
||||
@@ -1649,92 +1750,6 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
|
||||
|
||||
fi
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the presence of ZLIB libraries and headers
|
||||
dnl **********************************************************************
|
||||
|
||||
dnl Check for & handle argument to --with-zlib.
|
||||
|
||||
_cppflags=$CPPFLAGS
|
||||
_ldflags=$LDFLAGS
|
||||
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"])
|
||||
|
||||
if test "$OPT_ZLIB" = "no" ; then
|
||||
AC_MSG_WARN([zlib disabled])
|
||||
else
|
||||
if test "$OPT_ZLIB" = "yes" ; then
|
||||
OPT_ZLIB=""
|
||||
fi
|
||||
|
||||
if test -z "$OPT_ZLIB" ; then
|
||||
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,
|
||||
dnl libz found, set the variable
|
||||
[HAVE_LIBZ="1"],
|
||||
dnl if no lib found, try /usr/local
|
||||
[OPT_ZLIB="/usr/local"])
|
||||
|
||||
fi
|
||||
|
||||
dnl Add a nonempty path to the compiler flags
|
||||
if test -n "$OPT_ZLIB"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
|
||||
LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADER(zlib.h,
|
||||
[
|
||||
dnl zlib.h was found
|
||||
HAVE_ZLIB_H="1"
|
||||
dnl if the lib wasn't found already, try again with the new paths
|
||||
if test "$HAVE_LIBZ" != "1"; then
|
||||
AC_CHECK_LIB(z, gzread,
|
||||
[
|
||||
dnl the lib was found!
|
||||
HAVE_LIBZ="1"
|
||||
],
|
||||
[ CPPFLAGS=$_cppflags
|
||||
LDFLAGS=$_ldflags])
|
||||
fi
|
||||
],
|
||||
[
|
||||
dnl zlib.h was not found, restore the flags
|
||||
CPPFLAGS=$_cppflags
|
||||
LDFLAGS=$_ldflags]
|
||||
)
|
||||
|
||||
if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
|
||||
then
|
||||
AC_MSG_WARN([configure found only the libz lib, not the header file!])
|
||||
HAVE_LIBZ=""
|
||||
elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
|
||||
then
|
||||
AC_MSG_WARN([configure found only the libz header file, not the lib!])
|
||||
elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
|
||||
then
|
||||
dnl both header and lib were found!
|
||||
AC_SUBST(HAVE_LIBZ)
|
||||
AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
|
||||
AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
|
||||
|
||||
CURL_LIBS="$CURL_LIBS -lz"
|
||||
LIBS="$LIBS -lz"
|
||||
|
||||
dnl replace 'HAVE_LIBZ' in the automake makefile.ams
|
||||
AMFIXLIB="1"
|
||||
AC_MSG_NOTICE([found both libz and libz.h header])
|
||||
curl_zlib_msg="enabled"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl set variable for use in automakefile(s)
|
||||
AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the random seed preferences
|
||||
dnl **********************************************************************
|
||||
@@ -1799,6 +1814,11 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
if test X"$OPT_GNUTLS" != Xno; then
|
||||
|
||||
addld=""
|
||||
addlib=""
|
||||
gtlslib=""
|
||||
version=""
|
||||
addcflags=""
|
||||
|
||||
if test "x$OPT_GNUTLS" = "xyes"; then
|
||||
dnl this is with no partiular path given
|
||||
CURL_CHECK_PKGCONFIG(gnutls)
|
||||
@@ -1849,9 +1869,9 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
|
||||
CLEANLIBS="$LIBS"
|
||||
CLEANCPPFLAGS="$CPPFLAGS"
|
||||
CLEADLDFLAGS="$LDFLAGS"
|
||||
CLEANLDFLAGS="$LDFLAGS"
|
||||
|
||||
LIBS="$LIBS $addlib"
|
||||
LIBS="$addlib $LIBS"
|
||||
LDFLAGS="$LDFLAGS $addld"
|
||||
if test "$addcflags" != "-I/usr/include"; then
|
||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||
@@ -1916,9 +1936,9 @@ if test "$GNUTLS_ENABLED" = "1"; then
|
||||
if test "$USE_GNUTLS_NETTLE" = "1"; then
|
||||
AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend])
|
||||
AC_SUBST(USE_GNUTLS_NETTLE, [1])
|
||||
LIBS="$LIBS -lnettle"
|
||||
LIBS="-lnettle $LIBS"
|
||||
else
|
||||
LIBS="$LIBS -lgcrypt"
|
||||
LIBS="-lgcrypt $LIBS"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1969,6 +1989,11 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
])
|
||||
fi
|
||||
|
||||
addld=""
|
||||
addlib=""
|
||||
addcflags=""
|
||||
polarssllib=""
|
||||
|
||||
if test "x$USE_POLARSSL" != "xyes"; then
|
||||
dnl add the path and test again
|
||||
addld=-L$OPT_POLARSSL/lib$libsuff
|
||||
@@ -1997,8 +2022,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
if test "x$USE_POLARSSL" = "xyes"; then
|
||||
AC_MSG_NOTICE([detected PolarSSL])
|
||||
|
||||
CURL_LIBS="$CURL_LIBS -lpolarssl"
|
||||
LIBS="$LIBS -lpolarssl"
|
||||
LIBS="-lpolarssl $LIBS"
|
||||
|
||||
if test -n "$polarssllib"; then
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
@@ -2053,6 +2077,11 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
])
|
||||
fi
|
||||
|
||||
addld=""
|
||||
addlib=""
|
||||
addcflags=""
|
||||
cyassllib=""
|
||||
|
||||
if test "x$USE_CYASSL" != "xyes"; then
|
||||
dnl add the path and test again
|
||||
addld=-L$OPT_CYASSL/lib$libsuff
|
||||
@@ -2081,8 +2110,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
if test "x$USE_CYASSL" = "xyes"; then
|
||||
AC_MSG_NOTICE([detected CyaSSL])
|
||||
|
||||
CURL_LIBS="$CURL_LIBS -lcyassl -lm"
|
||||
LIBS="$LIBS -lcyassl -lm"
|
||||
LIBS="-lcyassl -lm $LIBS"
|
||||
|
||||
if test -n "$cyassllib"; then
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
@@ -2117,6 +2145,13 @@ AC_HELP_STRING([--without-nss], [disable NSS detection]),
|
||||
if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
|
||||
if test X"$OPT_NSS" != Xno; then
|
||||
|
||||
addld=""
|
||||
addlib=""
|
||||
addcflags=""
|
||||
nssprefix=""
|
||||
version=""
|
||||
|
||||
if test "x$OPT_NSS" = "xyes"; then
|
||||
|
||||
CURL_CHECK_PKGCONFIG(nss)
|
||||
@@ -2154,7 +2189,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
|
||||
CLEANLIBS="$LIBS"
|
||||
CLEANCPPFLAGS="$CPPFLAGS"
|
||||
|
||||
LIBS="$LIBS $addlib"
|
||||
LIBS="$addlib $LIBS"
|
||||
if test "$addcflags" != "-I/usr/include"; then
|
||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||
fi
|
||||
@@ -2284,11 +2319,12 @@ AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]),
|
||||
|
||||
if test X"$OPT_LIBMETALINK" != Xno; then
|
||||
|
||||
addlib=""
|
||||
addld=""
|
||||
addlib=""
|
||||
addcflags=""
|
||||
version=""
|
||||
libmetalinklib=""
|
||||
|
||||
PKGTEST="no"
|
||||
if test "x$OPT_LIBMETALINK" = "xyes"; then
|
||||
dnl this is with no partiular path given
|
||||
@@ -2348,10 +2384,10 @@ if test X"$OPT_LIBMETALINK" != Xno; then
|
||||
AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support])
|
||||
LIBMETALINK_LIBS=$addlib
|
||||
LIBMETALINK_LDFLAGS=$addld
|
||||
LIBMETALINK_CFLAGS=$addcflags
|
||||
LIBMETALINK_CPPFLAGS=$addcflags
|
||||
AC_SUBST([LIBMETALINK_LIBS])
|
||||
AC_SUBST([LIBMETALINK_LDFLAGS])
|
||||
AC_SUBST([LIBMETALINK_CFLAGS])
|
||||
AC_SUBST([LIBMETALINK_CPPFLAGS])
|
||||
curl_mtlnk_msg="enabled"
|
||||
fi
|
||||
|
||||
@@ -2408,7 +2444,7 @@ if test X"$OPT_LIBSSH2" != Xno; then
|
||||
|
||||
LDFLAGS="$LDFLAGS $LD_SSH2"
|
||||
CPPFLAGS="$CPPFLAGS $CPP_SSH2"
|
||||
LIBS="$LIBS $LIB_SSH2"
|
||||
LIBS="$LIB_SSH2 $LIBS"
|
||||
|
||||
AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
|
||||
|
||||
@@ -2504,7 +2540,7 @@ if test X"$OPT_LIBRTMP" != Xno; then
|
||||
|
||||
LDFLAGS="$LDFLAGS $LD_RTMP"
|
||||
CPPFLAGS="$CPPFLAGS $CPP_RTMP"
|
||||
LIBS="$LIBS $LIB_RTMP"
|
||||
LIBS="$LIB_RTMP $LIBS"
|
||||
|
||||
AC_CHECK_LIB(rtmp, RTMP_Init,
|
||||
[
|
||||
@@ -2948,6 +2984,8 @@ AC_CHECK_TYPE([bool],[
|
||||
|
||||
CURL_CONFIGURE_CURL_SOCKLEN_T
|
||||
|
||||
CURL_CONFIGURE_PULL_SYS_POLL
|
||||
|
||||
TYPE_IN_ADDR_T
|
||||
|
||||
TYPE_SOCKADDR_STORAGE
|
||||
@@ -3074,10 +3112,6 @@ if test "$ipv6" = "yes"; then
|
||||
CURL_CHECK_NI_WITHSCOPEID
|
||||
fi
|
||||
|
||||
dnl ************************************************************
|
||||
dnl enable non-blocking communications
|
||||
dnl
|
||||
CURL_CHECK_OPTION_NONBLOCKING
|
||||
CURL_CHECK_NONBLOCKING_SOCKET
|
||||
|
||||
dnl ************************************************************
|
||||
@@ -3314,33 +3348,21 @@ AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]),
|
||||
)
|
||||
AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes)
|
||||
|
||||
|
||||
dnl ************************************************************
|
||||
if test ! -z "$winsock_LIB"; then
|
||||
|
||||
dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
|
||||
dnl things work when built with c-ares). But we can't just move it last
|
||||
dnl since then other stuff (SSL) won't build. So we simply append it to the
|
||||
dnl end.
|
||||
|
||||
LIBS="$LIBS $winsock_LIB"
|
||||
TEST_SERVER_LIBS="$TEST_SERVER_LIBS $winsock_LIB"
|
||||
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl All the library dependencies put into $LIB apply to libcurl only.
|
||||
dnl Those in $CURL_LIBS apply to the curl command-line client only.
|
||||
dnl Those in $TEST_SERVER_LIBS apply to test servers only.
|
||||
dnl Those in $ALL_LIBS apply to all targets, including test targets.
|
||||
dnl
|
||||
LIBCURL_LIBS=$LIBS
|
||||
|
||||
AC_SUBST(LIBCURL_LIBS)
|
||||
AC_SUBST(CURL_LIBS)
|
||||
AC_SUBST(TEST_SERVER_LIBS)
|
||||
AC_SUBST(CURL_NETWORK_LIBS)
|
||||
LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link
|
||||
AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
|
||||
|
||||
dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
|
||||
dnl LIBS variable used in generated makefile at makefile processing
|
||||
dnl time. Doing this functionally prevents LIBS from being used for
|
||||
dnl all link targets in given makefile.
|
||||
BLANK_AT_MAKETIME=
|
||||
AC_SUBST(BLANK_AT_MAKETIME)
|
||||
|
||||
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
|
||||
|
||||
@@ -3473,14 +3495,15 @@ squeeze DEFS
|
||||
squeeze LDFLAGS
|
||||
squeeze LIBS
|
||||
|
||||
squeeze CURL_LIBS
|
||||
squeeze LIBCURL_LIBS
|
||||
squeeze TEST_SERVER_LIBS
|
||||
squeeze CURL_NETWORK_LIBS
|
||||
squeeze CURL_NETWORK_AND_TIME_LIBS
|
||||
|
||||
squeeze SUPPORT_FEATURES
|
||||
squeeze SUPPORT_PROTOCOLS
|
||||
|
||||
XC_CHECK_BUILD_FLAGS
|
||||
|
||||
if test "x$want_curldebug_assumed" = "xyes" &&
|
||||
test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
|
||||
ac_configure_args="$ac_configure_args --enable-curldebug"
|
||||
@@ -3496,6 +3519,8 @@ AC_CONFIG_FILES([Makefile \
|
||||
lib/Makefile \
|
||||
lib/libcurl.vers \
|
||||
tests/Makefile \
|
||||
tests/certs/Makefile \
|
||||
tests/certs/scripts/Makefile \
|
||||
tests/data/Makefile \
|
||||
tests/server/Makefile \
|
||||
tests/libtest/Makefile \
|
||||
|
||||
@@ -135,9 +135,9 @@ while test $# -gt 0; do
|
||||
CPPFLAG_CURL_STATICLIB=""
|
||||
fi
|
||||
if test "X@includedir@" = "X/usr/include"; then
|
||||
echo "$(CPPFLAG_CURL_STATICLIB)"
|
||||
echo "$CPPFLAG_CURL_STATICLIB"
|
||||
else
|
||||
echo "$(CPPFLAG_CURL_STATICLIB)-I@includedir@"
|
||||
echo "${CPPFLAG_CURL_STATICLIB}-I@includedir@"
|
||||
fi
|
||||
;;
|
||||
|
||||
@@ -148,14 +148,14 @@ while test $# -gt 0; do
|
||||
CURLLIBDIR=""
|
||||
fi
|
||||
if test "X@REQUIRE_LIB_DEPS@" = "Xyes"; then
|
||||
echo ${CURLLIBDIR}-lcurl @LIBCURL_LIBS@ @LIBS@
|
||||
echo ${CURLLIBDIR}-lcurl @LIBCURL_LIBS@
|
||||
else
|
||||
echo ${CURLLIBDIR}-lcurl @LIBS@
|
||||
echo ${CURLLIBDIR}-lcurl
|
||||
fi
|
||||
;;
|
||||
|
||||
--static-libs)
|
||||
echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@ @LIBS@
|
||||
echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@
|
||||
;;
|
||||
|
||||
--configure)
|
||||
|
||||
@@ -20,7 +20,7 @@ BUGS
|
||||
1.1 There are still bugs
|
||||
|
||||
Curl and libcurl have grown substantially since the beginning. At the time
|
||||
of writing (September 2011), there are about 66000 lines of source code, and
|
||||
of writing (January 2013), there are about 83,000 lines of source code, and
|
||||
by the time you read this it has probably grown even more.
|
||||
|
||||
Of course there are lots of bugs left. And lots of misfeatures.
|
||||
@@ -35,9 +35,11 @@ BUGS
|
||||
have a go at a solution. You can optionally also post your bug/problem at
|
||||
curl's bug tracking system over at
|
||||
|
||||
http://sourceforge.net/bugs/?group_id=976
|
||||
https://sourceforge.net/p/curl/bugs/
|
||||
|
||||
(but please read the sections below first before doing that)
|
||||
Please read the rest of this document below first before doing that! Also,
|
||||
you need to login to your sourceforge account before being able to submit a
|
||||
bug report (necessary evil done to avoid spam).
|
||||
|
||||
If you feel you need to ask around first, find a suitable mailing list and
|
||||
post there. The lists are available on http://curl.haxx.se/mail/
|
||||
|
||||
82
docs/FAQ
82
docs/FAQ
@@ -1,4 +1,3 @@
|
||||
Updated: December 7, 2011 (http://curl.haxx.se/docs/faq.html)
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
@@ -53,6 +52,7 @@ FAQ
|
||||
3.19 How do I get HTTP from a host using a specific IP address?
|
||||
3.20 How to SFTP from my user's home directory?
|
||||
3.21 Protocol xxx not supported or disabled in libcurl
|
||||
3.22 curl -X gives me HTTP problems
|
||||
|
||||
4. Running Problems
|
||||
4.1 Problems connecting to SSL servers.
|
||||
@@ -97,6 +97,8 @@ FAQ
|
||||
5.13 How do I stop an ongoing transfer?
|
||||
5.14 Using C++ non-static functions for callbacks?
|
||||
5.15 How do I get an FTP directory listing?
|
||||
5.16 I want a different time-out!
|
||||
5.17 Can I write a server with libcurl?
|
||||
|
||||
6. License Issues
|
||||
6.1 I have a GPL program, can I use the libcurl library?
|
||||
@@ -417,10 +419,15 @@ FAQ
|
||||
|
||||
2.2 Does curl work/build with other SSL libraries?
|
||||
|
||||
Curl has been written to use OpenSSL, GnuTLS, yassl, NSS, PolarSSL, axTLS or
|
||||
qssl, although there should not be many problems using a different
|
||||
library. If anyone does "port" curl to use a different SSL library, we are
|
||||
of course very interested in getting the patch!
|
||||
Curl has been written to use a generic SSL function layer internally, and
|
||||
that SSL functionality can then be provided by one out of many different SSL
|
||||
backends.
|
||||
|
||||
curl can be built to use one of the following SSL alternatives: OpenSSL,
|
||||
GnuTLS, yassl, NSS, PolarSSL, axTLS, Secure Transport (native iOS/OS X),
|
||||
schannel (native Windows) or qssl (native IBM i). They all have their pros
|
||||
and cons, and we try to maintain a comparison of them here:
|
||||
http://curl.haxx.se/docs/ssl-compared.html
|
||||
|
||||
2.3 Where can I find a copy of LIBEAY32.DLL?
|
||||
|
||||
@@ -481,9 +488,10 @@ FAQ
|
||||
You can tell curl to perform optional commands both before and/or after a
|
||||
file transfer. Study the -Q/--quote option.
|
||||
|
||||
Since curl is used for file transfers, you don't use curl to just perform
|
||||
FTP commands without transferring anything. Therefore you must always specify
|
||||
a URL to transfer to/from even when doing custom FTP commands.
|
||||
Since curl is used for file transfers, you don't normally use curl to
|
||||
perform FTP commands without transferring anything. Therefore you must
|
||||
always specify a URL to transfer to/from even when doing custom FTP
|
||||
commands, or use -I which implies the "no body" option sent to libcurl.
|
||||
|
||||
3.5 How can I disable the Accept: */* header?
|
||||
|
||||
@@ -730,6 +738,33 @@ FAQ
|
||||
part as in "htpt://example.com" or as in the less evident case if you prefix
|
||||
the protocol part with a space as in " http://example.com/".
|
||||
|
||||
3.22 curl -X gives me HTTP problems
|
||||
|
||||
In normal circumstances, -X should hardly ever be used.
|
||||
|
||||
By default you use curl without explicitly saying which request method to
|
||||
use when the URL identifies a HTTP transfer. If you just pass in a URL like
|
||||
"curl http://example.com" it will use GET. If you use -d or -F curl will use
|
||||
POST, -I will cause a HEAD and -T will make it a PUT.
|
||||
|
||||
If for whatever reason you're not happy with these default choices that curl
|
||||
does for you, you can override those request methods by specifying -X
|
||||
[WHATEVER]. This way you can for example send a DELETE by doing "curl -X
|
||||
DELETE [URL]".
|
||||
|
||||
It is thus pointless to do "curl -XGET [URL]" as GET would be used
|
||||
anyway. In the same vein it is pointless to do "curl -X POST -d data
|
||||
[URL]"... But you can make a fun and somewhat rare request that sends a
|
||||
request-body in a GET request with something like "curl -X GET -d data
|
||||
[URL]"
|
||||
|
||||
Note that -X doesn't change curl's behavior. It only modifies the actual
|
||||
string sent in the request.
|
||||
|
||||
Accordingly, by using -XPOST on a command line that for example would follow
|
||||
a 303 redirect, you will effectively prevent curl from behaving
|
||||
correctly. Be aware.
|
||||
|
||||
|
||||
4. Running Problems
|
||||
|
||||
@@ -878,8 +913,8 @@ FAQ
|
||||
|
||||
4.9 Curl can't authenticate to the server that requires NTLM?
|
||||
|
||||
NTLM support requires OpenSSL, GnuTLS, NSS or Microsoft Windows libraries at
|
||||
build-time to provide this functionality.
|
||||
NTLM support requires OpenSSL, GnuTLS, NSS, Secure Transport, or Microsoft
|
||||
Windows libraries at build-time to provide this functionality.
|
||||
|
||||
NTLM is a Microsoft proprietary protocol. Proprietary formats are evil. You
|
||||
should not use such ones.
|
||||
@@ -1252,7 +1287,7 @@ FAQ
|
||||
|
||||
If you're using the multi interface, you can also stop a transfer by
|
||||
removing the particular easy handle from the multi stack at any moment you
|
||||
think the transfer is done.
|
||||
think the transfer is done or when you wish to abort the transfer.
|
||||
|
||||
5.14 Using C++ non-static functions for callbacks?
|
||||
|
||||
@@ -1294,6 +1329,31 @@ FAQ
|
||||
libcurl since 7.21.0 also provide the ability to specify a wildcard to
|
||||
download multiple files from one FTP directory.
|
||||
|
||||
5.16 I want a different time-out!
|
||||
|
||||
Time and time again users realize that CURLOPT_TIMEOUT and
|
||||
CURLOPT_CONNECTIMEOUT are not sufficiently advanced or flexible to cover all
|
||||
the various use cases and scenarios applications end up with.
|
||||
|
||||
libcurl offers many more ways to time-out operations. A common alternative
|
||||
is to use the CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME options to
|
||||
specify the lowest possible speed to accept before to consider the transfer
|
||||
timed out.
|
||||
|
||||
The most flexible way is by writing your own time-out logic and using
|
||||
CURLOPT_PROGRESSFUNCTION (perhaps in combination with other callbacks) and
|
||||
use that to figure out exactly when the right condition is met when the
|
||||
transfer should get stopped.
|
||||
|
||||
5.17 Can I write a server with libcurl?
|
||||
|
||||
No. libcurl offers no functions or building blocks to build any kind of
|
||||
internet protocol server. libcurl is only a client-side library. For server
|
||||
libraries, you need to continue your search elsewhere but there exist many
|
||||
good open source ones out there for most protocols you could possibly want a
|
||||
server for. And there are really good stand-alone ones that have been tested
|
||||
and proven for many years. There's no need for you to reinvent them!
|
||||
|
||||
|
||||
6. License Issues
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ HTTP
|
||||
- POST
|
||||
- Pipelining
|
||||
- multipart formpost (RFC1867-style)
|
||||
- authentication: Basic, Digest, NTLM(*9), GSS-Negotiate/Negotiate(*3) and
|
||||
- authentication: Basic, Digest, NTLM (*9), GSS-Negotiate/Negotiate (*3) and
|
||||
SPNEGO (*4) to server and proxy
|
||||
- resume (both GET and PUT)
|
||||
- follow redirects
|
||||
@@ -122,10 +122,52 @@ FILE
|
||||
- "uploads"
|
||||
- resume
|
||||
|
||||
SMTP
|
||||
- authentication: Plain, Login, CRAM-MD5, Digest-MD5 and NTLM (*9)
|
||||
- send mail
|
||||
- mail from support
|
||||
- mail size support
|
||||
- mail auth support for trusted server-to-server relaying
|
||||
- multiple recipients
|
||||
- via http-proxy
|
||||
|
||||
SMTPS (*1)
|
||||
- implicit smtps:// support
|
||||
- explicit "STARTTLS" usage to "upgrade" plain smtp:// connections to use SSL
|
||||
- via http-proxy
|
||||
|
||||
POP3
|
||||
- authentication: Clear Text, APOP and SASL
|
||||
- SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5 and
|
||||
NTLM (*9)
|
||||
- list e-mails
|
||||
- retrieve e-mails
|
||||
- enhanced command support for: CAPA, DELE, TOP, STAT, UIDL and NOOP
|
||||
- via http-proxy
|
||||
|
||||
POP3S (*1)
|
||||
- implicit pop3s:// support
|
||||
- explicit "STLS" usage to "upgrade" plain pop3:// connections to use SSL
|
||||
- via http-proxy
|
||||
|
||||
IMAP
|
||||
- authentication: Clear Text and SASL
|
||||
- select mailbox
|
||||
- basic fetch e-mail support
|
||||
- SASL based authentication: Plain, Login, CRAM-MD5, Digest-MD5 and
|
||||
NTLM (*9)
|
||||
- via http-proxy
|
||||
|
||||
IMAPS (*1)
|
||||
- implicit imaps:// support
|
||||
- explicit "STARTTLS" usage to "upgrade" plain imap:// connections to use SSL
|
||||
- via http-proxy
|
||||
|
||||
FOOTNOTES
|
||||
=========
|
||||
|
||||
*1 = requires OpenSSL, GnuTLS, NSS, yassl, axTLS, PolarSSL or schannel
|
||||
*1 = requires OpenSSL, GnuTLS, NSS, yassl, axTLS, PolarSSL, schannel (native
|
||||
Windows), Secure Transport (native iOS/OS X) or qssl (native IBM i)
|
||||
*2 = requires OpenLDAP
|
||||
*3 = requires a GSSAPI-compliant library, such as Heimdal or similar.
|
||||
*4 = requires FBopenssl
|
||||
@@ -133,4 +175,4 @@ FOOTNOTES
|
||||
*6 = requires c-ares
|
||||
*7 = requires OpenSSL or NSS, as GnuTLS only supports SSLv3 and TLSv1
|
||||
*8 = requires libssh2
|
||||
*9 = requires OpenSSL, GnuTLS, NSS or yassl
|
||||
*9 = requires OpenSSL, GnuTLS, NSS, yassl or SSPI (native Windows)
|
||||
|
||||
69
docs/INSTALL
69
docs/INSTALL
@@ -135,21 +135,18 @@ UNIX
|
||||
default. But if you want to alter it, you can select how to deal with
|
||||
each individual library.
|
||||
|
||||
To build with GnuTLS support instead of OpenSSL for SSL/TLS, note that
|
||||
you need to use both --without-ssl and --with-gnutls.
|
||||
To build with GnuTLS for SSL/TLS, use both --without-ssl and
|
||||
--with-gnutls.
|
||||
|
||||
To build with yassl support instead of OpenSSL or GnuTLS, you must build
|
||||
yassl with its OpenSSL emulation enabled and point to that directory root
|
||||
with configure --with-ssl.
|
||||
To build with Cyassl for SSL/TLS, use both --without-ssl and
|
||||
--with-cyassl.
|
||||
|
||||
To build with NSS support instead of OpenSSL for SSL/TLS, note that
|
||||
you need to use both --without-ssl and --with-nss.
|
||||
To build with NSS for SSL/TLS, use both --without-ssl and --with-nss.
|
||||
|
||||
To build with PolarSSL support instead of OpenSSL for SSL/TLS, note that
|
||||
you need to use both --without-ssl and --with-polarssl.
|
||||
To build with PolarSSL for SSL/TLS, use both --without-ssl and
|
||||
--with-polarssl.
|
||||
|
||||
To build with axTLS support instead of OpenSSL for TLS, note that you
|
||||
need to use both --without-ssl and --with-axtls.
|
||||
To build with axTLS for SSL/TLS, use both --without-ssl and --with-axtls.
|
||||
|
||||
To get GSSAPI support, build with --with-gssapi and have the MIT or
|
||||
Heimdal Kerberos 5 packages installed.
|
||||
@@ -225,7 +222,7 @@ Win32
|
||||
|
||||
set ZLIB_PATH=c:\zlib-1.2.7
|
||||
set OPENSSL_PATH=c:\openssl-0.9.8x
|
||||
set LIBSSH2_PATH=c:\libssh2-1.4.2
|
||||
set LIBSSH2_PATH=c:\libssh2-1.4.3
|
||||
|
||||
ATTENTION: if you want to build with libssh2 support you have to use latest
|
||||
version 0.17 - previous versions will NOT work with 7.17.0 and later!
|
||||
@@ -467,7 +464,7 @@ Win32
|
||||
possibilities:
|
||||
|
||||
- Modify lib/config-win32.h
|
||||
- Modify lib/setup.h
|
||||
- Modify lib/curl_setup.h
|
||||
- Modify lib/Makefile.vc6
|
||||
- Add defines to Project/Settings/C/C++/General/Preprocessor Definitions
|
||||
in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project.
|
||||
@@ -509,6 +506,38 @@ Win32
|
||||
dynamic import symbols.
|
||||
|
||||
|
||||
Apple iOS and Mac OS X
|
||||
======================
|
||||
On recent Apple operating systems, curl can be built to use Apple's
|
||||
SSL/TLS implementation, Secure Transport, instead of OpenSSL. To build with
|
||||
Secure Transport for SSL/TLS, use the configure option --with-darwinssl. (It
|
||||
is not necessary to use the option --without-ssl.) This feature requires iOS
|
||||
5.0 or later, or OS X 10.5 ("Leopard") or later.
|
||||
|
||||
When Secure Transport is in use, the curl options --cacert and --capath and
|
||||
their libcurl equivalents, will be ignored, because Secure Transport uses
|
||||
the certificates stored in the Keychain to evaluate whether or not to trust
|
||||
the server. This, of course, includes the root certificates that ship with
|
||||
the OS. The --cert and --engine options, and their libcurl equivalents, are
|
||||
currently unimplemented in curl with Secure Transport.
|
||||
|
||||
For OS X users: In OS X 10.8 ("Mountain Lion"), Apple made a major
|
||||
overhaul to the Secure Transport API that, among other things, added
|
||||
support for the newer TLS 1.1 and 1.2 protocols. To get curl to support
|
||||
TLS 1.1 and 1.2, you must build curl on Mountain Lion or later, or by
|
||||
using the equivalent SDK. If you set the MACOSX_DEPLOYMENT_TARGET
|
||||
environmental variable to an earlier version of OS X prior to building curl,
|
||||
then curl will use the new Secure Transport API on Mountain Lion and later,
|
||||
and fall back on the older API when the same curl binary is executed on
|
||||
older cats. For example, running these commands in curl's directory in the
|
||||
shell will build the code such that it will run on cats as old as OS X 10.6
|
||||
("Snow Leopard") (using bash):
|
||||
|
||||
export MACOSX_DEPLOYMENT_TARGET="10.6"
|
||||
./configure --with-darwinssl
|
||||
make
|
||||
|
||||
|
||||
IBM OS/2
|
||||
========
|
||||
Building under OS/2 is not much different from building under unix.
|
||||
@@ -970,8 +999,9 @@ REDUCING SIZE
|
||||
The GNU compiler and linker have a number of options that can reduce the
|
||||
size of the libcurl dynamic libraries on some platforms even further.
|
||||
Specify them by providing appropriate CFLAGS and LDFLAGS variables on the
|
||||
configure command-line:
|
||||
CFLAGS="-ffunction-sections -fdata-sections" \
|
||||
configure command-line, e.g.
|
||||
CFLAGS="-Os -ffunction-sections -fdata-sections \
|
||||
-fno-unwind-tables -fno-asynchronous-unwind-tables" \
|
||||
LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections"
|
||||
|
||||
Be sure also to strip debugging symbols from your binaries after
|
||||
@@ -981,9 +1011,9 @@ REDUCING SIZE
|
||||
.comment section).
|
||||
|
||||
Using these techniques it is possible to create a basic HTTP-only shared
|
||||
libcurl library for i386 Linux platforms that is only 101 KiB in size, and
|
||||
an FTP-only library that is 105 KiB in size (as of libcurl version 7.21.5,
|
||||
using gcc 4.4.3).
|
||||
libcurl library for i386 Linux platforms that is only 106 KiB in size, and
|
||||
an FTP-only library that is 108 KiB in size (as of libcurl version 7.27.0,
|
||||
using gcc 4.6.3).
|
||||
|
||||
You may find that statically linking libcurl to your application will
|
||||
result in a lower total size than dynamically linking.
|
||||
@@ -1017,7 +1047,7 @@ PORTS
|
||||
- AVR32 Linux
|
||||
- ARM Android 1.5, 2.1
|
||||
- ARM INTEGRITY
|
||||
- ARM iPhone OS
|
||||
- ARM iOS
|
||||
- Cell Linux
|
||||
- Cell Cell OS
|
||||
- HP-PA HP-UX 9.X 10.X 11.X
|
||||
@@ -1055,6 +1085,7 @@ PORTS
|
||||
- i386 HURD
|
||||
- i386 Haiku OS
|
||||
- i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6
|
||||
- i386 Mac OS X
|
||||
- i386 MINIX 3.1
|
||||
- i386 NetBSD
|
||||
- i386 Novell NetWare
|
||||
|
||||
@@ -18,6 +18,25 @@ Building with CMake
|
||||
CMake builds can be configured either from the command line, or from one
|
||||
of CMake's GUI's.
|
||||
|
||||
Current flaws in the curl CMake build
|
||||
=====================================
|
||||
|
||||
Missing features in the cmake build:
|
||||
|
||||
- Builds libcurl without large file support
|
||||
- It doesn't build src/tool_hugehelp.c which creates the --manual output
|
||||
- Can't select which SSL library to build with, only OpenSSL
|
||||
- Doesn't build with SCP and SFTP support (libssh2)
|
||||
- Doesn't allow different resolver backends (no c-ares build support)
|
||||
- No RTMP support built
|
||||
- Doesn't allow build curl and libcurl debug enabled
|
||||
- Doesn't allow a custom CA bundle path
|
||||
- Doesn't allow you to disable specific protocols from the build
|
||||
- Doesn't properly enable IPv6 support by default
|
||||
- Doesn't find or use krb4 or GSS
|
||||
- Rebuilds test files too eagerly, but still can't run the tests
|
||||
|
||||
|
||||
Important notice
|
||||
==================
|
||||
If you got your curl sources from a distribution tarball, make sure to
|
||||
@@ -31,22 +50,28 @@ Important notice
|
||||
|
||||
Command Line CMake
|
||||
==================
|
||||
A command line build of Curl is similar to the autotools build of Curl. It
|
||||
A CMake build of curl is similar to the autotools build of curl. It
|
||||
consists of the following steps after you have unpacked the source.
|
||||
# 1st create an out of source build tree parallel to the curl source
|
||||
# tree and change into that directory
|
||||
mkdir curl-build
|
||||
cd curl-build
|
||||
# now run CMake from the build tree, giving it the path to the top of
|
||||
# the Curl source tree. CMake will pick a compiler for you. If you
|
||||
# want to specify the compile, you can set the CC environment
|
||||
# variable prior to running CMake.
|
||||
cmake ../curl
|
||||
make
|
||||
# currently make test is not implemented
|
||||
#make test
|
||||
# Install to default location:
|
||||
make install
|
||||
|
||||
1. Create an out of source build tree parallel to the curl source
|
||||
tree and change into that directory
|
||||
|
||||
$ mkdir curl-build
|
||||
$ cd curl-build
|
||||
|
||||
2. Run CMake from the build tree, giving it the path to the top of
|
||||
the curl source tree. CMake will pick a compiler for you. If you
|
||||
want to specify the compile, you can set the CC environment
|
||||
variable prior to running CMake.
|
||||
|
||||
$ cmake ../curl
|
||||
$ make
|
||||
|
||||
3. Install to default location:
|
||||
|
||||
$ make install
|
||||
|
||||
(The teste suit does not work with the cmake build)
|
||||
|
||||
ccmake
|
||||
=========
|
||||
|
||||
@@ -47,9 +47,6 @@ Portability
|
||||
axTLS 1.2.7
|
||||
Heimdal ?
|
||||
|
||||
* = only partly functional, but that's due to bugs in the third party lib, not
|
||||
because of libcurl code
|
||||
|
||||
On systems where configure runs, we aim at working on them all - if they have
|
||||
a suitable C compiler. On systems that don't run configure, we strive to keep
|
||||
curl running fine on:
|
||||
@@ -413,10 +410,10 @@ Client
|
||||
|
||||
main() resides in src/main.c together with most of the client code.
|
||||
|
||||
src/hugehelp.c is automatically generated by the mkhelp.pl perl script to
|
||||
display the complete "manual" and the src/urlglob.c file holds the functions
|
||||
used for the URL-"globbing" support. Globbing in the sense that the {} and []
|
||||
expansion stuff is there.
|
||||
src/tool_hugehelp.c is automatically generated by the mkhelp.pl perl script
|
||||
to display the complete "manual" and the src/urlglob.c file holds the
|
||||
functions used for the URL-"globbing" support. Globbing in the sense that
|
||||
the {} and [] expansion stuff is there.
|
||||
|
||||
The client mostly messes around to setup its 'config' struct properly, then
|
||||
it calls the curl_easy_*() functions of the library and when it gets back
|
||||
|
||||
@@ -134,13 +134,6 @@ may have been fixed since this was written!
|
||||
38. Kumar Swamy Bhatt's problem in ftp/ssl "LIST" operation:
|
||||
http://curl.haxx.se/mail/lib-2007-01/0103.html
|
||||
|
||||
37. Having more than one connection to the same host when doing NTLM
|
||||
authentication (with performs multiple "passes" and authenticates a
|
||||
connection rather than a HTTP request), and particularly when using the
|
||||
multi interface, there's a risk that libcurl will re-use a wrong connection
|
||||
when doing the different passes in the NTLM negotiation and thus fail to
|
||||
negotiate (in seemingly mysterious ways).
|
||||
|
||||
35. Both SOCKS5 and SOCKS4 proxy connections are done blocking, which is very
|
||||
bad when used with the multi interface.
|
||||
|
||||
@@ -170,7 +163,6 @@ may have been fixed since this was written!
|
||||
to what winhttp does. See http://curl.haxx.se/bug/view.cgi?id=1281867
|
||||
|
||||
23. SOCKS-related problems:
|
||||
A) libcurl doesn't support SOCKS for IPv6.
|
||||
B) libcurl doesn't support FTPS over a SOCKS proxy.
|
||||
E) libcurl doesn't support active FTP over a SOCKS proxy
|
||||
|
||||
|
||||
110
docs/MANUAL
110
docs/MANUAL
@@ -19,7 +19,7 @@ SIMPLE USAGE
|
||||
|
||||
curl http://www.weirdserver.com:8000/
|
||||
|
||||
Get a list of a directory of an FTP site:
|
||||
Get a directory listing of an FTP site:
|
||||
|
||||
curl ftp://cool.haxx.se/
|
||||
|
||||
@@ -54,7 +54,7 @@ SIMPLE USAGE
|
||||
|
||||
DOWNLOAD TO A FILE
|
||||
|
||||
Get a web page and store in a local file:
|
||||
Get a web page and store in a local file with a specific name:
|
||||
|
||||
curl -o thatpage.html http://www.netscape.com/
|
||||
|
||||
@@ -113,9 +113,10 @@ USING PASSWORDS
|
||||
ones out of the ones that the server accepts for the given URL, by using
|
||||
--anyauth.
|
||||
|
||||
NOTE! Since HTTP URLs don't support user and password, you can't use that
|
||||
style when using Curl via a proxy. You _must_ use the -u style fetch
|
||||
during such circumstances.
|
||||
NOTE! According to the URL specification, HTTP URLs can not contain a user
|
||||
and password, so that style will not work when using curl via a proxy, even
|
||||
though curl allows it at other times. When using a proxy, you _must_ use
|
||||
the -u style for user and password.
|
||||
|
||||
HTTPS
|
||||
|
||||
@@ -133,7 +134,7 @@ PROXY
|
||||
|
||||
curl -x my-proxy:888 ftp://ftp.leachsite.com/README
|
||||
|
||||
Get a file from a HTTP server that requires user and password, using the
|
||||
Get a file from an HTTP server that requires user and password, using the
|
||||
same proxy as above:
|
||||
|
||||
curl -u user:passwd -x my-proxy:888 http://www.get.this/
|
||||
@@ -171,7 +172,7 @@ PROXY
|
||||
|
||||
RANGES
|
||||
|
||||
With HTTP 1.1 byte-ranges were introduced. Using this, a client can request
|
||||
HTTP 1.1 introduced byte-ranges. Using this, a client can request
|
||||
to get only one or more subparts of a specified document. Curl supports
|
||||
this with the -r flag.
|
||||
|
||||
@@ -202,8 +203,8 @@ UPLOADING
|
||||
|
||||
curl -T uploadfile -u user:passwd ftp://ftp.upload.com/myfile
|
||||
|
||||
Upload a local file to the remote site, and use the local file name remote
|
||||
too:
|
||||
Upload a local file to the remote site, and use the local file name at the remote
|
||||
site too:
|
||||
|
||||
curl -T uploadfile -u user:passwd ftp://ftp.upload.com/
|
||||
|
||||
@@ -219,14 +220,14 @@ UPLOADING
|
||||
|
||||
HTTP
|
||||
|
||||
Upload all data on stdin to a specified http site:
|
||||
Upload all data on stdin to a specified HTTP site:
|
||||
|
||||
curl -T - http://www.upload.com/myfile
|
||||
|
||||
Note that the http server must have been configured to accept PUT before
|
||||
Note that the HTTP server must have been configured to accept PUT before
|
||||
this can be done successfully.
|
||||
|
||||
For other ways to do http data upload, see the POST section below.
|
||||
For other ways to do HTTP data upload, see the POST section below.
|
||||
|
||||
VERBOSE / DEBUG
|
||||
|
||||
@@ -289,7 +290,7 @@ POST (HTTP)
|
||||
The 'variable' names are the names set with "name=" in the <input> tags, and
|
||||
the data is the contents you want to fill in for the inputs. The data *must*
|
||||
be properly URL encoded. That means you replace space with + and that you
|
||||
write weird letters with %XX where XX is the hexadecimal representation of
|
||||
replace weird letters with %XX where XX is the hexadecimal representation of
|
||||
the letter's ASCII code.
|
||||
|
||||
Example:
|
||||
@@ -361,8 +362,8 @@ POST (HTTP)
|
||||
|
||||
REFERRER
|
||||
|
||||
A HTTP request has the option to include information about which address
|
||||
that referred to actual page. Curl allows you to specify the
|
||||
An HTTP request has the option to include information about which address
|
||||
referred it to the actual page. Curl allows you to specify the
|
||||
referrer to be used on the command line. It is especially useful to
|
||||
fool or trick stupid servers or CGI scripts that rely on that information
|
||||
being available or contain certain data.
|
||||
@@ -373,7 +374,7 @@ REFERRER
|
||||
|
||||
USER AGENT
|
||||
|
||||
A HTTP request has the option to include information about the browser
|
||||
An HTTP request has the option to include information about the browser
|
||||
that generated the request. Curl allows it to be specified on the command
|
||||
line. It is especially useful to fool or trick stupid servers or CGI
|
||||
scripts that only accept certain browsers.
|
||||
@@ -618,16 +619,16 @@ FTP and firewalls
|
||||
|
||||
The default way for curl is to issue the PASV command which causes the
|
||||
server to open another port and await another connection performed by the
|
||||
client. This is good if the client is behind a firewall that don't allow
|
||||
client. This is good if the client is behind a firewall that doesn't allow
|
||||
incoming connections.
|
||||
|
||||
curl ftp.download.com
|
||||
|
||||
If the server for example, is behind a firewall that don't allow connections
|
||||
on other ports than 21 (or if it just doesn't support the PASV command), the
|
||||
If the server, for example, is behind a firewall that doesn't allow connections
|
||||
on ports other than 21 (or if it just doesn't support the PASV command), the
|
||||
other way to do it is to use the PORT command and instruct the server to
|
||||
connect to the client on the given (as parameters to the PORT command) IP
|
||||
number and port.
|
||||
connect to the client on the given IP number and port (as parameters to the
|
||||
PORT command).
|
||||
|
||||
The -P flag to curl supports a few different options. Your machine may have
|
||||
several IP-addresses and/or network interfaces and curl allows you to select
|
||||
@@ -685,8 +686,8 @@ HTTPS
|
||||
If you neglect to specify the password on the command line, you will be
|
||||
prompted for the correct password before any data can be received.
|
||||
|
||||
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
|
||||
Many older SSL-servers have problems with SSLv3 or TLS, which newer versions
|
||||
of OpenSSL etc use, therefore it is sometimes useful to specify what
|
||||
SSL-version curl should use. Use -3, -2 or -1 to specify that exact SSL
|
||||
version to use (for SSLv3, SSLv2 or TLSv1 respectively):
|
||||
|
||||
@@ -695,14 +696,13 @@ HTTPS
|
||||
Otherwise, curl will first attempt to use v3 and then v2.
|
||||
|
||||
To use OpenSSL to convert your favourite browser's certificate into a PEM
|
||||
formatted one that curl can use, do something like this (assuming netscape,
|
||||
but IE is likely to work similarly):
|
||||
formatted one that curl can use, do something like this:
|
||||
|
||||
You start with hitting the 'security' menu button in netscape.
|
||||
In Netscape, you start with hitting the 'Security' menu button.
|
||||
|
||||
Select 'certificates->yours' and then pick a certificate in the list
|
||||
|
||||
Press the 'export' button
|
||||
Press the 'Export' button
|
||||
|
||||
enter your PIN code for the certs
|
||||
|
||||
@@ -713,11 +713,21 @@ HTTPS
|
||||
|
||||
# ./apps/openssl pkcs12 -in [file you saved] -clcerts -out [PEMfile]
|
||||
|
||||
In Firefox, select Options, then Advanced, then the Encryption tab,
|
||||
View Certificates. This opens the Certificate Manager, where you can
|
||||
Export. Be sure to select PEM for the Save as type.
|
||||
|
||||
In Internet Explorer, select Internet Options, then the Content tab, then
|
||||
Certificates. Then you can Export, and depending on the format you may
|
||||
need to convert to PEM.
|
||||
|
||||
In Chrome, select Settings, then Show Advanced Settings. Under HTTPS/SSL
|
||||
select Manage Certificates.
|
||||
|
||||
RESUMING FILE TRANSFERS
|
||||
|
||||
To continue a file transfer where it was previously aborted, curl supports
|
||||
resume on http(s) downloads as well as ftp uploads and downloads.
|
||||
resume on HTTP(S) downloads as well as FTP uploads and downloads.
|
||||
|
||||
Continue downloading a document:
|
||||
|
||||
@@ -731,7 +741,7 @@ RESUMING FILE TRANSFERS
|
||||
|
||||
curl -C - -o file http://www.server.com/
|
||||
|
||||
(*1) = This requires that the ftp server supports the non-standard command
|
||||
(*1) = This requires that the FTP server supports the non-standard command
|
||||
SIZE. If it doesn't, curl will say so.
|
||||
|
||||
(*2) = This requires that the web server supports at least HTTP/1.1. If it
|
||||
@@ -740,7 +750,7 @@ RESUMING FILE TRANSFERS
|
||||
TIME CONDITIONS
|
||||
|
||||
HTTP allows a client to specify a time condition for the document it
|
||||
requests. It is If-Modified-Since or If-Unmodified-Since. Curl allow you to
|
||||
requests. It is If-Modified-Since or If-Unmodified-Since. Curl allows you to
|
||||
specify them with the -z/--time-cond flag.
|
||||
|
||||
For example, you can easily make a download that only gets performed if the
|
||||
@@ -788,7 +798,7 @@ LDAP
|
||||
and offer ldap:// support.
|
||||
|
||||
LDAP is a complex thing and writing an LDAP query is not an easy task. I do
|
||||
advice you to dig up the syntax description for that elsewhere. Two places
|
||||
advise you to dig up the syntax description for that elsewhere. Two places
|
||||
that might suit you are:
|
||||
|
||||
Netscape's "Netscape Directory SDK 3.0 for C Programmer's Guide Chapter 10:
|
||||
@@ -797,7 +807,7 @@ LDAP
|
||||
|
||||
RFC 2255, "The LDAP URL Format" http://curl.haxx.se/rfc/rfc2255.txt
|
||||
|
||||
To show you an example, this is now I can get all people from my local LDAP
|
||||
To show you an example, this is how I can get all people from my local LDAP
|
||||
server that has a certain sub-domain in their email address:
|
||||
|
||||
curl -B "ldap://ldap.frontec.se/o=frontec??sub?mail=*sth.frontec.se"
|
||||
@@ -831,15 +841,15 @@ ENVIRONMENT VARIABLES
|
||||
NETRC
|
||||
|
||||
Unix introduced the .netrc concept a long time ago. It is a way for a user
|
||||
to specify name and password for commonly visited ftp sites in a file so
|
||||
to specify name and password for commonly visited FTP sites in a file so
|
||||
that you don't have to type them in each time you visit those sites. You
|
||||
realize this is a big security risk if someone else gets hold of your
|
||||
passwords, so therefore 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 and
|
||||
--netrc-optional options). 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 to (using the -n/--netrc and
|
||||
--netrc-optional options). This is not restricted to just FTP,
|
||||
so curl can use it for all protocols where authentication is used.
|
||||
|
||||
A very simple .netrc file could look something like:
|
||||
|
||||
@@ -860,7 +870,7 @@ KERBEROS FTP TRANSFER
|
||||
|
||||
Curl supports kerberos4 and kerberos5/GSSAPI for FTP transfers. You need
|
||||
the kerberos package installed and used at curl build time for it to be
|
||||
used.
|
||||
available.
|
||||
|
||||
First, get the krb-ticket the normal way, like with the kinit/kauth tool.
|
||||
Then use curl in way similar to:
|
||||
@@ -895,7 +905,7 @@ TELNET
|
||||
|
||||
- NEW_ENV=<var,val> Sets an environment variable.
|
||||
|
||||
NOTE: the telnet protocol does not specify any way to login with a specified
|
||||
NOTE: The telnet protocol does not specify any way to login with a specified
|
||||
user and password so curl can't do that automatically. To do that, you need
|
||||
to track when the login prompt is received and send the username and
|
||||
password accordingly.
|
||||
@@ -914,7 +924,7 @@ PERSISTENT CONNECTIONS
|
||||
Note that curl cannot use persistent connections for transfers that are used
|
||||
in subsequence curl invokes. Try to stuff as many URLs as possible on the
|
||||
same command line if they are using the same host, as that'll make the
|
||||
transfers faster. If you use a http proxy for file transfers, practically
|
||||
transfers faster. If you use an HTTP proxy for file transfers, practically
|
||||
all transfers will be persistent.
|
||||
|
||||
MULTIPLE TRANSFERS WITH A SINGLE COMMAND LINE
|
||||
@@ -955,6 +965,28 @@ IPv6
|
||||
IPv6 addresses provided other than in URLs (e.g. to the --proxy, --interface
|
||||
or --ftp-port options) should not be URL encoded.
|
||||
|
||||
METALINK
|
||||
|
||||
Curl supports Metalink (both version 3 and 4 (RFC 5854) are supported), a way
|
||||
to list multiple URIs and hashes for a file. Curl will make use of the mirrors
|
||||
listed within for failover if there are errors (such as the file or server not
|
||||
being available). It will also verify the hash of the file after the download
|
||||
completes. The Metalink file itself is downloaded and processed in memory and
|
||||
not stored in the local file system.
|
||||
|
||||
Example to use a remote Metalink file:
|
||||
|
||||
curl --metalink http://www.example.com/example.metalink
|
||||
|
||||
To use a Metalink file in the local file system, use FILE protocol (file://):
|
||||
|
||||
curl --metalink file://example.metalink
|
||||
|
||||
Please note that if FILE protocol is disabled, there is no way to use a local
|
||||
Metalink file at the time of this writing. Also note that if --metalink and
|
||||
--include are used together, --include will be ignored. This is because including
|
||||
headers in the response will break Metalink parser and if the headers are included
|
||||
in the file described in Metalink file, hash check will fail.
|
||||
|
||||
MAILING LISTS
|
||||
|
||||
|
||||
40
docs/THANKS
40
docs/THANKS
@@ -12,6 +12,7 @@ Adam Piggott
|
||||
Adam Tkac
|
||||
Adrian Schuur
|
||||
Adriano Meirelles
|
||||
Ajit Dhumale
|
||||
Akos Pasztory
|
||||
Alan Pinstein
|
||||
Albert Chin
|
||||
@@ -24,6 +25,7 @@ Alessandro Ghedini
|
||||
Alessandro Vesely
|
||||
Alex Bligh
|
||||
Alex Fishman
|
||||
Alex Gruz
|
||||
Alex Neblett
|
||||
Alex Suykov
|
||||
Alex Vinnik
|
||||
@@ -71,9 +73,12 @@ Andy Serpa
|
||||
Andy Tsouladze
|
||||
Angus Mackay
|
||||
Anthony Bryan
|
||||
Anthony G. Basile
|
||||
Antoine Calando
|
||||
Anton Bychkov
|
||||
Anton Kalmykov
|
||||
Anton Malov
|
||||
Anton Yabchinskiy
|
||||
Arkadiusz Miskiewicz
|
||||
Armel Asselin
|
||||
Arnaud Compan
|
||||
@@ -146,6 +151,7 @@ Chris Mumford
|
||||
Chris Smowton
|
||||
Christian Grothoff
|
||||
Christian Hagele
|
||||
Christian Hägele
|
||||
Christian Krause
|
||||
Christian Kurz
|
||||
Christian Robottom Reis
|
||||
@@ -172,6 +178,7 @@ Craig Davison
|
||||
Craig Markwardt
|
||||
Cris Bailiff
|
||||
Cristian Rodriguez
|
||||
Cristian Rodríguez
|
||||
Curt Bogmine
|
||||
Cyrill Osterwalder
|
||||
Dag Ekengren
|
||||
@@ -204,6 +211,7 @@ Dave Reisner
|
||||
Dave Vasilevsky
|
||||
David Bau
|
||||
David Binderman
|
||||
David Blaikie
|
||||
David Byron
|
||||
David Cohen
|
||||
David Eriksson
|
||||
@@ -260,6 +268,8 @@ Early Ehlinger
|
||||
Ebenezer Ikonne
|
||||
Edin Kadribasic
|
||||
Eduard Bloch
|
||||
Edward Sheldrake
|
||||
Eelco Dolstra
|
||||
Eetu Ojanen
|
||||
Ellis Pritchard
|
||||
Emanuele Bovisio
|
||||
@@ -298,11 +308,13 @@ Frank McGeough
|
||||
Frank Meier
|
||||
Frank Ticheler
|
||||
Frank Van Uffelen
|
||||
František Kučera
|
||||
Fred Machado
|
||||
Fred New
|
||||
Fred Noz
|
||||
Frederic Lepied
|
||||
Gabriel Kuri
|
||||
Gabriel Sjoberg
|
||||
Garrett Holmstrom
|
||||
Gary Maxwell
|
||||
Gautam Kachroo
|
||||
@@ -316,6 +328,7 @@ Georg Wicherski
|
||||
Gerd v. Egidy
|
||||
Gerhard Herre
|
||||
Gerrit Bruchhäuser
|
||||
Ghennadi Procopciuc
|
||||
Giancarlo Formicuccia
|
||||
Giaslas Georgios
|
||||
Gil Weber
|
||||
@@ -336,6 +349,7 @@ Greg Zavertnik
|
||||
Grigory Entin
|
||||
Guenole Bescon
|
||||
Guenter Knauf
|
||||
Guido Berhoerster
|
||||
Guillaume Arluison
|
||||
Gustaf Hui
|
||||
Gwenole Beauchesne
|
||||
@@ -355,6 +369,7 @@ Henrik Storner
|
||||
Henry Ludemann
|
||||
Herve Amblard
|
||||
Hidemoto Nakada
|
||||
Ho-chi Chen
|
||||
Hoi-Ho Chan
|
||||
Hongli Lai
|
||||
Howard Chu
|
||||
@@ -392,6 +407,7 @@ Jamie Lokier
|
||||
Jamie Newton
|
||||
Jamie Wilkinson
|
||||
Jan Ehrhardt
|
||||
Jan Koen Annot
|
||||
Jan Kunder
|
||||
Jan Schaumann
|
||||
Jan Van Boghout
|
||||
@@ -410,6 +426,7 @@ Jean-Francois Bertrand
|
||||
Jean-Louis Lemaire
|
||||
Jean-Marc Ranger
|
||||
Jean-Philippe Barrette-LaPierre
|
||||
Jeff Connelly
|
||||
Jeff Johnson
|
||||
Jeff Lawson
|
||||
Jeff Phillips
|
||||
@@ -423,6 +440,7 @@ Jerry Wu
|
||||
Jes Badwal
|
||||
Jesper Jensen
|
||||
Jesse Noller
|
||||
Jie He
|
||||
Jim Drash
|
||||
Jim Freeman
|
||||
Jim Hollinger
|
||||
@@ -430,6 +448,7 @@ Jim Meyering
|
||||
Jocelyn Jaubert
|
||||
Joe Halpin
|
||||
Joe Malicki
|
||||
Joe Mason
|
||||
Joel Chen
|
||||
Jofell Gallardo
|
||||
Johan Anderson
|
||||
@@ -445,8 +464,10 @@ John Joseph Bachir
|
||||
John Kelly
|
||||
John Lask
|
||||
John Lightsey
|
||||
John Marino
|
||||
John McGowan
|
||||
John P. McCaskey
|
||||
John Suprock
|
||||
John Wilkinson
|
||||
John-Mark Bell
|
||||
Johnny Luong
|
||||
@@ -519,6 +540,7 @@ Kyle Sallee
|
||||
Lachlan O'Dea
|
||||
Larry Campbell
|
||||
Larry Fahnoe
|
||||
Lars Buitinck
|
||||
Lars Gustafsson
|
||||
Lars J. Aas
|
||||
Lars Nilsson
|
||||
@@ -555,6 +577,7 @@ Manuel Massing
|
||||
Marc Boucher
|
||||
Marc Hoersken
|
||||
Marc Kleine-Budde
|
||||
Marcel Raad
|
||||
Marcel Roelofs
|
||||
Marcelo Juchem
|
||||
Marcin Adamski
|
||||
@@ -571,6 +594,9 @@ Mark Eichin
|
||||
Mark Incley
|
||||
Mark Karpeles
|
||||
Mark Lentczner
|
||||
Mark Salisbury
|
||||
Mark Snelling
|
||||
Mark Tully
|
||||
Markus Duft
|
||||
Markus Koetter
|
||||
Markus Moeller
|
||||
@@ -604,6 +630,7 @@ Max Katsev
|
||||
Maxim Ivanov
|
||||
Maxim Perenesenko
|
||||
Maxim Prohorov
|
||||
Maxime Larocque
|
||||
Mehmet Bozkurt
|
||||
Mekonikum
|
||||
Mettgut Jamalla
|
||||
@@ -622,6 +649,7 @@ Michael Stillwell
|
||||
Michael Wallner
|
||||
Michal Bonino
|
||||
Michal Gorny
|
||||
Michal Kowalczyk
|
||||
Michal Marek
|
||||
Michele Bini
|
||||
Mihai Ionescu
|
||||
@@ -644,6 +672,7 @@ Nathan O'Sullivan
|
||||
Nathanael Nerode
|
||||
Naveen Chandran
|
||||
Naveen Noel
|
||||
Neil Bowers
|
||||
Neil Dunbar
|
||||
Neil Spring
|
||||
Nic Roets
|
||||
@@ -671,8 +700,11 @@ Ofer
|
||||
Olaf Flebbe
|
||||
Olaf Stueben
|
||||
Olaf Stüben
|
||||
Olivier Berger
|
||||
Oren Tirosh
|
||||
Ori Avtalion
|
||||
Oscar Koeroo
|
||||
Oscar Norlander
|
||||
P R Schaffner
|
||||
Paolo Piacentini
|
||||
Pascal Terjan
|
||||
@@ -718,6 +750,7 @@ Phil Blundell
|
||||
Phil Karn
|
||||
Phil Lisiecki
|
||||
Phil Pellouchoud
|
||||
Philip Craig
|
||||
Philip Gladstone
|
||||
Philip Langdale
|
||||
Philippe Hameau
|
||||
@@ -773,6 +806,7 @@ Rob Jones
|
||||
Rob Stanzel
|
||||
Rob Ward
|
||||
Robert A. Monat
|
||||
Robert B. Harris
|
||||
Robert D. Young
|
||||
Robert Foreman
|
||||
Robert Iakobashvili
|
||||
@@ -810,14 +844,19 @@ Samuel Listopad
|
||||
Samuel Thibault
|
||||
Sander Gates
|
||||
Sandor Feldi
|
||||
Santhana Todatry
|
||||
Saqib Ali
|
||||
Sara Golemon
|
||||
Saul good
|
||||
Scott Bailey
|
||||
Scott Barrett
|
||||
Scott Cantor
|
||||
Scott Davis
|
||||
Scott McCreary
|
||||
Sebastian Rasmussen
|
||||
Sebastien Willemijns
|
||||
Senthil Raja Velu
|
||||
Sergei Nikulov
|
||||
Sergio Ballestrero
|
||||
Seshubabu Pasam
|
||||
Sh Diao
|
||||
@@ -901,6 +940,7 @@ Tom Mueller
|
||||
Tom Regner
|
||||
Tom Wright
|
||||
Tom Zerucha
|
||||
Tomas Mlcoch
|
||||
Tomas Pospisek
|
||||
Tomas Szepe
|
||||
Tomasz Lacki
|
||||
|
||||
128
docs/TODO
128
docs/TODO
@@ -21,8 +21,7 @@
|
||||
|
||||
2. libcurl - multi interface
|
||||
2.1 More non-blocking
|
||||
2.2 Remove easy interface internally
|
||||
2.4 Fix HTTP Pipelining for PUT
|
||||
2.2 Fix HTTP Pipelining for PUT
|
||||
|
||||
3. Documentation
|
||||
3.1 More and better
|
||||
@@ -55,34 +54,31 @@
|
||||
7.6 Provide callback for cert verification
|
||||
7.7 Support other SSL libraries
|
||||
7.9 improve configure --with-ssl
|
||||
7.10 Support DANE
|
||||
|
||||
8. GnuTLS
|
||||
8.1 SSL engine stuff
|
||||
8.3 check connection
|
||||
8.4 non-gcrypt
|
||||
|
||||
9. SMTP
|
||||
9.1 Other authentication mechanisms
|
||||
9.2 Specify the preferred authentication mechanism
|
||||
9.3 Initial response
|
||||
9.4 Pipelining
|
||||
9.1 Specify the preferred authentication mechanism
|
||||
9.2 Initial response
|
||||
9.3 Pipelining
|
||||
|
||||
10. POP3
|
||||
10.1 APOP Authentication
|
||||
10.2 SASL based authentication mechanisms
|
||||
10.3 auth= in URLs
|
||||
10.1 auth= in URLs
|
||||
|
||||
11. IMAP
|
||||
11. LDAP
|
||||
11.1 SASL based authentication mechanisms
|
||||
|
||||
12. LDAP
|
||||
12.1 SASL based authentication mechanisms
|
||||
12. Other protocols
|
||||
|
||||
13. New protocols
|
||||
13.1 RSYNC
|
||||
|
||||
14. SASL
|
||||
14.1 Other authentication mechanisms
|
||||
|
||||
13. Other protocols
|
||||
|
||||
14. New protocols
|
||||
14.1 RSYNC
|
||||
|
||||
15. Client
|
||||
15.1 sync
|
||||
15.2 glob posts
|
||||
@@ -90,9 +86,8 @@
|
||||
15.4 simultaneous parallel transfers
|
||||
15.5 provide formpost headers
|
||||
15.6 url-specific options
|
||||
15.7 metalink support
|
||||
15.8 warning when setting an option
|
||||
15.9 IPv6 addresses with globbing
|
||||
15.7 warning when setting an option
|
||||
15.8 IPv6 addresses with globbing
|
||||
|
||||
16. Build
|
||||
16.1 roffit
|
||||
@@ -195,16 +190,7 @@
|
||||
- The "DONE" operation (post transfer protocol-specific actions) for the
|
||||
protocols SFTP, SMTP, FTP. Fixing Curl_done() for this is a worthy task.
|
||||
|
||||
2.2 Remove easy interface internally
|
||||
|
||||
Make curl_easy_perform() a wrapper-function that simply creates a multi
|
||||
handle, adds the easy handle to it, runs curl_multi_perform() until the
|
||||
transfer is done, then detach the easy handle, destroy the multi handle and
|
||||
return the easy handle's return code. This will thus make everything
|
||||
internally use and assume the multi interface. The select()-loop should use
|
||||
curl_multi_socket().
|
||||
|
||||
2.4 Fix HTTP Pipelining for PUT
|
||||
2.2 Fix HTTP Pipelining for PUT
|
||||
|
||||
HTTP Pipelining can be a way to greatly enhance performance for multiple
|
||||
serial requests and currently libcurl only supports that for HEAD and GET
|
||||
@@ -356,6 +342,13 @@ to provide the data to send.
|
||||
make the configure --with-ssl option first check for OpenSSL, then GnuTLS,
|
||||
then NSS...
|
||||
|
||||
7.10 Support DANE
|
||||
|
||||
DNS-Based Authentication of Named Entities (DANE) is a way to provide SSL
|
||||
keys and certs over DNS using DNSSEC as an alternative to the CA model.
|
||||
http://www.rfc-editor.org/rfc/rfc6698.txt
|
||||
|
||||
|
||||
8. GnuTLS
|
||||
|
||||
8.1 SSL engine stuff
|
||||
@@ -367,30 +360,16 @@ to provide the data to send.
|
||||
Add a way to check if the connection seems to be alive, to correspond to the
|
||||
SSL_peak() way we use with OpenSSL.
|
||||
|
||||
8.4 non-gcrypt
|
||||
|
||||
libcurl assumes that there are gcrypt functions available when
|
||||
GnuTLS is.
|
||||
|
||||
GnuTLS can be built to use libnettle instead as crypto library,
|
||||
which breaks the previously mentioned assumption
|
||||
|
||||
The correct fix would be to detect which crypto layer that is in use and
|
||||
adapt our code to use that instead of blindly assuming gcrypt.
|
||||
|
||||
9. SMTP
|
||||
|
||||
9.1 Other authentication mechanisms
|
||||
|
||||
Add support for gssapi.
|
||||
|
||||
9.2 Specify the preferred authentication mechanism
|
||||
9.1 Specify the preferred authentication mechanism
|
||||
|
||||
Add the ability to specify the preferred authentication mechanism or a list
|
||||
of mechanisms that should be used. Not only that, but the order that is
|
||||
returned by the server during the EHLO response should be honored by curl.
|
||||
|
||||
9.3 Initial response
|
||||
9.2 Initial response
|
||||
|
||||
Add the ability for the user to specify whether the initial response is
|
||||
included in the AUTH command. Some email servers, such as Microsoft
|
||||
@@ -399,58 +378,42 @@ to provide the data to send.
|
||||
|
||||
http://curl.haxx.se/mail/lib-2012-03/0114.html
|
||||
|
||||
9.4 Pipelining
|
||||
9.3 Pipelining
|
||||
|
||||
Add support for pipelining emails.
|
||||
|
||||
10. POP3
|
||||
|
||||
10.1 APOP Authentication
|
||||
|
||||
Add support for the APOP command rather than using plain text authentication
|
||||
(USER and PASS) as this is very week security wise. Note: The APOP command
|
||||
is specified as "APOP <username> <md5 password>", however, it isn't
|
||||
supported by all mail servers.
|
||||
|
||||
10.2 SASL authentication mechanisms
|
||||
|
||||
SASL offers support for additional authentication mechanisms via the AUTH
|
||||
command. Detection of an email server's support for SASL authentication
|
||||
can be detected via the CAPA command whilst a list of supported mechanisms
|
||||
can be retrieved with an empty AUTH command.
|
||||
|
||||
10.3 auth= in URLs
|
||||
10.1 auth= in URLs
|
||||
|
||||
Being able to specify the preferred authentication mechanism in the URL as
|
||||
per RFC2384.
|
||||
|
||||
11. IMAP
|
||||
11. LDAP
|
||||
|
||||
11.1 SASL based authentication mechanisms
|
||||
|
||||
Like POP3 curl currently sends usernames and passwords as clear text.
|
||||
Support should also be added to support SASL based authentication mechanisms
|
||||
as these are more secure.
|
||||
|
||||
12. LDAP
|
||||
|
||||
12.1 SASL based authentication mechansims
|
||||
|
||||
Currently the LDAP module only supports ldap_simple_bind_s() in order to bind
|
||||
to an LDAP server. However, this function sends username and password details
|
||||
using the simple authentication mechanism (as clear text). However, it should
|
||||
be possible to use ldap_bind_s() instead specifing the security context
|
||||
information ourselves.
|
||||
|
||||
13. Other protocols
|
||||
12. Other protocols
|
||||
|
||||
14. New protocols
|
||||
13. New protocols
|
||||
|
||||
14.1 RSYNC
|
||||
13.1 RSYNC
|
||||
|
||||
There's no RFC for the protocol or an URI/URL format. An implementation
|
||||
should most probably use an existing rsync library, such as librsync.
|
||||
|
||||
14. SASL
|
||||
|
||||
14.1 Other authentication mechanisms
|
||||
|
||||
Add support for gssapi to SMTP, POP3 and IMAP.
|
||||
|
||||
15. Client
|
||||
|
||||
15.1 sync
|
||||
@@ -510,18 +473,13 @@ to provide the data to send.
|
||||
|
||||
The example would do a POST-GET-POST combination on a single command line.
|
||||
|
||||
15.7 metalink support
|
||||
|
||||
Add metalink support to curl (http://www.metalinker.org/). This is most useful
|
||||
with simultaneous parallel transfers (11.6) but not necessary.
|
||||
|
||||
15.8 warning when setting an option
|
||||
15.7 warning when setting an option
|
||||
|
||||
Display a warning when libcurl returns an error when setting an option.
|
||||
This can be useful to tell when support for a particular feature hasn't been
|
||||
compiled into the library.
|
||||
|
||||
15.9 IPv6 addresses with globbing
|
||||
15.8 IPv6 addresses with globbing
|
||||
|
||||
Currently the command line client needs to get url globbing disabled (with
|
||||
-g) for it to support IPv6 numerical addresses. This is a rather silly flaw
|
||||
@@ -533,7 +491,7 @@ to provide the data to send.
|
||||
16.1 roffit
|
||||
|
||||
Consider extending 'roffit' to produce decent ASCII output, and use that
|
||||
instead of (g)nroff when building src/hugehelp.c
|
||||
instead of (g)nroff when building src/tool_hugehelp.c
|
||||
|
||||
17. Test suite
|
||||
|
||||
@@ -597,7 +555,7 @@ to provide the data to send.
|
||||
for applications to differentiate on TCP vs UDP and even HTTP vs FTP and
|
||||
similar.
|
||||
|
||||
19. Next major release
|
||||
10. Next major release
|
||||
|
||||
19.1 cleanup return codes
|
||||
|
||||
@@ -680,4 +638,4 @@ to provide the data to send.
|
||||
|
||||
Please see the following thread for more information:
|
||||
http://curl.haxx.se/mail/lib-2012-05/0178.html
|
||||
|
||||
|
||||
|
||||
396
docs/curl.1
396
docs/curl.1
@@ -20,7 +20,7 @@
|
||||
.\" *
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl 1 "16 February 2012" "Curl 7.25.0" "Curl Manual"
|
||||
.TH curl 1 "27 July 2012" "Curl 7.27.0" "Curl Manual"
|
||||
.SH NAME
|
||||
curl \- transfer a URL
|
||||
.SH SYNOPSIS
|
||||
@@ -79,14 +79,14 @@ curl will do its best to use what you pass to it as a URL. It is not trying to
|
||||
validate it as a syntactically correct URL by any means but is instead
|
||||
\fBvery\fP liberal with what it accepts.
|
||||
|
||||
Curl will attempt to re-use connections for multiple file transfers, so that
|
||||
curl will attempt to re-use connections for multiple file transfers, so that
|
||||
getting many files from the same server will not do multiple connects /
|
||||
handshakes. This improves speed. Of course this is only done on files
|
||||
specified on a single command line and cannot be used between separate curl
|
||||
invokes.
|
||||
.SH "PROGRESS METER"
|
||||
curl normally displays a progress meter during operations, indicating the amount
|
||||
of transferred data, transfer speeds and estimated time left, etc.
|
||||
curl normally displays a progress meter during operations, indicating the
|
||||
amount of transferred data, transfer speeds and estimated time left, etc.
|
||||
|
||||
curl displays this data to the terminal by default, so if you invoke curl to
|
||||
do an operation and it is about to write data to the terminal, it
|
||||
@@ -103,7 +103,7 @@ any response data to the terminal.
|
||||
If you prefer a progress "bar" instead of the regular meter, \fI-#\fP is your
|
||||
friend.
|
||||
.SH OPTIONS
|
||||
In general, all boolean options are enabled with --option and yet again
|
||||
In general, all boolean options are enabled with --\fBoption\fP and yet again
|
||||
disabled with --\fBno-\fPoption. That is, you use the exact same option name
|
||||
but prefix it with "no-". However, in this list we mostly only list and show
|
||||
the --option version of them. (This concept with --no options was added in
|
||||
@@ -125,14 +125,13 @@ Forces curl to use SSL version 2 when negotiating with a remote SSL server.
|
||||
(SSL)
|
||||
Forces curl to use SSL version 3 when negotiating with a remote SSL server.
|
||||
.IP "-4, --ipv4"
|
||||
If libcurl is capable of resolving an address to multiple IP versions (which
|
||||
it is if it is IPv6-capable), this option tells libcurl to resolve names to
|
||||
IPv4 addresses only.
|
||||
If curl is capable of resolving an address to multiple IP versions (which it
|
||||
is if it is IPv6-capable), this option tells curl to resolve names to IPv4
|
||||
addresses only.
|
||||
.IP "-6, --ipv6"
|
||||
If libcurl is capable of resolving an address to multiple IP versions (which
|
||||
it is if it is IPv6-capable), this option tells libcurl to resolve names to
|
||||
IPv6 addresses only.
|
||||
default statistics.
|
||||
If curl is capable of resolving an address to multiple IP versions (which it
|
||||
is if it is IPv6-capable), this option tells curl to resolve names to IPv6
|
||||
addresses only.
|
||||
.IP "-a, --append"
|
||||
(FTP/SFTP) When used in an upload, this will tell curl to append to the target
|
||||
file instead of overwriting it. If the file doesn't exist, it will be created.
|
||||
@@ -143,8 +142,7 @@ done CGIs fail if this field isn't set to "Mozilla/4.0". To encode blanks in
|
||||
the string, surround the string with single quote marks. This can also be set
|
||||
with the \fI-H, --header\fP option of course.
|
||||
|
||||
If this option is set more than once, the last one will be the one that's
|
||||
used.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--anyauth"
|
||||
(HTTP) Tells curl to figure out authentication method by itself, and use the
|
||||
most secure one the remote site claims to support. This is done by first
|
||||
@@ -176,10 +174,9 @@ input. No cookies will be stored in the file. To store cookies, use the
|
||||
\fI-c, --cookie-jar\fP option or you could even save the HTTP headers to a file
|
||||
using \fI-D, --dump-header\fP!
|
||||
|
||||
If this option is set more than once, the last one will be the one that's
|
||||
used.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-B, --use-ascii"
|
||||
Enable ASCII transfer when using FTP or LDAP. For FTP, this can also be
|
||||
(FTP/LDAP) Enable ASCII transfer. For FTP, this can also be
|
||||
enforced by using an URL that ends with ";type=A". This option causes data
|
||||
sent to stdout to be in text mode for win32 systems.
|
||||
.IP "--basic"
|
||||
@@ -188,12 +185,12 @@ this option is usually pointless, unless you use it to override a previously
|
||||
set option that sets a different authentication method (such as \fI--ntlm\fP,
|
||||
\fI--digest\fP, or \fI--negotiate\fP).
|
||||
.IP "-c, --cookie-jar <file name>"
|
||||
Specify to which file you want curl to write all cookies after a completed
|
||||
operation. Curl writes all cookies previously read from a specified file as
|
||||
well as all cookies received from remote server(s). If no cookies are known,
|
||||
no file will be written. The file will be written using the Netscape cookie
|
||||
file format. If you set the file name to a single dash, "-", the cookies will
|
||||
be written to stdout.
|
||||
(HTTP) Specify to which file you want curl to write all cookies after a
|
||||
completed operation. Curl writes all cookies previously read from a specified
|
||||
file as well as all cookies received from remote server(s). If no cookies are
|
||||
known, no file will be written. The file will be written using the Netscape
|
||||
cookie file format. If you set the file name to a single dash, "-", the
|
||||
cookies will be written to stdout.
|
||||
|
||||
This command line option will activate the cookie engine that makes curl
|
||||
record and use cookies. Another way to activate it is to use the \fI-b,
|
||||
@@ -221,13 +218,13 @@ If this option is used several times, the last one will be used.
|
||||
must specify valid ciphers. Read up on SSL cipher list details on this URL:
|
||||
\fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
|
||||
|
||||
NSS ciphers are done differently than OpenSSL and GnuTLS. The full list of
|
||||
NSS ciphers is in the NSSCipherSuite entry at this URL:
|
||||
\fIhttp://directory.fedora.redhat.com/docs/mod_nss.html#Directives\fP
|
||||
NSS ciphers are done differently than OpenSSL and GnuTLS. The full list of NSS
|
||||
ciphers is in the NSSCipherSuite entry at this URL:
|
||||
\fIhttp://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives\fP
|
||||
|
||||
If this option is used several times, the last one will override the others.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--compressed"
|
||||
(HTTP) Request a compressed response using one of the algorithms libcurl
|
||||
(HTTP) Request a compressed response using one of the algorithms curl
|
||||
supports, and save the uncompressed document. If this option is used and the
|
||||
server sends an unsupported encoding, curl will report an error.
|
||||
.IP "--connect-timeout <seconds>"
|
||||
@@ -237,10 +234,10 @@ of no more use. See also the \fI-m, --max-time\fP option.
|
||||
|
||||
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. This option creates the dirs mentioned
|
||||
with the -o option, nothing else. If the -o file name uses no dir or if the
|
||||
dirs it mentions already exist, no dir will be created.
|
||||
When used in conjunction with the \fI-o\fP option, curl will create the
|
||||
necessary local directory hierarchy as needed. This option creates the dirs
|
||||
mentioned with the \fI-o\fP option, nothing else. If the \fI-o\fP file name
|
||||
uses no dir or if the dirs it mentions already exist, no dir will be created.
|
||||
|
||||
To create remote directories when using FTP or SFTP, try
|
||||
\fI--ftp-create-dirs\fP.
|
||||
@@ -277,7 +274,7 @@ specified. Posting data from a file named 'foobar' would thus be done with
|
||||
.IP "-D, --dump-header <file>"
|
||||
Write the protocol headers to the specified file.
|
||||
|
||||
This option is handy to use when you want to store the headers that a HTTP
|
||||
This option is handy to use when you want to store the headers that an HTTP
|
||||
site sends to you. Cookies from the headers could then be read in a second
|
||||
curl invocation by using the \fI-b, --cookie\fP option! The
|
||||
\fI-c, --cookie-jar\fP option is however a better way to store cookies.
|
||||
@@ -285,8 +282,10 @@ curl invocation by using the \fI-b, --cookie\fP option! The
|
||||
When used in FTP, the FTP server response lines are considered being "headers"
|
||||
and thus are saved there.
|
||||
|
||||
If this option is used several times, the last one will be used. IP
|
||||
"--data-ascii <data>" See \fI-d, --data\fP.
|
||||
If this option is used several times, the last one will be used.
|
||||
|
||||
.IP "--data-ascii <data>"
|
||||
See \fI-d, --data\fP.
|
||||
.IP "--data-binary <data>"
|
||||
(HTTP) This posts data exactly as specified with no extra processing
|
||||
whatsoever.
|
||||
@@ -337,21 +336,20 @@ service ticket, which is a matter of realm policy.
|
||||
Unconditionally allow the server to delegate.
|
||||
.RE
|
||||
.IP "--digest"
|
||||
(HTTP) Enables HTTP Digest authentication. This is a authentication that
|
||||
prevents the password from being sent over the wire in clear text. Use this in
|
||||
combination with the normal \fI-u, --user\fP option to set user name and
|
||||
password. See also \fI--ntlm\fP, \fI--negotiate\fP and \fI--anyauth\fP for
|
||||
(HTTP) Enables HTTP Digest authentication. This is an authentication scheme
|
||||
that prevents the password from being sent over the wire in clear text. Use
|
||||
this in combination with the normal \fI-u, --user\fP option to set user name
|
||||
and password. See also \fI--ntlm\fP, \fI--negotiate\fP and \fI--anyauth\fP for
|
||||
related options.
|
||||
|
||||
If this option is used several times, the following occurrences make no
|
||||
difference.
|
||||
If this option is used several times, only the first one is used.
|
||||
.IP "--disable-eprt"
|
||||
(FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing
|
||||
active FTP transfers. Curl will normally always first attempt to use EPRT,
|
||||
then LPRT before using PORT, but with this option, it will use PORT right
|
||||
away. EPRT and LPRT are extensions to the original FTP protocol, and may not work
|
||||
on all servers, but they enable more functionality in a better way than the
|
||||
traditional PORT command.
|
||||
away. EPRT and LPRT are extensions to the original FTP protocol, and may not
|
||||
work on all servers, but they enable more functionality in a better way than
|
||||
the traditional PORT command.
|
||||
|
||||
\fB--eprt\fP can be used to explicitly enable EPRT again and \fB--no-eprt\fP
|
||||
is an alias for \fB--disable-eprt\fP.
|
||||
@@ -399,9 +397,9 @@ operations. Use \fI--engine list\fP to print a list of build-time supported
|
||||
engines. Note that not all (or none) of the engines may be available at
|
||||
run-time.
|
||||
.IP "--environment"
|
||||
(RISC OS ONLY) Sets a range of environment variables, using the names the -w
|
||||
option supports, to allow easier extraction of useful information after having
|
||||
run curl.
|
||||
(RISC OS ONLY) Sets a range of environment variables, using the names the
|
||||
\fI-w\fP option supports, to allow easier extraction of useful information
|
||||
after having run curl.
|
||||
.IP "--egd-file <file>"
|
||||
(SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket
|
||||
is used to seed the random engine for SSL connections. See also the
|
||||
@@ -425,11 +423,8 @@ The windows version of curl will automatically look for a CA certs file named
|
||||
\'curl-ca-bundle.crt\', either in the same directory as curl.exe, or in the
|
||||
Current Working Directory, or in any folder along your PATH.
|
||||
|
||||
If curl is built against the NSS SSL library then this option tells
|
||||
curl the nickname of the CA certificate to use within the NSS database
|
||||
defined by the environment variable SSL_DIR (or by default /etc/pki/nssdb).
|
||||
If the NSS PEM PKCS#11 module (libnsspem.so) is available then PEM files
|
||||
may be loaded.
|
||||
If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module
|
||||
(libnsspem.so) needs to be available for this option to work properly.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--capath <CA certificate directory>"
|
||||
@@ -446,7 +441,7 @@ used several times, the last one will be used.
|
||||
.IP "-f, --fail"
|
||||
(HTTP) Fail silently (no output at all) on server errors. This is mostly done
|
||||
to better enable scripts etc to better deal with failed attempts. In
|
||||
normal cases when a HTTP server fails to deliver a document, it returns an
|
||||
normal cases when an HTTP server fails to deliver a document, it returns an
|
||||
HTML document stating so (which often also describes why and more). This flag
|
||||
will prevent curl from outputting that and return error 22.
|
||||
|
||||
@@ -486,6 +481,17 @@ filename=, like this:
|
||||
|
||||
\fBcurl\fP -F "file=@localfile;filename=nameinpost" url.com
|
||||
|
||||
If filename/path contains ',' or ';', it must be quoted by double-quotes like:
|
||||
|
||||
\fBcurl\fP -F "file=@\\"localfile\\";filename=\\"nameinpost\\"" url.com
|
||||
|
||||
or
|
||||
|
||||
\fBcurl\fP -F 'file=@"localfile";filename="nameinpost"' url.com
|
||||
|
||||
Note that if a filename/path is quoted by double-quotes, any double-quote
|
||||
or backslash within the filename must be escaped by backslash.
|
||||
|
||||
See further examples and details in the MANUAL.
|
||||
|
||||
This option can be used multiple times.
|
||||
@@ -494,7 +500,7 @@ This option can be used multiple times.
|
||||
has been provided, this data is sent off using the ACCT command. (Added in
|
||||
7.13.0)
|
||||
|
||||
If this option is used twice, the second will override the previous use.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--ftp-alternative-to-user <command>"
|
||||
(FTP) If authenticating with the USER and PASS commands fails, send this
|
||||
command. When connecting to Tumbleweed's Secure Transport server over FTPS
|
||||
@@ -506,7 +512,7 @@ currently exist on the server, the standard behavior of curl is to
|
||||
fail. Using this option, curl will instead attempt to create missing
|
||||
directories.
|
||||
.IP "--ftp-method [method]"
|
||||
(FTP) Control what method curl should use to reach a file on a FTP(S)
|
||||
(FTP) Control what method curl should use to reach a file on an FTP(S)
|
||||
server. The method argument should be one of the following alternatives:
|
||||
.RS
|
||||
.IP multicwd
|
||||
@@ -527,9 +533,9 @@ compliant than 'nocwd' but without the full penalty of 'multicwd'.
|
||||
behavior, but using this option can be used to override a previous
|
||||
\fI-P/-ftp-port\fP option. (Added in 7.11.0)
|
||||
|
||||
If this option is used several times, the following occurrences make no
|
||||
difference. Undoing an enforced passive really isn't doable but you must then
|
||||
instead enforce the correct \fI-P, --ftp-port\fP again.
|
||||
If this option is used several times, only the first one is used. Undoing an
|
||||
enforced passive really isn't doable but you must then instead enforce the
|
||||
correct \fI-P, --ftp-port\fP again.
|
||||
|
||||
Passive mode means that curl will try the EPSV command first and then PASV,
|
||||
unless \fI--disable-epsv\fP is used.
|
||||
@@ -550,7 +556,7 @@ directory listings as well as up and downloads in PASV mode.
|
||||
Shuts down the SSL/TLS layer after authenticating. The rest of the
|
||||
control channel communication will be unencrypted. This allows
|
||||
NAT routers to follow the FTP transaction. The default mode is
|
||||
passive. See --ftp-ssl-ccc-mode for other modes.
|
||||
passive. See \fI--ftp-ssl-ccc-mode\fP for other modes.
|
||||
(Added in 7.16.1)
|
||||
.IP "--ftp-ssl-ccc-mode [active/passive]"
|
||||
(FTP) Use CCC (Clear Command Channel)
|
||||
@@ -577,16 +583,16 @@ interpreted by curl itself. Note that these letters are not normal legal URL
|
||||
contents but they should be encoded according to the URI standard.
|
||||
.IP "-G, --get"
|
||||
When used, this option will make all data specified with \fI-d, --data\fP or
|
||||
\fI--data-binary\fP to be used in a HTTP GET request instead of the POST
|
||||
\fI--data-binary\fP to be used in an HTTP GET request instead of the POST
|
||||
request that otherwise would be used. The data will be appended to the URL
|
||||
with a '?' separator.
|
||||
|
||||
If used in combination with -I, the POST data will instead be appended to the
|
||||
URL with a HEAD request.
|
||||
|
||||
If this option is used several times, the following occurrences make no
|
||||
difference. This is because undoing a GET doesn't make sense, but you should
|
||||
then instead enforce the alternative method you prefer.
|
||||
If this option is used several times, only the first one is used. This is
|
||||
because undoing a GET doesn't make sense, but you should then instead enforce
|
||||
the alternative method you prefer.
|
||||
.IP "-H, --header <header>"
|
||||
(HTTP) Extra header to use when getting a web page. You may specify any number
|
||||
of extra headers. Note that if you should add a custom header that has the
|
||||
@@ -595,9 +601,9 @@ header will be used instead of the internal one. This allows you to make even
|
||||
trickier stuff than curl would normally do. You should not replace internally
|
||||
set headers without knowing perfectly well what you're doing. Remove an
|
||||
internal header by giving a replacement without content on the right side of
|
||||
the colon, as in: -H \&"Host:". If you send the custom header with no-value then
|
||||
its header must be terminated with a semicolon, such as \-H "X-Custom-Header;"
|
||||
to send "X-Custom-Header:".
|
||||
the colon, as in: -H \&"Host:". If you send the custom header with no-value
|
||||
then its header must be terminated with a semicolon, such as \-H
|
||||
\&"X-Custom-Header;" to send "X-Custom-Header:".
|
||||
|
||||
curl will make sure that each header you add/replace is sent with the proper
|
||||
end-of-line marker, you should thus \fBnot\fP add that as a part of the header
|
||||
@@ -608,10 +614,9 @@ See also the \fI-A, --user-agent\fP and \fI-e, --referer\fP options.
|
||||
|
||||
This option can be used multiple times to add/replace/remove multiple headers.
|
||||
.IP "--hostpubmd5 <md5>"
|
||||
Pass a string containing 32 hexadecimal digits. The string should be the 128
|
||||
bit MD5 checksum of the remote host's public key, curl will refuse the
|
||||
connection with the host unless the md5sums match. This option is only for SCP
|
||||
and SFTP transfers. (Added in 7.17.1)
|
||||
(SCP/SFTP) Pass a string containing 32 hexadecimal digits. The string should
|
||||
be the 128 bit MD5 checksum of the remote host's public key, curl will refuse
|
||||
the connection with the host unless the md5sums match. (Added in 7.17.1)
|
||||
.IP "--ignore-content-length"
|
||||
(HTTP)
|
||||
Ignore the Content-Length header. This is particularly useful for servers
|
||||
@@ -624,7 +629,7 @@ like server-name, date of the document, HTTP-version and more...
|
||||
(HTTP/FTP/FILE)
|
||||
Fetch the HTTP-header only! HTTP-servers feature the command HEAD
|
||||
which this uses to get nothing but the header of a document. When used
|
||||
on a FTP or FILE file, curl displays the file size and last modification
|
||||
on an FTP or FILE file, curl displays the file size and last modification
|
||||
time only.
|
||||
.IP "--interface <name>"
|
||||
Perform an operation using a specified interface. You can enter interface
|
||||
@@ -639,8 +644,9 @@ make it discard all "session cookies". This will basically have the same effect
|
||||
as if a new session is started. Typical browsers always discard session
|
||||
cookies when they're closed down.
|
||||
.IP "-J, --remote-header-name"
|
||||
(HTTP) This option tells the -O, --remote-name option to use the server-specified
|
||||
Content-Disposition filename instead of extracting a filename from the URL.
|
||||
(HTTP) This option tells the \fI-O, --remote-name\fP option to use the
|
||||
server-specified Content-Disposition filename instead of extracting a filename
|
||||
from the URL.
|
||||
.IP "-k, --insecure"
|
||||
(SSL) This option explicitly allows curl to perform "insecure" SSL connections
|
||||
and transfers. All SSL connections are attempted to be made secure by using
|
||||
@@ -711,7 +717,7 @@ currently effective on operating systems offering the TCP_KEEPIDLE and
|
||||
TCP_KEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more). This
|
||||
option has no effect if \fI--no-keepalive\fP is used. (Added in 7.18.0)
|
||||
|
||||
If this option is used multiple times, the last occurrence sets the amount. If
|
||||
If this option is used several times, the last one will be used. If
|
||||
unspecified, the option defaults to 60 seconds.
|
||||
.IP "--key <key>"
|
||||
(SSL/SSH) Private key file name. Allows you to provide your private key in this
|
||||
@@ -817,9 +823,9 @@ Specify the maximum size (in bytes) of a file to download. If the file
|
||||
requested is larger than this value, the transfer will not start and curl will
|
||||
return with exit code 63.
|
||||
|
||||
\fBNOTE:\fP The file size is not always known prior to download, and for such files
|
||||
this option has no effect even if the file transfer ends up being larger than
|
||||
this given limit. This concerns both FTP and HTTP transfers.
|
||||
\fBNOTE:\fP The file size is not always known prior to download, and for such
|
||||
files this option has no effect even if the file transfer ends up being larger
|
||||
than this given limit. This concerns both FTP and HTTP transfers.
|
||||
.IP "--mail-rcpt <address>"
|
||||
(SMTP) Specify a single address that the given mail should get sent to. This
|
||||
option can be used multiple times to specify many recipients.
|
||||
@@ -833,12 +839,12 @@ option to -1 to make it limitless.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--metalink"
|
||||
This option can tell curl to parse and process a given URI as Metalink file (both
|
||||
version 3 and 4 (RFC 5854) are supported) and make use of the mirrors
|
||||
listed within for failover if there are errors (such as the file or
|
||||
server not being available). It will also verify the hashe of the file
|
||||
after the download completes. The Metalink file itself is downloaded
|
||||
and processed in memory and not stored in the local file system.
|
||||
This option can tell curl to parse and process a given URI as Metalink file
|
||||
(both version 3 and 4 (RFC 5854) are supported) and make use of the mirrors
|
||||
listed within for failover if there are errors (such as the file or server not
|
||||
being available). It will also verify the hash of the file after the download
|
||||
completes. The Metalink file itself is downloaded and processed in memory and
|
||||
not stored in the local file system.
|
||||
|
||||
Example to use a remote Metalink file:
|
||||
|
||||
@@ -850,8 +856,8 @@ To use a Metalink file in the local file system, use FILE protocol
|
||||
\fBcurl\fP --metalink file://example.metalink
|
||||
|
||||
Please note that if FILE protocol is disabled, there is no way to use
|
||||
a local Metalink file at the time of this writing. Also note that If
|
||||
--metalink and --include are used together, --include will be
|
||||
a local Metalink file at the time of this writing. Also note that if
|
||||
\fI--metalink\fP and \fI--include\fP are used together, \fI--include\fP will be
|
||||
ignored. This is because including headers in the response will break
|
||||
Metalink parser and if the headers are included in the file described
|
||||
in Metalink file, hash check will fail.
|
||||
@@ -890,7 +896,7 @@ You can only specify one netrc file per invocation. If several
|
||||
(Added in 7.21.5)
|
||||
|
||||
This option overrides any use of \fI--netrc\fP as they are mutually exclusive.
|
||||
It will also abide by --netrc-optional if specified.
|
||||
It will also abide by \fI--netrc-optional\fP if specified.
|
||||
|
||||
.IP "--netrc-optional"
|
||||
Very similar to \fI--netrc\fP, but this option makes the .netrc usage
|
||||
@@ -910,12 +916,11 @@ This option requires a library built with GSSAPI support. This is
|
||||
not very common. Use \fI-V, --version\fP to see if your version supports
|
||||
GSS-Negotiate.
|
||||
|
||||
When using this option, you must also provide a fake -u, --user option to
|
||||
When using this option, you must also provide a fake \fI-u, --user\fP option to
|
||||
activate the authentication code properly. Sending a '-u :' is enough as the
|
||||
user name and password from the -u option aren't actually used.
|
||||
user name and password from the \fI-u\fP option aren't actually used.
|
||||
|
||||
If this option is used several times, the following occurrences make no
|
||||
difference.
|
||||
If this option is used several times, only the first one is used.
|
||||
.IP "--no-keepalive"
|
||||
Disables the use of keepalive messages on the TCP connection, as by default
|
||||
curl enables them.
|
||||
@@ -952,8 +957,7 @@ If you want to enable NTLM for your proxy authentication, then use
|
||||
This option requires a library built with SSL support. Use
|
||||
\fI-V, --version\fP to see if your curl supports NTLM.
|
||||
|
||||
If this option is used several times, the following occurrences make no
|
||||
difference.
|
||||
If this option is used several times, only the first one is used.
|
||||
.IP "-o, --output <file>"
|
||||
Write output to <file> instead of stdout. If you are using {} or [] to fetch
|
||||
multiple documents, you can use '#' followed by a number in the <file>
|
||||
@@ -1021,16 +1025,16 @@ available.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--post301"
|
||||
Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET
|
||||
requests when following a 301 redirection. The non-RFC behaviour is ubiquitous
|
||||
in web browsers, so curl does the conversion by default to maintain
|
||||
(HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests
|
||||
into GET requests when following a 301 redirection. The non-RFC behaviour is
|
||||
ubiquitous in web browsers, so curl does the conversion by default to maintain
|
||||
consistency. However, a server may require a POST to remain a POST after such
|
||||
a redirection. This option is meaningful only when using \fI-L, --location\fP
|
||||
(Added in 7.17.1)
|
||||
.IP "--post302"
|
||||
Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET
|
||||
requests when following a 302 redirection. The non-RFC behaviour is ubiquitous
|
||||
in web browsers, so curl does the conversion by default to maintain
|
||||
(HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests
|
||||
into GET requests when following a 302 redirection. The non-RFC behaviour is
|
||||
ubiquitous in web browsers, so curl does the conversion by default to maintain
|
||||
consistency. However, a server may require a POST to remain a POST after such
|
||||
a redirection. This option is meaningful only when using \fI-L, --location\fP
|
||||
(Added in 7.19.1)
|
||||
@@ -1119,24 +1123,24 @@ default config file search path.
|
||||
commands are sent BEFORE the transfer takes place (just after the initial PWD
|
||||
command in an FTP transfer, to be exact). To make commands take place after a
|
||||
successful transfer, prefix them with a dash '-'. To make commands be sent
|
||||
after libcurl has changed the working directory, just before the transfer
|
||||
after curl has changed the working directory, just before the transfer
|
||||
command(s), prefix the command with a '+' (this is only supported for
|
||||
FTP). You may specify any number of commands. If the server returns failure
|
||||
for one of the commands, the entire operation will be aborted. You must send
|
||||
syntactically correct FTP commands as RFC 959 defines to FTP servers, or one
|
||||
of the commands listed below to SFTP servers. This option can be used
|
||||
multiple times. When speaking to a FTP server, prefix the command with an
|
||||
asterisk (*) to make libcurl continue even if the command fails as by default
|
||||
multiple times. When speaking to an FTP server, prefix the command with an
|
||||
asterisk (*) to make curl continue even if the command fails as by default
|
||||
curl will stop at first failure.
|
||||
|
||||
SFTP is a binary protocol. Unlike for FTP, libcurl interprets SFTP quote
|
||||
commands itself before sending them to the server. File names may be quoted
|
||||
SFTP is a binary protocol. Unlike for FTP, curl interprets SFTP quote commands
|
||||
itself before sending them to the server. File names may be quoted
|
||||
shell-style to embed spaces or special characters. Following is the list of
|
||||
all supported SFTP quote commands:
|
||||
.RS
|
||||
.IP "chgrp group file"
|
||||
The chgrp command sets the group ID of the file named by the file operand to the
|
||||
group ID specified by the group operand. The group operand is a decimal
|
||||
The chgrp command sets the group ID of the file named by the file operand to
|
||||
the group ID specified by the group operand. The group operand is a decimal
|
||||
integer group ID.
|
||||
.IP "chmod mode file"
|
||||
The chmod command modifies the file mode bits of the specified file. The
|
||||
@@ -1194,9 +1198,10 @@ specifies two separate 100-byte ranges(*)(H)
|
||||
(*) = NOTE that this will cause the server to reply with a multipart
|
||||
response!
|
||||
|
||||
Only digit characters (0-9) are valid in the 'start' and 'stop' fields of
|
||||
the \&'start-stop' range syntax. If a non-digit character is given in the range, the server's
|
||||
response will be unspecified, depending on the server's configuration.
|
||||
Only digit characters (0-9) are valid in the 'start' and 'stop' fields of the
|
||||
\&'start-stop' range syntax. If a non-digit character is given in the range,
|
||||
the server's response will be unspecified, depending on the server's
|
||||
configuration.
|
||||
|
||||
You should also be aware that many HTTP/1.1 servers do not have this feature
|
||||
enabled, so that when you attempt to get a range, you'll instead get the whole
|
||||
@@ -1208,7 +1213,7 @@ FTP command SIZE.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-R, --remote-time"
|
||||
When used, this will make libcurl attempt to figure out the timestamp of the
|
||||
When used, this will make curl attempt to figure out the timestamp of the
|
||||
remote file, and if that is available make the local file get that same
|
||||
timestamp.
|
||||
.IP "--random-file <file>"
|
||||
@@ -1216,7 +1221,7 @@ timestamp.
|
||||
random data. The data is used to seed the random engine for SSL connections.
|
||||
See also the \fI--egd-file\fP option.
|
||||
.IP "--raw"
|
||||
When used, it disables all internal HTTP decoding of content or transfer
|
||||
(HTTP) When used, it disables all internal HTTP decoding of content or transfer
|
||||
encodings and instead makes them passed on unaltered, raw. (Added in 7.16.2)
|
||||
.IP "--remote-name-all"
|
||||
This option changes the default action for all given URLs to be dealt with as
|
||||
@@ -1248,7 +1253,7 @@ using \fI--retry-delay\fP you disable this exponential backoff algorithm. See
|
||||
also \fI--retry-max-time\fP to limit the total time allowed for
|
||||
retries. (Added in 7.12.3)
|
||||
|
||||
If this option is used multiple times, the last occurrence determines the amount.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--retry-delay <seconds>"
|
||||
Make curl sleep this amount of time before each retry when a transfer has
|
||||
failed with a transient error (it changes the default backoff time algorithm
|
||||
@@ -1256,7 +1261,7 @@ between retries). This option is only interesting if \fI--retry\fP is also
|
||||
used. Setting this delay to zero will make curl use the default backoff time.
|
||||
(Added in 7.12.3)
|
||||
|
||||
If this option is used multiple times, the last occurrence determines the amount.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--retry-max-time <seconds>"
|
||||
The retry timer is reset before the first transfer attempt. Retries will be
|
||||
done as usual (see \fI--retry\fP) as long as the timer hasn't reached this
|
||||
@@ -1265,13 +1270,12 @@ will be made and while performing, it may take longer than this given time
|
||||
period. To limit a single request\'s maximum time, use \fI-m, --max-time\fP.
|
||||
Set this option to zero to not timeout retries. (Added in 7.12.3)
|
||||
|
||||
If this option is used multiple times, the last occurrence determines the
|
||||
amount.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-s, --silent"
|
||||
Silent or quiet mode. Don't show progress meter or error messages. Makes
|
||||
Curl mute.
|
||||
.IP "-S, --show-error"
|
||||
When used with -s it makes curl show an error message if it fails.
|
||||
When used with \fI-s\fP it makes curl show an error message if it fails.
|
||||
.IP "--ssl"
|
||||
(FTP, POP3, IMAP, SMTP) Try to use SSL/TLS for the connection. Reverts to a
|
||||
non-secure connection if the server doesn't support SSL/TLS. See also
|
||||
@@ -1375,7 +1379,7 @@ part in the specified URL, Curl will append the local file name. NOTE that you
|
||||
must use a trailing / on the last directory to really prove to Curl that there
|
||||
is no file name or curl will think that your last directory name is the remote
|
||||
file name to use. That will most likely cause the upload operation to fail. If
|
||||
this is used on a HTTP(S) server, the PUT command will be used.
|
||||
this is used on an HTTP(S) server, the PUT command will be used.
|
||||
|
||||
Use the file name "-" (a single dash) to use stdin instead of a given file.
|
||||
Alternately, the file name "." (a single period) may be specified instead
|
||||
@@ -1418,7 +1422,7 @@ Set password for use with the TLS authentication method specified with
|
||||
7.21.4)
|
||||
.IP "--tr-encoding"
|
||||
(HTTP) Request a compressed Transfer-Encoding response using one of the
|
||||
algorithms libcurl supports, and uncompress the data while receiving it.
|
||||
algorithms curl supports, and uncompress the data while receiving it.
|
||||
|
||||
(Added in 7.21.6)
|
||||
.IP "--trace <file>"
|
||||
@@ -1503,17 +1507,21 @@ space with \\t.
|
||||
The %-symbol is a special symbol in the win32-environment, where all
|
||||
occurrences of % must be doubled when using this option.
|
||||
|
||||
The variables available at this point are:
|
||||
The variables available are:
|
||||
.RS
|
||||
.TP 15
|
||||
.B url_effective
|
||||
The URL that was fetched last. This is most meaningful if you've told curl
|
||||
to follow location: headers.
|
||||
.B content_type
|
||||
The Content-Type of the requested document, if there was any.
|
||||
.TP
|
||||
.B filename_effective
|
||||
The ultimate filename that curl writes out to. This is only meaningful if curl
|
||||
is told to write to a file with the --remote-name or --output option. It's most
|
||||
useful in combination with the --remote-header-name option. (Added in 7.25.1)
|
||||
is told to write to a file with the \fI--remote-name\fP or \fI--output\fP
|
||||
option. It's most useful in combination with the \fI--remote-header-name\fP
|
||||
option. (Added in 7.25.1)
|
||||
.TP
|
||||
.B ftp_entry_path
|
||||
The initial path curl ended up in when logging on to the remote FTP
|
||||
server. (Added in 7.15.4)
|
||||
.TP
|
||||
.B http_code
|
||||
The numerical response code that was found in the last retrieved HTTP(S) or
|
||||
@@ -1524,21 +1532,65 @@ same info.
|
||||
The numerical code that was found in the last response (from a proxy) to a
|
||||
curl CONNECT request. (Added in 7.12.4)
|
||||
.TP
|
||||
.B time_total
|
||||
The total time, in seconds, that the full operation lasted. The time will be
|
||||
displayed with millisecond resolution.
|
||||
.B local_ip
|
||||
The IP address of the local end of the most recently done connection - can be
|
||||
either IPv4 or IPv6 (Added in 7.29.0)
|
||||
.TP
|
||||
.B time_namelookup
|
||||
The time, in seconds, it took from the start until the name resolving was
|
||||
completed.
|
||||
.B local_port
|
||||
The local port number of the most recently done connection (Added in 7.29.0)
|
||||
.TP
|
||||
.B num_connects
|
||||
Number of new connects made in the recent transfer. (Added in 7.12.3)
|
||||
.TP
|
||||
.B num_redirects
|
||||
Number of redirects that were followed in the request. (Added in 7.12.3)
|
||||
.TP
|
||||
.B redirect_url
|
||||
When an HTTP request was made without -L to follow redirects, this variable
|
||||
will show the actual URL a redirect \fIwould\fP take you to. (Added in 7.18.2)
|
||||
.TP
|
||||
.B remote_ip
|
||||
The remote IP address of the most recently done connection - can be either
|
||||
IPv4 or IPv6 (Added in 7.29.0)
|
||||
.TP
|
||||
.B remote_port
|
||||
The remote port number of the most recently done connection (Added in 7.29.0)
|
||||
.TP
|
||||
.B size_download
|
||||
The total amount of bytes that were downloaded.
|
||||
.TP
|
||||
.B size_header
|
||||
The total amount of bytes of the downloaded headers.
|
||||
.TP
|
||||
.B size_request
|
||||
The total amount of bytes that were sent in the HTTP request.
|
||||
.TP
|
||||
.B size_upload
|
||||
The total amount of bytes that were uploaded.
|
||||
.TP
|
||||
.B speed_download
|
||||
The average download speed that curl measured for the complete download. Bytes
|
||||
per second.
|
||||
.TP
|
||||
.B speed_upload
|
||||
The average upload speed that curl measured for the complete upload. Bytes per
|
||||
second.
|
||||
.TP
|
||||
.B ssl_verify_result
|
||||
The result of the SSL peer certificate verification that was requested. 0
|
||||
means the verification was successful. (Added in 7.19.0)
|
||||
.TP
|
||||
.B time_appconnect
|
||||
The time, in seconds, it took from the start until the SSL/SSH/etc
|
||||
connect/handshake to the remote host was completed. (Added in 7.19.0)
|
||||
.TP
|
||||
.B time_connect
|
||||
The time, in seconds, it took from the start until the TCP connect to the
|
||||
remote host (or proxy) was completed.
|
||||
.TP
|
||||
.B time_appconnect
|
||||
The time, in seconds, it took from the start until the SSL/SSH/etc
|
||||
connect/handshake to the remote host was completed. (Added in 7.19.0)
|
||||
.B time_namelookup
|
||||
The time, in seconds, it took from the start until the name resolving was
|
||||
completed.
|
||||
.TP
|
||||
.B time_pretransfer
|
||||
The time, in seconds, it took from the start until the file transfer was just
|
||||
@@ -1552,50 +1604,17 @@ started. time_redirect shows the complete execution time for multiple
|
||||
redirections. (Added in 7.12.3)
|
||||
.TP
|
||||
.B time_starttransfer
|
||||
The time, in seconds, it took from the start until the first byte was just about
|
||||
to be transferred. This includes time_pretransfer and also the time the
|
||||
The time, in seconds, it took from the start until the first byte was just
|
||||
about to be transferred. This includes time_pretransfer and also the time the
|
||||
server needed to calculate the result.
|
||||
.TP
|
||||
.B size_download
|
||||
The total amount of bytes that were downloaded.
|
||||
.B time_total
|
||||
The total time, in seconds, that the full operation lasted. The time will be
|
||||
displayed with millisecond resolution.
|
||||
.TP
|
||||
.B size_upload
|
||||
The total amount of bytes that were uploaded.
|
||||
.TP
|
||||
.B size_header
|
||||
The total amount of bytes of the downloaded headers.
|
||||
.TP
|
||||
.B size_request
|
||||
The total amount of bytes that were sent in the HTTP request.
|
||||
.TP
|
||||
.B speed_download
|
||||
The average download speed that curl measured for the complete download. Bytes
|
||||
per second.
|
||||
.TP
|
||||
.B speed_upload
|
||||
The average upload speed that curl measured for the complete upload. Bytes per
|
||||
second.
|
||||
.TP
|
||||
.B content_type
|
||||
The Content-Type of the requested document, if there was any.
|
||||
.TP
|
||||
.B num_connects
|
||||
Number of new connects made in the recent transfer. (Added in 7.12.3)
|
||||
.TP
|
||||
.B num_redirects
|
||||
Number of redirects that were followed in the request. (Added in 7.12.3)
|
||||
.TP
|
||||
.B redirect_url
|
||||
When a HTTP request was made without -L to follow redirects, this variable
|
||||
will show the actual URL a redirect \fIwould\fP take you to. (Added in 7.18.2)
|
||||
.TP
|
||||
.B ftp_entry_path
|
||||
The initial path libcurl ended up in when logging on to the remote FTP
|
||||
server. (Added in 7.15.4)
|
||||
.TP
|
||||
.B ssl_verify_result
|
||||
The result of the SSL peer certificate verification that was requested. 0
|
||||
means the verification was successful. (Added in 7.19.0)
|
||||
.B url_effective
|
||||
The URL that was fetched last. This is most meaningful if you've told curl
|
||||
to follow location: headers.
|
||||
.RE
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
@@ -1607,14 +1626,14 @@ This option overrides existing environment variables that set the proxy to
|
||||
use. If there's an environment variable setting a proxy, you can set proxy to
|
||||
\&"" to override it.
|
||||
|
||||
All operations that are performed over a HTTP proxy will transparently be
|
||||
All operations that are performed over an HTTP proxy will transparently be
|
||||
converted to HTTP. It means that certain protocol specific operations might
|
||||
not be available. This is not the case if you can tunnel through the proxy, as
|
||||
one with the \fI-p, --proxytunnel\fP option.
|
||||
|
||||
User and password that might be provided in the proxy string are URL decoded
|
||||
by libcurl. This allows you to pass in special characters such as @ by using
|
||||
%40 or pass in a colon with %3a.
|
||||
by curl. This allows you to pass in special characters such as @ by using %40
|
||||
or pass in a colon with %3a.
|
||||
|
||||
The proxy host can be specified the exact same way as the proxy environment
|
||||
variables, including the protocol prefix (http://) and the embedded user +
|
||||
@@ -1634,6 +1653,14 @@ details and explanations. Common additional HTTP requests include PUT and
|
||||
DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and
|
||||
more.
|
||||
|
||||
Normally you don't need this option. All sorts of GET, HEAD, POST and PUT
|
||||
requests are rather invoked by using dedicated command line options.
|
||||
|
||||
This option only changes the actual word used in the HTTP request, it does not
|
||||
alter the way curl behaves. So for example if you want to make a proper HEAD
|
||||
request, using -X HEAD will not suffice. You need to use the \fI-I, --head\fP
|
||||
option.
|
||||
|
||||
(FTP)
|
||||
Specifies a custom FTP command to use instead of LIST when doing file lists
|
||||
with FTP.
|
||||
@@ -1650,7 +1677,7 @@ attributes, a warning is issued.
|
||||
.IP "-y, --speed-time <time>"
|
||||
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.
|
||||
speed-limit will be 1 unless set with \fI-Y\fP.
|
||||
|
||||
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.
|
||||
@@ -1658,16 +1685,17 @@ 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
|
||||
speed-time seconds it gets aborted. speed-time is set with -y and is 30 if
|
||||
not set.
|
||||
speed-time seconds it gets aborted. speed-time is set with \fI-y\fP and is 30
|
||||
if not set.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-z/--time-cond <date expression>|<file>"
|
||||
(HTTP/FTP) Request a file that has been modified later than the given time and
|
||||
date, or one that has been modified before that time. The <date expression> can
|
||||
be all sorts of date strings or if it doesn't match any internal ones, it is
|
||||
taken as a filename and tries to get the modification date (mtime) from <file>
|
||||
instead. See the \fIcurl_getdate(3)\fP man pages for date expression details.
|
||||
date, or one that has been modified before that time. The <date expression>
|
||||
can be all sorts of date strings or if it doesn't match any internal ones, it
|
||||
is taken as a filename and tries to get the modification date (mtime) from
|
||||
<file> instead. See the \fIcurl_getdate(3)\fP man pages for date expression
|
||||
details.
|
||||
|
||||
Start the date expression with a dash (-) to make it request for a document
|
||||
that is older than the given date/time, default is a document that is newer
|
||||
@@ -1753,7 +1781,7 @@ Since curl version 7.21.7, the proxy string may be specified with a
|
||||
protocol:// prefix to specify alternative proxy protocols.
|
||||
|
||||
If no protocol is specified in the proxy string or if the string doesn't match
|
||||
a supported one, the proxy will be treated as a HTTP proxy.
|
||||
a supported one, the proxy will be treated as an HTTP proxy.
|
||||
|
||||
The supported proxy protocol prefixes are as follows:
|
||||
.IP "socks4://"
|
||||
|
||||
2
docs/examples/.gitignore
vendored
2
docs/examples/.gitignore
vendored
@@ -11,6 +11,7 @@ ftp-wildcard
|
||||
ftpget
|
||||
ftpgetinfo
|
||||
ftpgetresp
|
||||
ftpsget
|
||||
ftpupload
|
||||
getinfo
|
||||
getinmemory
|
||||
@@ -34,6 +35,7 @@ resolve
|
||||
rtsp
|
||||
sendrecv
|
||||
sepheaders
|
||||
sftpget
|
||||
simple
|
||||
simplepost
|
||||
simplesmtp
|
||||
|
||||
@@ -31,24 +31,32 @@ EXTRA_DIST = README Makefile.example Makefile.inc Makefile.m32 \
|
||||
# might possibly already be installed in the system.
|
||||
#
|
||||
# $(top_builddir)/include/curl for generated curlbuild.h included from curl.h
|
||||
# $(top_builddir)/include for generated curlbuild.h included from lib/setup.h
|
||||
# $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h
|
||||
# $(top_srcdir)/include is for libcurl's external include files
|
||||
|
||||
INCLUDES = -I$(top_builddir)/include/curl \
|
||||
-I$(top_builddir)/include \
|
||||
-I$(top_srcdir)/include
|
||||
AM_CPPFLAGS = -I$(top_builddir)/include/curl \
|
||||
-I$(top_builddir)/include \
|
||||
-I$(top_srcdir)/include
|
||||
|
||||
LIBDIR = $(top_builddir)/lib
|
||||
|
||||
AM_CPPFLAGS = -DCURL_NO_OLDIES
|
||||
# Avoid libcurl obsolete stuff
|
||||
AM_CPPFLAGS += -DCURL_NO_OLDIES
|
||||
|
||||
# Mostly for Windows build targets, when using static libcurl
|
||||
if USE_CPPFLAG_CURL_STATICLIB
|
||||
AM_CPPFLAGS += -DCURL_STATICLIB
|
||||
endif
|
||||
|
||||
# Prevent LIBS from being used for all link targets
|
||||
LIBS = $(BLANK_AT_MAKETIME)
|
||||
|
||||
# Dependencies
|
||||
if USE_EXPLICIT_LIB_DEPS
|
||||
LDADD = $(LIBDIR)/libcurl.la @LIBCURL_LIBS@
|
||||
else
|
||||
LDADD = $(LIBDIR)/libcurl.la
|
||||
endif
|
||||
|
||||
# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
|
||||
include Makefile.inc
|
||||
|
||||
@@ -5,11 +5,11 @@ check_PROGRAMS = 10-at-a-time anyauthput cookie_interface debug fileupload \
|
||||
persistant post-callback postit2 sepheaders simple simplepost simplessl \
|
||||
sendrecv httpcustomheader certinfo chkspeed ftpgetinfo ftp-wildcard \
|
||||
smtp-multi simplesmtp smtp-tls rtsp externalsocket resolve \
|
||||
progressfunc pop3s pop3slist imap url2file
|
||||
progressfunc pop3s pop3slist imap url2file sftpget ftpsget
|
||||
|
||||
# These examples require external dependencies that may not be commonly
|
||||
# available on POSIX systems, so don't bother attempting to compile them here.
|
||||
COMPLICATED_EXAMPLES = curlgtk.c curlx.c htmltitle.cc cacertinmem.c \
|
||||
COMPLICATED_EXAMPLES = curlgtk.c curlx.c htmltitle.cpp cacertinmem.c \
|
||||
ftpuploadresume.c ghiper.c hiperfifo.c htmltidy.c multithread.c \
|
||||
opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c evhiperfifo.c \
|
||||
smooth-gtk-thread.c version-check.pl
|
||||
smooth-gtk-thread.c version-check.pl href_extractor.c asiohiper.cpp
|
||||
|
||||
@@ -42,7 +42,7 @@ OPENSSL_PATH = ../../../openssl-0.9.8x
|
||||
endif
|
||||
# Edit the path below to point to the base of your LibSSH2 package.
|
||||
ifndef LIBSSH2_PATH
|
||||
LIBSSH2_PATH = ../../../libssh2-1.4.2
|
||||
LIBSSH2_PATH = ../../../libssh2-1.4.3
|
||||
endif
|
||||
# Edit the path below to point to the base of your librtmp package.
|
||||
ifndef LIBRTMP_PATH
|
||||
|
||||
@@ -24,7 +24,7 @@ endif
|
||||
|
||||
# Edit the path below to point to the base of your LibSSH2 package.
|
||||
ifndef LIBSSH2_PATH
|
||||
LIBSSH2_PATH = ../../../libssh2-1.4.2
|
||||
LIBSSH2_PATH = ../../../libssh2-1.4.3
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your axTLS package.
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
# ifdef __VMS
|
||||
typedef int intptr_t;
|
||||
# endif
|
||||
# include <stdint.h>
|
||||
# if !defined(_AIX) && !defined(__sgi) && !defined(__osf__)
|
||||
# include <stdint.h>
|
||||
# endif
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
@@ -51,6 +53,12 @@
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#if defined(_AIX) || defined(__sgi) || defined(__osf__)
|
||||
#ifndef intptr_t
|
||||
#define intptr_t long
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This example shows a HTTP PUT operation with authentiction using "any"
|
||||
* type. It PUTs a file given as a command line argument to the URL also given
|
||||
|
||||
454
docs/examples/asiohiper.cpp
Normal file
454
docs/examples/asiohiper.cpp
Normal file
@@ -0,0 +1,454 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* file: asiohiper.cpp
|
||||
* Example program to demonstrate the use of multi socket interface
|
||||
* with boost::asio
|
||||
*
|
||||
* This program is in c++ and uses boost::asio instead of libevent/libev.
|
||||
* Requires boost::asio, boost::bind and boost::system
|
||||
*
|
||||
* This is an adaptation of libcurl's "hiperfifo.c" and "evhiperfifo.c"
|
||||
* sample programs. This example implements a subset of the functionality from
|
||||
* hiperfifo.c, for full functionality refer hiperfifo.c or evhiperfifo.c
|
||||
*
|
||||
* Written by Lijo Antony based on hiperfifo.c by Jeff Pohlmeyer
|
||||
*
|
||||
* When running, the program creates an easy handle for a URL and
|
||||
* uses the curl_multi API to fetch it.
|
||||
*
|
||||
* Note:
|
||||
* For the sake of simplicity, URL is hard coded to "www.google.com"
|
||||
*
|
||||
* This is purely a demo app, all retrieved data is simply discarded by the write
|
||||
* callback.
|
||||
*/
|
||||
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */
|
||||
|
||||
/* boost::asio related objects
|
||||
* using global variables for simplicity
|
||||
*/
|
||||
boost::asio::io_service io_service;
|
||||
boost::asio::deadline_timer timer(io_service);
|
||||
std::map<curl_socket_t, boost::asio::ip::tcp::socket *> socket_map;
|
||||
|
||||
/* Global information, common to all connections */
|
||||
typedef struct _GlobalInfo
|
||||
{
|
||||
CURLM *multi;
|
||||
int still_running;
|
||||
} GlobalInfo;
|
||||
|
||||
/* Information associated with a specific easy handle */
|
||||
typedef struct _ConnInfo
|
||||
{
|
||||
CURL *easy;
|
||||
char *url;
|
||||
GlobalInfo *global;
|
||||
char error[CURL_ERROR_SIZE];
|
||||
} ConnInfo;
|
||||
|
||||
static void timer_cb(const boost::system::error_code & error, GlobalInfo *g);
|
||||
|
||||
/* Update the event timer after curl_multi library calls */
|
||||
static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
||||
{
|
||||
fprintf(MSG_OUT, "\nmulti_timer_cb: timeout_ms %ld", timeout_ms);
|
||||
|
||||
/* cancel running timer */
|
||||
timer.cancel();
|
||||
|
||||
if ( timeout_ms > 0 )
|
||||
{
|
||||
/* update timer */
|
||||
timer.expires_from_now(boost::posix_time::millisec(timeout_ms));
|
||||
timer.async_wait(boost::bind(&timer_cb, _1, g));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* call timeout function immediately */
|
||||
boost::system::error_code error; /*success*/
|
||||
timer_cb(error, g);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Die if we get a bad CURLMcode somewhere */
|
||||
static void mcode_or_die(const char *where, CURLMcode code)
|
||||
{
|
||||
if ( CURLM_OK != code )
|
||||
{
|
||||
const char *s;
|
||||
switch ( code )
|
||||
{
|
||||
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
||||
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
||||
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
|
||||
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
|
||||
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
|
||||
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
|
||||
case CURLM_LAST: s="CURLM_LAST"; break;
|
||||
default: s="CURLM_unknown";
|
||||
break;
|
||||
case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET";
|
||||
fprintf(MSG_OUT, "\nERROR: %s returns %s", where, s);
|
||||
/* ignore this error */
|
||||
return;
|
||||
}
|
||||
fprintf(MSG_OUT, "\nERROR: %s returns %s", where, s);
|
||||
exit(code);
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for completed transfers, and remove their easy handles */
|
||||
static void check_multi_info(GlobalInfo *g)
|
||||
{
|
||||
char *eff_url;
|
||||
CURLMsg *msg;
|
||||
int msgs_left;
|
||||
ConnInfo *conn;
|
||||
CURL *easy;
|
||||
CURLcode res;
|
||||
|
||||
fprintf(MSG_OUT, "\nREMAINING: %d", g->still_running);
|
||||
|
||||
while ((msg = curl_multi_info_read(g->multi, &msgs_left)))
|
||||
{
|
||||
if (msg->msg == CURLMSG_DONE)
|
||||
{
|
||||
easy = msg->easy_handle;
|
||||
res = msg->data.result;
|
||||
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
|
||||
curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url);
|
||||
fprintf(MSG_OUT, "\nDONE: %s => (%d) %s", eff_url, res, conn->error);
|
||||
curl_multi_remove_handle(g->multi, easy);
|
||||
free(conn->url);
|
||||
curl_easy_cleanup(easy);
|
||||
free(conn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Called by asio when there is an action on a socket */
|
||||
static void event_cb(GlobalInfo * g, boost::asio::ip::tcp::socket * tcp_socket, int action)
|
||||
{
|
||||
fprintf(MSG_OUT, "\nevent_cb: action=%d", action);
|
||||
|
||||
CURLMcode rc;
|
||||
rc = curl_multi_socket_action(g->multi, tcp_socket->native_handle(), action, &g->still_running);
|
||||
|
||||
mcode_or_die("event_cb: curl_multi_socket_action", rc);
|
||||
check_multi_info(g);
|
||||
|
||||
if ( g->still_running <= 0 )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nlast transfer done, kill timeout");
|
||||
timer.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
/* Called by asio when our timeout expires */
|
||||
static void timer_cb(const boost::system::error_code & error, GlobalInfo *g)
|
||||
{
|
||||
if ( !error)
|
||||
{
|
||||
fprintf(MSG_OUT, "\ntimer_cb: ");
|
||||
|
||||
CURLMcode rc;
|
||||
rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running);
|
||||
|
||||
mcode_or_die("timer_cb: curl_multi_socket_action", rc);
|
||||
check_multi_info(g);
|
||||
}
|
||||
}
|
||||
|
||||
/* Clean up any data */
|
||||
static void remsock(int *f, GlobalInfo *g)
|
||||
{
|
||||
fprintf(MSG_OUT, "\nremsock: ");
|
||||
|
||||
if ( f )
|
||||
{
|
||||
free(f);
|
||||
}
|
||||
}
|
||||
|
||||
static void setsock(int *fdp, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
||||
{
|
||||
fprintf(MSG_OUT, "\nsetsock: socket=%d, act=%d, fdp=%p", s, act, fdp);
|
||||
|
||||
std::map<curl_socket_t, boost::asio::ip::tcp::socket *>::iterator it = socket_map.find(s);
|
||||
|
||||
if ( it == socket_map.end() )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nsocket %d is a c-ares socket, ignoring", s);
|
||||
return;
|
||||
}
|
||||
|
||||
boost::asio::ip::tcp::socket * tcp_socket = it->second;
|
||||
|
||||
*fdp = act;
|
||||
|
||||
if ( act == CURL_POLL_IN )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nwatching for socket to become readable");
|
||||
|
||||
tcp_socket->async_read_some(boost::asio::null_buffers(),
|
||||
boost::bind(&event_cb, g,
|
||||
tcp_socket,
|
||||
act));
|
||||
}
|
||||
else if ( act == CURL_POLL_OUT )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nwatching for socket to become writable");
|
||||
|
||||
tcp_socket->async_write_some(boost::asio::null_buffers(),
|
||||
boost::bind(&event_cb, g,
|
||||
tcp_socket,
|
||||
act));
|
||||
}
|
||||
else if ( act == CURL_POLL_INOUT )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nwatching for socket to become readable & writable");
|
||||
|
||||
tcp_socket->async_read_some(boost::asio::null_buffers(),
|
||||
boost::bind(&event_cb, g,
|
||||
tcp_socket,
|
||||
act));
|
||||
|
||||
tcp_socket->async_write_some(boost::asio::null_buffers(),
|
||||
boost::bind(&event_cb, g,
|
||||
tcp_socket,
|
||||
act));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
|
||||
{
|
||||
int *fdp = (int *)calloc(sizeof(int), 1); /* fdp is used to store current action */
|
||||
|
||||
setsock(fdp, s, easy, action, g);
|
||||
curl_multi_assign(g->multi, s, fdp);
|
||||
}
|
||||
|
||||
/* CURLMOPT_SOCKETFUNCTION */
|
||||
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
||||
{
|
||||
fprintf(MSG_OUT, "\nsock_cb: socket=%d, what=%d, sockp=%p", s, what, sockp);
|
||||
|
||||
GlobalInfo *g = (GlobalInfo*) cbp;
|
||||
int *actionp = (int*) sockp;
|
||||
const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE"};
|
||||
|
||||
fprintf(MSG_OUT,
|
||||
"\nsocket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
|
||||
|
||||
if ( what == CURL_POLL_REMOVE )
|
||||
{
|
||||
fprintf(MSG_OUT, "\n");
|
||||
remsock(actionp, g);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !actionp )
|
||||
{
|
||||
fprintf(MSG_OUT, "\nAdding data: %s", whatstr[what]);
|
||||
addsock(s, e, what, g);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(MSG_OUT,
|
||||
"\nChanging action from %s to %s",
|
||||
whatstr[*actionp], whatstr[what]);
|
||||
setsock(actionp, s, e, what, g);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* CURLOPT_WRITEFUNCTION */
|
||||
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
|
||||
size_t written = size * nmemb;
|
||||
char* pBuffer = (char*)malloc(written + 1);
|
||||
|
||||
strncpy(pBuffer, (const char *)ptr, written);
|
||||
pBuffer [written] = '\0';
|
||||
|
||||
fprintf(MSG_OUT, "%s", pBuffer);
|
||||
|
||||
free(pBuffer);
|
||||
|
||||
return written;
|
||||
}
|
||||
|
||||
|
||||
/* CURLOPT_PROGRESSFUNCTION */
|
||||
static int prog_cb (void *p, double dltotal, double dlnow, double ult,
|
||||
double uln)
|
||||
{
|
||||
ConnInfo *conn = (ConnInfo *)p;
|
||||
(void)ult;
|
||||
(void)uln;
|
||||
|
||||
fprintf(MSG_OUT, "\nProgress: %s (%g/%g)", conn->url, dlnow, dltotal);
|
||||
fprintf(MSG_OUT, "\nProgress: %s (%g)", conn->url, ult);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* CURLOPT_OPENSOCKETFUNCTION */
|
||||
static curl_socket_t opensocket(void *clientp,
|
||||
curlsocktype purpose,
|
||||
struct curl_sockaddr *address)
|
||||
{
|
||||
fprintf(MSG_OUT, "\nopensocket :");
|
||||
|
||||
curl_socket_t sockfd = CURL_SOCKET_BAD;
|
||||
|
||||
/* restrict to ipv4 */
|
||||
if (purpose == CURLSOCKTYPE_IPCXN && address->family == AF_INET)
|
||||
{
|
||||
/* create a tcp socket object */
|
||||
boost::asio::ip::tcp::socket *tcp_socket = new boost::asio::ip::tcp::socket(io_service);
|
||||
|
||||
/* open it and get the native handle*/
|
||||
boost::system::error_code ec;
|
||||
tcp_socket->open(boost::asio::ip::tcp::v4(), ec);
|
||||
|
||||
if (ec)
|
||||
{
|
||||
//An error occurred
|
||||
std::cout << std::endl << "Couldn't open socket [" << ec << "][" << ec.message() << "]";
|
||||
fprintf(MSG_OUT, "\nERROR: Returning CURL_SOCKET_BAD to signal error");
|
||||
}
|
||||
else
|
||||
{
|
||||
sockfd = tcp_socket->native_handle();
|
||||
fprintf(MSG_OUT, "\nOpened socket %d", sockfd);
|
||||
|
||||
/* save it for monitoring */
|
||||
socket_map.insert(std::pair<curl_socket_t, boost::asio::ip::tcp::socket *>(sockfd, tcp_socket));
|
||||
}
|
||||
}
|
||||
|
||||
return sockfd;
|
||||
}
|
||||
|
||||
/* CURLOPT_CLOSESOCKETFUNCTION */
|
||||
static int closesocket(void *clientp, curl_socket_t item)
|
||||
{
|
||||
fprintf(MSG_OUT, "\nclosesocket : %d", item);
|
||||
|
||||
std::map<curl_socket_t, boost::asio::ip::tcp::socket *>::iterator it = socket_map.find(item);
|
||||
|
||||
if ( it != socket_map.end() )
|
||||
{
|
||||
delete it->second;
|
||||
socket_map.erase(it);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Create a new easy handle, and add it to the global curl_multi */
|
||||
static void new_conn(char *url, GlobalInfo *g )
|
||||
{
|
||||
ConnInfo *conn;
|
||||
CURLMcode rc;
|
||||
|
||||
conn = (ConnInfo *)calloc(1, sizeof(ConnInfo));
|
||||
memset(conn, 0, sizeof(ConnInfo));
|
||||
conn->error[0]='\0';
|
||||
|
||||
conn->easy = curl_easy_init();
|
||||
|
||||
if ( !conn->easy )
|
||||
{
|
||||
fprintf(MSG_OUT, "\ncurl_easy_init() failed, exiting!");
|
||||
exit(2);
|
||||
}
|
||||
conn->global = g;
|
||||
conn->url = strdup(url);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 1L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 3L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 10L);
|
||||
|
||||
/* call this function to get a socket */
|
||||
curl_easy_setopt(conn->easy, CURLOPT_OPENSOCKETFUNCTION, opensocket);
|
||||
|
||||
/* call this function to close a socket */
|
||||
curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, closesocket);
|
||||
|
||||
fprintf(MSG_OUT,
|
||||
"\nAdding easy %p to multi %p (%s)", conn->easy, g->multi, url);
|
||||
rc = curl_multi_add_handle(g->multi, conn->easy);
|
||||
mcode_or_die("new_conn: curl_multi_add_handle", rc);
|
||||
|
||||
/* note that the add_handle() will set a time-out to trigger very soon so
|
||||
that the necessary socket_action() call will be called by this app */
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GlobalInfo g;
|
||||
CURLMcode rc;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
memset(&g, 0, sizeof(GlobalInfo));
|
||||
g.multi = curl_multi_init();
|
||||
|
||||
curl_multi_setopt(g.multi, CURLMOPT_SOCKETFUNCTION, sock_cb);
|
||||
curl_multi_setopt(g.multi, CURLMOPT_SOCKETDATA, &g);
|
||||
curl_multi_setopt(g.multi, CURLMOPT_TIMERFUNCTION, multi_timer_cb);
|
||||
curl_multi_setopt(g.multi, CURLMOPT_TIMERDATA, &g);
|
||||
|
||||
new_conn((char *)"www.google.com", &g); /* add a URL */
|
||||
|
||||
/* enter io_service run loop */
|
||||
io_service.run();
|
||||
|
||||
curl_multi_cleanup(g.multi);
|
||||
|
||||
fprintf(MSG_OUT, "\ndone.\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -52,18 +52,24 @@ int main(void)
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
struct curl_certinfo *ci = NULL;
|
||||
union {
|
||||
struct curl_slist *to_info;
|
||||
struct curl_certinfo *to_certinfo;
|
||||
} ptr;
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ci);
|
||||
ptr.to_info = NULL;
|
||||
|
||||
if(!res && ci) {
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ptr.to_info);
|
||||
|
||||
if(!res && ptr.to_info) {
|
||||
int i;
|
||||
printf("%d certs!\n", ci->num_of_certs);
|
||||
|
||||
for(i=0; i<ci->num_of_certs; i++) {
|
||||
printf("%d certs!\n", ptr.to_certinfo->num_of_certs);
|
||||
|
||||
for(i = 0; i < ptr.to_certinfo->num_of_certs; i++) {
|
||||
struct curl_slist *slist;
|
||||
|
||||
for(slist = ci->certinfo[i]; slist; slist = slist->next)
|
||||
for(slist = ptr.to_certinfo->certinfo[i]; slist; slist = slist->next)
|
||||
printf("%s\n", slist->data);
|
||||
|
||||
}
|
||||
@@ -71,7 +77,6 @@ int main(void)
|
||||
|
||||
}
|
||||
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 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
|
||||
@@ -89,7 +89,7 @@ main(void)
|
||||
#endif
|
||||
/* Netscape format cookie */
|
||||
snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%lu\t%s\t%s",
|
||||
".google.com", "TRUE", "/", "FALSE", time(NULL) + 31337, "PREF", "hello google, i like you very much!");
|
||||
".google.com", "TRUE", "/", "FALSE", (unsigned long)time(NULL) + 31337UL, "PREF", "hello google, i like you very much!");
|
||||
res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline);
|
||||
if (res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", curl_easy_strerror(res));
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2013, 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
|
||||
@@ -130,6 +130,9 @@ int main(void)
|
||||
/* the DEBUGFUNCTION has no effect until we enable VERBOSE */
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
/* example.com is redirected, so we tell libcurl to follow redirection */
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
|
||||
res = curl_easy_perform(curl);
|
||||
/* Check for errors */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 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
|
||||
@@ -336,7 +336,7 @@ static void new_conn(char *url, GlobalInfo *g )
|
||||
conn->url = strdup(url);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
|
||||
|
||||
@@ -47,6 +47,10 @@
|
||||
#define IPADDR "127.0.0.1"
|
||||
#define PORTNUM 80
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE 0xffffffff
|
||||
#endif
|
||||
|
||||
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
int written = fwrite(ptr, size, nmemb, (FILE *)stream);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 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
|
||||
@@ -43,8 +43,8 @@ int main(void)
|
||||
char ftpurl[] = "ftp://ftp.example.com/gnu/binutils/binutils-2.19.1.tar.bz2";
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
const time_t filetime;
|
||||
const double filesize;
|
||||
long filetime = -1;
|
||||
double filesize = 0.0;
|
||||
const char *filename = strrchr(ftpurl, '/') + 1;
|
||||
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
@@ -67,10 +67,12 @@ int main(void)
|
||||
if(CURLE_OK == res) {
|
||||
/* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
|
||||
res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
if((CURLE_OK == res) && filetime)
|
||||
printf("filetime %s: %s", filename, ctime(&filetime));
|
||||
if((CURLE_OK == res) && (filetime >= 0)) {
|
||||
time_t file_time = (time_t)filetime;
|
||||
printf("filetime %s: %s", filename, ctime(&file_time));
|
||||
}
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize);
|
||||
if((CURLE_OK == res) && (filesize>0))
|
||||
if((CURLE_OK == res) && (filesize>0.0))
|
||||
printf("filesize %s: %0.0f bytes\n", filename, filesize);
|
||||
} else {
|
||||
/* we failed */
|
||||
|
||||
101
docs/examples/ftpsget.c
Normal file
101
docs/examples/ftpsget.c
Normal file
@@ -0,0 +1,101 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2012, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
/*
|
||||
* This is an example showing how to get a single file from an FTPS server.
|
||||
* It delays the actual destination file creation until the first write
|
||||
* callback so that it won't create an empty file in case the remote file
|
||||
* doesn't exist or something else fails.
|
||||
*/
|
||||
|
||||
struct FtpFile {
|
||||
const char *filename;
|
||||
FILE *stream;
|
||||
};
|
||||
|
||||
static size_t my_fwrite(void *buffer, size_t size, size_t nmemb,
|
||||
void *stream)
|
||||
{
|
||||
struct FtpFile *out=(struct FtpFile *)stream;
|
||||
if(out && !out->stream) {
|
||||
/* open file for writing */
|
||||
out->stream=fopen(out->filename, "wb");
|
||||
if(!out->stream)
|
||||
return -1; /* failure, can't open file to write */
|
||||
}
|
||||
return fwrite(buffer, size, nmemb, out->stream);
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
struct FtpFile ftpfile={
|
||||
"yourfile.bin", /* name to store the file as if succesful */
|
||||
NULL
|
||||
};
|
||||
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
/*
|
||||
* You better replace the URL with one that works! Note that we use an
|
||||
* FTP:// URL with standard explicit FTPS. You can also do FTPS:// URLs if
|
||||
* you want to do the rarer kind of transfers: implicit.
|
||||
*/
|
||||
curl_easy_setopt(curl, CURLOPT_URL,
|
||||
"ftp://user@server/home/user/file.txt");
|
||||
/* Define our callback to get called when there's data to be written */
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
|
||||
/* Set a pointer to our struct to pass to the callback */
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile);
|
||||
|
||||
/* We activate SSL and we require it for both control and data */
|
||||
curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);
|
||||
|
||||
/* Switch on full protocol/debug output */
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
if(CURLE_OK != res) {
|
||||
/* we failed */
|
||||
fprintf(stderr, "curl told us %d\n", res);
|
||||
}
|
||||
}
|
||||
|
||||
if(ftpfile.stream)
|
||||
fclose(ftpfile.stream); /* close the local file */
|
||||
|
||||
curl_global_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
86
docs/examples/href_extractor.c
Normal file
86
docs/examples/href_extractor.c
Normal file
@@ -0,0 +1,86 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
* This example uses the "Streaming HTML parser" to extract the href pieces in
|
||||
* a streaming manner from a downloaded HTML. Kindly donated by Michał
|
||||
* Kowalczyk.
|
||||
*
|
||||
* The parser is found at
|
||||
* http://code.google.com/p/htmlstreamparser/
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <curl/curl.h>
|
||||
#include <htmlstreamparser.h>
|
||||
|
||||
|
||||
static size_t write_callback(void *buffer, size_t size, size_t nmemb,
|
||||
void *hsp)
|
||||
{
|
||||
size_t realsize = size * nmemb, p;
|
||||
for (p = 0; p < realsize; p++) {
|
||||
html_parser_char_parse(hsp, ((char *)buffer)[p]);
|
||||
if (html_parser_cmp_tag(hsp, "a", 1))
|
||||
if (html_parser_cmp_attr(hsp, "href", 4))
|
||||
if (html_parser_is_in(hsp, HTML_VALUE_ENDED)) {
|
||||
html_parser_val(hsp)[html_parser_val_length(hsp)] = '\0';
|
||||
printf("%s\n", html_parser_val(hsp));
|
||||
}
|
||||
}
|
||||
return realsize;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char tag[1], attr[4], val[128];
|
||||
CURL *curl;
|
||||
HTMLSTREAMPARSER *hsp;
|
||||
|
||||
if (argc != 2) {
|
||||
printf("Usage: %s URL\n", argv[0]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
curl = curl_easy_init();
|
||||
|
||||
hsp = html_parser_init();
|
||||
|
||||
html_parser_set_tag_to_lower(hsp, 1);
|
||||
html_parser_set_attr_to_lower(hsp, 1);
|
||||
html_parser_set_tag_buffer(hsp, tag, sizeof(tag));
|
||||
html_parser_set_attr_buffer(hsp, attr, sizeof(attr));
|
||||
html_parser_set_val_buffer(hsp, val, sizeof(val)-1);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, hsp);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
|
||||
curl_easy_perform(curl);
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
html_parser_cleanup(hsp);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 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
|
||||
@@ -53,6 +53,9 @@ int main(void)
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
/* free the custom headers */
|
||||
curl_slist_free_all(chunk);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 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
|
||||
@@ -27,6 +27,8 @@ int main(void)
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||
@@ -45,7 +47,7 @@ int main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
#endif
|
||||
|
||||
#ifdef SKIP_HOSTNAME_VERFICATION
|
||||
#ifdef SKIP_HOSTNAME_VERIFICATION
|
||||
/*
|
||||
* If the site you're connecting to uses a different host name that what
|
||||
* they have mentioned in their server certificate's commonName (or
|
||||
@@ -65,5 +67,8 @@ int main(void)
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
||||
curl_global_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ int main(void)
|
||||
/* we start some action by calling perform right away */
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
|
||||
while(still_running) {
|
||||
do {
|
||||
struct timeval timeout;
|
||||
int rc; /* select() return code */
|
||||
|
||||
@@ -118,7 +118,7 @@ int main(void)
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(still_running);
|
||||
|
||||
/* See how the transfers went */
|
||||
while ((msg = curl_multi_info_read(multi_handle, &msgs_left))) {
|
||||
|
||||
@@ -144,7 +144,7 @@ int main(void)
|
||||
/* we start some action by calling perform right away */
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
|
||||
while(still_running) {
|
||||
do {
|
||||
struct timeval timeout;
|
||||
int rc; /* select() return code */
|
||||
|
||||
@@ -195,7 +195,7 @@ int main(void)
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(still_running);
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ int main(void)
|
||||
/* we start some action by calling perform right away */
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
|
||||
while(still_running) {
|
||||
do {
|
||||
struct timeval timeout;
|
||||
int rc; /* select() return code */
|
||||
|
||||
@@ -108,7 +108,7 @@ int main(void)
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(still_running);
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ int main(void)
|
||||
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
|
||||
while(still_running) {
|
||||
do {
|
||||
struct timeval timeout;
|
||||
int rc; /* select() return code */
|
||||
|
||||
@@ -131,7 +131,7 @@ int main(void)
|
||||
printf("running: %d!\n", still_running);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(still_running);
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ int main(void)
|
||||
/* we start some action by calling perform right away */
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
|
||||
while(still_running) {
|
||||
do {
|
||||
struct timeval timeout;
|
||||
int rc; /* select() return code */
|
||||
|
||||
@@ -106,7 +106,7 @@ int main(void)
|
||||
curl_multi_perform(multi_handle, &still_running);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(still_running);
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ int main(void)
|
||||
struct WriteThis pooh;
|
||||
|
||||
pooh.readptr = data;
|
||||
pooh.sizeleft = strlen(data);
|
||||
pooh.sizeleft = (long)strlen(data);
|
||||
|
||||
/* In windows, this will init the winsock stuff */
|
||||
res = curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
|
||||
@@ -59,7 +59,7 @@ static int progress(void *p,
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res=0;
|
||||
CURLcode res = CURLE_OK;
|
||||
struct myprogress prog;
|
||||
|
||||
curl = curl_easy_init();
|
||||
@@ -74,7 +74,7 @@ int main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(res)
|
||||
if(res != CURLE_OK)
|
||||
fprintf(stderr, "%s\n", curl_easy_strerror(res));
|
||||
|
||||
/* always cleanup */
|
||||
|
||||
@@ -178,7 +178,7 @@ int main(int argc, char * const argv[])
|
||||
#endif
|
||||
const char *range = "0.000-";
|
||||
int rc = EXIT_SUCCESS;
|
||||
char *basename = NULL;
|
||||
char *base_name = NULL;
|
||||
|
||||
printf("\nRTSP request %s\n", VERSION_STR);
|
||||
printf(" Project web site: http://code.google.com/p/rtsprequest/\n");
|
||||
@@ -186,20 +186,20 @@ int main(int argc, char * const argv[])
|
||||
|
||||
/* check command line */
|
||||
if ((argc != 2) && (argc != 3)) {
|
||||
basename = strrchr(argv[0], '/');
|
||||
if (basename == NULL) {
|
||||
basename = strrchr(argv[0], '\\');
|
||||
base_name = strrchr(argv[0], '/');
|
||||
if (base_name == NULL) {
|
||||
base_name = strrchr(argv[0], '\\');
|
||||
}
|
||||
if (basename == NULL) {
|
||||
basename = argv[0];
|
||||
if (base_name == NULL) {
|
||||
base_name = argv[0];
|
||||
} else {
|
||||
basename++;
|
||||
base_name++;
|
||||
}
|
||||
printf("Usage: %s url [transport]\n", basename);
|
||||
printf("Usage: %s url [transport]\n", base_name);
|
||||
printf(" url of video server\n");
|
||||
printf(" transport (optional) specifier for media stream protocol\n");
|
||||
printf(" default transport: %s\n", transport);
|
||||
printf("Example: %s rtsp://192.168.0.2/media/video1\n\n", basename);
|
||||
printf("Example: %s rtsp://192.168.0.2/media/video1\n\n", base_name);
|
||||
rc = EXIT_FAILURE;
|
||||
} else {
|
||||
const char *url = argv[1];
|
||||
|
||||
106
docs/examples/sftpget.c
Normal file
106
docs/examples/sftpget.c
Normal file
@@ -0,0 +1,106 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2012, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
/* define this to switch off the use of ssh-agent in this program */
|
||||
#undef DISABLE_SSH_AGENT
|
||||
|
||||
/*
|
||||
* This is an example showing how to get a single file from an SFTP server.
|
||||
* It delays the actual destination file creation until the first write
|
||||
* callback so that it won't create an empty file in case the remote file
|
||||
* doesn't exist or something else fails.
|
||||
*/
|
||||
|
||||
struct FtpFile {
|
||||
const char *filename;
|
||||
FILE *stream;
|
||||
};
|
||||
|
||||
static size_t my_fwrite(void *buffer, size_t size, size_t nmemb,
|
||||
void *stream)
|
||||
{
|
||||
struct FtpFile *out=(struct FtpFile *)stream;
|
||||
if(out && !out->stream) {
|
||||
/* open file for writing */
|
||||
out->stream=fopen(out->filename, "wb");
|
||||
if(!out->stream)
|
||||
return -1; /* failure, can't open file to write */
|
||||
}
|
||||
return fwrite(buffer, size, nmemb, out->stream);
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
struct FtpFile ftpfile={
|
||||
"yourfile.bin", /* name to store the file as if succesful */
|
||||
NULL
|
||||
};
|
||||
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
/*
|
||||
* You better replace the URL with one that works!
|
||||
*/
|
||||
curl_easy_setopt(curl, CURLOPT_URL,
|
||||
"sftp://user@server/home/user/file.txt");
|
||||
/* Define our callback to get called when there's data to be written */
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
|
||||
/* Set a pointer to our struct to pass to the callback */
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile);
|
||||
|
||||
#ifndef DISABLE_SSH_AGENT
|
||||
/* We activate ssh agent. For this to work you need
|
||||
to have ssh-agent running (type set | grep SSH_AGENT to check) or
|
||||
pageant on Windows (there is an icon in systray if so) */
|
||||
curl_easy_setopt(curl, CURLOPT_SSH_AUTH_TYPES, CURLSSH_AUTH_AGENT);
|
||||
#endif
|
||||
|
||||
/* Switch on full protocol/debug output */
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
if(CURLE_OK != res) {
|
||||
/* we failed */
|
||||
fprintf(stderr, "curl told us %d\n", res);
|
||||
}
|
||||
}
|
||||
|
||||
if(ftpfile.stream)
|
||||
fclose(ftpfile.stream); /* close the local file */
|
||||
|
||||
curl_global_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2013, 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
|
||||
@@ -30,6 +30,8 @@ int main(void)
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||
/* example.com is redirected, so we tell libcurl to follow redirection */
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
|
||||
/* Perform the request, res will get the return code */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 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
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int i;
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
FILE *headerfile;
|
||||
@@ -76,7 +77,7 @@ int main(void)
|
||||
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... */
|
||||
for(i = 0; i < 1; i++) /* single-iteration loop, just to break out from */
|
||||
{
|
||||
if (pEngine) /* use crypto engine */
|
||||
{
|
||||
@@ -125,7 +126,7 @@ int main(void)
|
||||
fprintf(stderr, "curl_easy_perform() failed: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
|
||||
break; /* we are done... */
|
||||
/* we are done... */
|
||||
}
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2012, 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
|
||||
@@ -38,7 +38,7 @@ man_MANS = curl_easy_cleanup.3 curl_easy_getinfo.3 curl_easy_init.3 \
|
||||
curl_easy_unescape.3 curl_multi_setopt.3 curl_multi_socket.3 \
|
||||
curl_multi_timeout.3 curl_formget.3 curl_multi_assign.3 \
|
||||
curl_easy_pause.3 curl_easy_recv.3 curl_easy_send.3 \
|
||||
curl_multi_socket_action.3
|
||||
curl_multi_socket_action.3 curl_multi_wait.3
|
||||
|
||||
HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \
|
||||
curl_easy_init.html curl_easy_perform.html curl_easy_setopt.html \
|
||||
@@ -58,7 +58,7 @@ HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \
|
||||
curl_easy_unescape.html curl_multi_setopt.html curl_multi_socket.html \
|
||||
curl_multi_timeout.html curl_formget.html curl_multi_assign.html \
|
||||
curl_easy_pause.html curl_easy_recv.html curl_easy_send.html \
|
||||
curl_multi_socket_action.html
|
||||
curl_multi_socket_action.html curl_multi_wait.html
|
||||
|
||||
PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf \
|
||||
curl_easy_init.pdf curl_easy_perform.pdf curl_easy_setopt.pdf \
|
||||
@@ -77,7 +77,7 @@ PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf \
|
||||
curl_easy_escape.pdf curl_easy_unescape.pdf curl_multi_setopt.pdf \
|
||||
curl_multi_socket.pdf curl_multi_timeout.pdf curl_formget.pdf \
|
||||
curl_multi_assign.pdf curl_easy_pause.pdf curl_easy_recv.pdf \
|
||||
curl_easy_send.pdf curl_multi_socket_action.pdf
|
||||
curl_easy_send.pdf curl_multi_socket_action.pdf curl_multi_wait.pdf
|
||||
|
||||
CLEANFILES = $(HTMLPAGES) $(PDFPAGES)
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ method(s) available for your proxy authentication. (Added in 7.10.8)
|
||||
.IP CURLINFO_OS_ERRNO
|
||||
Pass a pointer to a long to receive the errno variable from a connect failure.
|
||||
Note that the value is only set on failure, it is not reset upon a
|
||||
successfull operation. (Added in 7.12.2)
|
||||
successful operation. (Added in 7.12.2)
|
||||
.IP CURLINFO_NUM_CONNECTS
|
||||
Pass a pointer to a long to receive how many new connections libcurl had to
|
||||
create to achieve the previous transfer (only the successful connects are
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" * Copyright (C) 1998 - 2013, 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
|
||||
@@ -59,8 +59,13 @@ On success, returns \fBCURLE_OK\fP, stores the received data into
|
||||
|
||||
On failure, returns the appropriate error code.
|
||||
|
||||
If there is no data to read, the function returns \fBCURLE_AGAIN\fP. Use
|
||||
your operating system facilities to wait until the data is ready, and retry.
|
||||
If there is no data to read, the function returns \fBCURLE_AGAIN\fP. Use your
|
||||
operating system facilities to wait until the data is ready, and retry.
|
||||
|
||||
Reading exactly 0 bytes would indicate a closed connection.
|
||||
|
||||
If there's no socket available to use from the previous transfer, this function
|
||||
returns CURLE_UNSUPPORTED_PROTOCOL.
|
||||
.SH EXAMPLE
|
||||
See \fBsendrecv.c\fP in \fBdocs/examples\fP directory for usage example.
|
||||
.SH "SEE ALSO"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" * Copyright (C) 1998 - 2013, 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
|
||||
@@ -57,6 +57,9 @@ sent into \fB*n\fP. Note that this may very well be less than the amount you
|
||||
wanted to send.
|
||||
|
||||
On failure, returns the appropriate error code.
|
||||
|
||||
If there's no socket available to use from the previous transfer, this function
|
||||
returns CURLE_UNSUPPORTED_PROTOCOL.
|
||||
.SH EXAMPLE
|
||||
See \fBsendrecv.c\fP in \fBdocs/examples\fP directory for usage example.
|
||||
.SH "SEE ALSO"
|
||||
|
||||
@@ -274,14 +274,18 @@ Pass a pointer to a function that matches the following prototype: \fBint
|
||||
function(void *clientp, curl_socket_t curlfd, curlsocktype purpose);\fP. This
|
||||
function gets called by libcurl after the socket() call but before the
|
||||
connect() call. The callback's \fIpurpose\fP argument identifies the exact
|
||||
purpose for this particular socket, and currently only one value is supported:
|
||||
\fICURLSOCKTYPE_IPCXN\fP for the primary connection (meaning the control
|
||||
connection in the FTP case). Future versions of libcurl may support more
|
||||
purposes. It passes the newly created socket descriptor so additional
|
||||
setsockopt() calls can be done at the user's discretion. Return 0 (zero) from
|
||||
the callback on success. Return 1 from the callback function to signal an
|
||||
unrecoverable error to the library and it will close the socket and return
|
||||
\fICURLE_COULDNT_CONNECT\fP. (Option added in 7.16.0)
|
||||
purpose for this particular socket:
|
||||
|
||||
\fICURLSOCKTYPE_IPCXN\fP for actively created connections or since 7.28.0
|
||||
\fICURLSOCKTYPE_ACCEPT\fP for FTP when the connection was setup with PORT/EPSV
|
||||
(in earlier versions these sockets weren't passed to this callback).
|
||||
|
||||
Future versions of libcurl may support more purposes. It passes the newly
|
||||
created socket descriptor so additional setsockopt() calls can be done at the
|
||||
user's discretion. Return 0 (zero) from the callback on success. Return 1
|
||||
from the callback function to signal an unrecoverable error to the library and
|
||||
it will close the socket and return \fICURLE_COULDNT_CONNECT\fP. (Option
|
||||
added in 7.16.0)
|
||||
|
||||
Added in 7.21.5, the callback function may return
|
||||
\fICURL_SOCKOPT_ALREADY_CONNECTED\fP, which tells libcurl that the socket is
|
||||
@@ -2089,11 +2093,12 @@ Resolve to IPv6 addresses.
|
||||
.IP CURLOPT_CONNECT_ONLY
|
||||
Pass a long. If the parameter equals 1, it tells the library to perform all
|
||||
the required proxy authentication and connection setup, but no data transfer.
|
||||
This option is useful only on HTTP URLs.
|
||||
This option is implemented for HTTP, SMTP and POP3.
|
||||
|
||||
This option is useful with the \fICURLINFO_LASTSOCKET\fP option to
|
||||
\fIcurl_easy_getinfo(3)\fP. The library can set up the connection and then the
|
||||
application can obtain the most recently used socket for special data
|
||||
The option can be used to simply test a connection to a server, but is more
|
||||
useful when used with the \fICURLINFO_LASTSOCKET\fP option to
|
||||
\fIcurl_easy_getinfo(3)\fP as the library can set up the connection and then
|
||||
the application can obtain the most recently used socket for special data
|
||||
transfers. (Added in 7.15.2)
|
||||
.IP CURLOPT_USE_SSL
|
||||
Pass a long using one of the values from below, to make libcurl use your
|
||||
@@ -2255,8 +2260,8 @@ even indicate an accessible file.
|
||||
This option is by default set to the system path where libcurl's cacert bundle
|
||||
is assumed to be stored, as established at build time.
|
||||
|
||||
When built against NSS, this is the directory that the NSS certificate
|
||||
database resides in.
|
||||
If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module
|
||||
(libnsspem.so) needs to be available for this option to work properly.
|
||||
.IP CURLOPT_ISSUERCERT
|
||||
Pass a char * to a zero terminated string naming a file holding a CA
|
||||
certificate in PEM format. If the option is set, an additional check against
|
||||
@@ -2319,8 +2324,9 @@ Curl considers the server the intended one when the Common Name field or a
|
||||
Subject Alternate Name field in the certificate matches the host name in the
|
||||
URL to which you told Curl to connect.
|
||||
|
||||
When the value is 1, the certificate must contain a Common Name field, but it
|
||||
doesn't matter what name it says. (This is not ordinarily a useful setting).
|
||||
When the value is 1, libcurl will return a failure. It was previously (in
|
||||
7.28.0 and earlier) a debug option of some sorts, but it is no longer
|
||||
supported due to frequently leading to programmer mistakes.
|
||||
|
||||
When the value is 0, the connection succeeds regardless of the names in the
|
||||
certificate.
|
||||
@@ -2367,7 +2373,7 @@ this option then all known ciphers are disabled and only those passed in
|
||||
are enabled.
|
||||
|
||||
You'll find more details about the NSS cipher lists on this URL:
|
||||
\fIhttp://directory.fedora.redhat.com/docs/mod_nss.html#Directives\fP
|
||||
\fIhttp://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives\fP
|
||||
|
||||
.IP CURLOPT_SSL_SESSIONID_CACHE
|
||||
Pass a long set to 0 to disable libcurl's use of SSL session-ID caching. Set
|
||||
@@ -2405,8 +2411,11 @@ GSS_C_DELEG_POLICY_FLAG was available at compile-time.
|
||||
.IP CURLOPT_SSH_AUTH_TYPES
|
||||
Pass a long set to a bitmask consisting of one or more of
|
||||
CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST,
|
||||
CURLSSH_AUTH_KEYBOARD. Set CURLSSH_AUTH_ANY to let libcurl pick one. Currently
|
||||
CURLSSH_AUTH_HOST has no effect. (Added in 7.16.1)
|
||||
CURLSSH_AUTH_KEYBOARD and CURLSSH_AUTH_AGENT. Set CURLSSH_AUTH_ANY to let
|
||||
libcurl pick a suitable one. Currently CURLSSH_AUTH_HOST has no effect. (Added
|
||||
in 7.16.1) If CURLSSH_AUTH_AGENT is used, libcurl attempts to connect to
|
||||
ssh-agent or pageant and let the agent attempt the authentication. (Added in
|
||||
7.28.0)
|
||||
.IP CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
|
||||
Pass a char * pointing to a string containing 32 hexadecimal digits. The
|
||||
string should be the 128 bit MD5 checksum of the remote host's public key, and
|
||||
|
||||
@@ -52,7 +52,7 @@ To replace strdup()
|
||||
.IP "void *calloc_callback(size_t nmemb, size_t size);"
|
||||
To replace calloc()
|
||||
.SH "CAUTION"
|
||||
Manipulating these gives considerable powers to the application to severly
|
||||
Manipulating these gives considerable powers to the application to severely
|
||||
screw things up for libcurl. Take care!
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_global_init "(3), "
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" * Copyright (C) 1998 - 2012, 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
|
||||
@@ -28,21 +28,24 @@ curl_multi_perform - reads/writes available data from each easy handle
|
||||
CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles);
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
When the app thinks there's data available for the multi_handle, it should
|
||||
call this function to read/write whatever there is to read or write right
|
||||
now. curl_multi_perform() returns as soon as the reads/writes are done. This
|
||||
This function handles transfers on all the added handles that need attention
|
||||
in an non-blocking fashion.
|
||||
|
||||
When an application has found out there's data available for the multi_handle
|
||||
or a timeout has elapsed, the application should call this function to
|
||||
read/write whatever there is to read or write right now etc.
|
||||
curl_multi_perform() returns as soon as the reads/writes are done. This
|
||||
function does not require that there actually is any data available for
|
||||
reading or that data can be written, it can be called just in case. It will
|
||||
write the number of handles that still transfer data in the second argument's
|
||||
integer-pointer.
|
||||
|
||||
When you call curl_multi_perform() and the amount of \fIrunning_handles\fP is
|
||||
changed from the previous call (or is less than the amount of easy handles
|
||||
you've added to the multi handle), you know that there is one or more
|
||||
transfers less "running". You can then call \fIcurl_multi_info_read(3)\fP to
|
||||
get information about each individual completed transfer, and that returned
|
||||
info includes CURLcode and more. If an added handle fails very quickly, it may
|
||||
never be counted as a running_handle.
|
||||
If the amount of \fIrunning_handles\fP is changed from the previous call (or
|
||||
is less than the amount of easy handles you've added to the multi handle), you
|
||||
know that there is one or more transfers less "running". You can then call
|
||||
\fIcurl_multi_info_read(3)\fP to get information about each individual
|
||||
completed transfer, and that returned info includes CURLcode and more. If an
|
||||
added handle fails very quickly, it may never be counted as a running_handle.
|
||||
|
||||
When \fIrunning_handles\fP is set to zero (0) on the return of this function,
|
||||
there is no longer any transfers in progress.
|
||||
@@ -61,12 +64,14 @@ need to wait for \&"action" and then call this function again.
|
||||
|
||||
This function only returns errors etc regarding the whole multi stack.
|
||||
Problems still might have occurred on individual transfers even when this
|
||||
function returns \fICURLM_OK\fP.
|
||||
function returns \fICURLM_OK\fP. Use \fIcurl_multi_info_read(3)\fP to figure
|
||||
out how individual transfers did.
|
||||
.SH "TYPICAL USAGE"
|
||||
Most applications will use \fIcurl_multi_fdset(3)\fP to get the multi_handle's
|
||||
file descriptors, then it'll wait for action on them using \fBselect(3)\fP and
|
||||
as soon as one or more of them are ready, \fIcurl_multi_perform(3)\fP gets
|
||||
called.
|
||||
file descriptors, and \fIcurl_multi_timeout(3)\fP to get a suitable timeout
|
||||
period, then it'll wait for action on the file descriptors using
|
||||
\fBselect(3)\fP. As soon as one or more file descriptor is ready,
|
||||
\fIcurl_multi_perform(3)\fP gets called.
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_multi_cleanup "(3), " curl_multi_init "(3), "
|
||||
.BR curl_multi_fdset "(3), " curl_multi_info_read "(3), "
|
||||
|
||||
75
docs/libcurl/curl_multi_wait.3
Normal file
75
docs/libcurl/curl_multi_wait.3
Normal file
@@ -0,0 +1,75 @@
|
||||
.\" **************************************************************************
|
||||
.\" * _ _ ____ _
|
||||
.\" * Project ___| | | | _ \| |
|
||||
.\" * / __| | | | |_) | |
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2012, 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.
|
||||
.\" *
|
||||
.\" **************************************************************************
|
||||
.TH curl_multi_wait 3 "12 Jul 2012" "libcurl 7.28.0" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_multi_wait - polls on all easy handles in a multi handle
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLMcode curl_multi_wait(CURLM *multi_handle,
|
||||
struct curl_waitfd extra_fds[],
|
||||
unsigned int extra_nfds,
|
||||
int timeout_ms,
|
||||
int *numfds);
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
This function polls on all file descriptors used by the curl easy handles
|
||||
contained in the given multi handle set. It will block until activity is
|
||||
detected on at least one of the handles or \fItimeout_ms\fP has passed.
|
||||
|
||||
The calling application may pass additional curl_waitfd structures which are
|
||||
similar to \fIpoll(2)\fP's pollfd structure to be waited on in the same call.
|
||||
|
||||
On completion, if \fInumfds\fP is supplied, it will be populated with the
|
||||
number of file descriptors on which interesting events occured.
|
||||
|
||||
If no extra file descriptors are provided and libcurl has no file descriptor
|
||||
to offer to wait for, this function will return immediately.
|
||||
|
||||
This function is encouraged to be used instead of select(3) when using the
|
||||
multi interface to allow applications to easier circumvent the common problem
|
||||
with 1024 maximum file descriptors.
|
||||
.SH curl_waitfd
|
||||
.nf
|
||||
struct curl_waitfd {
|
||||
curl_socket_t fd;
|
||||
short events;
|
||||
short revents;
|
||||
};
|
||||
.fi
|
||||
.IP CURL_WAIT_POLLIN
|
||||
Bit flag to curl_waitfd.events indicating the socket should poll on read
|
||||
events such as new data received.
|
||||
.IP CURL_WAIT_POLLPRI
|
||||
Bit flag to curl_waitfd.events indicating the socket should poll on high
|
||||
priority read events such as out of band data.
|
||||
.IP CURL_WAIT_POLLOUT
|
||||
Bit flag to curl_waitfd.events indicating the socket should poll on write
|
||||
events such as the socket being clear to write without blocking.
|
||||
.SH RETURN VALUE
|
||||
CURLMcode type, general libcurl multi interface error code. See
|
||||
\fIlibcurl-errors(3)\fP
|
||||
.SH AVAILABILITY
|
||||
This function was added in libcurl 7.28.0.
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_multi_fdset "(3), " curl_multi_perform "(3)"
|
||||
@@ -5,7 +5,7 @@
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" * Copyright (C) 1998 - 2012, 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
|
||||
@@ -41,8 +41,7 @@ You create a shared object with \fIcurl_share_init(3)\fP. It returns a handle
|
||||
for a newly created one.
|
||||
|
||||
You tell the shared object what data you want it to share by using
|
||||
\fIcurl_share_setopt(3)\fP. Currently you can only share DNS and/or COOKIE
|
||||
data.
|
||||
\fIcurl_share_setopt(3)\fP.
|
||||
|
||||
Since you can use this share from multiple threads, and libcurl has no
|
||||
internal thread synchronization, you must provide mutex callbacks if you're
|
||||
|
||||
@@ -567,7 +567,9 @@ CURLSHOPT_SHARE 7.10.3
|
||||
CURLSHOPT_UNLOCKFUNC 7.10.3
|
||||
CURLSHOPT_UNSHARE 7.10.3
|
||||
CURLSHOPT_USERDATA 7.10.3
|
||||
CURLSOCKTYPE_ACCEPT 7.28.0
|
||||
CURLSOCKTYPE_IPCXN 7.16.0
|
||||
CURLSSH_AUTH_AGENT 7.28.0
|
||||
CURLSSH_AUTH_ANY 7.16.1
|
||||
CURLSSH_AUTH_DEFAULT 7.16.1
|
||||
CURLSSH_AUTH_HOST 7.16.1
|
||||
@@ -697,4 +699,7 @@ CURL_VERSION_SPNEGO 7.10.8
|
||||
CURL_VERSION_SSL 7.10
|
||||
CURL_VERSION_SSPI 7.13.2
|
||||
CURL_VERSION_TLSAUTH_SRP 7.21.4
|
||||
CURL_WAIT_POLLIN 7.28.0
|
||||
CURL_WAIT_POLLOUT 7.28.0
|
||||
CURL_WAIT_POLLPRI 7.28.0
|
||||
CURL_WRITEFUNC_PAUSE 7.18.0
|
||||
|
||||
@@ -1,51 +1,70 @@
|
||||
.Dd April 27, 2012
|
||||
.Dt MK-CA-BUNDLE 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm mk-ca-bundle
|
||||
.Nd create a new ca-bundle.crt from mozilla's certdata.txt
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl bilnqtuv
|
||||
.Or outputfile
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
tool downloads the certdata.txt file from Mozilla's source tree, then
|
||||
parses certdata.txt and extracts CA Root Certificates into PEM format.
|
||||
These are then processed with the OpenSSL commandline tool to produce the
|
||||
final ca-bundle.crt file.
|
||||
.Sh OPTIONS
|
||||
The following options are supported by
|
||||
.Nm :
|
||||
.Bl -tag -width _h
|
||||
.It Fl b
|
||||
backup an existing version of ca-bundle.crt
|
||||
.It Fl i
|
||||
.\" **************************************************************************
|
||||
.\" * _ _ ____ _
|
||||
.\" * Project ___| | | | _ \| |
|
||||
.\" * / __| | | | |_) | |
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 2008 - 2013, 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.
|
||||
.\" *
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH mk-ca-bundle 1 "5 Jan 2013" "version 1.17" "mk-ca-bundle manual"
|
||||
.SH NAME
|
||||
mk-ca-bundle \- convert mozilla's certdata.txt to PEM format
|
||||
.SH SYNOPSIS
|
||||
mk-ca-bundle [bilnqtuv]
|
||||
.I [outputfile]
|
||||
.SH DESCRIPTION
|
||||
The mk-ca-bundle tool downloads the certdata.txt file from Mozilla's source
|
||||
tree over HTTP, then parses certdata.txt and extracts CA Root Certificates
|
||||
into PEM format. These are then processed with the OpenSSL commandline tool
|
||||
to produce the final ca-bundle file.
|
||||
|
||||
The default \fIoutputfile\fP name is \fBca-bundle.crt\fP. By setting it to '-'
|
||||
(a single dash) you will get the output sent to STDOUT instead of a file.
|
||||
|
||||
The PEM format this scripts uses for output makes the result readily available
|
||||
for use by just about all OpenSSL or GnuTLS powered applications, such as
|
||||
curl, wget and more.
|
||||
.SH OPTIONS
|
||||
The following options are supported:
|
||||
.IP -b
|
||||
backup an existing version of \fIoutputfilename\fP
|
||||
.IP -f
|
||||
force rebuild even if certdata.txt is current (Added in version 1.17)
|
||||
.IP -i
|
||||
print version info about used modules
|
||||
.It Fl l
|
||||
.IP -l
|
||||
print license info about certdata.txt
|
||||
.It Fl n
|
||||
.IP -n
|
||||
no download of certdata.txt (to use existing)
|
||||
.It Fl q
|
||||
.IP -q
|
||||
be really quiet (no progress output at all)
|
||||
.It Fl t
|
||||
.IP -t
|
||||
include plain text listing of certificates
|
||||
.It Fl u
|
||||
.IP -u
|
||||
unlink (remove) certdata.txt after processing
|
||||
.It Fl v
|
||||
.IP -v
|
||||
be verbose and print out processed CAs
|
||||
.El
|
||||
.Sh EXIT STATUS
|
||||
.Ex -std
|
||||
.Sh SEE ALSO
|
||||
.Xr curl 1
|
||||
.Sh HISTORY
|
||||
.Nm
|
||||
was based on the parse-certs script written by
|
||||
.An Roland Krikava
|
||||
and hacked by
|
||||
.An Guenter Knauf .
|
||||
This manual page was written by
|
||||
.An Jan Schaumann
|
||||
.Aq jschauma@netmeister.org .
|
||||
.SH EXIT STATUS
|
||||
Returns 0 on success. Returns 1 if it fails to download data.
|
||||
.SH SEE ALSO
|
||||
.BR curl (1)
|
||||
.SH HISTORY
|
||||
\fBmk-ca-bundle\fP is a command line tool that is shipped as part of every
|
||||
curl and libcurl release (see http://curl.haxx.se/). It was originally based
|
||||
on the parse-certs script written by Roland Krikava and was later much
|
||||
improved by Guenter Knauf. This manual page was written by Jan Schaumann
|
||||
\&<jschauma@netmeister.org>.
|
||||
|
||||
@@ -309,8 +309,9 @@ typedef size_t (*curl_read_callback)(char *buffer,
|
||||
void *instream);
|
||||
|
||||
typedef enum {
|
||||
CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
|
||||
CURLSOCKTYPE_LAST /* never use */
|
||||
CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
|
||||
CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */
|
||||
CURLSOCKTYPE_LAST /* never use */
|
||||
} curlsocktype;
|
||||
|
||||
/* The return code from the sockopt_callback can signal information back
|
||||
@@ -631,6 +632,7 @@ typedef enum {
|
||||
#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */
|
||||
#define CURLSSH_AUTH_HOST (1<<2) /* host key files */
|
||||
#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
|
||||
#define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */
|
||||
#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
|
||||
|
||||
#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */
|
||||
@@ -1045,9 +1047,8 @@ typedef enum {
|
||||
/* Set to the Entropy Gathering Daemon socket pathname */
|
||||
CINIT(EGDSOCKET, OBJECTPOINT, 77),
|
||||
|
||||
/* Time-out connect operations after this amount of seconds, if connects
|
||||
are OK within this time, then fine... This only aborts the connect
|
||||
phase. [Only works on unix-style/SIGALRM operating systems] */
|
||||
/* Time-out connect operations after this amount of seconds, if connects are
|
||||
OK within this time, then fine... This only aborts the connect phase. */
|
||||
CINIT(CONNECTTIMEOUT, LONG, 78),
|
||||
|
||||
/* Function that will be called to store headers (instead of fwrite). The
|
||||
@@ -1221,9 +1222,9 @@ typedef enum {
|
||||
CINIT(NETRC_FILE, OBJECTPOINT, 118),
|
||||
|
||||
/* Enable SSL/TLS for FTP, pick one of:
|
||||
CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
|
||||
CURLFTPSSL_CONTROL - SSL for the control connection or fail
|
||||
CURLFTPSSL_ALL - SSL for all communication or fail
|
||||
CURLUSESSL_TRY - try using SSL, proceed anyway otherwise
|
||||
CURLUSESSL_CONTROL - SSL for the control connection or fail
|
||||
CURLUSESSL_ALL - SSL for all communication or fail
|
||||
*/
|
||||
CINIT(USE_SSL, LONG, 119),
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 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
|
||||
@@ -151,6 +151,13 @@
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/poll.h must be included by the external interface. */
|
||||
#undef CURL_PULL_SYS_POLL_H
|
||||
#ifdef CURL_PULL_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
#endif
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef CURL_SIZEOF_LONG
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 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
|
||||
@@ -190,7 +190,7 @@ typedef char
|
||||
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
|
||||
* these to be visible and exported by the external libcurl interface API,
|
||||
* while also making them visible to the library internals, simply including
|
||||
* setup.h, without actually needing to include curl.h internally.
|
||||
* curl_setup.h, without actually needing to include curl.h internally.
|
||||
* If some day this section would grow big enough, all this should be moved
|
||||
* to its own header file.
|
||||
*/
|
||||
@@ -248,6 +248,7 @@ typedef char
|
||||
#undef CURL_PULL_WS2TCPIP_H
|
||||
#undef CURL_PULL_SYS_TYPES_H
|
||||
#undef CURL_PULL_SYS_SOCKET_H
|
||||
#undef CURL_PULL_SYS_POLL_H
|
||||
#undef CURL_PULL_STDINT_H
|
||||
#undef CURL_PULL_INTTYPES_H
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2013, 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
|
||||
@@ -26,17 +26,17 @@
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2012 Daniel Stenberg, <daniel@haxx.se>."
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2013 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.27.0-DEV"
|
||||
#define LIBCURL_VERSION "7.28.2-DEV"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 27
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
#define LIBCURL_VERSION_MINOR 28
|
||||
#define LIBCURL_VERSION_PATCH 2
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
@@ -53,7 +53,7 @@
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x071B00
|
||||
#define LIBCURL_VERSION_NUM 0x071c02
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 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
|
||||
@@ -89,6 +89,19 @@ struct CURLMsg {
|
||||
};
|
||||
typedef struct CURLMsg CURLMsg;
|
||||
|
||||
/* Based on poll(2) structure and values.
|
||||
* We don't use pollfd and POLL* constants explicitly
|
||||
* to cover platforms without poll(). */
|
||||
#define CURL_WAIT_POLLIN 0x0001
|
||||
#define CURL_WAIT_POLLPRI 0x0002
|
||||
#define CURL_WAIT_POLLOUT 0x0004
|
||||
|
||||
struct curl_waitfd {
|
||||
curl_socket_t fd;
|
||||
short events;
|
||||
short revents; /* not supported yet */
|
||||
};
|
||||
|
||||
/*
|
||||
* Name: curl_multi_init()
|
||||
*
|
||||
@@ -133,6 +146,20 @@ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
|
||||
fd_set *exc_fd_set,
|
||||
int *max_fd);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_wait()
|
||||
*
|
||||
* Desc: Poll on all fds within a CURLM set as well as any
|
||||
* additional fds passed to the function.
|
||||
*
|
||||
* Returns: CURLMcode type, general multi error code.
|
||||
*/
|
||||
CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
|
||||
struct curl_waitfd extra_fds[],
|
||||
unsigned int extra_nfds,
|
||||
int timeout_ms,
|
||||
int *ret);
|
||||
|
||||
/*
|
||||
* Name: curl_multi_perform()
|
||||
*
|
||||
|
||||
@@ -89,7 +89,7 @@ ZLIB_ROOT = ..$(DS)..$(DS)zlib-1.2.7
|
||||
!ifdef %libssh2_root
|
||||
LIBSSH2_ROOT = $(%libssh2_root)
|
||||
!else
|
||||
LIBSSH2_ROOT = ..$(DS)..$(DS)libssh2-1.4.2
|
||||
LIBSSH2_ROOT = ..$(DS)..$(DS)libssh2-1.4.3
|
||||
!endif
|
||||
|
||||
!ifdef %librtmp_root
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2013, 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
|
||||
@@ -30,15 +30,15 @@ DOCS = README.encoding README.memoryleak README.ares README.curlx \
|
||||
|
||||
CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
|
||||
|
||||
EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 $(DSP) \
|
||||
vc6libcurl.dsw config-win32.h config-win32ce.h config-riscos.h \
|
||||
config-mac.h curl_config.h.in makefile.dj config-dos.h libcurl.plist \
|
||||
libcurl.rc config-amigaos.h makefile.amiga \
|
||||
Makefile.netware nwlib.c nwos.c msvcproj.head msvcproj.foot \
|
||||
config-win32ce.h config-os400.h setup-os400.h config-symbian.h \
|
||||
Makefile.Watcom config-tpf.h $(DOCS) $(VCPROJ) mk-ca-bundle.pl \
|
||||
mk-ca-bundle.vbs firefox-db2pem.sh $(CMAKE_DIST) config-vxworks.h \
|
||||
Makefile.vxworks config-vms.h checksrc.pl
|
||||
EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 $(DSP) \
|
||||
vc6libcurl.dsw config-win32.h config-win32ce.h config-riscos.h \
|
||||
config-mac.h curl_config.h.in makefile.dj config-dos.h libcurl.plist \
|
||||
libcurl.rc config-amigaos.h makefile.amiga Makefile.netware nwlib.c \
|
||||
nwos.c msvcproj.head msvcproj.foot config-win32ce.h config-os400.h \
|
||||
setup-os400.h config-symbian.h Makefile.Watcom config-tpf.h $(DOCS) \
|
||||
$(VCPROJ) mk-ca-bundle.pl mk-ca-bundle.vbs firefox-db2pem.sh \
|
||||
$(CMAKE_DIST) config-vxworks.h Makefile.vxworks checksrc.pl \
|
||||
objnames-test08.sh objnames-test10.sh objnames.inc
|
||||
|
||||
CLEANFILES = $(DSP) $(VCPROJ)
|
||||
|
||||
@@ -56,31 +56,29 @@ CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@
|
||||
# might possibly already be installed in the system.
|
||||
#
|
||||
# $(top_builddir)/include/curl for generated curlbuild.h included from curl.h
|
||||
# $(top_builddir)/include for generated curlbuild.h included from lib/setup.h
|
||||
# $(top_builddir)/include for generated curlbuild.h inc. from lib/curl_setup.h
|
||||
# $(top_srcdir)/include is for libcurl's external include files
|
||||
# $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
|
||||
# $(top_srcdir)/lib is for libcurl's lib/setup.h and other "private" files
|
||||
# $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "private" files
|
||||
# $(top_builddir)/ares is for in-tree c-ares's generated ares_build.h file
|
||||
# $(top_srcdir)/ares is for in-tree c-ares's external include files
|
||||
|
||||
if USE_EMBEDDED_ARES
|
||||
INCLUDES = -I$(top_builddir)/include/curl \
|
||||
-I$(top_builddir)/include \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_builddir)/lib \
|
||||
-I$(top_srcdir)/lib \
|
||||
-I$(top_builddir)/ares \
|
||||
-I$(top_srcdir)/ares
|
||||
AM_CPPFLAGS = -I$(top_builddir)/include/curl \
|
||||
-I$(top_builddir)/include \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_builddir)/lib \
|
||||
-I$(top_srcdir)/lib \
|
||||
-I$(top_builddir)/ares \
|
||||
-I$(top_srcdir)/ares
|
||||
else
|
||||
INCLUDES = -I$(top_builddir)/include/curl \
|
||||
-I$(top_builddir)/include \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_builddir)/lib \
|
||||
-I$(top_srcdir)/lib
|
||||
AM_CPPFLAGS = -I$(top_builddir)/include/curl \
|
||||
-I$(top_builddir)/include \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_builddir)/lib \
|
||||
-I$(top_srcdir)/lib
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS =
|
||||
|
||||
# Mostly for Windows build targets, when building libcurl library
|
||||
if USE_CPPFLAG_BUILDING_LIBCURL
|
||||
AM_CPPFLAGS += -DBUILDING_LIBCURL
|
||||
@@ -101,9 +99,9 @@ if SONAME_BUMP
|
||||
#
|
||||
# This conditional soname bump SHOULD be removed at next "proper" bump.
|
||||
#
|
||||
VERSIONINFO=-version-info 7:0:2
|
||||
VERSIONINFO=-version-info 8:0:3
|
||||
else
|
||||
VERSIONINFO=-version-info 6:0:2
|
||||
VERSIONINFO=-version-info 7:0:3
|
||||
endif
|
||||
|
||||
# This flag accepts an argument of the form current[:revision[:age]]. So,
|
||||
@@ -134,6 +132,9 @@ if VERSIONED_SYMBOLS
|
||||
VERSIONED_SYMBOLS = -Wl,--version-script=libcurl.vers
|
||||
endif
|
||||
|
||||
# Prevent LIBS from being used for all link targets
|
||||
LIBS = $(BLANK_AT_MAKETIME)
|
||||
|
||||
libcurl_la_LDFLAGS = $(UNDEF) $(VERSIONINFO) $(MIMPURE) $(VERSIONED_SYMBOLS) $(LIBCURL_LIBS)
|
||||
|
||||
if DOING_CURL_SYMBOL_HIDING
|
||||
|
||||
@@ -23,8 +23,9 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
|
||||
curl_rtmp.c openldap.c curl_gethostname.c gopher.c axtls.c \
|
||||
idn_win32.c http_negotiate_sspi.c cyassl.c http_proxy.c non-ascii.c \
|
||||
asyn-ares.c asyn-thread.c curl_gssapi.c curl_ntlm.c curl_ntlm_wb.c \
|
||||
curl_ntlm_core.c curl_ntlm_msgs.c curl_sasl.c curl_schannel.c \
|
||||
curl_multibyte.c curl_darwinssl.c
|
||||
curl_ntlm_core.c curl_ntlm_msgs.c curl_sasl.c curl_schannel.c \
|
||||
curl_multibyte.c curl_darwinssl.c hostcheck.c \
|
||||
bundles.c conncache.c
|
||||
|
||||
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
|
||||
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
|
||||
@@ -33,12 +34,14 @@ HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
|
||||
curl_fnmatch.h wildcard.h fileinfo.h ftplistparser.h strtok.h \
|
||||
connect.h llist.h hash.h content_encoding.h share.h curl_md4.h \
|
||||
curl_md5.h http_digest.h http_negotiate.h inet_pton.h amigaos.h \
|
||||
strtoofft.h strerror.h inet_ntop.h curlx.h curl_memory.h setup.h \
|
||||
strtoofft.h strerror.h inet_ntop.h curlx.h curl_memory.h curl_setup.h \
|
||||
transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h gtls.h \
|
||||
tftp.h sockaddr.h splay.h strdup.h setup_once.h socks.h ssh.h nssg.h \
|
||||
tftp.h sockaddr.h splay.h strdup.h socks.h ssh.h nssg.h \
|
||||
curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h slist.h nonblock.h \
|
||||
curl_memrchr.h imap.h pop3.h smtp.h pingpong.h rtsp.h curl_threads.h \
|
||||
warnless.h curl_hmac.h polarssl.h curl_rtmp.h curl_gethostname.h \
|
||||
gopher.h axtls.h cyassl.h http_proxy.h non-ascii.h asyn.h curl_ntlm.h \
|
||||
curl_gssapi.h curl_ntlm_wb.h curl_ntlm_core.h curl_ntlm_msgs.h \
|
||||
curl_sasl.h curl_schannel.h curl_multibyte.h curl_darwinssl.h
|
||||
curl_sasl.h curl_schannel.h curl_multibyte.h curl_darwinssl.h \
|
||||
hostcheck.h bundles.h conncache.h curl_setup_once.h multihandle.h \
|
||||
setup-vms.h
|
||||
|
||||
@@ -22,7 +22,7 @@ OPENSSL_PATH = ../../openssl-0.9.8x
|
||||
endif
|
||||
# Edit the path below to point to the base of your LibSSH2 package.
|
||||
ifndef LIBSSH2_PATH
|
||||
LIBSSH2_PATH = ../../libssh2-1.4.2
|
||||
LIBSSH2_PATH = ../../libssh2-1.4.3
|
||||
endif
|
||||
# Edit the path below to point to the base of your librtmp package.
|
||||
ifndef LIBRTMP_PATH
|
||||
@@ -273,8 +273,9 @@ $(libcurl_a_LIBRARY): $(libcurl_a_OBJECTS) $(libcurl_a_DEPENDENCIES)
|
||||
|
||||
$(libcurl_dll_LIBRARY): $(libcurl_a_OBJECTS) $(RESOURCE) $(libcurl_dll_DEPENDENCIES)
|
||||
@$(call DEL, $@)
|
||||
$(CC) $(LDFLAGS) -shared -Wl,--out-implib,$(libcurl_dll_a_LIBRARY) \
|
||||
-o $@ $(libcurl_a_OBJECTS) $(RESOURCE) $(DLL_LIBS)
|
||||
$(CC) $(LDFLAGS) -shared -o $@ \
|
||||
-Wl,--output-def,$(@:.dll=.def),--out-implib,$(libcurl_dll_a_LIBRARY) \
|
||||
$(libcurl_a_OBJECTS) $(RESOURCE) $(DLL_LIBS)
|
||||
|
||||
%.o: %.c $(PROOT)/include/curl/curlbuild.h
|
||||
$(CC) $(INCLUDES) $(CFLAGS) -c $<
|
||||
@@ -289,7 +290,7 @@ endif
|
||||
@$(call DEL, $(libcurl_a_OBJECTS) $(RESOURCE))
|
||||
|
||||
distclean vclean: clean
|
||||
@$(call DEL, $(libcurl_a_LIBRARY) $(libcurl_dll_LIBRARY) $(libcurl_dll_a_LIBRARY))
|
||||
@$(call DEL, $(libcurl_a_LIBRARY) $(libcurl_dll_LIBRARY) $(libcurl_dll_LIBRARY:.dll=.def) $(libcurl_dll_a_LIBRARY))
|
||||
|
||||
$(PROOT)/include/curl/curlbuild.h:
|
||||
@echo Creating $@
|
||||
|
||||
@@ -24,7 +24,7 @@ endif
|
||||
|
||||
# Edit the path below to point to the base of your LibSSH2 package.
|
||||
ifndef LIBSSH2_PATH
|
||||
LIBSSH2_PATH = ../../libssh2-1.4.2
|
||||
LIBSSH2_PATH = ../../libssh2-1.4.3
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your axTLS package.
|
||||
|
||||
@@ -69,7 +69,7 @@ OPENSSL_PATH = ../../openssl-0.9.8x
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF LIBSSH2_PATH
|
||||
LIBSSH2_PATH = ../../libssh2-1.4.2
|
||||
LIBSSH2_PATH = ../../libssh2-1.4.3
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF ZLIB_PATH
|
||||
@@ -105,7 +105,7 @@ WINDOWS_SDK_PATH = "$(PROGRAMFILES)\Microsoft SDK"
|
||||
|
||||
CCNODBG = cl.exe /O2 /DNDEBUG
|
||||
CCDEBUG = cl.exe /Od /Gm /Zi /D_DEBUG /GZ
|
||||
CFLAGSSSL = /DUSE_SSLEAY /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl"
|
||||
CFLAGSSSL = /DUSE_SSLEAY /DUSE_OPENSSL /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl"
|
||||
CFLAGSSSH2 = /DUSE_LIBSSH2 /DCURL_DISABLE_LDAP /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H /DLIBSSH2_WIN32 /DLIBSSH2_LIBRARY /I "$(LIBSSH2_PATH)/include"
|
||||
CFLAGSZLIB = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)"
|
||||
CFLAGS = /I. /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL /D_BIND_TO_CURRENT_VCLIBS_VERSION=1
|
||||
@@ -116,7 +116,7 @@ LFLAGS = /nologo /machine:$(MACHINE)
|
||||
SSLLIBS = libeay32.lib ssleay32.lib
|
||||
ZLIBLIBSDLL= zdll.lib
|
||||
ZLIBLIBS = zlib.lib
|
||||
WINLIBS = ws2_32.lib wldap32.lib
|
||||
WINLIBS = ws2_32.lib wldap32.lib advapi32.lib
|
||||
CFLAGS = $(CFLAGS)
|
||||
|
||||
CFGSET = FALSE
|
||||
@@ -497,6 +497,8 @@ X_OBJS= \
|
||||
$(DIROBJ)\asyn-ares.obj \
|
||||
$(DIROBJ)\asyn-thread.obj \
|
||||
$(DIROBJ)\base64.obj \
|
||||
$(DIROBJ)\bundles.obj \
|
||||
$(DIROBJ)\conncache.obj \
|
||||
$(DIROBJ)\connect.obj \
|
||||
$(DIROBJ)\content_encoding.obj \
|
||||
$(DIROBJ)\cookie.obj \
|
||||
@@ -531,6 +533,7 @@ X_OBJS= \
|
||||
$(DIROBJ)\hash.obj \
|
||||
$(DIROBJ)\hmac.obj \
|
||||
$(DIROBJ)\hostasyn.obj \
|
||||
$(DIROBJ)\hostcheck.obj \
|
||||
$(DIROBJ)\hostip.obj \
|
||||
$(DIROBJ)\hostip4.obj \
|
||||
$(DIROBJ)\hostip6.obj \
|
||||
|
||||
@@ -32,4 +32,4 @@
|
||||
hostip6.c - ipv6-specific functions
|
||||
|
||||
The hostip.h is the single united header file for all this. It defines the
|
||||
CURLRES_* defines based on the config*.h and setup.h defines.
|
||||
CURLRES_* defines based on the config*.h and curl_setup.h defines.
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if defined(__AMIGA__) && !defined(__ixemul__)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if defined(__AMIGA__) && !defined(__ixemul__)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2013, 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
|
||||
@@ -20,14 +20,11 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
@@ -37,9 +34,6 @@
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h> /* for the close() proto */
|
||||
#endif
|
||||
#ifdef __VMS
|
||||
#include <in.h>
|
||||
#include <inet.h>
|
||||
@@ -83,6 +77,8 @@
|
||||
# define CARES_STATICLIB
|
||||
# endif
|
||||
# include <ares.h>
|
||||
# include <ares_version.h> /* really old c-ares didn't include this by
|
||||
itself */
|
||||
|
||||
#if ARES_VERSION >= 0x010500
|
||||
/* c-ares 1.5.0 or later, the callback proto is modified */
|
||||
@@ -211,12 +207,12 @@ static void destroy_async_data (struct Curl_async *async)
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_resolver_fdset() is called when someone from the outside world (using
|
||||
* curl_multi_fdset()) wants to get our fd_set setup and we're talking with
|
||||
* ares. The caller must make sure that this function is only called when we
|
||||
* have a working ares channel.
|
||||
* Curl_resolver_getsock() is called when someone from the outside world
|
||||
* (using curl_multi_fdset()) wants to get our fd_set setup and we're talking
|
||||
* with ares. The caller must make sure that this function is only called when
|
||||
* we have a working ares channel.
|
||||
*
|
||||
* Returns: CURLE_OK always!
|
||||
* Returns: sockets-in-use-bitmap
|
||||
*/
|
||||
|
||||
int Curl_resolver_getsock(struct connectdata *conn,
|
||||
|
||||
@@ -20,11 +20,8 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
@@ -34,9 +31,6 @@
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h> /* for the close() proto */
|
||||
#endif
|
||||
#ifdef __VMS
|
||||
#include <in.h>
|
||||
#include <inet.h>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
#include "curl_addrinfo.h"
|
||||
|
||||
struct addrinfo;
|
||||
|
||||
72
lib/axtls.c
72
lib/axtls.c
@@ -26,16 +26,12 @@
|
||||
* but sslgen.c should ever call or use these functions.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef USE_AXTLS
|
||||
#include <axTLS/ssl.h>
|
||||
#include "axtls.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#include "sendf.h"
|
||||
#include "inet_pton.h"
|
||||
#include "sslgen.h"
|
||||
@@ -47,6 +43,8 @@
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
#include "hostcheck.h"
|
||||
|
||||
|
||||
/* SSL_read is opied from axTLS compat layer */
|
||||
static int SSL_read(SSL *ssl, void *buf, int num)
|
||||
@@ -150,7 +148,11 @@ Curl_axtls_connect(struct connectdata *conn,
|
||||
int i, ssl_fcn_return;
|
||||
const uint8_t *ssl_sessionid;
|
||||
size_t ssl_idsize;
|
||||
const char *x509;
|
||||
const char *peer_CN;
|
||||
uint32_t dns_altname_index;
|
||||
const char *dns_altname;
|
||||
int8_t found_subject_alt_names = 0;
|
||||
int8_t found_subject_alt_name_matching_conn = 0;
|
||||
|
||||
/* Assuming users will not compile in custom key/cert to axTLS */
|
||||
uint32_t client_option = SSL_NO_DEFAULT_KEY|SSL_SERVER_VERIFY_LATER;
|
||||
@@ -296,19 +298,65 @@ Curl_axtls_connect(struct connectdata *conn,
|
||||
/* Here, gtls.c does issuer verification. axTLS has no straightforward
|
||||
* equivalent, so omitting for now.*/
|
||||
|
||||
/* See if common name was set in server certificate */
|
||||
x509 = ssl_get_cert_dn(ssl, SSL_X509_CERT_COMMON_NAME);
|
||||
if(x509 == NULL)
|
||||
infof(data, "error fetching CN from cert\n");
|
||||
|
||||
/* Here, gtls.c does the following
|
||||
* 1) x509 hostname checking per RFC2818. axTLS doesn't support this, but
|
||||
* it seems useful. Omitting for now.
|
||||
* it seems useful. This is now implemented, by Oscar Koeroo
|
||||
* 2) checks cert validity based on time. axTLS does this in ssl_verify_cert
|
||||
* 3) displays a bunch of cert information. axTLS doesn't support most of
|
||||
* this, but a couple fields are available.
|
||||
*/
|
||||
|
||||
|
||||
/* There is no (DNS) Altnames count in the version 1.4.8 API. There is a
|
||||
risk of an inifite loop */
|
||||
for(dns_altname_index = 0; ; dns_altname_index++) {
|
||||
dns_altname = ssl_get_cert_subject_alt_dnsname(ssl, dns_altname_index);
|
||||
if(dns_altname == NULL) {
|
||||
break;
|
||||
}
|
||||
found_subject_alt_names = 1;
|
||||
|
||||
infof(data, "\tComparing subject alt name DNS with hostname: %s <-> %s\n",
|
||||
dns_altname, conn->host.name);
|
||||
if(Curl_cert_hostcheck(dns_altname, conn->host.name)) {
|
||||
found_subject_alt_name_matching_conn = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* RFC2818 checks */
|
||||
if(found_subject_alt_names && !found_subject_alt_name_matching_conn) {
|
||||
/* Break connection ! */
|
||||
Curl_axtls_close(conn, sockindex);
|
||||
failf(data, "\tsubjectAltName(s) do not match %s\n", conn->host.dispname);
|
||||
return CURLE_PEER_FAILED_VERIFICATION;
|
||||
}
|
||||
else if(found_subject_alt_names == 0) {
|
||||
/* Per RFC2818, when no Subject Alt Names were available, examine the peer
|
||||
CN as a legacy fallback */
|
||||
peer_CN = ssl_get_cert_dn(ssl, SSL_X509_CERT_COMMON_NAME);
|
||||
if(peer_CN == NULL) {
|
||||
/* Similar behaviour to the OpenSSL interface */
|
||||
Curl_axtls_close(conn, sockindex);
|
||||
failf(data, "unable to obtain common name from peer certificate");
|
||||
return CURLE_PEER_FAILED_VERIFICATION;
|
||||
}
|
||||
else {
|
||||
if(!Curl_cert_hostcheck((const char *)peer_CN, conn->host.name)) {
|
||||
if(data->set.ssl.verifyhost) {
|
||||
/* Break connection ! */
|
||||
Curl_axtls_close(conn, sockindex);
|
||||
failf(data, "\tcommon name \"%s\" does not match \"%s\"\n",
|
||||
peer_CN, conn->host.dispname);
|
||||
return CURLE_PEER_FAILED_VERIFICATION;
|
||||
}
|
||||
else
|
||||
infof(data, "\tcommon name \"%s\" does not match \"%s\"\n",
|
||||
peer_CN, conn->host.dispname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* General housekeeping */
|
||||
conn->ssl[sockindex].state = ssl_connection_complete;
|
||||
conn->ssl[sockindex].ssl = ssl;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __AXTLS_H
|
||||
#define __AXTLS_H
|
||||
#ifndef HEADER_CURL_AXTLS_H
|
||||
#define HEADER_CURL_AXTLS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
@@ -59,4 +59,5 @@ int Curl_axtls_check_cxn(struct connectdata *conn);
|
||||
#define curlssl_data_pending(x,y) (x=x, y=y, 0)
|
||||
|
||||
#endif /* USE_AXTLS */
|
||||
#endif
|
||||
#endif /* HEADER_CURL_AXTLS_H */
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
/* Base64 encoding/decoding */
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#define _MPRINTF_REPLACE /* use our functions only */
|
||||
#include <curl/mprintf.h>
|
||||
|
||||
110
lib/bundles.c
Normal file
110
lib/bundles.c
Normal file
@@ -0,0 +1,110 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012, Linus Nielsen Feltzing, <linus@haxx.se>
|
||||
* Copyright (C) 2012, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "urldata.h"
|
||||
#include "url.h"
|
||||
#include "progress.h"
|
||||
#include "multiif.h"
|
||||
#include "bundles.h"
|
||||
#include "sendf.h"
|
||||
#include "rawstr.h"
|
||||
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
static void conn_llist_dtor(void *user, void *element)
|
||||
{
|
||||
struct connectdata *data = element;
|
||||
(void)user;
|
||||
|
||||
data->bundle = NULL;
|
||||
}
|
||||
|
||||
CURLcode Curl_bundle_create(struct SessionHandle *data,
|
||||
struct connectbundle **cb_ptr)
|
||||
{
|
||||
(void)data;
|
||||
DEBUGASSERT(*cb_ptr == NULL);
|
||||
*cb_ptr = malloc(sizeof(struct connectbundle));
|
||||
if(!*cb_ptr)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
(*cb_ptr)->num_connections = 0;
|
||||
(*cb_ptr)->server_supports_pipelining = FALSE;
|
||||
|
||||
(*cb_ptr)->conn_list = Curl_llist_alloc((curl_llist_dtor) conn_llist_dtor);
|
||||
if(!(*cb_ptr)->conn_list) {
|
||||
Curl_safefree(*cb_ptr);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
void Curl_bundle_destroy(struct connectbundle *cb_ptr)
|
||||
{
|
||||
if(!cb_ptr)
|
||||
return;
|
||||
|
||||
if(cb_ptr->conn_list) {
|
||||
Curl_llist_destroy(cb_ptr->conn_list, NULL);
|
||||
cb_ptr->conn_list = NULL;
|
||||
}
|
||||
Curl_safefree(cb_ptr);
|
||||
}
|
||||
|
||||
/* Add a connection to a bundle */
|
||||
CURLcode Curl_bundle_add_conn(struct connectbundle *cb_ptr,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
if(!Curl_llist_insert_next(cb_ptr->conn_list, cb_ptr->conn_list->tail, conn))
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
conn->bundle = cb_ptr;
|
||||
|
||||
cb_ptr->num_connections++;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* Remove a connection from a bundle */
|
||||
int Curl_bundle_remove_conn(struct connectbundle *cb_ptr,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
struct curl_llist_element *curr;
|
||||
|
||||
curr = cb_ptr->conn_list->head;
|
||||
while(curr) {
|
||||
if(curr->ptr == conn) {
|
||||
Curl_llist_remove(cb_ptr->conn_list, curr, NULL);
|
||||
cb_ptr->num_connections--;
|
||||
conn->bundle = NULL;
|
||||
return 1; /* we removed a handle */
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
45
lib/bundles.h
Normal file
45
lib/bundles.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef HEADER_CURL_BUNDLES_H
|
||||
#define HEADER_CURL_BUNDLES_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012, Linus Nielsen Feltzing, <linus@haxx.se>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
struct connectbundle {
|
||||
bool server_supports_pipelining; /* TRUE if server supports pipelining,
|
||||
set after first response */
|
||||
size_t num_connections; /* Number of connections in the bundle */
|
||||
struct curl_llist *conn_list; /* The connectdata members of the bundle */
|
||||
};
|
||||
|
||||
CURLcode Curl_bundle_create(struct SessionHandle *data,
|
||||
struct connectbundle **cb_ptr);
|
||||
|
||||
void Curl_bundle_destroy(struct connectbundle *cb_ptr);
|
||||
|
||||
CURLcode Curl_bundle_add_conn(struct connectbundle *cb_ptr,
|
||||
struct connectdata *conn);
|
||||
|
||||
int Curl_bundle_remove_conn(struct connectbundle *cb_ptr,
|
||||
struct connectdata *conn);
|
||||
|
||||
|
||||
#endif /* HEADER_CURL_BUNDLES_H */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef HEADER_CONFIG_DOS_H
|
||||
#define HEADER_CONFIG_DOS_H
|
||||
#ifndef HEADER_CURL_CONFIG_DOS_H
|
||||
#define HEADER_CURL_CONFIG_DOS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
@@ -188,5 +188,5 @@
|
||||
#undef word
|
||||
#undef byte
|
||||
|
||||
#endif /* HEADER_CONFIG_DOS_H */
|
||||
#endif /* HEADER_CURL_CONFIG_DOS_H */
|
||||
|
||||
|
||||
398
lib/config-vms.h
398
lib/config-vms.h
@@ -1,398 +0,0 @@
|
||||
#ifndef HEADER_CONFIG_VMS_H
|
||||
#define HEADER_CONFIG_VMS_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* */
|
||||
/* MSK, 02/05/04, Hand edited for trail build on Alpha V7.3, DEC C 6.5-003 */
|
||||
/* MSK, 03/09/04, Seems to work for all platforms I've built on so far. */
|
||||
/* Added HAVE_SYS_IOCTL_H define */
|
||||
/* TES, 10/06/04, Added MAX_INITIAL_POST_SIZE, HAVE_BASENAME */
|
||||
/* MSK, 02/02/05, Changed HAVE_TERMIOS_H to an undef since the change in */
|
||||
/* getpass.c no longer undef'd it during compile. */
|
||||
/* MSK, 02/08/05, turned two config-vms files into one by using USE_SSLEAY */
|
||||
/* MPZ, 12/28/05, changed HAVE_STRTOK_R define to use CRTL_VER */
|
||||
/* MSK, 01/27/07, needed to add HAVE_STRUCT_TIMEVAL define */
|
||||
|
||||
/* Define cpu-machine-OS */
|
||||
#if defined(__alpha)
|
||||
# define OS "ALPHA-HP-VMS"
|
||||
#elif defined(__vax)
|
||||
# define OS "VAX-HP-VMS"
|
||||
#elif defined(__ia64)
|
||||
# define OS "IA64-HP-VMS"
|
||||
#else
|
||||
# define OS "UNKNOWN-HP-VMS"
|
||||
#endif
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of `long double', as computed by sizeof. */
|
||||
#define SIZEOF_LONG_DOUBLE 8
|
||||
|
||||
/* The size of `long long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#define SIZEOF_SHORT 2
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T 4
|
||||
|
||||
/* Define if you have the alarm function. */
|
||||
#define HAVE_ALARM 1
|
||||
|
||||
/* Define if you have the geteuid function. */
|
||||
#define HAVE_GETEUID 1
|
||||
|
||||
/* Define if you have the basename function. */
|
||||
#define HAVE_BASENAME 1
|
||||
|
||||
/* Define if you have the gethostbyaddr function. */
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
|
||||
/* Define if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define if you have the getpwuid function. */
|
||||
#define HAVE_GETPWUID 1
|
||||
|
||||
/* Define if you have the getservbyname function. */
|
||||
#define HAVE_GETSERVBYNAME 1
|
||||
|
||||
/* Define if you have the gettimeofday function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define if you have the inet_addr function. */
|
||||
#define HAVE_INET_ADDR 1
|
||||
|
||||
/* Define if you have the ioctl function. */
|
||||
#define HAVE_IOCTL 1
|
||||
|
||||
/* Define if you have a working ioctl FIONBIO function. */
|
||||
#define HAVE_IOCTL_FIONBIO 1
|
||||
|
||||
/* Define if you have a working ioctl SIOCGIFADDR function. */
|
||||
#define HAVE_IOCTL_SIOCGIFADDR 1
|
||||
|
||||
/* Define if you have the perror function. */
|
||||
#define HAVE_PERROR 1
|
||||
|
||||
/* Define if you have the select function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define if you have the setvbuf function. */
|
||||
#define HAVE_SETVBUF 1
|
||||
|
||||
/* Define if you have the sigaction function. */
|
||||
#define HAVE_SIGACTION 1
|
||||
|
||||
/* Define if you have the signal function. */
|
||||
#define HAVE_SIGNAL 1
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
#define HAVE_STRCASECMP 1
|
||||
|
||||
/* Define if you have the strcmpi function. */
|
||||
/* #define HAVE_STRCMPI 1 */
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#define HAVE_STRFTIME 1
|
||||
|
||||
/* Define if you have the stricmp function. */
|
||||
/* #define HAVE_STRICMP 1 */
|
||||
|
||||
/* Define if you have the strstr function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define if you have the ftruncate function. */
|
||||
#define HAVE_FTRUNCATE 1
|
||||
|
||||
/* Define if you have the uname function. */
|
||||
#define HAVE_UNAME 1
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H 1
|
||||
|
||||
/* Define if you have the <err.h> header file. */
|
||||
#define HAVE_ERR_H 1
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define if you have the <getopt.h> header file. */
|
||||
#define HAVE_GETOPT_H 1
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#define HAVE_MALLOC_H 1
|
||||
|
||||
/* Define if you need the malloc.h header header file even with stdlib.h */
|
||||
/* #define NEED_MALLOC_H 1 */
|
||||
|
||||
/* Define if you have the <net/if.h> header file. */
|
||||
#define HAVE_NET_IF_H 1
|
||||
|
||||
/* Define if you have the <netdb.h> header file. */
|
||||
#define HAVE_NETDB_H 1
|
||||
|
||||
/* Define if you have the <netinet/if_ether.h> header file. */
|
||||
#define HAVE_NETINET_IF_ETHER_H 1
|
||||
|
||||
/* Define if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* OpenSSL section starts here */
|
||||
|
||||
/* Define if you have a working OpenSSL installation */
|
||||
#ifdef USE_SSLEAY
|
||||
|
||||
/* if OpenSSL is in use */
|
||||
#define USE_OPENSSL 1
|
||||
|
||||
/* Define if you have the crypto library (-lcrypto). */
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
|
||||
/* Define if you have the ssl library (-lssl). */
|
||||
#define HAVE_LIBSSL 1
|
||||
|
||||
/* Define if you have the <openssl/crypto.h> header file. */
|
||||
#define HAVE_OPENSSL_CRYPTO_H 1
|
||||
|
||||
/* Define if you have the <openssl/err.h> header file. */
|
||||
#define HAVE_OPENSSL_ERR_H 1
|
||||
|
||||
/* Define if you have the <openssl/pem.h> header file. */
|
||||
#define HAVE_OPENSSL_PEM_H 1
|
||||
|
||||
/* Define if you have the <openssl/rsa.h> header file. */
|
||||
#define HAVE_OPENSSL_RSA_H 1
|
||||
|
||||
/* Define if you have the <openssl/ssl.h> header file. */
|
||||
#define HAVE_OPENSSL_SSL_H 1
|
||||
|
||||
/* Define if you have the <openssl/x509.h> header file. */
|
||||
#define HAVE_OPENSSL_X509_H 1
|
||||
|
||||
/*
|
||||
* This needs to be defined for OpenSSL 0.9.7 and other versions that have the
|
||||
* ENGINE stuff supported. If an include of "openssl/engine.h" fails, then
|
||||
* undefine the define below.
|
||||
*/
|
||||
#define HAVE_OPENSSL_ENGINE_H 1
|
||||
|
||||
#endif /* USE_SSLEAY */
|
||||
/* OpenSSL section ends here */
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
#define HAVE_PWD_H 1
|
||||
|
||||
/* Define if you have the <sgtty.h> header file. */
|
||||
#define HAVE_SGTTY_H 1
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define if you have the resolv library (-lresolv). */
|
||||
#define HAVE_LIBRESOLV 1
|
||||
|
||||
/* Define if you have the socket library (-lsocket). */
|
||||
#define HAVE_LIBSOCKET 1
|
||||
|
||||
/* Define if getaddrinfo exists and works */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define if you have the <timeval.h> header file. */
|
||||
#define HAVE_TIMEVAL_H 1
|
||||
|
||||
/* Define if you have the timeval struct. */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* Name of this package! */
|
||||
#define PACKAGE "not-used"
|
||||
|
||||
/* Version number of this archive. */
|
||||
#define VERSION "not-used"
|
||||
|
||||
/* Define if you have the getpass function. */
|
||||
#undef HAVE_GETPASS
|
||||
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define if you have the `strtok_r' function. */
|
||||
/* Condition lifted from <string.h> */
|
||||
#if __CRTL_VER >= 70301000
|
||||
# define HAVE_STRTOK_R 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the `strtoll' function. */
|
||||
#define HAVE_STRTOLL 1
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you need the memory.h header file even with stdlib.h */
|
||||
#define NEED_MEMORY_H 1
|
||||
|
||||
/* Define if you have the `sigsetjmp' function. */
|
||||
#define HAVE_SIGSETJMP 1
|
||||
|
||||
/* Define to 1 if you have the <setjmp.h> header file. */
|
||||
#define HAVE_SETJMP_H 1
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define to 1 if you have the <stropts.h> header file. */
|
||||
#define HAVE_STROPTS_H 1
|
||||
|
||||
/* Define if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG2 size_t
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG46 size_t
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
/* Define if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
/* Define to the type of arg 1 for recv. */
|
||||
#define RECV_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type of arg 2 for recv. */
|
||||
#define RECV_TYPE_ARG2 void *
|
||||
|
||||
/* Define to the type of arg 3 for recv. */
|
||||
#define RECV_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for recv. */
|
||||
#define RECV_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define if you have the recvfrom function. */
|
||||
#define HAVE_RECVFROM 1
|
||||
|
||||
/* Define to the type of arg 1 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type pointed by arg 2 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG2 void
|
||||
|
||||
/* Define if the type pointed by arg 2 for recvfrom is void. */
|
||||
#define RECVFROM_TYPE_ARG2_IS_VOID 1
|
||||
|
||||
/* Define to the type of arg 3 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG4 int
|
||||
|
||||
/* Define to the type pointed by arg 5 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG5 struct sockaddr
|
||||
|
||||
/* Define to the type pointed by arg 6 for recvfrom. */
|
||||
#define RECVFROM_TYPE_ARG6 int
|
||||
|
||||
/* Define to the function return type for recvfrom. */
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
|
||||
/* Define if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
/* Define to the type of arg 1 for send. */
|
||||
#define SEND_TYPE_ARG1 int
|
||||
|
||||
/* Define to the type qualifier of arg 2 for send. */
|
||||
#define SEND_QUAL_ARG2 const
|
||||
|
||||
/* Define to the type of arg 2 for send. */
|
||||
#define SEND_TYPE_ARG2 void *
|
||||
|
||||
/* Define to the type of arg 3 for send. */
|
||||
#define SEND_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for send. */
|
||||
#define SEND_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for send. */
|
||||
#define SEND_TYPE_RETV int
|
||||
|
||||
/* Define to hide dollar sign from compilers in strict ansi mode. */
|
||||
#define decc_translate_vms(__s) decc$translate_vms(__s)
|
||||
|
||||
#endif /* HEADER_CONFIG_VMS_H */
|
||||
282
lib/conncache.c
Normal file
282
lib/conncache.c
Normal file
@@ -0,0 +1,282 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012, Linus Nielsen Feltzing, <linus@haxx.se>
|
||||
* Copyright (C) 2012 - 2013, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "urldata.h"
|
||||
#include "url.h"
|
||||
#include "progress.h"
|
||||
#include "multiif.h"
|
||||
#include "sendf.h"
|
||||
#include "rawstr.h"
|
||||
#include "bundles.h"
|
||||
#include "conncache.h"
|
||||
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
#define CONNECTION_HASH_SIZE 97
|
||||
|
||||
static void free_bundle_hash_entry(void *freethis)
|
||||
{
|
||||
struct connectbundle *b = (struct connectbundle *) freethis;
|
||||
|
||||
Curl_bundle_destroy(b);
|
||||
}
|
||||
|
||||
struct conncache *Curl_conncache_init(void)
|
||||
{
|
||||
struct conncache *connc;
|
||||
|
||||
connc = calloc(1, sizeof(struct conncache));
|
||||
if(!connc)
|
||||
return NULL;
|
||||
|
||||
connc->hash = Curl_hash_alloc(CONNECTION_HASH_SIZE, Curl_hash_str,
|
||||
Curl_str_key_compare, free_bundle_hash_entry);
|
||||
|
||||
if(!connc->hash) {
|
||||
free(connc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return connc;
|
||||
}
|
||||
|
||||
void Curl_conncache_destroy(struct conncache *connc)
|
||||
{
|
||||
if(connc) {
|
||||
Curl_hash_destroy(connc->hash);
|
||||
connc->hash = NULL;
|
||||
free(connc);
|
||||
}
|
||||
}
|
||||
|
||||
struct connectbundle *Curl_conncache_find_bundle(struct conncache *connc,
|
||||
char *hostname)
|
||||
{
|
||||
struct connectbundle *bundle = NULL;
|
||||
|
||||
if(connc)
|
||||
bundle = Curl_hash_pick(connc->hash, hostname, strlen(hostname)+1);
|
||||
|
||||
return bundle;
|
||||
}
|
||||
|
||||
static bool conncache_add_bundle(struct conncache *connc,
|
||||
char *hostname,
|
||||
struct connectbundle *bundle)
|
||||
{
|
||||
void *p;
|
||||
|
||||
p = Curl_hash_add(connc->hash, hostname, strlen(hostname)+1, bundle);
|
||||
|
||||
return p?TRUE:FALSE;
|
||||
}
|
||||
|
||||
static void conncache_remove_bundle(struct conncache *connc,
|
||||
struct connectbundle *bundle)
|
||||
{
|
||||
struct curl_hash_iterator iter;
|
||||
struct curl_hash_element *he;
|
||||
|
||||
if(!connc)
|
||||
return;
|
||||
|
||||
Curl_hash_start_iterate(connc->hash, &iter);
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
while(he) {
|
||||
if(he->ptr == bundle) {
|
||||
/* The bundle is destroyed by the hash destructor function,
|
||||
free_bundle_hash_entry() */
|
||||
Curl_hash_delete(connc->hash, he->key, he->key_len);
|
||||
return;
|
||||
}
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
}
|
||||
}
|
||||
|
||||
CURLcode Curl_conncache_add_conn(struct conncache *connc,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
CURLcode result;
|
||||
struct connectbundle *bundle;
|
||||
struct connectbundle *new_bundle = NULL;
|
||||
struct SessionHandle *data = conn->data;
|
||||
|
||||
bundle = Curl_conncache_find_bundle(data->state.conn_cache,
|
||||
conn->host.name);
|
||||
if(!bundle) {
|
||||
result = Curl_bundle_create(data, &new_bundle);
|
||||
if(result != CURLE_OK)
|
||||
return result;
|
||||
|
||||
if(!conncache_add_bundle(data->state.conn_cache,
|
||||
conn->host.name, new_bundle)) {
|
||||
Curl_bundle_destroy(new_bundle);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
bundle = new_bundle;
|
||||
}
|
||||
|
||||
result = Curl_bundle_add_conn(bundle, conn);
|
||||
if(result != CURLE_OK) {
|
||||
if(new_bundle)
|
||||
conncache_remove_bundle(data->state.conn_cache, new_bundle);
|
||||
return result;
|
||||
}
|
||||
|
||||
connc->num_connections++;
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
void Curl_conncache_remove_conn(struct conncache *connc,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
struct connectbundle *bundle = conn->bundle;
|
||||
|
||||
/* The bundle pointer can be NULL, since this function can be called
|
||||
due to a failed connection attempt, before being added to a bundle */
|
||||
if(bundle) {
|
||||
Curl_bundle_remove_conn(bundle, conn);
|
||||
if(bundle->num_connections == 0) {
|
||||
conncache_remove_bundle(connc, bundle);
|
||||
}
|
||||
connc->num_connections--;
|
||||
|
||||
DEBUGF(infof(conn->data, "The cache now contains %d members\n",
|
||||
connc->num_connections));
|
||||
}
|
||||
}
|
||||
|
||||
/* This function iterates the entire connection cache and calls the
|
||||
function func() with the connection pointer as the first argument
|
||||
and the supplied 'param' argument as the other,
|
||||
|
||||
Return 0 from func() to continue the loop, return 1 to abort it.
|
||||
*/
|
||||
void Curl_conncache_foreach(struct conncache *connc,
|
||||
void *param,
|
||||
int (*func)(struct connectdata *conn, void *param))
|
||||
{
|
||||
struct curl_hash_iterator iter;
|
||||
struct curl_llist_element *curr;
|
||||
struct curl_hash_element *he;
|
||||
|
||||
if(!connc)
|
||||
return;
|
||||
|
||||
Curl_hash_start_iterate(connc->hash, &iter);
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
while(he) {
|
||||
struct connectbundle *bundle;
|
||||
struct connectdata *conn;
|
||||
|
||||
bundle = he->ptr;
|
||||
|
||||
curr = bundle->conn_list->head;
|
||||
while(curr) {
|
||||
/* Yes, we need to update curr before calling func(), because func()
|
||||
might decide to remove the connection */
|
||||
conn = curr->ptr;
|
||||
curr = curr->next;
|
||||
|
||||
if(1 == func(conn, param))
|
||||
return;
|
||||
}
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the first connection found in the cache. Used when closing all
|
||||
connections */
|
||||
struct connectdata *
|
||||
Curl_conncache_find_first_connection(struct conncache *connc)
|
||||
{
|
||||
struct curl_hash_iterator iter;
|
||||
struct curl_llist_element *curr;
|
||||
struct curl_hash_element *he;
|
||||
struct connectbundle *bundle;
|
||||
|
||||
Curl_hash_start_iterate(connc->hash, &iter);
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
while(he) {
|
||||
bundle = he->ptr;
|
||||
|
||||
curr = bundle->conn_list->head;
|
||||
if(curr) {
|
||||
return curr->ptr;
|
||||
}
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/* Useful for debugging the connection cache */
|
||||
void Curl_conncache_print(struct conncache *connc)
|
||||
{
|
||||
struct curl_hash_iterator iter;
|
||||
struct curl_llist_element *curr;
|
||||
struct curl_hash_element *he;
|
||||
|
||||
if(!connc)
|
||||
return;
|
||||
|
||||
fprintf(stderr, "=Bundle cache=\n");
|
||||
|
||||
Curl_hash_start_iterate(connc->hash, &iter);
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
while(he) {
|
||||
struct connectbundle *bundle;
|
||||
struct connectdata *conn;
|
||||
|
||||
bundle = he->ptr;
|
||||
|
||||
fprintf(stderr, "%s -", he->key);
|
||||
curr = bundle->conn_list->head;
|
||||
while(curr) {
|
||||
conn = curr->ptr;
|
||||
|
||||
fprintf(stderr, " [%p %d]", (void *)conn, conn->inuse);
|
||||
curr = curr->next;
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
he = Curl_hash_next_element(&iter);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
53
lib/conncache.h
Normal file
53
lib/conncache.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef HEADER_CURL_CONNCACHE_H
|
||||
#define HEADER_CURL_CONNCACHE_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012, 2013, Linus Nielsen Feltzing, <linus@haxx.se>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
struct conncache {
|
||||
struct curl_hash *hash;
|
||||
size_t num_connections;
|
||||
};
|
||||
|
||||
struct conncache *Curl_conncache_init(void);
|
||||
|
||||
void Curl_conncache_destroy(struct conncache *connc);
|
||||
|
||||
struct connectbundle *Curl_conncache_find_bundle(struct conncache *connc,
|
||||
char *hostname);
|
||||
|
||||
CURLcode Curl_conncache_add_conn(struct conncache *connc,
|
||||
struct connectdata *conn);
|
||||
|
||||
void Curl_conncache_remove_conn(struct conncache *connc,
|
||||
struct connectdata *conn);
|
||||
|
||||
void Curl_conncache_foreach(struct conncache *connc,
|
||||
void *param,
|
||||
int (*func)(struct connectdata *conn,
|
||||
void *param));
|
||||
|
||||
struct connectdata *
|
||||
Curl_conncache_find_first_connection(struct conncache *connc);
|
||||
|
||||
void Curl_conncache_print(struct conncache *connc);
|
||||
|
||||
#endif /* HEADER_CURL_CONNCACHE_H */
|
||||
195
lib/connect.c
195
lib/connect.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2013, 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
|
||||
@@ -20,11 +20,8 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h> /* <netinet/tcp.h> may need it */
|
||||
#endif
|
||||
@@ -37,9 +34,6 @@
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
@@ -80,6 +74,8 @@
|
||||
#include "sslgen.h" /* for Curl_ssl_check_cxn() */
|
||||
#include "progress.h"
|
||||
#include "warnless.h"
|
||||
#include "conncache.h"
|
||||
#include "multihandle.h"
|
||||
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
@@ -132,7 +128,6 @@ tcpkeepalive(struct SessionHandle *data,
|
||||
static CURLcode
|
||||
singleipconnect(struct connectdata *conn,
|
||||
const Curl_addrinfo *ai, /* start connecting to this */
|
||||
long timeout_ms,
|
||||
curl_socket_t *sock,
|
||||
bool *connected);
|
||||
|
||||
@@ -203,20 +198,19 @@ long Curl_timeleft(struct SessionHandle *data,
|
||||
}
|
||||
|
||||
/*
|
||||
* waitconnect() waits for a TCP connect on the given socket for the specified
|
||||
* number if milliseconds. It returns:
|
||||
* checkconnect() checks for a TCP connect on the given socket.
|
||||
* It returns:
|
||||
*/
|
||||
|
||||
#define WAITCONN_CONNECTED 0
|
||||
#define WAITCONN_SELECT_ERROR -1
|
||||
#define WAITCONN_TIMEOUT 1
|
||||
#define WAITCONN_FDSET_ERROR 2
|
||||
#define WAITCONN_ABORTED 3
|
||||
enum chkconn_t {
|
||||
CHKCONN_SELECT_ERROR = -1,
|
||||
CHKCONN_CONNECTED = 0,
|
||||
CHKCONN_IDLE = 1,
|
||||
CHKCONN_FDSET_ERROR = 2
|
||||
};
|
||||
|
||||
static
|
||||
int waitconnect(struct connectdata *conn,
|
||||
curl_socket_t sockfd, /* socket */
|
||||
long timeout_msec)
|
||||
static enum chkconn_t
|
||||
checkconnect(curl_socket_t sockfd)
|
||||
{
|
||||
int rc;
|
||||
#ifdef mpeix
|
||||
@@ -226,34 +220,20 @@ int waitconnect(struct connectdata *conn,
|
||||
(void)verifyconnect(sockfd, NULL);
|
||||
#endif
|
||||
|
||||
for(;;) {
|
||||
rc = Curl_socket_ready(CURL_SOCKET_BAD, sockfd, 0);
|
||||
|
||||
/* now select() until we get connect or timeout */
|
||||
rc = Curl_socket_ready(CURL_SOCKET_BAD, sockfd, timeout_msec>1000?
|
||||
1000:timeout_msec);
|
||||
if(Curl_pgrsUpdate(conn))
|
||||
return WAITCONN_ABORTED;
|
||||
if(-1 == rc)
|
||||
/* error, no connect here, try next */
|
||||
return CHKCONN_SELECT_ERROR;
|
||||
|
||||
if(-1 == rc)
|
||||
/* error, no connect here, try next */
|
||||
return WAITCONN_SELECT_ERROR;
|
||||
else if(rc & CURL_CSELECT_ERR)
|
||||
/* error condition caught */
|
||||
return CHKCONN_FDSET_ERROR;
|
||||
|
||||
else if(0 == rc) {
|
||||
/* timeout */
|
||||
timeout_msec -= 1000;
|
||||
if(timeout_msec <= 0)
|
||||
return WAITCONN_TIMEOUT;
|
||||
else if(rc)
|
||||
return CHKCONN_CONNECTED;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if(rc & CURL_CSELECT_ERR)
|
||||
/* error condition caught */
|
||||
return WAITCONN_FDSET_ERROR;
|
||||
|
||||
break;
|
||||
}
|
||||
return WAITCONN_CONNECTED;
|
||||
return CHKCONN_IDLE;
|
||||
}
|
||||
|
||||
static CURLcode bindlocal(struct connectdata *conn,
|
||||
@@ -552,7 +532,7 @@ static CURLcode trynextip(struct connectdata *conn,
|
||||
ai = conn->ip_addr->ai_next;
|
||||
|
||||
while(ai) {
|
||||
CURLcode res = singleipconnect(conn, ai, 0L, &sockfd, connected);
|
||||
CURLcode res = singleipconnect(conn, ai, &sockfd, connected);
|
||||
if(res)
|
||||
return res;
|
||||
if(sockfd != CURL_SOCKET_BAD) {
|
||||
@@ -680,21 +660,20 @@ void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_is_connected() is used from the multi interface to check if the
|
||||
* firstsocket has connected.
|
||||
* Curl_is_connected() checks if the socket has connected.
|
||||
*/
|
||||
|
||||
CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
int sockindex,
|
||||
bool *connected)
|
||||
{
|
||||
int rc;
|
||||
struct SessionHandle *data = conn->data;
|
||||
CURLcode code = CURLE_OK;
|
||||
curl_socket_t sockfd = conn->sock[sockindex];
|
||||
long allow = DEFAULT_CONNECT_TIMEOUT;
|
||||
int error = 0;
|
||||
struct timeval now;
|
||||
enum chkconn_t chk;
|
||||
|
||||
DEBUGASSERT(sockindex >= FIRSTSOCKET && sockindex <= SECONDARYSOCKET);
|
||||
|
||||
@@ -717,9 +696,9 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
|
||||
/* check for connect without timeout as we want to return immediately */
|
||||
rc = waitconnect(conn, sockfd, 0);
|
||||
if(WAITCONN_TIMEOUT == rc) {
|
||||
/* check socket for connect */
|
||||
chk = checkconnect(sockfd);
|
||||
if(CHKCONN_IDLE == chk) {
|
||||
if(curlx_tvdiff(now, conn->connecttime) >= conn->timeoutms_per_addr) {
|
||||
infof(data, "After %ldms connect time, move on!\n",
|
||||
conn->timeoutms_per_addr);
|
||||
@@ -730,7 +709,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
return code;
|
||||
}
|
||||
|
||||
if(WAITCONN_CONNECTED == rc) {
|
||||
if(CHKCONN_CONNECTED == chk) {
|
||||
if(verifyconnect(sockfd, &error)) {
|
||||
/* we are connected with TCP, awesome! */
|
||||
|
||||
@@ -740,6 +719,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
return code;
|
||||
|
||||
conn->bits.tcpconnect[sockindex] = TRUE;
|
||||
|
||||
*connected = TRUE;
|
||||
if(sockindex == FIRSTSOCKET)
|
||||
Curl_pgrsTime(data, TIMER_CONNECT); /* connect done */
|
||||
@@ -752,7 +732,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
}
|
||||
else {
|
||||
/* nope, not connected */
|
||||
if(WAITCONN_FDSET_ERROR == rc) {
|
||||
if(CHKCONN_FDSET_ERROR == chk) {
|
||||
(void)verifyconnect(sockfd, &error);
|
||||
infof(data, "%s\n",Curl_strerror(conn, error));
|
||||
}
|
||||
@@ -868,12 +848,11 @@ void Curl_sndbufset(curl_socket_t sockfd)
|
||||
* CURL_SOCKET_BAD. Other errors will however return proper errors.
|
||||
*
|
||||
* singleipconnect() connects to the given IP only, and it may return without
|
||||
* having connected if used from the multi interface.
|
||||
* having connected.
|
||||
*/
|
||||
static CURLcode
|
||||
singleipconnect(struct connectdata *conn,
|
||||
const Curl_addrinfo *ai,
|
||||
long timeout_ms,
|
||||
curl_socket_t *sockp,
|
||||
bool *connected)
|
||||
{
|
||||
@@ -944,17 +923,24 @@ singleipconnect(struct connectdata *conn,
|
||||
/* set socket non-blocking */
|
||||
curlx_nonblock(sockfd, TRUE);
|
||||
|
||||
conn->connecttime = Curl_tvnow();
|
||||
if(conn->num_addr > 1)
|
||||
Curl_expire(data, conn->timeoutms_per_addr);
|
||||
|
||||
/* Connect TCP sockets, bind UDP */
|
||||
if(!isconnected && (conn->socktype == SOCK_STREAM)) {
|
||||
rc = connect(sockfd, &addr.sa_addr, addr.addrlen);
|
||||
if(-1 == rc)
|
||||
error = SOCKERRNO;
|
||||
conn->connecttime = Curl_tvnow();
|
||||
if(conn->num_addr > 1)
|
||||
Curl_expire(data, conn->timeoutms_per_addr);
|
||||
}
|
||||
else
|
||||
rc = 0;
|
||||
else {
|
||||
*sockp = sockfd;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
conn->bits.ipv6 = (addr.family == AF_INET6)?TRUE:FALSE;
|
||||
#endif
|
||||
|
||||
if(-1 == rc) {
|
||||
switch (error) {
|
||||
@@ -969,54 +955,23 @@ singleipconnect(struct connectdata *conn,
|
||||
case EAGAIN:
|
||||
#endif
|
||||
#endif
|
||||
rc = waitconnect(conn, sockfd, timeout_ms);
|
||||
if(WAITCONN_ABORTED == rc) {
|
||||
Curl_closesocket(conn, sockfd);
|
||||
return CURLE_ABORTED_BY_CALLBACK;
|
||||
}
|
||||
break;
|
||||
*sockp = sockfd;
|
||||
return CURLE_OK;
|
||||
|
||||
default:
|
||||
/* unknown error, fallthrough and try another address! */
|
||||
failf(data, "Failed to connect to %s: %s",
|
||||
conn->ip_addr_str, Curl_strerror(conn,error));
|
||||
data->state.os_errno = error;
|
||||
|
||||
/* connect failed */
|
||||
Curl_closesocket(conn, sockfd);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* The 'WAITCONN_TIMEOUT == rc' comes from the waitconnect(), and not from
|
||||
connect(). We can be sure of this since connect() cannot return 1. */
|
||||
if((WAITCONN_TIMEOUT == rc) &&
|
||||
(data->state.used_interface == Curl_if_multi)) {
|
||||
/* Timeout when running the multi interface */
|
||||
else
|
||||
*sockp = sockfd;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
if(!isconnected)
|
||||
isconnected = verifyconnect(sockfd, &error);
|
||||
|
||||
if(!rc && isconnected) {
|
||||
/* we are connected, awesome! */
|
||||
*connected = TRUE; /* this is a true connect */
|
||||
infof(data, "connected\n");
|
||||
#ifdef ENABLE_IPV6
|
||||
conn->bits.ipv6 = (addr.family == AF_INET6)?TRUE:FALSE;
|
||||
#endif
|
||||
|
||||
Curl_updateconninfo(conn, sockfd);
|
||||
*sockp = sockfd;
|
||||
return CURLE_OK;
|
||||
}
|
||||
else if(WAITCONN_TIMEOUT == rc)
|
||||
infof(data, "Timeout\n");
|
||||
else {
|
||||
data->state.os_errno = error;
|
||||
infof(data, "%s\n", Curl_strerror(conn, error));
|
||||
}
|
||||
|
||||
/* connect failed or timed out */
|
||||
Curl_closesocket(conn, sockfd);
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
@@ -1078,9 +1033,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
|
||||
/* start connecting to the IP curr_addr points to */
|
||||
res = singleipconnect(conn, curr_addr,
|
||||
/* don't hang when doing multi */
|
||||
(data->state.used_interface == Curl_if_multi)?0:
|
||||
conn->timeoutms_per_addr, &sockfd, connected);
|
||||
&sockfd, connected);
|
||||
if(res)
|
||||
return res;
|
||||
|
||||
@@ -1101,7 +1054,9 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
|
||||
if(sockfd == CURL_SOCKET_BAD) {
|
||||
/* no good connect was made */
|
||||
failf(data, "couldn't connect to host");
|
||||
failf(data, "couldn't connect to %s at %s:%d",
|
||||
conn->bits.proxy?"proxy":"host",
|
||||
conn->bits.proxy?conn->proxy.name:conn->host.name, conn->port);
|
||||
return CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
|
||||
@@ -1116,6 +1071,21 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
struct connfind {
|
||||
struct connectdata *tofind;
|
||||
bool found;
|
||||
};
|
||||
|
||||
static int conn_is_conn(struct connectdata *conn, void *param)
|
||||
{
|
||||
struct connfind *f = (struct connfind *)param;
|
||||
if(conn == f->tofind) {
|
||||
f->found = TRUE;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Used to extract socket and connectdata struct for the most recent
|
||||
* transfer on the given SessionHandle.
|
||||
@@ -1129,10 +1099,21 @@ curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
|
||||
|
||||
DEBUGASSERT(data);
|
||||
|
||||
if((data->state.lastconnect != -1) &&
|
||||
(data->state.connc->connects[data->state.lastconnect] != NULL)) {
|
||||
struct connectdata *c =
|
||||
data->state.connc->connects[data->state.lastconnect];
|
||||
/* this only works for an easy handle that has been used for
|
||||
curl_easy_perform()! */
|
||||
if(data->state.lastconnect && data->multi_easy) {
|
||||
struct connectdata *c = data->state.lastconnect;
|
||||
struct connfind find;
|
||||
find.tofind = data->state.lastconnect;
|
||||
find.found = FALSE;
|
||||
|
||||
Curl_conncache_foreach(data->multi_easy->conn_cache, &find, conn_is_conn);
|
||||
|
||||
if(!find.found) {
|
||||
data->state.lastconnect = NULL;
|
||||
return CURL_SOCKET_BAD;
|
||||
}
|
||||
|
||||
if(connp)
|
||||
/* only store this if the caller cares for it */
|
||||
*connp = c;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include "nonblock.h" /* for curlx_nonblock(), formerly Curl_nonblock() */
|
||||
#include "sockaddr.h"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
/*
|
||||
* Comma-separated list all supported Content-Encodings ('identity' is implied)
|
||||
|
||||
@@ -77,7 +77,7 @@ Example set of cookies:
|
||||
****/
|
||||
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 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
|
||||
@@ -20,13 +20,10 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2012, 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
|
||||
@@ -22,11 +22,8 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2012, Nick Zitzmann, <nickzman@gmail.com>.
|
||||
* Copyright (C) 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 2012-2013, Nick Zitzmann, <nickzman@gmail.com>.
|
||||
* Copyright (C) 2012-2013, 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
|
||||
@@ -26,21 +26,21 @@
|
||||
* TLS/SSL layer. No code but sslgen.c should ever call or use these functions.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef USE_DARWINSSL
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#include <Security/Security.h>
|
||||
#include <Security/SecureTransport.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <CommonCrypto/CommonDigest.h>
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
#include "urldata.h"
|
||||
#include "sendf.h"
|
||||
@@ -60,6 +60,16 @@
|
||||
/* From MacTypes.h (which we can't include because it isn't present in iOS: */
|
||||
#define ioErr -36
|
||||
|
||||
/* In Mountain Lion and iOS 5, Apple made some changes to the API. They
|
||||
added TLS 1.1 and 1.2 support, and deprecated and replaced some
|
||||
functions. You need to build against the Mountain Lion or iOS 5 SDK
|
||||
or later to get TLS 1.1 or 1.2 support working in cURL. We'll weak-link
|
||||
to the newer functions and use them if present in the user's OS.
|
||||
|
||||
Builders: If you want TLS 1.1 and 1.2 but still want to retain support
|
||||
for older cats, don't forget to set the MACOSX_DEPLOYMENT_TARGET
|
||||
environmental variable prior to building cURL. */
|
||||
|
||||
/* The following two functions were ripped from Apple sample code,
|
||||
* with some modifications: */
|
||||
static OSStatus SocketRead(SSLConnectionRef connection,
|
||||
@@ -68,15 +78,15 @@ static OSStatus SocketRead(SSLConnectionRef connection,
|
||||
* RETURNED */
|
||||
size_t *dataLength) /* IN/OUT */
|
||||
{
|
||||
UInt32 bytesToGo = *dataLength;
|
||||
UInt32 initLen = bytesToGo;
|
||||
size_t bytesToGo = *dataLength;
|
||||
size_t initLen = bytesToGo;
|
||||
UInt8 *currData = (UInt8 *)data;
|
||||
/*int sock = *(int *)connection;*/
|
||||
struct ssl_connect_data *connssl = (struct ssl_connect_data *)connection;
|
||||
int sock = connssl->ssl_sockfd;
|
||||
OSStatus rtn = noErr;
|
||||
UInt32 bytesRead;
|
||||
int rrtn;
|
||||
size_t bytesRead;
|
||||
ssize_t rrtn;
|
||||
int theErr;
|
||||
|
||||
*dataLength = 0;
|
||||
@@ -130,12 +140,12 @@ static OSStatus SocketWrite(SSLConnectionRef connection,
|
||||
const void *data,
|
||||
size_t *dataLength) /* IN/OUT */
|
||||
{
|
||||
UInt32 bytesSent = 0;
|
||||
size_t bytesSent = 0;
|
||||
/*int sock = *(int *)connection;*/
|
||||
struct ssl_connect_data *connssl = (struct ssl_connect_data *)connection;
|
||||
int sock = connssl->ssl_sockfd;
|
||||
int length;
|
||||
UInt32 dataLen = *dataLength;
|
||||
ssize_t length;
|
||||
size_t dataLen = *dataLength;
|
||||
const UInt8 *dataPtr = (UInt8 *)data;
|
||||
OSStatus ortn;
|
||||
int theErr;
|
||||
@@ -166,8 +176,9 @@ static OSStatus SocketWrite(SSLConnectionRef connection,
|
||||
return ortn;
|
||||
}
|
||||
|
||||
CF_INLINE const char *CipherNameForNumber(SSLCipherSuite cipher) {
|
||||
CF_INLINE const char *SSLCipherNameForNumber(SSLCipherSuite cipher) {
|
||||
switch (cipher) {
|
||||
/* SSL version 3.0 */
|
||||
case SSL_RSA_WITH_NULL_MD5:
|
||||
return "SSL_RSA_WITH_NULL_MD5";
|
||||
break;
|
||||
@@ -255,6 +266,8 @@ CF_INLINE const char *CipherNameForNumber(SSLCipherSuite cipher) {
|
||||
case SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA:
|
||||
return "SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA";
|
||||
break;
|
||||
/* TLS 1.0 with AES (RFC 3268)
|
||||
(Apparently these are used in SSLv3 implementations as well.) */
|
||||
case TLS_RSA_WITH_AES_128_CBC_SHA:
|
||||
return "TLS_RSA_WITH_AES_128_CBC_SHA";
|
||||
break;
|
||||
@@ -291,6 +304,63 @@ CF_INLINE const char *CipherNameForNumber(SSLCipherSuite cipher) {
|
||||
case TLS_DH_anon_WITH_AES_256_CBC_SHA:
|
||||
return "TLS_DH_anon_WITH_AES_256_CBC_SHA";
|
||||
break;
|
||||
/* SSL version 2.0 */
|
||||
case SSL_RSA_WITH_RC2_CBC_MD5:
|
||||
return "SSL_RSA_WITH_RC2_CBC_MD5";
|
||||
break;
|
||||
case SSL_RSA_WITH_IDEA_CBC_MD5:
|
||||
return "SSL_RSA_WITH_IDEA_CBC_MD5";
|
||||
break;
|
||||
case SSL_RSA_WITH_DES_CBC_MD5:
|
||||
return "SSL_RSA_WITH_DES_CBC_MD5";
|
||||
break;
|
||||
case SSL_RSA_WITH_3DES_EDE_CBC_MD5:
|
||||
return "SSL_RSA_WITH_3DES_EDE_CBC_MD5";
|
||||
break;
|
||||
}
|
||||
return "SSL_NULL_WITH_NULL_NULL";
|
||||
}
|
||||
|
||||
CF_INLINE const char *TLSCipherNameForNumber(SSLCipherSuite cipher) {
|
||||
switch(cipher) {
|
||||
/* TLS 1.0 with AES (RFC 3268) */
|
||||
case TLS_RSA_WITH_AES_128_CBC_SHA:
|
||||
return "TLS_RSA_WITH_AES_128_CBC_SHA";
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_128_CBC_SHA:
|
||||
return "TLS_DH_DSS_WITH_AES_128_CBC_SHA";
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_128_CBC_SHA:
|
||||
return "TLS_DH_RSA_WITH_AES_128_CBC_SHA";
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_128_CBC_SHA:
|
||||
return "TLS_DHE_DSS_WITH_AES_128_CBC_SHA";
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_128_CBC_SHA:
|
||||
return "TLS_DHE_RSA_WITH_AES_128_CBC_SHA";
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_128_CBC_SHA:
|
||||
return "TLS_DH_anon_WITH_AES_128_CBC_SHA";
|
||||
break;
|
||||
case TLS_RSA_WITH_AES_256_CBC_SHA:
|
||||
return "TLS_RSA_WITH_AES_256_CBC_SHA";
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_256_CBC_SHA:
|
||||
return "TLS_DH_DSS_WITH_AES_256_CBC_SHA";
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_256_CBC_SHA:
|
||||
return "TLS_DH_RSA_WITH_AES_256_CBC_SHA";
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_256_CBC_SHA:
|
||||
return "TLS_DHE_DSS_WITH_AES_256_CBC_SHA";
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_256_CBC_SHA:
|
||||
return "TLS_DHE_RSA_WITH_AES_256_CBC_SHA";
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_256_CBC_SHA:
|
||||
return "TLS_DH_anon_WITH_AES_256_CBC_SHA";
|
||||
break;
|
||||
/* TLS 1.0 with ECDSA (RFC 4492) */
|
||||
case TLS_ECDH_ECDSA_WITH_NULL_SHA:
|
||||
return "TLS_ECDH_ECDSA_WITH_NULL_SHA";
|
||||
break;
|
||||
@@ -366,20 +436,229 @@ CF_INLINE const char *CipherNameForNumber(SSLCipherSuite cipher) {
|
||||
case TLS_ECDH_anon_WITH_AES_256_CBC_SHA:
|
||||
return "TLS_ECDH_anon_WITH_AES_256_CBC_SHA";
|
||||
break;
|
||||
case SSL_RSA_WITH_RC2_CBC_MD5:
|
||||
return "SSL_RSA_WITH_RC2_CBC_MD5";
|
||||
#if defined(__MAC_10_8) || defined(__IPHONE_5_0)
|
||||
/* TLS 1.2 (RFC 5246) */
|
||||
case TLS_RSA_WITH_NULL_MD5:
|
||||
return "TLS_RSA_WITH_NULL_MD5";
|
||||
break;
|
||||
case SSL_RSA_WITH_IDEA_CBC_MD5:
|
||||
return "SSL_RSA_WITH_IDEA_CBC_MD5";
|
||||
case TLS_RSA_WITH_NULL_SHA:
|
||||
return "TLS_RSA_WITH_NULL_SHA";
|
||||
break;
|
||||
case SSL_RSA_WITH_DES_CBC_MD5:
|
||||
return "SSL_RSA_WITH_DES_CBC_MD5";
|
||||
case TLS_RSA_WITH_RC4_128_MD5:
|
||||
return "TLS_RSA_WITH_RC4_128_MD5";
|
||||
break;
|
||||
case SSL_RSA_WITH_3DES_EDE_CBC_MD5:
|
||||
return "SSL_RSA_WITH_3DES_EDE_CBC_MD5";
|
||||
case TLS_RSA_WITH_RC4_128_SHA:
|
||||
return "TLS_RSA_WITH_RC4_128_SHA";
|
||||
break;
|
||||
case TLS_RSA_WITH_3DES_EDE_CBC_SHA:
|
||||
return "TLS_RSA_WITH_3DES_EDE_CBC_SHA";
|
||||
break;
|
||||
case TLS_RSA_WITH_NULL_SHA256:
|
||||
return "TLS_RSA_WITH_NULL_SHA256";
|
||||
break;
|
||||
case TLS_RSA_WITH_AES_128_CBC_SHA256:
|
||||
return "TLS_RSA_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_RSA_WITH_AES_256_CBC_SHA256:
|
||||
return "TLS_RSA_WITH_AES_256_CBC_SHA256";
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA:
|
||||
return "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA";
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA:
|
||||
return "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA";
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA:
|
||||
return "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA";
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA:
|
||||
return "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA";
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_128_CBC_SHA256:
|
||||
return "TLS_DH_DSS_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_128_CBC_SHA256:
|
||||
return "TLS_DH_RSA_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_128_CBC_SHA256:
|
||||
return "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256:
|
||||
return "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_256_CBC_SHA256:
|
||||
return "TLS_DH_DSS_WITH_AES_256_CBC_SHA256";
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_256_CBC_SHA256:
|
||||
return "TLS_DH_RSA_WITH_AES_256_CBC_SHA256";
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_256_CBC_SHA256:
|
||||
return "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256";
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256:
|
||||
return "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256";
|
||||
break;
|
||||
case TLS_DH_anon_WITH_RC4_128_MD5:
|
||||
return "TLS_DH_anon_WITH_RC4_128_MD5";
|
||||
break;
|
||||
case TLS_DH_anon_WITH_3DES_EDE_CBC_SHA:
|
||||
return "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA";
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_128_CBC_SHA256:
|
||||
return "TLS_DH_anon_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_256_CBC_SHA256:
|
||||
return "TLS_DH_anon_WITH_AES_256_CBC_SHA256";
|
||||
break;
|
||||
/* TLS 1.2 with AES GCM (RFC 5288) */
|
||||
case TLS_RSA_WITH_AES_128_GCM_SHA256:
|
||||
return "TLS_RSA_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_RSA_WITH_AES_256_GCM_SHA384:
|
||||
return "TLS_RSA_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_128_GCM_SHA256:
|
||||
return "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_DHE_RSA_WITH_AES_256_GCM_SHA384:
|
||||
return "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_128_GCM_SHA256:
|
||||
return "TLS_DH_RSA_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_DH_RSA_WITH_AES_256_GCM_SHA384:
|
||||
return "TLS_DH_RSA_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_128_GCM_SHA256:
|
||||
return "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_DHE_DSS_WITH_AES_256_GCM_SHA384:
|
||||
return "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_128_GCM_SHA256:
|
||||
return "TLS_DH_DSS_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_DH_DSS_WITH_AES_256_GCM_SHA384:
|
||||
return "TLS_DH_DSS_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_128_GCM_SHA256:
|
||||
return "TLS_DH_anon_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_DH_anon_WITH_AES_256_GCM_SHA384:
|
||||
return "TLS_DH_anon_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
/* TLS 1.2 with elliptic curve ciphers (RFC 5289) */
|
||||
case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256:
|
||||
return "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384:
|
||||
return "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384";
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256:
|
||||
return "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384:
|
||||
return "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384";
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256:
|
||||
return "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384:
|
||||
return "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384";
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256:
|
||||
return "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256";
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384:
|
||||
return "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384";
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:
|
||||
return "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:
|
||||
return "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256:
|
||||
return "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384:
|
||||
return "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:
|
||||
return "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:
|
||||
return "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256:
|
||||
return "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256";
|
||||
break;
|
||||
case TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384:
|
||||
return "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384";
|
||||
break;
|
||||
case TLS_EMPTY_RENEGOTIATION_INFO_SCSV:
|
||||
return "TLS_EMPTY_RENEGOTIATION_INFO_SCSV";
|
||||
break;
|
||||
#else
|
||||
case SSL_RSA_WITH_NULL_MD5:
|
||||
return "TLS_RSA_WITH_NULL_MD5";
|
||||
break;
|
||||
case SSL_RSA_WITH_NULL_SHA:
|
||||
return "TLS_RSA_WITH_NULL_SHA";
|
||||
break;
|
||||
case SSL_RSA_WITH_RC4_128_MD5:
|
||||
return "TLS_RSA_WITH_RC4_128_MD5";
|
||||
break;
|
||||
case SSL_RSA_WITH_RC4_128_SHA:
|
||||
return "TLS_RSA_WITH_RC4_128_SHA";
|
||||
break;
|
||||
case SSL_RSA_WITH_3DES_EDE_CBC_SHA:
|
||||
return "TLS_RSA_WITH_3DES_EDE_CBC_SHA";
|
||||
break;
|
||||
case SSL_DH_anon_WITH_RC4_128_MD5:
|
||||
return "TLS_DH_anon_WITH_RC4_128_MD5";
|
||||
break;
|
||||
case SSL_DH_anon_WITH_3DES_EDE_CBC_SHA:
|
||||
return "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA";
|
||||
break;
|
||||
#endif /* defined(__MAC_10_8) || defined(__IPHONE_5_0) */
|
||||
}
|
||||
return "(NONE)";
|
||||
return "TLS_NULL_WITH_NULL_NULL";
|
||||
}
|
||||
|
||||
CF_INLINE bool IsRunningMountainLionOrLater(void)
|
||||
{
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
|
||||
int mib[2];
|
||||
char *os_version;
|
||||
size_t os_version_len;
|
||||
char *os_version_major/*, *os_version_minor, *os_version_point*/;
|
||||
int os_version_major_int;
|
||||
|
||||
/* Get the Darwin kernel version from the kernel using sysctl(): */
|
||||
mib[0] = CTL_KERN;
|
||||
mib[1] = KERN_OSRELEASE;
|
||||
if(sysctl(mib, 2, NULL, &os_version_len, NULL, 0) == -1)
|
||||
return false;
|
||||
os_version = malloc(os_version_len*sizeof(char));
|
||||
if(!os_version)
|
||||
return false;
|
||||
if(sysctl(mib, 2, os_version, &os_version_len, NULL, 0) == -1) {
|
||||
free(os_version);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Parse the version. If it's version 12.0.0 or later, then this user is
|
||||
using Mountain Lion. */
|
||||
os_version_major = strtok(os_version, ".");
|
||||
/*os_version_minor = strtok(NULL, ".");
|
||||
os_version_point = strtok(NULL, ".");*/
|
||||
os_version_major_int = atoi(os_version_major);
|
||||
free(os_version);
|
||||
return os_version_major_int >= 12;
|
||||
#else
|
||||
return true; /* iOS users: this doesn't concern you */
|
||||
#endif
|
||||
}
|
||||
|
||||
static CURLcode darwinssl_connect_step1(struct connectdata *conn,
|
||||
@@ -388,7 +667,6 @@ static CURLcode darwinssl_connect_step1(struct connectdata *conn,
|
||||
struct SessionHandle *data = conn->data;
|
||||
curl_socket_t sockfd = conn->sock[sockindex];
|
||||
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
|
||||
bool sni = true;
|
||||
#ifdef ENABLE_IPV6
|
||||
struct in6_addr addr;
|
||||
#else
|
||||
@@ -397,6 +675,29 @@ static CURLcode darwinssl_connect_step1(struct connectdata *conn,
|
||||
/*SSLConnectionRef ssl_connection;*/
|
||||
OSStatus err = noErr;
|
||||
|
||||
#if defined(__MAC_10_8) || defined(__IPHONE_5_0)
|
||||
if(SSLCreateContext != NULL) { /* use the newer API if avaialble */
|
||||
if(connssl->ssl_ctx)
|
||||
CFRelease(connssl->ssl_ctx);
|
||||
connssl->ssl_ctx = SSLCreateContext(NULL, kSSLClientSide, kSSLStreamType);
|
||||
if(!connssl->ssl_ctx) {
|
||||
failf(data, "SSL: couldn't create a context!");
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* The old ST API does not exist under iOS, so don't compile it: */
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
|
||||
if(connssl->ssl_ctx)
|
||||
(void)SSLDisposeContext(connssl->ssl_ctx);
|
||||
err = SSLNewContext(false, &(connssl->ssl_ctx));
|
||||
if(err != noErr) {
|
||||
failf(data, "SSL: couldn't create a context: OSStatus %d", err);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
#endif /* (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) */
|
||||
}
|
||||
#else
|
||||
if(connssl->ssl_ctx)
|
||||
(void)SSLDisposeContext(connssl->ssl_ctx);
|
||||
err = SSLNewContext(false, &(connssl->ssl_ctx));
|
||||
@@ -404,8 +705,74 @@ static CURLcode darwinssl_connect_step1(struct connectdata *conn,
|
||||
failf(data, "SSL: couldn't create a context: OSStatus %d", err);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
#endif /* defined(__MAC_10_8) || defined(__IPHONE_5_0) */
|
||||
|
||||
/* check to see if we've been told to use an explicit SSL/TLS version */
|
||||
#if defined(__MAC_10_8) || defined(__IPHONE_5_0)
|
||||
if(SSLSetProtocolVersionMax != NULL) {
|
||||
switch(data->set.ssl.version) {
|
||||
case CURL_SSLVERSION_DEFAULT: default:
|
||||
(void)SSLSetProtocolVersionMin(connssl->ssl_ctx, kSSLProtocol3);
|
||||
(void)SSLSetProtocolVersionMax(connssl->ssl_ctx, kTLSProtocol12);
|
||||
break;
|
||||
case CURL_SSLVERSION_TLSv1:
|
||||
(void)SSLSetProtocolVersionMin(connssl->ssl_ctx, kTLSProtocol1);
|
||||
(void)SSLSetProtocolVersionMax(connssl->ssl_ctx, kTLSProtocol12);
|
||||
break;
|
||||
case CURL_SSLVERSION_SSLv3:
|
||||
(void)SSLSetProtocolVersionMin(connssl->ssl_ctx, kSSLProtocol3);
|
||||
(void)SSLSetProtocolVersionMax(connssl->ssl_ctx, kSSLProtocol3);
|
||||
break;
|
||||
case CURL_SSLVERSION_SSLv2:
|
||||
(void)SSLSetProtocolVersionMin(connssl->ssl_ctx, kSSLProtocol2);
|
||||
(void)SSLSetProtocolVersionMax(connssl->ssl_ctx, kSSLProtocol2);
|
||||
}
|
||||
}
|
||||
else {
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
|
||||
(void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx,
|
||||
kSSLProtocolAll,
|
||||
false);
|
||||
switch (data->set.ssl.version) {
|
||||
case CURL_SSLVERSION_DEFAULT: default:
|
||||
(void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx,
|
||||
kSSLProtocol3,
|
||||
true);
|
||||
(void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx,
|
||||
kTLSProtocol1,
|
||||
true);
|
||||
(void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx,
|
||||
kTLSProtocol11,
|
||||
true);
|
||||
(void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx,
|
||||
kTLSProtocol12,
|
||||
true);
|
||||
break;
|
||||
case CURL_SSLVERSION_TLSv1:
|
||||
(void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx,
|
||||
kTLSProtocol1,
|
||||
true);
|
||||
(void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx,
|
||||
kTLSProtocol11,
|
||||
true);
|
||||
(void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx,
|
||||
kTLSProtocol12,
|
||||
true);
|
||||
break;
|
||||
case CURL_SSLVERSION_SSLv3:
|
||||
(void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx,
|
||||
kSSLProtocol3,
|
||||
true);
|
||||
break;
|
||||
case CURL_SSLVERSION_SSLv2:
|
||||
(void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx,
|
||||
kSSLProtocol2,
|
||||
true);
|
||||
break;
|
||||
}
|
||||
#endif /* (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) */
|
||||
}
|
||||
#else
|
||||
(void)SSLSetProtocolVersionEnabled(connssl->ssl_ctx, kSSLProtocolAll, false);
|
||||
switch(data->set.ssl.version) {
|
||||
default:
|
||||
@@ -433,6 +800,7 @@ static CURLcode darwinssl_connect_step1(struct connectdata *conn,
|
||||
true);
|
||||
break;
|
||||
}
|
||||
#endif /* defined(__MAC_10_8) || defined(__IPHONE_5_0) */
|
||||
|
||||
/* No need to load certificates here. SecureTransport uses the Keychain
|
||||
* (which is also part of the Security framework) to evaluate trust. */
|
||||
@@ -441,19 +809,50 @@ static CURLcode darwinssl_connect_step1(struct connectdata *conn,
|
||||
* fail to connect if the verification fails, or if it should continue
|
||||
* anyway. In the latter case the result of the verification is checked with
|
||||
* SSL_get_verify_result() below. */
|
||||
#if defined(__MAC_10_6) || defined(__IPHONE_5_0)
|
||||
/* Snow Leopard introduced the SSLSetSessionOption() function, but due to
|
||||
a library bug with the way the kSSLSessionOptionBreakOnServerAuth flag
|
||||
works, it doesn't work as expected under Snow Leopard or Lion.
|
||||
So we need to call SSLSetEnableCertVerify() on those older cats in order
|
||||
to disable certificate validation if the user turned that off.
|
||||
(SecureTransport will always validate the certificate chain by
|
||||
default.) */
|
||||
if(SSLSetSessionOption != NULL && IsRunningMountainLionOrLater()) {
|
||||
err = SSLSetSessionOption(connssl->ssl_ctx,
|
||||
kSSLSessionOptionBreakOnServerAuth,
|
||||
data->set.ssl.verifypeer?false:true);
|
||||
if(err != noErr) {
|
||||
failf(data, "SSL: SSLSetSessionOption() failed: OSStatus %d", err);
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
}
|
||||
else {
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
|
||||
err = SSLSetEnableCertVerify(connssl->ssl_ctx,
|
||||
data->set.ssl.verifypeer?true:false);
|
||||
if(err != noErr) {
|
||||
failf(data, "SSL: SSLSetEnableCertVerify() failed: OSStatus %d", err);
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
#endif /* (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) */
|
||||
}
|
||||
#else
|
||||
err = SSLSetEnableCertVerify(connssl->ssl_ctx,
|
||||
data->set.ssl.verifypeer?true:false);
|
||||
if(err != noErr) {
|
||||
failf(data, "SSL: SSLSetEnableCertVerify() failed: OSStatus %d", err);
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
#endif /* defined(__MAC_10_6) || defined(__IPHONE_5_0) */
|
||||
|
||||
/* If this is a domain name and not an IP address, then configure SNI.
|
||||
* Also: the verifyhost setting influences SNI usage */
|
||||
/* If this is a domain name and not an IP address, then configure SNI: */
|
||||
if((0 == Curl_inet_pton(AF_INET, conn->host.name, &addr)) &&
|
||||
#ifdef ENABLE_IPV6
|
||||
(0 == Curl_inet_pton(AF_INET6, conn->host.name, &addr)) &&
|
||||
#endif
|
||||
sni) {
|
||||
data->set.ssl.verifyhost) {
|
||||
err = SSLSetPeerDomainName(connssl->ssl_ctx, conn->host.name,
|
||||
strlen(conn->host.name));
|
||||
if(err != noErr) {
|
||||
@@ -492,6 +891,7 @@ darwinssl_connect_step2(struct connectdata *conn, int sockindex)
|
||||
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
|
||||
OSStatus err;
|
||||
SSLCipherSuite cipher;
|
||||
SSLProtocol protocol = 0;
|
||||
|
||||
DEBUGASSERT(ssl_connect_2 == connssl->connecting_state
|
||||
|| ssl_connect_2_reading == connssl->connecting_state
|
||||
@@ -506,7 +906,6 @@ darwinssl_connect_step2(struct connectdata *conn, int sockindex)
|
||||
connssl->connecting_state = connssl->ssl_direction ?
|
||||
ssl_connect_2_writing : ssl_connect_2_reading;
|
||||
return CURLE_OK;
|
||||
break;
|
||||
|
||||
case errSSLServerAuthCompleted:
|
||||
/* the documentation says we need to call SSLHandshake() again */
|
||||
@@ -518,13 +917,16 @@ darwinssl_connect_step2(struct connectdata *conn, int sockindex)
|
||||
case errSSLCertExpired:
|
||||
failf(data, "SSL certificate problem: OSStatus %d", err);
|
||||
return CURLE_SSL_CACERT;
|
||||
break;
|
||||
|
||||
case errSSLHostNameMismatch:
|
||||
failf(data, "SSL certificate peer verification failed, the "
|
||||
"certificate did not match \"%s\"\n", conn->host.dispname);
|
||||
return CURLE_PEER_FAILED_VERIFICATION;
|
||||
|
||||
default:
|
||||
failf(data, "Unknown SSL protocol error in connection to %s:%d",
|
||||
conn->host.name, err);
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -533,7 +935,34 @@ darwinssl_connect_step2(struct connectdata *conn, int sockindex)
|
||||
|
||||
/* Informational message */
|
||||
(void)SSLGetNegotiatedCipher(connssl->ssl_ctx, &cipher);
|
||||
infof (data, "SSL connection using %s\n", CipherNameForNumber(cipher));
|
||||
(void)SSLGetNegotiatedProtocolVersion(connssl->ssl_ctx, &protocol);
|
||||
switch (protocol) {
|
||||
case kSSLProtocol2:
|
||||
infof(data, "SSL 2.0 connection using %s\n",
|
||||
SSLCipherNameForNumber(cipher));
|
||||
break;
|
||||
case kSSLProtocol3:
|
||||
infof(data, "SSL 3.0 connection using %s\n",
|
||||
SSLCipherNameForNumber(cipher));
|
||||
break;
|
||||
case kTLSProtocol1:
|
||||
infof(data, "TLS 1.0 connection using %s\n",
|
||||
TLSCipherNameForNumber(cipher));
|
||||
break;
|
||||
#if defined(__MAC_10_8) || defined(__IPHONE_5_0)
|
||||
case kTLSProtocol11:
|
||||
infof(data, "TLS 1.1 connection using %s\n",
|
||||
TLSCipherNameForNumber(cipher));
|
||||
break;
|
||||
case kTLSProtocol12:
|
||||
infof(data, "TLS 1.2 connection using %s\n",
|
||||
TLSCipherNameForNumber(cipher));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
infof(data, "Unknown protocol connection\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
@@ -551,10 +980,83 @@ darwinssl_connect_step3(struct connectdata *conn,
|
||||
SecCertificateRef server_cert;
|
||||
OSStatus err;
|
||||
CFIndex i, count;
|
||||
SecTrustRef trust;
|
||||
|
||||
/* There is no step 3!
|
||||
* Well, okay, if verbose mode is on, let's print the details of the
|
||||
* server certificates. */
|
||||
#if defined(__MAC_10_7) || defined(__IPHONE_5_0)
|
||||
#if (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
|
||||
#pragma unused(server_certs)
|
||||
err = SSLCopyPeerTrust(connssl->ssl_ctx, &trust);
|
||||
if(err == noErr) {
|
||||
count = SecTrustGetCertificateCount(trust);
|
||||
for(i = 0L ; i < count ; i++) {
|
||||
server_cert = SecTrustGetCertificateAtIndex(trust, i);
|
||||
server_cert_summary = SecCertificateCopySubjectSummary(server_cert);
|
||||
memset(server_cert_summary_c, 0, 128);
|
||||
if(CFStringGetCString(server_cert_summary,
|
||||
server_cert_summary_c,
|
||||
128,
|
||||
kCFStringEncodingUTF8)) {
|
||||
infof(data, "Server certificate: %s\n", server_cert_summary_c);
|
||||
}
|
||||
CFRelease(server_cert_summary);
|
||||
}
|
||||
CFRelease(trust);
|
||||
}
|
||||
#else
|
||||
/* SSLCopyPeerCertificates() is deprecated as of Mountain Lion.
|
||||
The function SecTrustGetCertificateAtIndex() is officially present
|
||||
in Lion, but it is unfortunately also present in Snow Leopard as
|
||||
private API and doesn't work as expected. So we have to look for
|
||||
a different symbol to make sure this code is only executed under
|
||||
Lion or later. */
|
||||
if(SecTrustEvaluateAsync != NULL) {
|
||||
#pragma unused(server_certs)
|
||||
err = SSLCopyPeerTrust(connssl->ssl_ctx, &trust);
|
||||
if(err == noErr) {
|
||||
count = SecTrustGetCertificateCount(trust);
|
||||
for(i = 0L ; i < count ; i++) {
|
||||
server_cert = SecTrustGetCertificateAtIndex(trust, i);
|
||||
server_cert_summary =
|
||||
SecCertificateCopyLongDescription(NULL, server_cert, NULL);
|
||||
memset(server_cert_summary_c, 0, 128);
|
||||
if(CFStringGetCString(server_cert_summary,
|
||||
server_cert_summary_c,
|
||||
128,
|
||||
kCFStringEncodingUTF8)) {
|
||||
infof(data, "Server certificate: %s\n", server_cert_summary_c);
|
||||
}
|
||||
CFRelease(server_cert_summary);
|
||||
}
|
||||
CFRelease(trust);
|
||||
}
|
||||
}
|
||||
else {
|
||||
err = SSLCopyPeerCertificates(connssl->ssl_ctx, &server_certs);
|
||||
if(err == noErr) {
|
||||
count = CFArrayGetCount(server_certs);
|
||||
for(i = 0L ; i < count ; i++) {
|
||||
server_cert = (SecCertificateRef)CFArrayGetValueAtIndex(server_certs,
|
||||
i);
|
||||
|
||||
server_cert_summary = SecCertificateCopySubjectSummary(server_cert);
|
||||
memset(server_cert_summary_c, 0, 128);
|
||||
if(CFStringGetCString(server_cert_summary,
|
||||
server_cert_summary_c,
|
||||
128,
|
||||
kCFStringEncodingUTF8)) {
|
||||
infof(data, "Server certificate: %s\n", server_cert_summary_c);
|
||||
}
|
||||
CFRelease(server_cert_summary);
|
||||
}
|
||||
CFRelease(server_certs);
|
||||
}
|
||||
}
|
||||
#endif /* (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) */
|
||||
#else
|
||||
#pragma unused(trust)
|
||||
err = SSLCopyPeerCertificates(connssl->ssl_ctx, &server_certs);
|
||||
if(err == noErr) {
|
||||
count = CFArrayGetCount(server_certs);
|
||||
@@ -573,6 +1075,7 @@ darwinssl_connect_step3(struct connectdata *conn,
|
||||
}
|
||||
CFRelease(server_certs);
|
||||
}
|
||||
#endif /* defined(__MAC_10_7) || defined(__IPHONE_5_0) */
|
||||
|
||||
connssl->connecting_state = ssl_connect_done;
|
||||
return CURLE_OK;
|
||||
@@ -722,9 +1225,20 @@ void Curl_darwinssl_close(struct connectdata *conn, int sockindex)
|
||||
{
|
||||
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
|
||||
|
||||
(void)SSLClose(connssl->ssl_ctx);
|
||||
(void)SSLDisposeContext(connssl->ssl_ctx);
|
||||
connssl->ssl_ctx = NULL;
|
||||
if(connssl->ssl_ctx) {
|
||||
(void)SSLClose(connssl->ssl_ctx);
|
||||
#if defined(__MAC_10_8) || defined(__IPHONE_5_0)
|
||||
if(SSLCreateContext != NULL)
|
||||
CFRelease(connssl->ssl_ctx);
|
||||
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
|
||||
else
|
||||
(void)SSLDisposeContext(connssl->ssl_ctx);
|
||||
#endif /* (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) */
|
||||
#else
|
||||
(void)SSLDisposeContext(connssl->ssl_ctx);
|
||||
#endif /* defined(__MAC_10_8) || defined(__IPHONE_5_0) */
|
||||
connssl->ssl_ctx = NULL;
|
||||
}
|
||||
connssl->ssl_sockfd = 0;
|
||||
}
|
||||
|
||||
@@ -840,15 +1354,15 @@ void Curl_darwinssl_random(struct SessionHandle *data,
|
||||
/* arc4random_buf() isn't available on cats older than Lion, so let's
|
||||
do this manually for the benefit of the older cats. */
|
||||
size_t i;
|
||||
u_int32_t random = 0;
|
||||
u_int32_t random_number = 0;
|
||||
|
||||
for(i = 0 ; i < length ; i++) {
|
||||
if(i % sizeof(u_int32_t) == 0)
|
||||
random = arc4random();
|
||||
entropy[i] = random & 0xFF;
|
||||
random >>= 8;
|
||||
random_number = arc4random();
|
||||
entropy[i] = random_number & 0xFF;
|
||||
random_number >>= 8;
|
||||
}
|
||||
i = random = 0;
|
||||
i = random_number = 0;
|
||||
(void)data;
|
||||
}
|
||||
|
||||
@@ -858,7 +1372,7 @@ void Curl_darwinssl_md5sum(unsigned char *tmp, /* input */
|
||||
size_t md5len)
|
||||
{
|
||||
(void)md5len;
|
||||
(void)CC_MD5(tmp, tmplen, md5sum);
|
||||
(void)CC_MD5(tmp, (CC_LONG)tmplen, md5sum);
|
||||
}
|
||||
|
||||
static ssize_t darwinssl_send(struct connectdata *conn,
|
||||
@@ -869,12 +1383,14 @@ static ssize_t darwinssl_send(struct connectdata *conn,
|
||||
{
|
||||
/*struct SessionHandle *data = conn->data;*/
|
||||
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
|
||||
size_t processed;
|
||||
size_t processed = 0UL;
|
||||
OSStatus err = SSLWrite(connssl->ssl_ctx, mem, len, &processed);
|
||||
|
||||
if(err != noErr) {
|
||||
switch (err) {
|
||||
case errSSLWouldBlock: /* we're not done yet; keep sending */
|
||||
case errSSLWouldBlock: /* return how much we sent (if anything) */
|
||||
if(processed)
|
||||
return (ssize_t)processed;
|
||||
*curlcode = CURLE_AGAIN;
|
||||
return -1;
|
||||
break;
|
||||
@@ -897,16 +1413,23 @@ static ssize_t darwinssl_recv(struct connectdata *conn,
|
||||
{
|
||||
/*struct SessionHandle *data = conn->data;*/
|
||||
struct ssl_connect_data *connssl = &conn->ssl[num];
|
||||
size_t processed;
|
||||
size_t processed = 0UL;
|
||||
OSStatus err = SSLRead(connssl->ssl_ctx, buf, buffersize, &processed);
|
||||
|
||||
if(err != noErr) {
|
||||
switch (err) {
|
||||
case errSSLWouldBlock: /* we're not done yet; keep reading */
|
||||
case errSSLWouldBlock: /* return how much we read (if anything) */
|
||||
if(processed)
|
||||
return (ssize_t)processed;
|
||||
*curlcode = CURLE_AGAIN;
|
||||
return -1;
|
||||
break;
|
||||
|
||||
case errSSLClosedGraceful: /* they're done; fail gracefully */
|
||||
*curlcode = CURLE_OK;
|
||||
return -1;
|
||||
break;
|
||||
|
||||
default:
|
||||
failf(conn->data, "SSLRead() return error %d", err);
|
||||
*curlcode = CURLE_RECV_ERROR;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
***************************************************************************/
|
||||
#include "setup.h"
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef USE_DARWINSSL
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user