Compare commits
329 Commits
curl-7_21_
...
curl-7_21_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6d7d0eba6d | ||
![]() |
a865bd9fba | ||
![]() |
0fd439ebac | ||
![]() |
012f9b7f04 | ||
![]() |
573a2900cd | ||
![]() |
c28443c551 | ||
![]() |
0b5901bec6 | ||
![]() |
5965d4554d | ||
![]() |
34127c7adc | ||
![]() |
315e5277dc | ||
![]() |
5c7c9a768d | ||
![]() |
bf1c102b80 | ||
![]() |
2271b60b71 | ||
![]() |
c2bfe60086 | ||
![]() |
63598059cd | ||
![]() |
c1901f7ed0 | ||
![]() |
9c4ff4874e | ||
![]() |
46a0062dff | ||
![]() |
d97fa56fd4 | ||
![]() |
d534cd0027 | ||
![]() |
afd6e738f7 | ||
![]() |
de670efeab | ||
![]() |
421d918da3 | ||
![]() |
99a07a1fdf | ||
![]() |
81c16c2e30 | ||
![]() |
dd5d3518e4 | ||
![]() |
07f60235b0 | ||
![]() |
5580fb2b9c | ||
![]() |
7e3f0bffe5 | ||
![]() |
5d47bf3776 | ||
![]() |
11cddb68e0 | ||
![]() |
1b2b93e074 | ||
![]() |
c328214a2d | ||
![]() |
f6f5d7874f | ||
![]() |
5db0a412ff | ||
![]() |
cbe67a1b71 | ||
![]() |
23245ca83a | ||
![]() |
3590874999 | ||
![]() |
e39ab6f203 | ||
![]() |
c9081a8280 | ||
![]() |
5088e3709d | ||
![]() |
c2ba8ca81f | ||
![]() |
ef24ecde68 | ||
![]() |
e8bc33d0a3 | ||
![]() |
5087f89ac8 | ||
![]() |
b3d39275f5 | ||
![]() |
1d75d30816 | ||
![]() |
6fe18add71 | ||
![]() |
d212fe43af | ||
![]() |
13d537e404 | ||
![]() |
46041ee918 | ||
![]() |
1bb05ac16f | ||
![]() |
091c52fef7 | ||
![]() |
a83870ef9d | ||
![]() |
a768e39b2d | ||
![]() |
1c4fa240be | ||
![]() |
5046dd02b9 | ||
![]() |
4d6c0bdf74 | ||
![]() |
cbf4961bf3 | ||
![]() |
add5766dd4 | ||
![]() |
8d59d69449 | ||
![]() |
465865c3cb | ||
![]() |
c539b83138 | ||
![]() |
0a2edfc348 | ||
![]() |
64520e43d4 | ||
![]() |
c79f816c32 | ||
![]() |
c8a7df108f | ||
![]() |
8636742256 | ||
![]() |
a1f32ffee5 | ||
![]() |
fec5f03e22 | ||
![]() |
2b2ac9068e | ||
![]() |
890425ecd7 | ||
![]() |
1df1032444 | ||
![]() |
b1e4dce671 | ||
![]() |
0b20de0194 | ||
![]() |
d596a523b9 | ||
![]() |
592df29f9c | ||
![]() |
f1db21218b | ||
![]() |
892cacef43 | ||
![]() |
12b2412c52 | ||
![]() |
7d8343934b | ||
![]() |
7cebf22d57 | ||
![]() |
c6b97a8278 | ||
![]() |
f96a2641fc | ||
![]() |
fc6c4c10f9 | ||
![]() |
152578fb33 | ||
![]() |
0a41318f1d | ||
![]() |
4bde456f73 | ||
![]() |
689ee8345c | ||
![]() |
5d4355f19b | ||
![]() |
710ecb6946 | ||
![]() |
1b24b89cca | ||
![]() |
dc3e7df1c9 | ||
![]() |
1171bc5c8a | ||
![]() |
3adb68c605 | ||
![]() |
34498c13be | ||
![]() |
517d3eb0a4 | ||
![]() |
6a07e704ca | ||
![]() |
95719fbea6 | ||
![]() |
fbf51696ef | ||
![]() |
1786950759 | ||
![]() |
87374a47c9 | ||
![]() |
368f5a8547 | ||
![]() |
68a485b00a | ||
![]() |
7b823badbc | ||
![]() |
b0fd03f5b8 | ||
![]() |
4b2fbe1e97 | ||
![]() |
afecd1aa13 | ||
![]() |
68cde058f6 | ||
![]() |
809a748124 | ||
![]() |
542318b113 | ||
![]() |
909e711e74 | ||
![]() |
d95b67f409 | ||
![]() |
96945c98d5 | ||
![]() |
1db61aca3b | ||
![]() |
bbb6eb3aaa | ||
![]() |
a4765b0551 | ||
![]() |
29de7dd288 | ||
![]() |
52e3c60c86 | ||
![]() |
282b41c69b | ||
![]() |
13e9571dd0 | ||
![]() |
36420330de | ||
![]() |
cc87913294 | ||
![]() |
ca9f9cb875 | ||
![]() |
0c8e5f7e6a | ||
![]() |
59db31902c | ||
![]() |
c36b00a166 | ||
![]() |
59f07ddf28 | ||
![]() |
e214cd4a73 | ||
![]() |
5997f54a71 | ||
![]() |
e8c442952d | ||
![]() |
98d9dc7840 | ||
![]() |
6164d40fce | ||
![]() |
65ca4b547b | ||
![]() |
d09a905751 | ||
![]() |
0152dbbe23 | ||
![]() |
2261ddf9db | ||
![]() |
295496fa34 | ||
![]() |
09a2d93a0f | ||
![]() |
b0ccd24a72 | ||
![]() |
11e131c9f9 | ||
![]() |
4b0c411ce6 | ||
![]() |
0f2e35b305 | ||
![]() |
0cb3d7913c | ||
![]() |
7e46061cac | ||
![]() |
7b79c8bf96 | ||
![]() |
04ae23afff | ||
![]() |
987168d6b9 | ||
![]() |
ea07fde40b | ||
![]() |
e3df610ada | ||
![]() |
72d9c96ad5 | ||
![]() |
d371458348 | ||
![]() |
ecd624b8e7 | ||
![]() |
81f151c912 | ||
![]() |
b804906414 | ||
![]() |
2869b6ea2b | ||
![]() |
2d3c7b7e01 | ||
![]() |
edf9566c3b | ||
![]() |
331531f70e | ||
![]() |
51b8d30dc4 | ||
![]() |
450c994a49 | ||
![]() |
6a43ffa0d5 | ||
![]() |
6a90aa3f3d | ||
![]() |
1998de9993 | ||
![]() |
61f4cdb73a | ||
![]() |
cda02fb78b | ||
![]() |
a5f96b49d1 | ||
![]() |
18e7b52e8e | ||
![]() |
6d272e53a2 | ||
![]() |
9bce615f46 | ||
![]() |
81e107010e | ||
![]() |
70e8814e44 | ||
![]() |
fc137ee272 | ||
![]() |
79cd7ef9ab | ||
![]() |
4b69f641a6 | ||
![]() |
2ae6c47d5d | ||
![]() |
15622e69a9 | ||
![]() |
8500586251 | ||
![]() |
3aef3ed8f6 | ||
![]() |
488f9545a2 | ||
![]() |
588402585b | ||
![]() |
750c9179ca | ||
![]() |
5f0ae7a062 | ||
![]() |
8fa519dce4 | ||
![]() |
5fb4279ec7 | ||
![]() |
67c83eb9eb | ||
![]() |
9e1083488f | ||
![]() |
dfaaa99ded | ||
![]() |
87badbef84 | ||
![]() |
e3811ed7c3 | ||
![]() |
dacc44ddc2 | ||
![]() |
fc9f369829 | ||
![]() |
bfbc4c7e00 | ||
![]() |
05b72a6af2 | ||
![]() |
1e2056fecb | ||
![]() |
5df13c3173 | ||
![]() |
ed4eecc05e | ||
![]() |
7e1a45e224 | ||
![]() |
e329586489 | ||
![]() |
397e61128f | ||
![]() |
578e833d3b | ||
![]() |
4d58f97f60 | ||
![]() |
33c3bb057b | ||
![]() |
6bf2014745 | ||
![]() |
a10f5b34ff | ||
![]() |
b1df37c60e | ||
![]() |
31d59fb2cc | ||
![]() |
562d40e671 | ||
![]() |
612832e4c0 | ||
![]() |
3c69a08e3b | ||
![]() |
5ea9e78bd7 | ||
![]() |
69d7c48072 | ||
![]() |
7d4f8c2809 | ||
![]() |
d23c59ecfc | ||
![]() |
1d95a48fe9 | ||
![]() |
512a82d395 | ||
![]() |
fbb38de415 | ||
![]() |
0006cdddee | ||
![]() |
b684ccd8b1 | ||
![]() |
3f64d05d34 | ||
![]() |
e4128f90ba | ||
![]() |
e991a3536d | ||
![]() |
8665d4e593 | ||
![]() |
0e36bb71f2 | ||
![]() |
19f45eaa79 | ||
![]() |
70a025f3df | ||
![]() |
95e230c591 | ||
![]() |
5fcc4332d6 | ||
![]() |
7d84113e1d | ||
![]() |
f3df524b62 | ||
![]() |
c47148f142 | ||
![]() |
8a00c94b0f | ||
![]() |
9de4b26643 | ||
![]() |
3208757c1a | ||
![]() |
fae19aed8d | ||
![]() |
c59dba338e | ||
![]() |
a76f852ca4 | ||
![]() |
3880dd3741 | ||
![]() |
d8041a7ea5 | ||
![]() |
abde4c9d84 | ||
![]() |
6d88d58dd5 | ||
![]() |
fbefd816e4 | ||
![]() |
296b246b9c | ||
![]() |
5393f08df8 | ||
![]() |
b5da54e6c9 | ||
![]() |
22085f7d6e | ||
![]() |
2c1b4e74e4 | ||
![]() |
aca67e2775 | ||
![]() |
8e2f16e66f | ||
![]() |
a7f6747019 | ||
![]() |
c3c4626fab | ||
![]() |
9808480860 | ||
![]() |
6ce76e6996 | ||
![]() |
64f12a3b9f | ||
![]() |
18a758d907 | ||
![]() |
7aea2d522d | ||
![]() |
f3e3f5f1b2 | ||
![]() |
62ef465262 | ||
![]() |
c6fa1952a1 | ||
![]() |
d47bd396ce | ||
![]() |
6882ae8dee | ||
![]() |
a00297158e | ||
![]() |
413cbdce3c | ||
![]() |
864d5add0d | ||
![]() |
3238ef5b69 | ||
![]() |
ca10e28f06 | ||
![]() |
5e92015711 | ||
![]() |
ce00c2ef5d | ||
![]() |
0db9140747 | ||
![]() |
55c266de6d | ||
![]() |
3af696f7c4 | ||
![]() |
09cee1633b | ||
![]() |
8d121b6f8f | ||
![]() |
892d6930e7 | ||
![]() |
200e9b5dd1 | ||
![]() |
b0873cb657 | ||
![]() |
19d2bf4ee4 | ||
![]() |
ae467115bb | ||
![]() |
f43ecac175 | ||
![]() |
d2a7fd2fe6 | ||
![]() |
29439acfeb | ||
![]() |
a049528e94 | ||
![]() |
2fbbddbe85 | ||
![]() |
ecb3fe63d7 | ||
![]() |
6ed72fd7fa | ||
![]() |
40e1623649 | ||
![]() |
53151db167 | ||
![]() |
cb64c987a0 | ||
![]() |
67d1616018 | ||
![]() |
65629f2915 | ||
![]() |
795107453d | ||
![]() |
201637d468 | ||
![]() |
6b6a3bcb61 | ||
![]() |
0cbdcd07a8 | ||
![]() |
d106189a47 | ||
![]() |
ddb810ab70 | ||
![]() |
77ba147e76 | ||
![]() |
bed311eda2 | ||
![]() |
9a0b6e42af | ||
![]() |
cfdc4aca45 | ||
![]() |
ab6681c2c8 | ||
![]() |
eeb2cb05a1 | ||
![]() |
daa96f9928 | ||
![]() |
f37affab8c | ||
![]() |
dc4adc484f | ||
![]() |
d0dea8f869 | ||
![]() |
ab81f6c7c4 | ||
![]() |
ebbe694e78 | ||
![]() |
70baf46d8d | ||
![]() |
280d2cff2e | ||
![]() |
ac20f52ed3 | ||
![]() |
59842d4d5f | ||
![]() |
2b6208a6de | ||
![]() |
2f0532a072 | ||
![]() |
6b490ed33c | ||
![]() |
4d703ee100 | ||
![]() |
13b8fc46a3 | ||
![]() |
9f4a174698 | ||
![]() |
8f6189600f | ||
![]() |
41572648db | ||
![]() |
b980c9a027 | ||
![]() |
9124bfba45 | ||
![]() |
232ad6549a | ||
![]() |
03da3ba1c0 | ||
![]() |
4d53dc5d80 | ||
![]() |
5907777153 | ||
![]() |
72da720b4a | ||
![]() |
a6e088e855 | ||
![]() |
4342a2087a |
@@ -831,7 +831,7 @@ function(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE)
|
|||||||
string(REPLACE "$(top_builddir)" "\${CURL_BINARY_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
string(REPLACE "$(top_builddir)" "\${CURL_BINARY_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
|
||||||
string(REGEX REPLACE "\\\\\n" "<22>!<21>" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
string(REGEX REPLACE "\\\\\n" "<22>!<21>" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*\n)" "SET(\\1 \\2)\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*)" "SET(\\1 \\2)" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
string(REPLACE "<22>!<21>" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
string(REPLACE "<22>!<21>" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
|
||||||
string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace $() with ${}
|
string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace $() with ${}
|
||||||
|
118
MacOSX-Framework
118
MacOSX-Framework
@@ -1,26 +1,76 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# This script performs all of the steps needed to build a
|
# This script performs all of the steps needed to build a
|
||||||
# universal binary libcurl.framework for Mac OS X 10.4 or greater.
|
# universal binary libcurl.framework for Mac OS X 10.4 or greater.
|
||||||
|
#
|
||||||
|
# Hendrik Visage:
|
||||||
|
# Generalizations added since Snowleopard (10.6) do not include
|
||||||
|
# the 10.4u SDK.
|
||||||
|
#
|
||||||
|
# Also note:
|
||||||
|
# 10.5 is the *ONLY* SDK that support PPC64 :( -- 10.6 do not have ppc64 support
|
||||||
|
#If you need to have PPC64 support then change below to 1
|
||||||
|
PPC64_NEEDED=0
|
||||||
|
|
||||||
|
# For me the default is to develop for the platform I am on, and if you
|
||||||
|
#desire compatibility with older versions then change USE_OLD to 1 :)
|
||||||
|
USE_OLD=0
|
||||||
|
|
||||||
VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`
|
VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`
|
||||||
|
FRAMEWORK_VERSION=Versions/Release-$VERSION
|
||||||
|
|
||||||
SDK32='/Developer/SDKs/MacOSX10.4u.sdk'
|
#I also wanted to "copy over" the system, and thus the reason I added the
|
||||||
|
# version to Versions/Release-7.20.1 etc.
|
||||||
|
# now a simple rsync -vaP libcurl.framework /Library/Frameworks will install it
|
||||||
|
# and setup the right paths to this version, leaving the system version
|
||||||
|
# "intact", so you can "fix" it later with the links to Versions/A/...
|
||||||
|
|
||||||
MINVER32='-mmacosx-version-min=10.4'
|
|
||||||
|
|
||||||
ARCHES32='-arch ppc -arch i386'
|
OLD_SDK=`ls /Developer/SDKs|head -1`
|
||||||
|
NEW_SDK=`ls -r /Developer/SDKs|head -1`
|
||||||
|
|
||||||
SDK64='/Developer/SDKs/MacOSX10.5.sdk'
|
if test "0"$USE_OLD -gt 0
|
||||||
|
then
|
||||||
|
SDK32=$OLD_SDK
|
||||||
|
else
|
||||||
|
SDK32=$NEW_SDK
|
||||||
|
fi
|
||||||
|
|
||||||
MINVER64='-mmacosx-version-min=10.5'
|
MACVER=`echo $SDK32|sed -e s/[a-zA-Z]//g -e s/.\$//`
|
||||||
|
|
||||||
ARCHES64='-arch ppc64 -arch x86_64'
|
SDK32_DIR='/Developer/SDKs/'$SDK32
|
||||||
|
MINVER32='-mmacosx-version-min='$MACVER
|
||||||
|
ARCHES32='-arch i386 -arch ppc'
|
||||||
|
|
||||||
if test -d $SDK32; then
|
|
||||||
|
if test $PPC64_NEEDED -gt 0
|
||||||
|
then
|
||||||
|
SDK64=10.5
|
||||||
|
ARCHES64='-arch x86_64 -arch ppc64'
|
||||||
|
SDK64=`ls /Developer/SDKs|grep 10.5|head -1`
|
||||||
|
else
|
||||||
|
ARCHES64='-arch x86_64'
|
||||||
|
#We "know" that 10.4 and earlier do not support 64bit
|
||||||
|
OLD_SDK64=`ls /Developer/SDKs|egrep -v "10.[0-4]"|head -1`
|
||||||
|
NEW_SDK64=`ls -r /Developer/SDKs|egrep -v "10.[0-4]"|head -1`
|
||||||
|
if test $USE_OLD -gt 0
|
||||||
|
then
|
||||||
|
SDK64=$OLD_SDK64
|
||||||
|
else
|
||||||
|
SDK64=$NEW_SDK64
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
SDK64_DIR='/Developer/SDKs/'$SDK64
|
||||||
|
MACVER64=`echo $SDK64|sed -e s/[a-zA-Z]//g -e s/.\$//`
|
||||||
|
|
||||||
|
MINVER64='-mmacosx-version-min='$MACVER64
|
||||||
|
|
||||||
|
if test ! -z $SDK32; then
|
||||||
echo "----Configuring libcurl for 32 bit universal framework..."
|
echo "----Configuring libcurl for 32 bit universal framework..."
|
||||||
|
make clean
|
||||||
./configure --disable-dependency-tracking --disable-static --with-gssapi \
|
./configure --disable-dependency-tracking --disable-static --with-gssapi \
|
||||||
CFLAGS="-Os -isysroot $SDK32 $ARCHES32 $MINVER32" \
|
CFLAGS="-Os -isysroot $SDK32_DIR $ARCHES32 $MINVER32" \
|
||||||
LDFLAGS="-Wl,-syslibroot,$SDK32 $ARCHES32 $MINVER32 -Wl,-headerpad_max_install_names" \
|
LDFLAGS="-Wl,-syslibroot,$SDK32_DIR $ARCHES32 $MINVER32 -Wl,-headerpad_max_install_names" \
|
||||||
CC=$CC
|
CC=$CC
|
||||||
|
|
||||||
echo "----Building 32 bit libcurl..."
|
echo "----Building 32 bit libcurl..."
|
||||||
@@ -28,40 +78,43 @@ if test -d $SDK32; then
|
|||||||
|
|
||||||
echo "----Creating 32 bit framework..."
|
echo "----Creating 32 bit framework..."
|
||||||
rm -r libcurl.framework
|
rm -r libcurl.framework
|
||||||
mkdir -p libcurl.framework/Versions/A/Resources
|
mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Resources
|
||||||
cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl
|
cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||||
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl
|
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||||
/usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/Versions/A/Resources/Info.plist
|
/usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/${FRAMEWORK_VERSION}/Resources/Info.plist
|
||||||
mkdir -p libcurl.framework/Versions/A/Headers/curl
|
mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
|
||||||
cp include/curl/*.h libcurl.framework/Versions/A/Headers/curl
|
cp include/curl/*.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
|
||||||
pushd libcurl.framework
|
pushd libcurl.framework
|
||||||
ln -fs Versions/A/libcurl libcurl
|
ln -fs ${FRAMEWORK_VERSION}/libcurl libcurl
|
||||||
ln -fs Versions/A/Resources Resources
|
ln -fs ${FRAMEWORK_VERSION}/Resources Resources
|
||||||
ln -fs Versions/A/Headers Headers
|
ln -fs ${FRAMEWORK_VERSION}/Headers Headers
|
||||||
cd Versions
|
cd Versions
|
||||||
ln -fs A Current
|
ln -fs ${FRAMEWORK_VERSION} Current
|
||||||
|
|
||||||
if test -d $SDK64; then
|
echo TEsting for SDK64
|
||||||
|
if test -d $SDK64_DIR; then
|
||||||
|
echo entering...
|
||||||
popd
|
popd
|
||||||
make clean
|
make clean
|
||||||
echo "----Configuring libcurl for 64 bit universal framework..."
|
echo "----Configuring libcurl for 64 bit universal framework..."
|
||||||
./configure --disable-dependency-tracking --disable-static --with-gssapi \
|
./configure --disable-dependency-tracking --disable-static --with-gssapi \
|
||||||
CFLAGS="-Os -isysroot $SDK64 $ARCHES64 $MINVER64" \
|
CFLAGS="-Os -isysroot $SDK64_DIR $ARCHES64 $MINVER64" \
|
||||||
LDFLAGS="-Wl,-syslibroot,$SDK64 $ARCHES64 $MINVER64 -Wl,-headerpad_max_install_names" \
|
LDFLAGS="-Wl,-syslibroot,$SDK64_DIR $ARCHES64 $MINVER64 -Wl,-headerpad_max_install_names" \
|
||||||
CC=$CC
|
CC=$CC
|
||||||
|
|
||||||
echo "----Building 64 bit libcurl..."
|
echo "----Building 64 bit libcurl..."
|
||||||
make
|
make
|
||||||
|
|
||||||
echo "----Appending 64 bit framework to 32 bit framework..."
|
echo "----Appending 64 bit framework to 32 bit framework..."
|
||||||
cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl64
|
cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||||
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl64
|
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||||
cp libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl32
|
cp libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl32
|
||||||
lipo libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64 -create -output libcurl.framework/Versions/A/libcurl
|
pwd
|
||||||
rm libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64
|
lipo libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 -create -output libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||||
cp libcurl.framework/Versions/A/Headers/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild32.h
|
rm libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
|
||||||
cp include/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild64.h
|
cp libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild32.h
|
||||||
cat >libcurl.framework/Versions/A/Headers/curl/curlbuild.h <<EOF
|
cp include/curl/curlbuild.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild64.h
|
||||||
|
cat >libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl/curlbuild.h <<EOF
|
||||||
#ifdef __LP64__
|
#ifdef __LP64__
|
||||||
#include "curl/curlbuild64.h"
|
#include "curl/curlbuild64.h"
|
||||||
#else
|
#else
|
||||||
@@ -70,9 +123,10 @@ if test -d $SDK32; then
|
|||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
lipo -info libcurl.framework/Versions/A/libcurl
|
pwd
|
||||||
|
lipo -info libcurl.framework/${FRAMEWORK_VERSION}/libcurl
|
||||||
echo "libcurl.framework is built and can now be included in other projects."
|
echo "libcurl.framework is built and can now be included in other projects."
|
||||||
echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks."
|
echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks."
|
||||||
else
|
else
|
||||||
echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4u SDK installed."
|
echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4/5/6 SDK installed."
|
||||||
fi
|
fi
|
||||||
|
@@ -55,22 +55,16 @@ borland-clean:
|
|||||||
make -f Makefile.b32 clean
|
make -f Makefile.b32 clean
|
||||||
|
|
||||||
watcom: .SYMBOLIC
|
watcom: .SYMBOLIC
|
||||||
cd lib
|
cd lib && $(MAKE) -u -f Makefile.Watcom
|
||||||
wmake -u -f Makefile.Watcom
|
cd src && $(MAKE) -u -f Makefile.Watcom
|
||||||
cd ..\src
|
|
||||||
wmake -u -f Makefile.Watcom
|
|
||||||
|
|
||||||
watcom-clean: .SYMBOLIC
|
watcom-clean: .SYMBOLIC
|
||||||
cd lib
|
cd lib && $(MAKE) -u -f Makefile.Watcom clean
|
||||||
wmake -u -f Makefile.Watcom clean
|
cd src && $(MAKE) -u -f Makefile.Watcom clean
|
||||||
cd ..\src
|
|
||||||
wmake -u -f Makefile.Watcom clean
|
|
||||||
|
|
||||||
watcom-vclean: .SYMBOLIC
|
watcom-vclean: .SYMBOLIC
|
||||||
cd lib
|
cd lib && $(MAKE) -u -f Makefile.Watcom vclean
|
||||||
wmake -u -f Makefile.Watcom vclean
|
cd src && $(MAKE) -u -f Makefile.Watcom vclean
|
||||||
cd ..\src
|
|
||||||
wmake -u -f Makefile.Watcom vclean
|
|
||||||
|
|
||||||
mingw32:
|
mingw32:
|
||||||
$(MAKE) -C lib -f Makefile.m32
|
$(MAKE) -C lib -f Makefile.m32
|
||||||
@@ -92,17 +86,21 @@ mingw32-ssh2-ssl-sspi-zlib:
|
|||||||
$(MAKE) -C lib -f Makefile.m32 SSH2=1 SSL=1 SSPI=1 ZLIB=1
|
$(MAKE) -C lib -f Makefile.m32 SSH2=1 SSL=1 SSPI=1 ZLIB=1
|
||||||
$(MAKE) -C src -f Makefile.m32 SSH2=1 SSL=1 SSPI=1 ZLIB=1
|
$(MAKE) -C src -f Makefile.m32 SSH2=1 SSL=1 SSPI=1 ZLIB=1
|
||||||
|
|
||||||
|
mingw32-rtmp-ssh2-ssl-sspi-zlib:
|
||||||
|
$(MAKE) -C lib -f Makefile.m32 RTMP=1 SSH2=1 SSL=1 SSPI=1 ZLIB=1
|
||||||
|
$(MAKE) -C src -f Makefile.m32 RTMP=1 SSH2=1 SSL=1 SSPI=1 ZLIB=1
|
||||||
|
|
||||||
mingw32-clean:
|
mingw32-clean:
|
||||||
$(MAKE) -C lib -f Makefile.m32 clean
|
$(MAKE) -C lib -f Makefile.m32 clean
|
||||||
$(MAKE) -C src -f Makefile.m32 clean
|
$(MAKE) -C src -f Makefile.m32 clean
|
||||||
|
|
||||||
vc-clean:
|
vc-clean: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake -f Makefile.$(VC) clean
|
nmake -f Makefile.$(VC) clean
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake -f Makefile.$(VC) clean
|
nmake -f Makefile.$(VC) clean
|
||||||
|
|
||||||
vc-all:
|
vc-all: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake -f Makefile.$(VC) cfg=release
|
nmake -f Makefile.$(VC) cfg=release
|
||||||
nmake -f Makefile.$(VC) cfg=release-ssl
|
nmake -f Makefile.$(VC) cfg=release-ssl
|
||||||
@@ -127,85 +125,85 @@ vc-all:
|
|||||||
nmake -f Makefile.$(VC) cfg=debug-dll-zlib-dll
|
nmake -f Makefile.$(VC) cfg=debug-dll-zlib-dll
|
||||||
nmake -f Makefile.$(VC) cfg=debug-dll-ssl-dll-zlib-dll
|
nmake -f Makefile.$(VC) cfg=debug-dll-ssl-dll-zlib-dll
|
||||||
|
|
||||||
vc:
|
vc: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release
|
nmake /f Makefile.$(VC) cfg=release
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC)
|
nmake /f Makefile.$(VC)
|
||||||
|
|
||||||
vc-x64:
|
vc-x64: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release
|
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release
|
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release
|
||||||
|
|
||||||
vc-zlib:
|
vc-zlib: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release-zlib
|
nmake /f Makefile.$(VC) cfg=release-zlib
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) cfg=release-zlib
|
nmake /f Makefile.$(VC) cfg=release-zlib
|
||||||
|
|
||||||
vc-ssl:
|
vc-ssl: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release-ssl
|
nmake /f Makefile.$(VC) cfg=release-ssl
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) cfg=release-ssl
|
nmake /f Makefile.$(VC) cfg=release-ssl
|
||||||
|
|
||||||
vc-ssl-zlib:
|
vc-ssl-zlib: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib
|
nmake /f Makefile.$(VC) cfg=release-ssl-zlib
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib
|
nmake /f Makefile.$(VC) cfg=release-ssl-zlib
|
||||||
|
|
||||||
vc-x64-ssl-zlib:
|
vc-x64-ssl-zlib: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
||||||
|
|
||||||
vc-ssl-dll:
|
vc-ssl-dll: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release-ssl-dll
|
nmake /f Makefile.$(VC) cfg=release-ssl-dll
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) cfg=release-ssl-dll
|
nmake /f Makefile.$(VC) cfg=release-ssl-dll
|
||||||
|
|
||||||
vc-dll-ssl-dll:
|
vc-dll-ssl-dll: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release-dll-ssl-dll
|
nmake /f Makefile.$(VC) cfg=release-dll-ssl-dll
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) cfg=release-dll-ssl-dll
|
nmake /f Makefile.$(VC) cfg=release-dll-ssl-dll
|
||||||
|
|
||||||
vc-dll:
|
vc-dll: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release-dll
|
nmake /f Makefile.$(VC) cfg=release-dll
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) cfg=release-dll
|
nmake /f Makefile.$(VC) cfg=release-dll
|
||||||
|
|
||||||
vc-dll-zlib-dll:
|
vc-dll-zlib-dll: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release-dll-zlib-dll
|
nmake /f Makefile.$(VC) cfg=release-dll-zlib-dll
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) cfg=release-dll-zlib-dll
|
nmake /f Makefile.$(VC) cfg=release-dll-zlib-dll
|
||||||
|
|
||||||
vc-dll-ssl-dll-zlib-dll:
|
vc-dll-ssl-dll-zlib-dll: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release-dll-ssl-dll-zlib-dll
|
nmake /f Makefile.$(VC) cfg=release-dll-ssl-dll-zlib-dll
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) cfg=release-dll-ssl-dll-zlib-dll
|
nmake /f Makefile.$(VC) cfg=release-dll-ssl-dll-zlib-dll
|
||||||
|
|
||||||
vc-ssl-dll-zlib-dll:
|
vc-ssl-dll-zlib-dll: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release-ssl-dll-zlib-dll
|
nmake /f Makefile.$(VC) cfg=release-ssl-dll-zlib-dll
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) cfg=release-ssl-dll-zlib-dll
|
nmake /f Makefile.$(VC) cfg=release-ssl-dll-zlib-dll
|
||||||
|
|
||||||
vc-zlib-dll:
|
vc-zlib-dll: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release-zlib-dll
|
nmake /f Makefile.$(VC) cfg=release-zlib-dll
|
||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) cfg=release-zlib-dll
|
nmake /f Makefile.$(VC) cfg=release-zlib-dll
|
||||||
|
|
||||||
vc-sspi:
|
vc-sspi: $(VC)
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release WINDOWS_SSPI=1
|
nmake /f Makefile.$(VC) cfg=release WINDOWS_SSPI=1
|
||||||
cd ..\src
|
cd ..\src
|
||||||
@@ -267,6 +265,8 @@ linux: all
|
|||||||
|
|
||||||
linux-ssl: ssl
|
linux-ssl: ssl
|
||||||
|
|
||||||
|
# We don't need to do anything for vc6.
|
||||||
|
vc6:
|
||||||
|
|
||||||
vc8: lib/Makefile.vc8 src/Makefile.vc8
|
vc8: lib/Makefile.vc8 src/Makefile.vc8
|
||||||
|
|
||||||
@@ -289,6 +289,17 @@ src/Makefile.vc9: src/Makefile.vc6
|
|||||||
@echo "generate $@"
|
@echo "generate $@"
|
||||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" src/Makefile.vc6 > src/Makefile.vc9
|
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" src/Makefile.vc6 > src/Makefile.vc9
|
||||||
|
|
||||||
|
# VC10 makefiles are for use with VS2010
|
||||||
|
vc10: lib/Makefile.vc10 src/Makefile.vc10
|
||||||
|
|
||||||
|
lib/Makefile.vc10: lib/Makefile.vc6
|
||||||
|
@echo "generate $@"
|
||||||
|
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc10/g" -e "s/VC6/VC10/g" lib/Makefile.vc6 > lib/Makefile.vc10
|
||||||
|
|
||||||
|
src/Makefile.vc10: src/Makefile.vc6
|
||||||
|
@echo "generate $@"
|
||||||
|
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc10/g" -e "s/VC6/VC10/g" src/Makefile.vc6 > src/Makefile.vc10
|
||||||
|
|
||||||
ca-bundle: lib/mk-ca-bundle.pl
|
ca-bundle: lib/mk-ca-bundle.pl
|
||||||
@echo "generate a fresh ca-bundle.crt"
|
@echo "generate a fresh ca-bundle.crt"
|
||||||
@perl $< -b -l -u lib/ca-bundle.crt
|
@perl $< -b -l -u lib/ca-bundle.crt
|
||||||
|
@@ -1,58 +1,51 @@
|
|||||||
Curl and libcurl 7.21.1
|
Curl and libcurl 7.21.3
|
||||||
|
|
||||||
Public curl releases: 117
|
Public curl releases: 119
|
||||||
Command line options: 138
|
Command line options: 143
|
||||||
curl_easy_setopt() options: 180
|
curl_easy_setopt() options: 185
|
||||||
Public functions in libcurl: 58
|
Public functions in libcurl: 58
|
||||||
Known libcurl bindings: 39
|
Known libcurl bindings: 39
|
||||||
Contributors: 808
|
Contributors: 827
|
||||||
|
|
||||||
This release includes the following changes:
|
This release includes the following changes:
|
||||||
|
|
||||||
o maketgz: produce CHANGES automatically
|
o Added --noconfigure switch to testcurl.pl
|
||||||
o added support for NTLM authentication when compiled with NSS
|
o Added --xattr option
|
||||||
o build: Enable configure --enable-werror
|
o Added CURLOPT_RESOLVE and --resolve
|
||||||
o curl-config: --built-shared returns shared info
|
o Added CURLAUTH_ONLY
|
||||||
|
o Added version-check.pl to the examples dir
|
||||||
|
|
||||||
This release includes the following bugfixes:
|
This release includes the following bugfixes:
|
||||||
|
|
||||||
o configure: spell --disable-threaded-resolver correctly
|
o check for libcurl features for some command line options
|
||||||
o multi: call the progress callback in all states
|
o Curl_setopt: disallow CURLOPT_USE_SSL without SSL support
|
||||||
o multi: unmark handle as used when no longer head of pipeline
|
o http_chunks: remove debug output
|
||||||
o sendrecv: treat all negative values from send/recv as errors
|
o URL-parsing: consider ? a divider
|
||||||
o ftp-wildcard: avoid tight loop when used without any pattern
|
o SSH: avoid using the libssh2_ prefix
|
||||||
o multi_socket: re-use of same socket without notifying app
|
o SSH: use libssh2_session_handshake() to work on win64
|
||||||
o ftp wildcard: FTP LIST parser FIX
|
o ftp: prevent server from hanging on closed data connection when stopping
|
||||||
o urlglobbing backslash escaping bug
|
a transfer before the end of the full transfer (ranges)
|
||||||
o build: add enable IPV6 option for the VC makefiles
|
o LDAP: detect non-binary attributes properly
|
||||||
o multi: CURLINFO_LASTSOCKET doesn't work after remove_handle
|
o ftp: treat server's response 421 as CURLE_OPERATION_TIMEDOUT
|
||||||
o --libcurl: use *_LARGE options with typecasted constants
|
o gnutls->handshake: improved timeout handling
|
||||||
o --libcurl: hide setopt() calls setting default options
|
o security: Pass the right parameter to init
|
||||||
o curl: avoid setting libcurl options to its default
|
o krb5: Use GSS_ERROR to check for error
|
||||||
o --libcurl: list the tricky options instead of using [REMARK]
|
o TFTP: resend the correct data
|
||||||
o http: don't enable chunked during authentication negotiations
|
o configure: fix autoconf 2.68 warning: no AC_LANG_SOURCE call detected
|
||||||
o upload: warn users trying to upload from stdin with anyauth
|
o GnuTLS: now detects socket errors on Windows
|
||||||
o configure: allow environments variable to override internals
|
o symbols-in-versions: updated en masse
|
||||||
o threaded resolver: fix timeout issue
|
o added a couple examples that were missing from the tar ball
|
||||||
o multi: fix condition that remove timers before trigger
|
o Curl_send/recv_plain: return errno on failure
|
||||||
o examples: add curl_multi_timeout
|
o Curl_wait_for_resolv (for c-ares): correct timeout
|
||||||
o --retry: access violation with URL part sets continued
|
o ossl_connect_common: detect connection re-use
|
||||||
o ssh: Fix compile error on 64-bit systems.
|
o configure: Prevent link errors with --librtmp
|
||||||
o remote-header-name: chop filename at next semicolon
|
o openldap: use remote port in URL passed to ldap_init_fd()
|
||||||
o ftp: response timeout bug in "quote" sending
|
o url: provide dead_connection flag in Curl_handler::disconnect
|
||||||
o CUSTOMREQUEST: shouldn't be disabled when HTTP is disabled
|
o lots of compiler warning fixes
|
||||||
o Watcom makefiles overhaul.
|
o ssh: fix a download resume point calculation
|
||||||
o NTLM tests: boost coverage by forcing the hostname
|
o fix getinfo CURLINFO_LOCAL* for reused connections
|
||||||
o multi: fix FTPS connecting the data connection with OpenSSL
|
o multi: the returned running handles conuter could turn negative
|
||||||
o retry: consider retrying even if -f is used
|
o multi: only ever consider pipelining for connections doing HTTP(S)
|
||||||
o fix SOCKS problem when using multi interface
|
|
||||||
o typecheck-gcc: add checks for recently added options
|
|
||||||
o SCP: send large files properly with new enough libssh2
|
|
||||||
o multi_socket: set timeout for 100-continue
|
|
||||||
o ";type=" URL suffix over HTTP proxy
|
|
||||||
o acknowledge progress callback error returns during connect
|
|
||||||
o Watcom makefile fixes
|
|
||||||
o runtests: clear old setenv remainders before test
|
|
||||||
|
|
||||||
This release includes the following known bugs:
|
This release includes the following known bugs:
|
||||||
|
|
||||||
@@ -61,11 +54,8 @@ This release includes the following known bugs:
|
|||||||
This release would not have looked like this without help, code, reports and
|
This release would not have looked like this without help, code, reports and
|
||||||
advice from friends like these:
|
advice from friends like these:
|
||||||
|
|
||||||
Dan Fandrich, Kamil Dudka, Krister Johansen, Pavel Raiskup, Jon Sargeant,
|
Dan Fandrich, Guenter Knauf, Pat Ray, Hongli Lai, Kamil Dudka,
|
||||||
Pierre Joye, Tor Arntsen, Constantine Sapuntzakis, Sidney San Martin,
|
Stefan Tomanek, Alfred Gebert, Yang Tse, Julien Chaffraix, Adam Light,
|
||||||
Jeff Pohlmeyer, Jan Van Boghout, Ben Greear, Guenter Knauf, Adam Light,
|
Rutger Hofman, Matthias Bolte, Heinrich Ko, Dmitri Shubin
|
||||||
Georg Lippitsch, Mike Power, Robin Cornelius, Mikael Johansson,
|
|
||||||
Yang Tse, Ben Darnell
|
|
||||||
|
|
||||||
|
|
||||||
Thanks! (and sorry if I forgot to mention someone)
|
Thanks! (and sorry if I forgot to mention someone)
|
||||||
|
10
TODO-RELEASE
10
TODO-RELEASE
@@ -1,4 +1,10 @@
|
|||||||
To be addressed in 7.XX.X
|
To be addressed in 7.21.3
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
261 -
|
263 - Support binding DNS to local interface/IP
|
||||||
|
|
||||||
|
265 - 1. FTP cmd channel and data channel validation
|
||||||
|
|
||||||
|
267 - 2. Cert chain for data channel
|
||||||
|
|
||||||
|
271 -
|
||||||
|
42
acinclude.m4
42
acinclude.m4
@@ -2145,6 +2145,7 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
|
|||||||
else
|
else
|
||||||
LIBS="$curl_cv_gclk_LIBS $curl_cv_save_LIBS"
|
LIBS="$curl_cv_gclk_LIBS $curl_cv_save_LIBS"
|
||||||
fi
|
fi
|
||||||
|
CURL_LIBS="$CURL_LIBS $curl_cv_gclk_LIBS"
|
||||||
AC_MSG_RESULT([$curl_cv_gclk_LIBS])
|
AC_MSG_RESULT([$curl_cv_gclk_LIBS])
|
||||||
ac_cv_func_clock_gettime="yes"
|
ac_cv_func_clock_gettime="yes"
|
||||||
;;
|
;;
|
||||||
@@ -3245,3 +3246,44 @@ AC_DEFUN([CURL_CHECK_PKGCONFIG], [
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
dnl CURL_GENERATE_CONFIGUREHELP_PM
|
||||||
|
dnl -------------------------------------------------
|
||||||
|
dnl Generate test harness configurehelp.pm module, defining and
|
||||||
|
dnl initializing some perl variables with values which are known
|
||||||
|
dnl when the configure script runs. For portability reasons, test
|
||||||
|
dnl harness needs information on how to run the C preprocessor.
|
||||||
|
|
||||||
|
AC_DEFUN([CURL_GENERATE_CONFIGUREHELP_PM], [
|
||||||
|
AC_REQUIRE([AC_PROG_CPP])dnl
|
||||||
|
tmp_cpp=`eval echo "$ac_cpp" 2>/dev/null`
|
||||||
|
if test -z "$tmp_cpp"; then
|
||||||
|
tmp_cpp='cpp'
|
||||||
|
fi
|
||||||
|
cat >./tests/configurehelp.pm <<_EOF
|
||||||
|
[@%:@] This is a generated file. Do not edit.
|
||||||
|
|
||||||
|
package configurehelp;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use Exporter;
|
||||||
|
|
||||||
|
use vars qw(
|
||||||
|
@ISA
|
||||||
|
@EXPORT_OK
|
||||||
|
\$Cpreprocessor
|
||||||
|
);
|
||||||
|
|
||||||
|
@ISA = qw(Exporter);
|
||||||
|
|
||||||
|
@EXPORT_OK = qw(
|
||||||
|
\$Cpreprocessor
|
||||||
|
);
|
||||||
|
|
||||||
|
\$Cpreprocessor = '$tmp_cpp';
|
||||||
|
|
||||||
|
1;
|
||||||
|
_EOF
|
||||||
|
])
|
||||||
|
15
buildconf
15
buildconf
@@ -248,13 +248,17 @@ fi
|
|||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# m4 check
|
# m4 check
|
||||||
#
|
#
|
||||||
m4=`${M4:-m4} --version 2>/dev/null|head -n 1`;
|
m4=`(${M4:-m4} --version || ${M4:-gm4} --version) 2>/dev/null | head -n 1`;
|
||||||
m4_version=`echo $m4 | sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//'`
|
m4_version=`echo $m4 | sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//'`
|
||||||
|
|
||||||
if { echo $m4 | grep "GNU" >/dev/null 2>&1; } then
|
if { echo $m4 | grep "GNU" >/dev/null 2>&1; } then
|
||||||
echo "buildconf: GNU m4 version $m4_version (ok)"
|
echo "buildconf: GNU m4 version $m4_version (ok)"
|
||||||
else
|
else
|
||||||
echo "buildconf: m4 version $m4 found. You need a GNU m4 installed!"
|
if test -z "$m4"; then
|
||||||
|
echo "buildconf: m4 version not recognized. You need a GNU m4 installed!"
|
||||||
|
else
|
||||||
|
echo "buildconf: m4 version $m4 found. You need a GNU m4 installed!"
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -289,6 +293,7 @@ for fname in .deps \
|
|||||||
config.status \
|
config.status \
|
||||||
config.sub \
|
config.sub \
|
||||||
configure \
|
configure \
|
||||||
|
configurehelp.pm \
|
||||||
curl-config \
|
curl-config \
|
||||||
curlbuild.h \
|
curlbuild.h \
|
||||||
depcomp \
|
depcomp \
|
||||||
@@ -360,6 +365,12 @@ if test ! -f ./config.guess; then
|
|||||||
else
|
else
|
||||||
buildhost=`./config.guess 2>/dev/null|head -n 1`
|
buildhost=`./config.guess 2>/dev/null|head -n 1`
|
||||||
case $buildhost in
|
case $buildhost in
|
||||||
|
*-*-darwin*)
|
||||||
|
need_lt_major=1
|
||||||
|
need_lt_minor=5
|
||||||
|
need_lt_patch=26
|
||||||
|
need_lt_check="yes"
|
||||||
|
;;
|
||||||
*-*-hpux*)
|
*-*-hpux*)
|
||||||
need_lt_major=1
|
need_lt_major=1
|
||||||
need_lt_minor=5
|
need_lt_minor=5
|
||||||
|
119
configure.ac
119
configure.ac
@@ -24,7 +24,7 @@ dnl Process this file with autoconf to produce a configure script.
|
|||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
|
|
||||||
dnl We don't know the version number "statically" so we use a dash here
|
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/])
|
AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/])
|
||||||
|
|
||||||
CURL_OVERRIDE_AUTOCONF
|
CURL_OVERRIDE_AUTOCONF
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ CONFIGURE_OPTIONS="\"$ac_configure_args\""
|
|||||||
AC_SUBST(CONFIGURE_OPTIONS)
|
AC_SUBST(CONFIGURE_OPTIONS)
|
||||||
|
|
||||||
CURL_CFLAG_EXTRAS=""
|
CURL_CFLAG_EXTRAS=""
|
||||||
if test X"$want_werror" == Xyes; then
|
if test X"$want_werror" = Xyes; then
|
||||||
CURL_CFLAG_EXTRAS="-Werror"
|
CURL_CFLAG_EXTRAS="-Werror"
|
||||||
fi
|
fi
|
||||||
AC_SUBST(CURL_CFLAG_EXTRAS)
|
AC_SUBST(CURL_CFLAG_EXTRAS)
|
||||||
@@ -416,7 +416,6 @@ AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
|
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
|
||||||
AC_SUBST(HAVE_LDAP_SSL, [1])
|
AC_SUBST(HAVE_LDAP_SSL, [1])
|
||||||
curl_ldaps_msg="enabled"
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac ],[
|
esac ],[
|
||||||
@@ -428,7 +427,6 @@ AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
|
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
|
||||||
AC_SUBST(HAVE_LDAP_SSL, [1])
|
AC_SUBST(HAVE_LDAP_SSL, [1])
|
||||||
curl_ldaps_msg="enabled"
|
|
||||||
fi ]
|
fi ]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -570,6 +568,22 @@ AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether to support gopher])
|
||||||
|
AC_ARG_ENABLE(gopher,
|
||||||
|
AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
|
||||||
|
AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
|
||||||
|
[ case "$enableval" in
|
||||||
|
no)
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
|
||||||
|
AC_SUBST(CURL_DISABLE_GOPHER, [1])
|
||||||
|
;;
|
||||||
|
*) AC_MSG_RESULT(yes)
|
||||||
|
;;
|
||||||
|
esac ],
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
dnl Check for built-in manual
|
dnl Check for built-in manual
|
||||||
@@ -876,6 +890,10 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test x$CURL_DISABLE_LDAPS != x1 ; then
|
||||||
|
curl_ldaps_msg="enabled"
|
||||||
|
fi
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
dnl Checks for IPv6
|
dnl Checks for IPv6
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
@@ -937,16 +955,19 @@ dnl Check if the operating system allows programs to write to their own argv[]
|
|||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
|
|
||||||
AC_MSG_CHECKING([if argv can be written to])
|
AC_MSG_CHECKING([if argv can be written to])
|
||||||
AC_CACHE_VAL(curl_cv_writable_argv, [
|
AC_RUN_IFELSE([
|
||||||
AC_RUN_IFELSE([[
|
AC_LANG_SOURCE([[
|
||||||
int main(int argc, char ** argv) {
|
int main(int argc, char ** argv) {
|
||||||
argv[0][0] = ' ';
|
argv[0][0] = ' ';
|
||||||
return (argv[0][0] == ' ')?0:1;
|
return (argv[0][0] == ' ')?0:1;
|
||||||
}
|
}
|
||||||
]],
|
]])
|
||||||
curl_cv_writable_argv=yes,
|
],[
|
||||||
curl_cv_writable_argv=no,
|
curl_cv_writable_argv=yes
|
||||||
curl_cv_writable_argv=cross)
|
],[
|
||||||
|
curl_cv_writable_argv=no
|
||||||
|
],[
|
||||||
|
curl_cv_writable_argv=cross
|
||||||
])
|
])
|
||||||
case $curl_cv_writable_argv in
|
case $curl_cv_writable_argv in
|
||||||
yes)
|
yes)
|
||||||
@@ -1718,6 +1739,20 @@ if test "$OPENSSL_ENABLED" != "1"; then
|
|||||||
|
|
||||||
fi dnl OPENSSL != 1
|
fi dnl OPENSSL != 1
|
||||||
|
|
||||||
|
dnl ---
|
||||||
|
dnl If GnuTLS is enabled, we MUST verify that it uses libgcrypt since
|
||||||
|
dnl curl code relies on that but recent GnuTLS versions can in fact build
|
||||||
|
dnl with different crypto libraries which curl right now cannot handle
|
||||||
|
dnl ---
|
||||||
|
|
||||||
|
if test "$GNUTLS_ENABLED" = "1"; then
|
||||||
|
AC_CHECK_LIB(gcrypt,
|
||||||
|
gcry_control, ,
|
||||||
|
[
|
||||||
|
AC_MSG_ERROR([need GnuTLS built with gcrypt to function with GnuTLS])
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
|
||||||
dnl ----------------------------------------------------
|
dnl ----------------------------------------------------
|
||||||
dnl check for PolarSSL
|
dnl check for PolarSSL
|
||||||
dnl ----------------------------------------------------
|
dnl ----------------------------------------------------
|
||||||
@@ -1987,8 +2022,9 @@ if test X"$OPT_LIBSSH2" != Xno; then
|
|||||||
dnl libssh2_version is a post 1.0 addition
|
dnl libssh2_version is a post 1.0 addition
|
||||||
dnl libssh2_init and libssh2_exit were added in 1.2.5
|
dnl libssh2_init and libssh2_exit were added in 1.2.5
|
||||||
dnl libssh2_scp_send64 was added in 1.2.6
|
dnl libssh2_scp_send64 was added in 1.2.6
|
||||||
|
dnl libssh2_session_handshake was added in 1.2.8
|
||||||
AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \
|
AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \
|
||||||
libssh2_scp_send64 )
|
libssh2_scp_send64 libssh2_session_handshake)
|
||||||
|
|
||||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
|
||||||
export LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH
|
||||||
@@ -2030,11 +2066,16 @@ if test X"$OPT_LIBRTMP" != Xno; then
|
|||||||
CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
|
CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
|
||||||
version=`$PKGCONFIG --modversion librtmp`
|
version=`$PKGCONFIG --modversion librtmp`
|
||||||
DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
|
DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
|
||||||
|
else
|
||||||
|
dnl To avoid link errors, we do not allow --librtmp without
|
||||||
|
dnl a pkgconfig file
|
||||||
|
AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
;;
|
;;
|
||||||
off)
|
off)
|
||||||
dnl no --with-librtmp option given, just check default places
|
dnl no --with-librtmp option given, just check default places
|
||||||
|
LIB_RTMP="-lrtmp"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
dnl use the given --with-librtmp spot
|
dnl use the given --with-librtmp spot
|
||||||
@@ -2053,13 +2094,19 @@ if test X"$OPT_LIBRTMP" != Xno; then
|
|||||||
CPPFLAGS="$CPPFLAGS $CPP_RTMP"
|
CPPFLAGS="$CPPFLAGS $CPP_RTMP"
|
||||||
LIBS="$LIBS $LIB_RTMP"
|
LIBS="$LIBS $LIB_RTMP"
|
||||||
|
|
||||||
AC_CHECK_LIB(rtmp, RTMP_Init)
|
AC_CHECK_LIB(rtmp, RTMP_Init,
|
||||||
|
[
|
||||||
AC_CHECK_HEADERS(librtmp/rtmp.h,
|
AC_CHECK_HEADERS(librtmp/rtmp.h,
|
||||||
curl_rtmp_msg="enabled (librtmp)"
|
curl_rtmp_msg="enabled (librtmp)"
|
||||||
LIBRTMP_ENABLED=1
|
LIBRTMP_ENABLED=1
|
||||||
AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
|
AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
|
||||||
AC_SUBST(USE_LIBRTMP, [1])
|
AC_SUBST(USE_LIBRTMP, [1])
|
||||||
|
)
|
||||||
|
],
|
||||||
|
dnl not found, revert back to clean variables
|
||||||
|
LDFLAGS=$CLEANLDFLAGS
|
||||||
|
CPPFLAGS=$CLEANCPPFLAGS
|
||||||
|
LIBS=$CLEANLIBS
|
||||||
)
|
)
|
||||||
|
|
||||||
if test X"$OPT_LIBRTMP" != Xoff &&
|
if test X"$OPT_LIBRTMP" != Xoff &&
|
||||||
@@ -2067,12 +2114,6 @@ if test X"$OPT_LIBRTMP" != Xno; then
|
|||||||
AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
|
AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$LIBRTMP_ENABLED" != "1"; then
|
|
||||||
dnl no librtmp, revert back to clean variables
|
|
||||||
LDFLAGS=$CLEANLDFLAGS
|
|
||||||
CPPFLAGS=$CLEANCPPFLAGS
|
|
||||||
LIBS=$CLEANLIBS
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
@@ -2244,11 +2285,17 @@ AC_CHECK_TYPE(long long,
|
|||||||
|
|
||||||
if test "xyes" = "x$longlong"; then
|
if test "xyes" = "x$longlong"; then
|
||||||
AC_MSG_CHECKING([if numberLL works])
|
AC_MSG_CHECKING([if numberLL works])
|
||||||
AC_COMPILE_IFELSE([long long val = 1000LL;],
|
AC_COMPILE_IFELSE([
|
||||||
[AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])]
|
AC_LANG_PROGRAM([[
|
||||||
AC_MSG_RESULT(yes),
|
]],[[
|
||||||
AC_MSG_RESULT(no)
|
long long val = 1000LL;
|
||||||
)
|
]])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@@ -2295,6 +2342,7 @@ CURL_CHECK_FUNC_FCNTL
|
|||||||
CURL_CHECK_FUNC_FDOPEN
|
CURL_CHECK_FUNC_FDOPEN
|
||||||
CURL_CHECK_FUNC_FREEADDRINFO
|
CURL_CHECK_FUNC_FREEADDRINFO
|
||||||
CURL_CHECK_FUNC_FREEIFADDRS
|
CURL_CHECK_FUNC_FREEIFADDRS
|
||||||
|
CURL_CHECK_FUNC_FSETXATTR
|
||||||
CURL_CHECK_FUNC_FTRUNCATE
|
CURL_CHECK_FUNC_FTRUNCATE
|
||||||
CURL_CHECK_FUNC_GETADDRINFO
|
CURL_CHECK_FUNC_GETADDRINFO
|
||||||
CURL_CHECK_FUNC_GETHOSTBYADDR
|
CURL_CHECK_FUNC_GETHOSTBYADDR
|
||||||
@@ -2335,10 +2383,6 @@ CURL_CHECK_FUNC_STRTOK_R
|
|||||||
CURL_CHECK_FUNC_STRTOLL
|
CURL_CHECK_FUNC_STRTOLL
|
||||||
CURL_CHECK_FUNC_WRITEV
|
CURL_CHECK_FUNC_WRITEV
|
||||||
|
|
||||||
dnl Checks for library functions.
|
|
||||||
dnl AC_PROG_GCC_TRADITIONAL
|
|
||||||
|
|
||||||
dnl AC_FUNC_VPRINTF
|
|
||||||
case $host in
|
case $host in
|
||||||
*msdosdjgpp)
|
*msdosdjgpp)
|
||||||
ac_cv_func_pipe=no
|
ac_cv_func_pipe=no
|
||||||
@@ -2738,6 +2782,9 @@ fi
|
|||||||
if test "x$CURL_DISABLE_TFTP" != "x1"; then
|
if test "x$CURL_DISABLE_TFTP" != "x1"; then
|
||||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
|
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
|
||||||
fi
|
fi
|
||||||
|
if test "x$CURL_DISABLE_GOPHER" != "x1"; then
|
||||||
|
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
|
||||||
|
fi
|
||||||
if test "x$CURL_DISABLE_POP3" != "x1"; then
|
if test "x$CURL_DISABLE_POP3" != "x1"; then
|
||||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
|
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
|
||||||
if test "x$SSL_ENABLED" = "x1"; then
|
if test "x$SSL_ENABLED" = "x1"; then
|
||||||
@@ -2826,6 +2873,8 @@ AC_CONFIG_FILES([Makefile \
|
|||||||
])
|
])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
CURL_GENERATE_CONFIGUREHELP_PM
|
||||||
|
|
||||||
AC_MSG_NOTICE([Configured to build curl/libcurl:
|
AC_MSG_NOTICE([Configured to build curl/libcurl:
|
||||||
|
|
||||||
curl version: ${VERSION}
|
curl version: ${VERSION}
|
||||||
|
107
docs/FAQ
107
docs/FAQ
@@ -1,4 +1,4 @@
|
|||||||
Updated: June 30, 2010 (http://curl.haxx.se/docs/faq.html)
|
Updated: October 6, 2010 (http://curl.haxx.se/docs/faq.html)
|
||||||
_ _ ____ _
|
_ _ ____ _
|
||||||
___| | | | _ \| |
|
___| | | | _ \| |
|
||||||
/ __| | | | |_) | |
|
/ __| | | | |_) | |
|
||||||
@@ -20,6 +20,8 @@ FAQ
|
|||||||
1.10 How many are using curl?
|
1.10 How many are using curl?
|
||||||
1.11 Why don't you update ca-bundle.crt
|
1.11 Why don't you update ca-bundle.crt
|
||||||
1.12 I have a problem who can I chat with?
|
1.12 I have a problem who can I chat with?
|
||||||
|
1.13 curl's ECCN number?
|
||||||
|
1.14 How do I submit my patch?
|
||||||
|
|
||||||
2. Install Related Problems
|
2. Install Related Problems
|
||||||
2.1 configure doesn't find OpenSSL even when it is installed
|
2.1 configure doesn't find OpenSSL even when it is installed
|
||||||
@@ -48,6 +50,7 @@ FAQ
|
|||||||
3.16 What certificates do I need when I use SSL?
|
3.16 What certificates do I need when I use SSL?
|
||||||
3.17 How do I list the root dir of an FTP server?
|
3.17 How do I list the root dir of an FTP server?
|
||||||
3.18 Can I use curl to send a POST/PUT and not wait for a response?
|
3.18 Can I use curl to send a POST/PUT and not wait for a response?
|
||||||
|
3.19 How do I get HTTP from a host using a specific IP address?
|
||||||
|
|
||||||
4. Running Problems
|
4. Running Problems
|
||||||
4.1 Problems connecting to SSL servers.
|
4.1 Problems connecting to SSL servers.
|
||||||
@@ -123,8 +126,10 @@ FAQ
|
|||||||
|
|
||||||
libcurl
|
libcurl
|
||||||
|
|
||||||
A free and easy-to-use client-side URL transfer library, supporting FTP,
|
A free and easy-to-use client-side URL transfer library, supporting DICT,
|
||||||
FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE, LDAP and LDAPS.
|
FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3,
|
||||||
|
POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP.
|
||||||
|
|
||||||
libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading,
|
libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading,
|
||||||
kerberos, HTTP form based upload, proxies, cookies, user+password
|
kerberos, HTTP form based upload, proxies, cookies, user+password
|
||||||
authentication, file transfer resume, http proxy tunneling and more!
|
authentication, file transfer resume, http proxy tunneling and more!
|
||||||
@@ -142,9 +147,8 @@ FAQ
|
|||||||
|
|
||||||
A command line tool for getting or sending files using URL syntax.
|
A command line tool for getting or sending files using URL syntax.
|
||||||
|
|
||||||
Since curl uses libcurl, it supports a range of common Internet protocols,
|
Since curl uses libcurl, curl supports the same wide range of common
|
||||||
currently including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, LDAPS,
|
Internet protocols that libcurl does.
|
||||||
DICT, TELNET and FILE.
|
|
||||||
|
|
||||||
We pronounce curl and cURL with an initial k sound: [kurl].
|
We pronounce curl and cURL with an initial k sound: [kurl].
|
||||||
|
|
||||||
@@ -308,9 +312,9 @@ FAQ
|
|||||||
as used by numerous applications that include libcurl binaries in their
|
as used by numerous applications that include libcurl binaries in their
|
||||||
distribution packages (like Adobe Acrobat Reader and Google Earth).
|
distribution packages (like Adobe Acrobat Reader and Google Earth).
|
||||||
|
|
||||||
More than 90 known named companies use curl in commercial environments and
|
More than a hundred known named companies use curl in commercial
|
||||||
products. More than 100 known named open source projects depend on
|
environments and products and more than a hundred known named open source
|
||||||
(lib)curl.
|
projects depend on (lib)curl.
|
||||||
|
|
||||||
In a poll on the curl web site mid-2005, more than 50% of the 300+ answers
|
In a poll on the curl web site mid-2005, more than 50% of the 300+ answers
|
||||||
estimated a user base of one million users or more.
|
estimated a user base of one million users or more.
|
||||||
@@ -320,6 +324,12 @@ FAQ
|
|||||||
based web servers. A guess is that a fair amount of these Linux
|
based web servers. A guess is that a fair amount of these Linux
|
||||||
installations have curl installed.
|
installations have curl installed.
|
||||||
|
|
||||||
|
The Debian project maintains statistics on packages installed by people
|
||||||
|
who have voluntarily run their package counting application. In mid-2010,
|
||||||
|
libcurl3 was installed on over 55000 such systems (62% of reporting systems)
|
||||||
|
and was one of the 320 most popular installed packages (out of about 107000
|
||||||
|
possible packages).
|
||||||
|
|
||||||
All this taken together, there is no doubt that there are millions of
|
All this taken together, there is no doubt that there are millions of
|
||||||
(lib)curl users.
|
(lib)curl users.
|
||||||
|
|
||||||
@@ -328,6 +338,7 @@ FAQ
|
|||||||
http://curl.haxx.se/libcurl/using/apps.html
|
http://curl.haxx.se/libcurl/using/apps.html
|
||||||
http://counter.li.org/estimates.php
|
http://counter.li.org/estimates.php
|
||||||
http://news.netcraft.com/archives/2005/03/14/fedora_makes_rapid_progress.html
|
http://news.netcraft.com/archives/2005/03/14/fedora_makes_rapid_progress.html
|
||||||
|
http://qa.debian.org/popcon.php?package=curl
|
||||||
|
|
||||||
1.11 Why don't you update ca-bundle.crt
|
1.11 Why don't you update ca-bundle.crt
|
||||||
|
|
||||||
@@ -358,6 +369,41 @@ FAQ
|
|||||||
IRC network irc.freenode.net. If you're polite and nice, chances are big
|
IRC network irc.freenode.net. If you're polite and nice, chances are big
|
||||||
that you can get -- or provide -- help instantly.
|
that you can get -- or provide -- help instantly.
|
||||||
|
|
||||||
|
1.13 curl's ECCN number?
|
||||||
|
|
||||||
|
The US government restricts exports of software that contains or uses
|
||||||
|
cryptography. When doing so, the Export Control Classification Number (ECCN)
|
||||||
|
is used to identify the level of export control etc.
|
||||||
|
|
||||||
|
ASF gives a good explanation at http://www.apache.org/dev/crypto.html
|
||||||
|
|
||||||
|
We believe curl's number might be ECCN 5D002, another possibility is
|
||||||
|
5D992. It seems necessary to write them, asking to confirm.
|
||||||
|
|
||||||
|
Comprehensible explanations of the meaning of such numbers and how to
|
||||||
|
obtain them (resp.) are here
|
||||||
|
|
||||||
|
http://www.bis.doc.gov/licensing/exportingbasics.htm
|
||||||
|
http://www.bis.doc.gov/licensing/do_i_needaneccn.html
|
||||||
|
|
||||||
|
An incomprehensible description of the two numbers above is here
|
||||||
|
http://www.access.gpo.gov/bis/ear/pdf/ccl5-pt2.pdf
|
||||||
|
|
||||||
|
1.14 How do I submit my patch?
|
||||||
|
|
||||||
|
When you have made a patch or a change of whatever sort, and want to submit
|
||||||
|
that to the project, there are a few different ways we prefer:
|
||||||
|
|
||||||
|
o send a patch to the curl-library mailing list. We're many subscribers
|
||||||
|
there and there are lots of people who can review patches, comment on them
|
||||||
|
and "receive" them properly.
|
||||||
|
|
||||||
|
o if your patch changes or fixes a bug, you can also opt to submit a bug
|
||||||
|
report in the bug tracker and attach your patch there. There are less
|
||||||
|
people involved there.
|
||||||
|
|
||||||
|
Lots of more details are found in the CONTRIBUTE and INTERNALS docs.
|
||||||
|
|
||||||
|
|
||||||
2. Install Related Problems
|
2. Install Related Problems
|
||||||
|
|
||||||
@@ -615,6 +661,9 @@ FAQ
|
|||||||
provide this in order to prove that you actually are who you claim to be.
|
provide this in order to prove that you actually are who you claim to be.
|
||||||
If the server doesn't require this, you don't need a client certificate.
|
If the server doesn't require this, you don't need a client certificate.
|
||||||
|
|
||||||
|
A client certificate is always used together with a private key, and the
|
||||||
|
private key has a pass phrase that protects it.
|
||||||
|
|
||||||
- Server certificate. The server you communicate with has a server
|
- Server certificate. The server you communicate with has a server
|
||||||
certificate. You can and should verify this certificate to make sure that
|
certificate. You can and should verify this certificate to make sure that
|
||||||
you are truly talking to the real server and not a server impersonating
|
you are truly talking to the real server and not a server impersonating
|
||||||
@@ -622,8 +671,9 @@ FAQ
|
|||||||
|
|
||||||
- Certificate Authority certificate ("CA cert"). You often have several CA
|
- Certificate Authority certificate ("CA cert"). You often have several CA
|
||||||
certs in a CA cert bundle that can be used to verify a server certificate
|
certs in a CA cert bundle that can be used to verify a server certificate
|
||||||
that was signed by one of the authorities in the bundle. curl comes with a
|
that was signed by one of the authorities in the bundle. curl does not
|
||||||
default CA cert bundle. You can override the default.
|
come with a CA cert bundle but most curl installs provide one. You can
|
||||||
|
also override the default.
|
||||||
|
|
||||||
The server certificate verification process is made by using a Certificate
|
The server certificate verification process is made by using a Certificate
|
||||||
Authority certificate ("CA cert") that was used to sign the server
|
Authority certificate ("CA cert") that was used to sign the server
|
||||||
@@ -654,6 +704,17 @@ FAQ
|
|||||||
|
|
||||||
But you could easily write your own program using libcurl to do such stunts.
|
But you could easily write your own program using libcurl to do such stunts.
|
||||||
|
|
||||||
|
3.19 How do I get HTTP from a host using a specific IP address?
|
||||||
|
|
||||||
|
For example, you may be trying out a web site installation that isn't yet in
|
||||||
|
the DNS. Or you have a site using multiple IP addresses for a given host
|
||||||
|
name and you want to address a specific one out of the set.
|
||||||
|
|
||||||
|
Set a custom Host: header that identifies the server name you want to reach
|
||||||
|
but use the target IP address in the URL:
|
||||||
|
|
||||||
|
curl --header "Host: www.example.com" http://127.0.0.1/
|
||||||
|
|
||||||
|
|
||||||
4. Running Problems
|
4. Running Problems
|
||||||
|
|
||||||
@@ -802,10 +863,8 @@ FAQ
|
|||||||
|
|
||||||
4.9 Curl can't authenticate to the server that requires NTLM?
|
4.9 Curl can't authenticate to the server that requires NTLM?
|
||||||
|
|
||||||
This is supported in curl 7.10.6 or later. No earlier curl version knows
|
NTLM support requires OpenSSL, GnuTLS, NSS or Microsoft Windows libraries at
|
||||||
of this magic. Later versions require the OpenSSL, GnuTLS or Microsoft
|
build-time to provide this functionality.
|
||||||
Windows libraries to provide this functionality. Using the NSS library
|
|
||||||
will not provide NTLM authentication functionality in curl.
|
|
||||||
|
|
||||||
NTLM is a Microsoft proprietary protocol. Proprietary formats are evil. You
|
NTLM is a Microsoft proprietary protocol. Proprietary formats are evil. You
|
||||||
should not use such ones.
|
should not use such ones.
|
||||||
@@ -1070,11 +1129,14 @@ FAQ
|
|||||||
|
|
||||||
When building an application that uses the static libcurl library, you must
|
When building an application that uses the static libcurl library, you must
|
||||||
add -DCURL_STATICLIB to your CFLAGS. Otherwise the linker will look for
|
add -DCURL_STATICLIB to your CFLAGS. Otherwise the linker will look for
|
||||||
dynamic import symbols. If you get linker error like "unknown symbol
|
dynamic import symbols. If you're using Visual Studio, you need to instead
|
||||||
__imp__curl_easy_init ..." you have linked against the wrong (static)
|
add CURL_STATICLIB in the "Preprocessor Definitions" section.
|
||||||
library. If you want to use the libcurl.dll and import lib, you don't need
|
|
||||||
any extra CFLAGS, but use one of the import libraries below. These are the
|
If you get linker error like "unknown symbol __imp__curl_easy_init ..." you
|
||||||
libraries produced by the various lib/Makefile.* files:
|
have linked against the wrong (static) library. If you want to use the
|
||||||
|
libcurl.dll and import lib, you don't need any extra CFLAGS, but use one of
|
||||||
|
the import libraries below. These are the libraries produced by the various
|
||||||
|
lib/Makefile.* files:
|
||||||
|
|
||||||
Target: static lib. import lib for libcurl*.dll.
|
Target: static lib. import lib for libcurl*.dll.
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
@@ -1222,7 +1284,10 @@ FAQ
|
|||||||
this section was much enhanced by Bjorn Reese.)
|
this section was much enhanced by Bjorn Reese.)
|
||||||
|
|
||||||
We are not lawyers and this is not legal advice. You should probably consult
|
We are not lawyers and this is not legal advice. You should probably consult
|
||||||
one if you want true and accurate legal insights without our prejudice.
|
one if you want true and accurate legal insights without our prejudice. Note
|
||||||
|
especially that this section concerns the libcurl license only; compiling in
|
||||||
|
features of libcurl that depend on other libraries (e.g. OpenSSL) may affect
|
||||||
|
the licensing obligations of your application.
|
||||||
|
|
||||||
6.1 I have a GPL program, can I use the libcurl library?
|
6.1 I have a GPL program, can I use the libcurl library?
|
||||||
|
|
||||||
|
@@ -161,6 +161,12 @@ December 2005:
|
|||||||
|
|
||||||
security vulnerability: libcurl URL Buffer Overflow
|
security vulnerability: libcurl URL Buffer Overflow
|
||||||
|
|
||||||
|
January 2006:
|
||||||
|
|
||||||
|
We dropped support for Gopher. We found bugs in the implementation that
|
||||||
|
turned out having been introduced years ago, so with the conclusion that
|
||||||
|
nobody had found out in all this time we removed it instead of fixing it.
|
||||||
|
|
||||||
March 2006:
|
March 2006:
|
||||||
|
|
||||||
security vulnerability: libcurl TFTP Packet Buffer Overflow
|
security vulnerability: libcurl TFTP Packet Buffer Overflow
|
||||||
@@ -235,3 +241,4 @@ August 2010:
|
|||||||
Known libcurl bindings: 39
|
Known libcurl bindings: 39
|
||||||
Contributors: 808
|
Contributors: 808
|
||||||
|
|
||||||
|
Gopher support added (re-added actually)
|
||||||
|
19
docs/INSTALL
19
docs/INSTALL
@@ -980,10 +980,17 @@ PORTS
|
|||||||
Useful URLs
|
Useful URLs
|
||||||
===========
|
===========
|
||||||
|
|
||||||
OpenSSL http://www.openssl.org
|
c-ares http://daniel.haxx.se/projects/c-ares/license.html
|
||||||
MingW http://www.mingw.org
|
GNU GSS http://www.gnu.org/software/gss/
|
||||||
OpenLDAP http://www.openldap.org
|
GnuTLS http://www.gnu.org/software/gnutls/
|
||||||
Zlib http://www.gzip.org/zlib/
|
Heimdal http://www.pdc.kth.se/heimdal/
|
||||||
|
libidn http://www.gnu.org/software/libidn/
|
||||||
libssh2 http://www.libssh2.org
|
libssh2 http://www.libssh2.org
|
||||||
|
MingW http://www.mingw.org
|
||||||
|
MIT Kerberos http://web.mit.edu/kerberos/www/dist/
|
||||||
|
NSS http://www.mozilla.org/projects/security/pki/nss/
|
||||||
|
OpenLDAP http://www.openldap.org
|
||||||
|
OpenSSL http://www.openssl.org
|
||||||
|
PolarSSL http://polarssl.org
|
||||||
|
yassl http://www.yassl.com/
|
||||||
|
Zlib http://www.gzip.org/zlib/
|
||||||
|
@@ -37,7 +37,7 @@ Portability
|
|||||||
GnuTLS 1.2
|
GnuTLS 1.2
|
||||||
zlib 1.1.4
|
zlib 1.1.4
|
||||||
libssh2 0.16
|
libssh2 0.16
|
||||||
c-ares 1.5.0
|
c-ares 1.6.0
|
||||||
libidn 0.4.1
|
libidn 0.4.1
|
||||||
*yassl 1.4.0 (http://curl.haxx.se/mail/lib-2008-02/0093.html)
|
*yassl 1.4.0 (http://curl.haxx.se/mail/lib-2008-02/0093.html)
|
||||||
openldap 2.0
|
openldap 2.0
|
||||||
|
@@ -54,11 +54,6 @@ may have been fixed since this was written!
|
|||||||
handle with curl_easy_cleanup() and create a new. Some more details:
|
handle with curl_easy_cleanup() and create a new. Some more details:
|
||||||
http://curl.haxx.se/mail/lib-2009-04/0300.html
|
http://curl.haxx.se/mail/lib-2009-04/0300.html
|
||||||
|
|
||||||
62. CURLOPT_TIMEOUT does not work properly with the regular multi and
|
|
||||||
multi_socket interfaces. The work-around for apps is to simply remove the
|
|
||||||
easy handle once the time is up. See also:
|
|
||||||
http://curl.haxx.se/bug/view.cgi?id=2501457
|
|
||||||
|
|
||||||
61. If an upload using Expect: 100-continue receives an HTTP 417 response,
|
61. If an upload using Expect: 100-continue receives an HTTP 417 response,
|
||||||
it ought to be automatically resent without the Expect:. A workaround is
|
it ought to be automatically resent without the Expect:. A workaround is
|
||||||
for the client application to redo the transfer after disabling Expect:.
|
for the client application to redo the transfer after disabling Expect:.
|
||||||
|
19
docs/THANKS
19
docs/THANKS
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
Aaron Oneal
|
Aaron Oneal
|
||||||
Adam D. Moss
|
Adam D. Moss
|
||||||
|
Adam Light
|
||||||
Adam Piggott
|
Adam Piggott
|
||||||
Adrian Schuur
|
Adrian Schuur
|
||||||
Akos Pasztory
|
Akos Pasztory
|
||||||
@@ -72,6 +73,7 @@ Axel Tillequin
|
|||||||
Balint Szilakszi
|
Balint Szilakszi
|
||||||
Bart Whiteley
|
Bart Whiteley
|
||||||
Bas Mevissen
|
Bas Mevissen
|
||||||
|
Ben Darnell
|
||||||
Ben Greear
|
Ben Greear
|
||||||
Ben Madsen
|
Ben Madsen
|
||||||
Ben Van Hof
|
Ben Van Hof
|
||||||
@@ -100,6 +102,7 @@ Brock Noland
|
|||||||
Bruce Mitchener
|
Bruce Mitchener
|
||||||
Bryan Henderson
|
Bryan Henderson
|
||||||
Bryan Kemp
|
Bryan Kemp
|
||||||
|
Cameron Kaiser
|
||||||
Camille Moncelier
|
Camille Moncelier
|
||||||
Caolan McNamara
|
Caolan McNamara
|
||||||
Carsten Lange
|
Carsten Lange
|
||||||
@@ -145,6 +148,7 @@ Damien Adant
|
|||||||
Dan Becker
|
Dan Becker
|
||||||
Dan C
|
Dan C
|
||||||
Dan Fandrich
|
Dan Fandrich
|
||||||
|
Dan Locks
|
||||||
Dan Nelson
|
Dan Nelson
|
||||||
Dan Petitt
|
Dan Petitt
|
||||||
Dan Torop
|
Dan Torop
|
||||||
@@ -190,6 +194,7 @@ Detlef Schmier
|
|||||||
Didier Brisebourg
|
Didier Brisebourg
|
||||||
Diego Casorran
|
Diego Casorran
|
||||||
Dima Barsky
|
Dima Barsky
|
||||||
|
Dimitre Dimitrov
|
||||||
Dimitris Sarris
|
Dimitris Sarris
|
||||||
Dinar
|
Dinar
|
||||||
Dirk Eddelbuettel
|
Dirk Eddelbuettel
|
||||||
@@ -302,6 +307,7 @@ Hardeep Singh
|
|||||||
Harshal Pradhan
|
Harshal Pradhan
|
||||||
Hauke Duden
|
Hauke Duden
|
||||||
Heikki Korpela
|
Heikki Korpela
|
||||||
|
Hendrik Visage
|
||||||
Henrik Storner
|
Henrik Storner
|
||||||
Hidemoto Nakada
|
Hidemoto Nakada
|
||||||
Hoi-Ho Chan
|
Hoi-Ho Chan
|
||||||
@@ -339,6 +345,7 @@ Jamie Lokier
|
|||||||
Jamie Newton
|
Jamie Newton
|
||||||
Jamie Wilkinson
|
Jamie Wilkinson
|
||||||
Jan Kunder
|
Jan Kunder
|
||||||
|
Jan Van Boghout
|
||||||
Jared Lundell
|
Jared Lundell
|
||||||
Jari Sundell
|
Jari Sundell
|
||||||
Jason McDonald
|
Jason McDonald
|
||||||
@@ -389,6 +396,7 @@ John-Mark Bell
|
|||||||
Johnny Luong
|
Johnny Luong
|
||||||
Jon Grubbs
|
Jon Grubbs
|
||||||
Jon Nelson
|
Jon Nelson
|
||||||
|
Jon Sargeant
|
||||||
Jon Travis
|
Jon Travis
|
||||||
Jon Turner
|
Jon Turner
|
||||||
Jonas Forsman
|
Jonas Forsman
|
||||||
@@ -515,6 +523,7 @@ Matt Wixson
|
|||||||
Matthew Blain
|
Matthew Blain
|
||||||
Matthew Clarke
|
Matthew Clarke
|
||||||
Maurice Barnum
|
Maurice Barnum
|
||||||
|
Mauro Iorio
|
||||||
Max Katsev
|
Max Katsev
|
||||||
Maxim Ivanov
|
Maxim Ivanov
|
||||||
Maxim Perenesenko
|
Maxim Perenesenko
|
||||||
@@ -532,14 +541,17 @@ Michael Smith
|
|||||||
Michael Stillwell
|
Michael Stillwell
|
||||||
Michael Wallner
|
Michael Wallner
|
||||||
Michal Bonino
|
Michal Bonino
|
||||||
|
Michal Gorny
|
||||||
Michal Marek
|
Michal Marek
|
||||||
Michele Bini
|
Michele Bini
|
||||||
Mihai Ionescu
|
Mihai Ionescu
|
||||||
|
Mikael Johansson
|
||||||
Mikael Sennerholm
|
Mikael Sennerholm
|
||||||
Mike Bytnar
|
Mike Bytnar
|
||||||
Mike Crowe
|
Mike Crowe
|
||||||
Mike Dobbs
|
Mike Dobbs
|
||||||
Mike Hommey
|
Mike Hommey
|
||||||
|
Mike Power
|
||||||
Mike Protts
|
Mike Protts
|
||||||
Mike Revi
|
Mike Revi
|
||||||
Miklos Nemeth
|
Miklos Nemeth
|
||||||
@@ -566,6 +578,7 @@ Nikita Schmidt
|
|||||||
Nikitinskit Dmitriy
|
Nikitinskit Dmitriy
|
||||||
Niklas Angebrand
|
Niklas Angebrand
|
||||||
Nikolai Kondrashov
|
Nikolai Kondrashov
|
||||||
|
Ning Dong
|
||||||
Nir Soffer
|
Nir Soffer
|
||||||
Nis Jorgensen
|
Nis Jorgensen
|
||||||
Nodak Sodak
|
Nodak Sodak
|
||||||
@@ -621,10 +634,12 @@ Philippe Raoult
|
|||||||
Philippe Vaucher
|
Philippe Vaucher
|
||||||
Pierre
|
Pierre
|
||||||
Pierre Brico
|
Pierre Brico
|
||||||
|
Pierre Joye
|
||||||
Pooyan McSporran
|
Pooyan McSporran
|
||||||
Pramod Sharma
|
Pramod Sharma
|
||||||
Puneet Pawaia
|
Puneet Pawaia
|
||||||
Quagmire
|
Quagmire
|
||||||
|
Quanah Gibson-Mount
|
||||||
Rafa Muyo
|
Rafa Muyo
|
||||||
Rafael Sagula
|
Rafael Sagula
|
||||||
Rainer Canavan
|
Rainer Canavan
|
||||||
@@ -665,6 +680,7 @@ Robert Foreman
|
|||||||
Robert Iakobashvili
|
Robert Iakobashvili
|
||||||
Robert Olson
|
Robert Olson
|
||||||
Robert Weaver
|
Robert Weaver
|
||||||
|
Robin Cornelius
|
||||||
Robin Johnson
|
Robin Johnson
|
||||||
Robin Kay
|
Robin Kay
|
||||||
Robson Braga Araujo
|
Robson Braga Araujo
|
||||||
@@ -705,6 +721,7 @@ Shard
|
|||||||
Shawn Poulson
|
Shawn Poulson
|
||||||
Shmulik Regev
|
Shmulik Regev
|
||||||
Siddhartha Prakash Jain
|
Siddhartha Prakash Jain
|
||||||
|
Sidney San Martin
|
||||||
Siegfried Gyuricsko
|
Siegfried Gyuricsko
|
||||||
Simon Dick
|
Simon Dick
|
||||||
Simon Josefsson
|
Simon Josefsson
|
||||||
@@ -752,6 +769,7 @@ Tim Baker
|
|||||||
Tim Bartley
|
Tim Bartley
|
||||||
Tim Chen
|
Tim Chen
|
||||||
Tim Costello
|
Tim Costello
|
||||||
|
Tim Newsome
|
||||||
Tim Sneddon
|
Tim Sneddon
|
||||||
Tobias Rundstr<74>m
|
Tobias Rundstr<74>m
|
||||||
Toby Peterson
|
Toby Peterson
|
||||||
@@ -790,6 +808,7 @@ Vincent Le Normand
|
|||||||
Vincent Penquerc'h
|
Vincent Penquerc'h
|
||||||
Vincent Sanders
|
Vincent Sanders
|
||||||
Vlad Grachov
|
Vlad Grachov
|
||||||
|
Vlad Ureche
|
||||||
Vladimir Lazarenko
|
Vladimir Lazarenko
|
||||||
Vojtech Janota
|
Vojtech Janota
|
||||||
Vojtech Minarik
|
Vojtech Minarik
|
||||||
|
34
docs/TODO
34
docs/TODO
@@ -22,7 +22,6 @@
|
|||||||
2.2 Remove easy interface internally
|
2.2 Remove easy interface internally
|
||||||
2.3 Avoid having to remove/readd handles
|
2.3 Avoid having to remove/readd handles
|
||||||
2.4 Fix HTTP Pipelining for PUT
|
2.4 Fix HTTP Pipelining for PUT
|
||||||
2.5 Make curl_multi_info_read faster
|
|
||||||
|
|
||||||
3. Documentation
|
3. Documentation
|
||||||
3.1 More and better
|
3.1 More and better
|
||||||
@@ -56,18 +55,17 @@
|
|||||||
7.7 Support other SSL libraries
|
7.7 Support other SSL libraries
|
||||||
7.8 Support SRP on the TLS layer
|
7.8 Support SRP on the TLS layer
|
||||||
7.9 improve configure --with-ssl
|
7.9 improve configure --with-ssl
|
||||||
7.10 Make NTLM work with other crypto functions
|
|
||||||
|
|
||||||
8. GnuTLS
|
8. GnuTLS
|
||||||
8.1 SSL engine stuff
|
8.1 SSL engine stuff
|
||||||
8.2 SRP
|
8.2 SRP
|
||||||
8.3 check connection
|
8.3 check connection
|
||||||
|
8.4 non-gcrypt
|
||||||
|
|
||||||
9. Other protocols
|
9. Other protocols
|
||||||
|
|
||||||
10. New protocols
|
10. New protocols
|
||||||
10.1 RSYNC
|
10.1 RSYNC
|
||||||
10.2 RTMP
|
|
||||||
|
|
||||||
11. Client
|
11. Client
|
||||||
11.1 sync
|
11.1 sync
|
||||||
@@ -185,11 +183,6 @@
|
|||||||
serial requests and currently libcurl only supports that for HEAD and GET
|
serial requests and currently libcurl only supports that for HEAD and GET
|
||||||
requests but it should also be possible for PUT.
|
requests but it should also be possible for PUT.
|
||||||
|
|
||||||
2.5 Make curl_multi_info_read faster
|
|
||||||
|
|
||||||
When checking if there's info to return, this function scans over ALL added
|
|
||||||
easy handles every time. That makes this function unnecessary heavy and slow.
|
|
||||||
|
|
||||||
3. Documentation
|
3. Documentation
|
||||||
|
|
||||||
3.1 More and better
|
3.1 More and better
|
||||||
@@ -342,14 +335,6 @@ to provide the data to send.
|
|||||||
make the configure --with-ssl option first check for OpenSSL, then GnuTLS,
|
make the configure --with-ssl option first check for OpenSSL, then GnuTLS,
|
||||||
then NSS...
|
then NSS...
|
||||||
|
|
||||||
7.10 Make NTLM work with other crypto functions
|
|
||||||
|
|
||||||
Get NTLM working using the functions provided by NSS etc. Not strictly
|
|
||||||
SSL/TLS related, but hey... Another option is to get available DES and MD4
|
|
||||||
source code from the cryptopp library. They are fine license-wise, but are
|
|
||||||
C++. NTLM currenly only works when libcurl is built with OpenSSL or GnuTLS
|
|
||||||
support.
|
|
||||||
|
|
||||||
8. GnuTLS
|
8. GnuTLS
|
||||||
|
|
||||||
8.1 SSL engine stuff
|
8.1 SSL engine stuff
|
||||||
@@ -366,6 +351,17 @@ to provide the data to send.
|
|||||||
Add a way to check if the connection seems to be alive, to correspond to the
|
Add a way to check if the connection seems to be alive, to correspond to the
|
||||||
SSL_peak() way we use with OpenSSL.
|
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. Other protocols
|
9. Other protocols
|
||||||
|
|
||||||
10. New protocols
|
10. New protocols
|
||||||
@@ -375,12 +371,6 @@ to provide the data to send.
|
|||||||
There's no RFC for protocol nor URI/URL format. An implementation should
|
There's no RFC for protocol nor URI/URL format. An implementation should
|
||||||
most probably use an existing rsync library, such as librsync.
|
most probably use an existing rsync library, such as librsync.
|
||||||
|
|
||||||
10.2 RTMP
|
|
||||||
|
|
||||||
There exists a patch that claims to introduce this protocol:
|
|
||||||
http://osdir.com/ml/gnu.gnash.devel2/2006-11/msg00278.html, further details
|
|
||||||
in the feature-request: http://curl.haxx.se/bug/feature.cgi?id=1843469
|
|
||||||
|
|
||||||
11. Client
|
11. Client
|
||||||
|
|
||||||
11.1 sync
|
11.1 sync
|
||||||
|
@@ -38,10 +38,10 @@ Date: May 28, 2008
|
|||||||
request a particular action, and then the server replies a few text lines
|
request a particular action, and then the server replies a few text lines
|
||||||
before the actual requested content is sent to the client.
|
before the actual requested content is sent to the client.
|
||||||
|
|
||||||
Using curl's option -v will display what kind of commands curl sends to the
|
Using curl's option --verbose (-v as a short option) will display what kind of
|
||||||
server, as well as a few other informational texts. -v is the single most
|
commands curl sends to the server, as well as a few other informational texts.
|
||||||
useful option when it comes to debug or even understand the curl<->server
|
--verbose is the single most useful option when it comes to debug or even
|
||||||
interaction.
|
understand the curl<->server interaction.
|
||||||
|
|
||||||
2. URL
|
2. URL
|
||||||
|
|
||||||
@@ -62,9 +62,9 @@ Date: May 28, 2008
|
|||||||
that that URL holds.
|
that that URL holds.
|
||||||
|
|
||||||
All HTTP replies contain a set of headers that are normally hidden, use
|
All HTTP replies contain a set of headers that are normally hidden, use
|
||||||
curl's -i option to display them as well as the rest of the document. You can
|
curl's --include (-i) option to display them as well as the rest of the
|
||||||
also ask the remote server for ONLY the headers by using the -I option (which
|
document. You can also ask the remote server for ONLY the headers by using the
|
||||||
will make curl issue a HEAD request).
|
--head (-I) option (which will make curl issue a HEAD request).
|
||||||
|
|
||||||
4. Forms
|
4. Forms
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ Date: May 28, 2008
|
|||||||
To make curl do the GET form post for you, just enter the expected created
|
To make curl do the GET form post for you, just enter the expected created
|
||||||
URL:
|
URL:
|
||||||
|
|
||||||
curl "www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK"
|
curl "http://www.hotmail.com/when/junk.cgi?birthyear=1905&press=OK"
|
||||||
|
|
||||||
4.2 POST
|
4.2 POST
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ Date: May 28, 2008
|
|||||||
And to use curl to post this form with the same data filled in as before, we
|
And to use curl to post this form with the same data filled in as before, we
|
||||||
could do it like:
|
could do it like:
|
||||||
|
|
||||||
curl -d "birthyear=1905&press=%20OK%20" www.hotmail.com/when/junk.cgi
|
curl --data "birthyear=1905&press=%20OK%20" http://www.hotmail.com/when/junk.cgi
|
||||||
|
|
||||||
This kind of POST will use the Content-Type
|
This kind of POST will use the Content-Type
|
||||||
application/x-www-form-urlencoded and is the most widely used POST kind.
|
application/x-www-form-urlencoded and is the most widely used POST kind.
|
||||||
@@ -139,7 +139,7 @@ Date: May 28, 2008
|
|||||||
|
|
||||||
Recent curl versions can in fact url-encode POST data for you, like this:
|
Recent curl versions can in fact url-encode POST data for you, like this:
|
||||||
|
|
||||||
curl --data-urlencode "name=I am Daniel" www.example.com
|
curl --data-urlencode "name=I am Daniel" http://www.example.com
|
||||||
|
|
||||||
4.3 File Upload POST
|
4.3 File Upload POST
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ Date: May 28, 2008
|
|||||||
|
|
||||||
To post to a form like this with curl, you enter a command line like:
|
To post to a form like this with curl, you enter a command line like:
|
||||||
|
|
||||||
curl -F upload=@localfilename -F press=OK [URL]
|
curl --form upload=@localfilename --form press=OK [URL]
|
||||||
|
|
||||||
4.4 Hidden Fields
|
4.4 Hidden Fields
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ Date: May 28, 2008
|
|||||||
To post this with curl, you won't have to think about if the fields are
|
To post this with curl, you won't have to think about if the fields are
|
||||||
hidden or not. To curl they're all the same:
|
hidden or not. To curl they're all the same:
|
||||||
|
|
||||||
curl -d "birthyear=1905&press=OK&person=daniel" [URL]
|
curl --data "birthyear=1905&press=OK&person=daniel" [URL]
|
||||||
|
|
||||||
4.5 Figure Out What A POST Looks Like
|
4.5 Figure Out What A POST Looks Like
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ Date: May 28, 2008
|
|||||||
|
|
||||||
Put a file to a HTTP server with curl:
|
Put a file to a HTTP server with curl:
|
||||||
|
|
||||||
curl -T uploadfile www.uploadhttp.com/receive.cgi
|
curl --upload-file uploadfile http://www.uploadhttp.com/receive.cgi
|
||||||
|
|
||||||
6. HTTP Authentication
|
6. HTTP Authentication
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ Date: May 28, 2008
|
|||||||
|
|
||||||
To tell curl to use a user and password for authentication:
|
To tell curl to use a user and password for authentication:
|
||||||
|
|
||||||
curl -u name:password www.secrets.com
|
curl --user name:password http://www.secrets.com
|
||||||
|
|
||||||
The site might require a different authentication method (check the headers
|
The site might require a different authentication method (check the headers
|
||||||
returned by the server), and then --ntlm, --digest, --negotiate or even
|
returned by the server), and then --ntlm, --digest, --negotiate or even
|
||||||
@@ -228,7 +228,7 @@ Date: May 28, 2008
|
|||||||
may require its own user and password to allow the client to get through to
|
may require its own user and password to allow the client to get through to
|
||||||
the Internet. To specify those with curl, run something like:
|
the Internet. To specify those with curl, run something like:
|
||||||
|
|
||||||
curl -U proxyuser:proxypassword curl.haxx.se
|
curl --proxy-user proxyuser:proxypassword curl.haxx.se
|
||||||
|
|
||||||
If your proxy requires the authentication to be done using the NTLM method,
|
If your proxy requires the authentication to be done using the NTLM method,
|
||||||
use --proxy-ntlm, if it requires Digest use --proxy-digest.
|
use --proxy-ntlm, if it requires Digest use --proxy-digest.
|
||||||
@@ -257,7 +257,7 @@ Date: May 28, 2008
|
|||||||
|
|
||||||
Use curl to set the referer field with:
|
Use curl to set the referer field with:
|
||||||
|
|
||||||
curl -e http://curl.haxx.se daniel.haxx.se
|
curl --referer http://curl.haxx.se http://daniel.haxx.se
|
||||||
|
|
||||||
8. User Agent
|
8. User Agent
|
||||||
|
|
||||||
@@ -275,11 +275,11 @@ Date: May 28, 2008
|
|||||||
|
|
||||||
To make curl look like Internet Explorer on a Windows 2000 box:
|
To make curl look like Internet Explorer on a Windows 2000 box:
|
||||||
|
|
||||||
curl -A "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" [URL]
|
curl --user-agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" [URL]
|
||||||
|
|
||||||
Or why not look like you're using Netscape 4.73 on a Linux (PIII) box:
|
Or why not look like you're using Netscape 4.73 on a Linux (PIII) box:
|
||||||
|
|
||||||
curl -A "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" [URL]
|
curl --user-agent "Mozilla/4.73 [en] (X11; U; Linux 2.2.15 i686)" [URL]
|
||||||
|
|
||||||
9. Redirects
|
9. Redirects
|
||||||
|
|
||||||
@@ -294,11 +294,12 @@ Date: May 28, 2008
|
|||||||
|
|
||||||
To tell curl to follow a Location:
|
To tell curl to follow a Location:
|
||||||
|
|
||||||
curl -L www.sitethatredirects.com
|
curl --location http://www.sitethatredirects.com
|
||||||
|
|
||||||
If you use curl to POST to a site that immediately redirects you to another
|
If you use curl to POST to a site that immediately redirects you to another
|
||||||
page, you can safely use -L and -d/-F together. Curl will only use POST in
|
page, you can safely use --location (-L) and --data/--form together. Curl will
|
||||||
the first request, and then revert to GET in the following operations.
|
only use POST in the first request, and then revert to GET in the following
|
||||||
|
operations.
|
||||||
|
|
||||||
10. Cookies
|
10. Cookies
|
||||||
|
|
||||||
@@ -320,16 +321,16 @@ Date: May 28, 2008
|
|||||||
The simplest way to send a few cookies to the server when getting a page with
|
The simplest way to send a few cookies to the server when getting a page with
|
||||||
curl is to add them on the command line like:
|
curl is to add them on the command line like:
|
||||||
|
|
||||||
curl -b "name=Daniel" www.cookiesite.com
|
curl --cookie "name=Daniel" http://www.cookiesite.com
|
||||||
|
|
||||||
Cookies are sent as common HTTP headers. This is practical as it allows curl
|
Cookies are sent as common HTTP headers. This is practical as it allows curl
|
||||||
to record cookies simply by recording headers. Record cookies with curl by
|
to record cookies simply by recording headers. Record cookies with curl by
|
||||||
using the -D option like:
|
using the --dump-header (-D) option like:
|
||||||
|
|
||||||
curl -D headers_and_cookies www.cookiesite.com
|
curl --dump-header headers_and_cookies http://www.cookiesite.com
|
||||||
|
|
||||||
(Take note that the -c option described below is a better way to store
|
(Take note that the --cookie-jar option described below is a better way to
|
||||||
cookies.)
|
store cookies.)
|
||||||
|
|
||||||
Curl has a full blown cookie parsing engine built-in that comes to use if you
|
Curl has a full blown cookie parsing engine built-in that comes to use if you
|
||||||
want to reconnect to a server and use cookies that were stored from a
|
want to reconnect to a server and use cookies that were stored from a
|
||||||
@@ -337,24 +338,24 @@ Date: May 28, 2008
|
|||||||
believing you had a previous connection). To use previously stored cookies,
|
believing you had a previous connection). To use previously stored cookies,
|
||||||
you run curl like:
|
you run curl like:
|
||||||
|
|
||||||
curl -b stored_cookies_in_file www.cookiesite.com
|
curl --cookie stored_cookies_in_file http://www.cookiesite.com
|
||||||
|
|
||||||
Curl's "cookie engine" gets enabled when you use the -b option. If you only
|
Curl's "cookie engine" gets enabled when you use the --cookie option. If you
|
||||||
want curl to understand received cookies, use -b with a file that doesn't
|
only want curl to understand received cookies, use --cookie with a file that
|
||||||
exist. Example, if you want to let curl understand cookies from a page and
|
doesn't exist. Example, if you want to let curl understand cookies from a page
|
||||||
follow a location (and thus possibly send back cookies it received), you can
|
and follow a location (and thus possibly send back cookies it received), you
|
||||||
invoke it like:
|
can invoke it like:
|
||||||
|
|
||||||
curl -b nada -L www.cookiesite.com
|
curl --cookie nada --location http://www.cookiesite.com
|
||||||
|
|
||||||
Curl has the ability to read and write cookie files that use the same file
|
Curl has the ability to read and write cookie files that use the same file
|
||||||
format that Netscape and Mozilla do. It is a convenient way to share cookies
|
format that Netscape and Mozilla do. It is a convenient way to share cookies
|
||||||
between browsers and automatic scripts. The -b switch automatically detects
|
between browsers and automatic scripts. The --cookie (-b) switch automatically
|
||||||
if a given file is such a cookie file and parses it, and by using the
|
detects if a given file is such a cookie file and parses it, and by using the
|
||||||
-c/--cookie-jar option you'll make curl write a new cookie file at the end of
|
--cookie-jar (-c) option you'll make curl write a new cookie file at the end of
|
||||||
an operation:
|
an operation:
|
||||||
|
|
||||||
curl -b cookies.txt -c newcookies.txt www.cookiesite.com
|
curl --cookie cookies.txt --cookie-jar newcookies.txt http://www.cookiesite.com
|
||||||
|
|
||||||
11. HTTPS
|
11. HTTPS
|
||||||
|
|
||||||
@@ -381,13 +382,13 @@ Date: May 28, 2008
|
|||||||
can be specified on the command line or if not, entered interactively when
|
can be specified on the command line or if not, entered interactively when
|
||||||
curl queries for it. Use a certificate with curl on a HTTPS server like:
|
curl queries for it. Use a certificate with curl on a HTTPS server like:
|
||||||
|
|
||||||
curl -E mycert.pem https://that.secure.server.com
|
curl --cert mycert.pem https://that.secure.server.com
|
||||||
|
|
||||||
curl also tries to verify that the server is who it claims to be, by
|
curl also tries to verify that the server is who it claims to be, by
|
||||||
verifying the server's certificate against a locally stored CA cert
|
verifying the server's certificate against a locally stored CA cert
|
||||||
bundle. Failing the verification will cause curl to deny the connection. You
|
bundle. Failing the verification will cause curl to deny the connection. You
|
||||||
must then use -k in case you want to tell curl to ignore that the server
|
must then use --insecure (-k) in case you want to tell curl to ignore that
|
||||||
can't be verified.
|
the server can't be verified.
|
||||||
|
|
||||||
More about server certificate verification and ca cert bundles can be read
|
More about server certificate verification and ca cert bundles can be read
|
||||||
in the SSLCERTS document, available online here:
|
in the SSLCERTS document, available online here:
|
||||||
@@ -402,17 +403,17 @@ Date: May 28, 2008
|
|||||||
For example, you can change the POST request to a PROPFIND and send the data
|
For example, you can change the POST request to a PROPFIND and send the data
|
||||||
as "Content-Type: text/xml" (instead of the default Content-Type) like this:
|
as "Content-Type: text/xml" (instead of the default Content-Type) like this:
|
||||||
|
|
||||||
curl -d "<xml>" -H "Content-Type: text/xml" -X PROPFIND url.com
|
curl --data "<xml>" --header "Content-Type: text/xml" --request PROPFIND url.com
|
||||||
|
|
||||||
You can delete a default header by providing one without content. Like you
|
You can delete a default header by providing one without content. Like you
|
||||||
can ruin the request by chopping off the Host: header:
|
can ruin the request by chopping off the Host: header:
|
||||||
|
|
||||||
curl -H "Host:" http://mysite.com
|
curl --header "Host:" http://mysite.com
|
||||||
|
|
||||||
You can add headers the same way. Your server may want a "Destination:"
|
You can add headers the same way. Your server may want a "Destination:"
|
||||||
header, and you can add it:
|
header, and you can add it:
|
||||||
|
|
||||||
curl -H "Destination: http://moo.com/nowhere" http://url.com
|
curl --header "Destination: http://moo.com/nowhere" http://url.com
|
||||||
|
|
||||||
13. Web Login
|
13. Web Login
|
||||||
|
|
||||||
@@ -456,8 +457,8 @@ Date: May 28, 2008
|
|||||||
* Use the --trace-ascii option to store fully detailed logs of the requests
|
* Use the --trace-ascii option to store fully detailed logs of the requests
|
||||||
for easier analyzing and better understanding
|
for easier analyzing and better understanding
|
||||||
|
|
||||||
* Make sure you check for and use cookies when needed (both reading with -b
|
* Make sure you check for and use cookies when needed (both reading with
|
||||||
and writing with -c)
|
--cookie and writing with --cookie-jar)
|
||||||
|
|
||||||
* Set user-agent to one like a recent popular browser does
|
* Set user-agent to one like a recent popular browser does
|
||||||
|
|
||||||
|
51
docs/curl.1
51
docs/curl.1
@@ -29,8 +29,9 @@ curl \- transfer a URL
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B curl
|
.B curl
|
||||||
is a tool to transfer data from or to a server, using one of the supported
|
is a tool to transfer data from or to a server, using one of the supported
|
||||||
protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or
|
protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP,
|
||||||
FILE). The command is designed to work without user interaction.
|
LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP). The
|
||||||
|
command is designed to work without user interaction.
|
||||||
|
|
||||||
curl offers a busload of useful tricks like proxy support, user
|
curl offers a busload of useful tricks like proxy support, user
|
||||||
authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
|
authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
|
||||||
@@ -55,16 +56,16 @@ or you can get sequences of alphanumeric series by using [] as in:
|
|||||||
ftp://ftp.numericals.com/file[001-100].txt (with leading zeros)
|
ftp://ftp.numericals.com/file[001-100].txt (with leading zeros)
|
||||||
ftp://ftp.letters.com/file[a-z].txt
|
ftp://ftp.letters.com/file[a-z].txt
|
||||||
|
|
||||||
No nesting of the sequences is supported at the moment, but you can use
|
Nested sequences are not supported, but you can use several ones next to each
|
||||||
several ones next to each other:
|
other:
|
||||||
|
|
||||||
http://any.org/archive[1996-1999]/vol[1-4]/part{a,b,c}.html
|
http://any.org/archive[1996-1999]/vol[1-4]/part{a,b,c}.html
|
||||||
|
|
||||||
You can specify any amount of URLs on the command line. They will be fetched
|
You can specify any amount of URLs on the command line. They will be fetched
|
||||||
in a sequential manner in the specified order.
|
in a sequential manner in the specified order.
|
||||||
|
|
||||||
Since curl 7.15.1 you can also specify a step counter for the ranges, so that
|
You can specify a step counter for the ranges to get every Nth number or
|
||||||
you can get every Nth number or letter:
|
letter:
|
||||||
|
|
||||||
http://www.numericals.com/file[1-100:10].txt
|
http://www.numericals.com/file[1-100:10].txt
|
||||||
http://www.letters.com/file[a-z:2].txt
|
http://www.letters.com/file[a-z:2].txt
|
||||||
@@ -87,8 +88,8 @@ invokes.
|
|||||||
curl normally displays a progress meter during operations, indicating the amount
|
curl normally displays a progress meter during operations, indicating the amount
|
||||||
of transferred data, transfer speeds and estimated time left, etc.
|
of transferred data, transfer speeds and estimated time left, etc.
|
||||||
|
|
||||||
However, since curl displays this data to the terminal by default, if you invoke
|
curl displays this data to the terminal by default, so if you invoke curl to
|
||||||
curl to do an operation and it is about to write data to the terminal, it
|
do an operation and it is about to write data to the terminal, it
|
||||||
\fIdisables\fP the progress meter as otherwise it would mess up the output
|
\fIdisables\fP the progress meter as otherwise it would mess up the output
|
||||||
mixing progress meter and response data.
|
mixing progress meter and response data.
|
||||||
|
|
||||||
@@ -300,8 +301,8 @@ away. EPRT and LPRT are extensions to the original FTP protocol, and may not wor
|
|||||||
on all servers, but they enable more functionality in a better way than the
|
on all servers, but they enable more functionality in a better way than the
|
||||||
traditional PORT command.
|
traditional PORT command.
|
||||||
|
|
||||||
Since curl 7.19.0, \fB--eprt\fP can be used to explicitly enable EPRT again
|
\fB--eprt\fP can be used to explicitly enable EPRT again and \fB--no-eprt\fP
|
||||||
and \fB--no-eprt\fP is an alias for \fB--disable-eprt\fP.
|
is an alias for \fB--disable-eprt\fP.
|
||||||
|
|
||||||
Disabling EPRT only changes the active behavior. If you want to switch to
|
Disabling EPRT only changes the active behavior. If you want to switch to
|
||||||
passive mode you need to not use \fI-P/--ftp-port\fP or force it with
|
passive mode you need to not use \fI-P/--ftp-port\fP or force it with
|
||||||
@@ -311,8 +312,8 @@ passive mode you need to not use \fI-P/--ftp-port\fP or force it with
|
|||||||
transfers. Curl will normally always first attempt to use EPSV before PASV,
|
transfers. Curl will normally always first attempt to use EPSV before PASV,
|
||||||
but with this option, it will not try using EPSV.
|
but with this option, it will not try using EPSV.
|
||||||
|
|
||||||
Since curl 7.19.0, \fB--epsv\fP can be used to explicitly enable EPRT again
|
\fB--epsv\fP can be used to explicitly enable EPRT again and \fB--no-epsv\fP
|
||||||
and \fB--no-epsv\fP is an alias for \fB--disable-epsv\fP.
|
is an alias for \fB--disable-epsv\fP.
|
||||||
|
|
||||||
Disabling EPSV only changes the passive behavior. If you want to switch to
|
Disabling EPSV only changes the passive behavior. If you want to switch to
|
||||||
active mode you need to use \fI-P/--ftp-port\fP.
|
active mode you need to use \fI-P/--ftp-port\fP.
|
||||||
@@ -525,8 +526,8 @@ or
|
|||||||
|
|
||||||
\fBcurl\fP -F "name=daniel;type=text/foo" url.com
|
\fBcurl\fP -F "name=daniel;type=text/foo" url.com
|
||||||
|
|
||||||
You can also explicitly change the name field of an file upload part by
|
You can also explicitly change the name field of a file upload part by setting
|
||||||
setting filename=, like this:
|
filename=, like this:
|
||||||
|
|
||||||
\fBcurl\fP -F "file=@localfile;filename=nameinpost" url.com
|
\fBcurl\fP -F "file=@localfile;filename=nameinpost" url.com
|
||||||
|
|
||||||
@@ -1141,6 +1142,18 @@ encodings and instead makes them passed on unaltered, raw. (Added in 7.16.2)
|
|||||||
When used, this will make libcurl attempt to figure out the timestamp of the
|
When used, this will make libcurl attempt to figure out the timestamp of the
|
||||||
remote file, and if that is available make the local file get that same
|
remote file, and if that is available make the local file get that same
|
||||||
timestamp.
|
timestamp.
|
||||||
|
.IP "--resolve <host:port:address>"
|
||||||
|
Provide a custom address for a specific host and port pair. Using this, you
|
||||||
|
can make the curl requests(s) use a specified address and prevent the
|
||||||
|
otherwise normally resolved address to be used. Consider it a sort of
|
||||||
|
/etc/hosts alternative provided on the command line. The port number should be
|
||||||
|
the number used for the specific protocol the host will be used for. It means
|
||||||
|
you need several entries if you want to provide address for the same host but
|
||||||
|
different ports.
|
||||||
|
|
||||||
|
This option can be used many times to add many host names to resolve.
|
||||||
|
|
||||||
|
(Added in 7.21.3)
|
||||||
.IP "--retry <num>"
|
.IP "--retry <num>"
|
||||||
If a transient error is returned when curl tries to perform a transfer, it
|
If a transient error is returned when curl tries to perform a transfer, it
|
||||||
will retry this number of times before giving up. Setting the number to 0
|
will retry this number of times before giving up. Setting the number to 0
|
||||||
@@ -1750,6 +1763,16 @@ Failed to shut down the SSL connection.
|
|||||||
Could not load CRL file, missing or wrong format (added in 7.19.0).
|
Could not load CRL file, missing or wrong format (added in 7.19.0).
|
||||||
.IP 83
|
.IP 83
|
||||||
Issuer check failed (added in 7.19.0).
|
Issuer check failed (added in 7.19.0).
|
||||||
|
.IP 84
|
||||||
|
The FTP PRET command failed
|
||||||
|
.IP 85
|
||||||
|
RTSP: mismatch of CSeq numbers
|
||||||
|
.IP 86
|
||||||
|
RTSP: mismatch of Session Identifiers
|
||||||
|
.IP 87
|
||||||
|
unable to parse FTP file list
|
||||||
|
.IP 88
|
||||||
|
FTP chunk callback reported error
|
||||||
.IP XX
|
.IP XX
|
||||||
More error codes will appear here in future releases. The existing ones
|
More error codes will appear here in future releases. The existing ones
|
||||||
are meant to never change.
|
are meant to never change.
|
||||||
|
@@ -119,7 +119,7 @@ int main(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (U) {
|
while (U) {
|
||||||
while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(cm, &U));
|
curl_multi_perform(cm, &U);
|
||||||
|
|
||||||
if (U) {
|
if (U) {
|
||||||
FD_ZERO(&R);
|
FD_ZERO(&R);
|
||||||
|
@@ -3,10 +3,12 @@ check_PROGRAMS = 10-at-a-time anyauthput cookie_interface debug fileupload \
|
|||||||
fopen ftpget ftpgetresp ftpupload getinfo getinmemory http-post httpput \
|
fopen ftpget ftpgetresp ftpupload getinfo getinmemory http-post httpput \
|
||||||
https multi-app multi-debugcallback multi-double multi-post multi-single \
|
https multi-app multi-debugcallback multi-double multi-post multi-single \
|
||||||
persistant post-callback postit2 sepheaders simple simplepost simplessl \
|
persistant post-callback postit2 sepheaders simple simplepost simplessl \
|
||||||
sendrecv httpcustomheader certinfo chkspeed ftpgetinfo ftp-wildcard
|
sendrecv httpcustomheader certinfo chkspeed ftpgetinfo ftp-wildcard \
|
||||||
|
smtp-multi
|
||||||
|
|
||||||
# These examples require external dependencies that may not be commonly
|
# These examples require external dependencies that may not be commonly
|
||||||
# available on POSIX systems, so don't bother attempting to compile them here.
|
# 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.cc cacertinmem.c \
|
||||||
ftpuploadresume.c ghiper.c hiperfifo.c htmltidy.c multithread.c \
|
ftpuploadresume.c ghiper.c hiperfifo.c htmltidy.c multithread.c \
|
||||||
opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c evhiperfifo.c
|
opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c evhiperfifo.c \
|
||||||
|
smooth-gtk-thread.c version-check.pl
|
||||||
|
@@ -111,7 +111,7 @@ int main(void)
|
|||||||
rv=curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr);
|
rv=curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr);
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
|
rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L);
|
rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L);
|
||||||
rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.cacert.org/");
|
rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/");
|
||||||
|
|
||||||
/* first try: retrieve page without cacerts' certificate -> will fail
|
/* first try: retrieve page without cacerts' certificate -> will fail
|
||||||
*/
|
*/
|
||||||
|
@@ -20,7 +20,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "https://www.networking4all.com/");
|
curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/");
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wrfu);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wrfu);
|
||||||
|
|
||||||
|
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
|
|||||||
} else if (strncasecmp(*argv, "-T", 2) == 0) {
|
} else if (strncasecmp(*argv, "-T", 2) == 0) {
|
||||||
prttime = 1;
|
prttime = 1;
|
||||||
} else if (strncasecmp(*argv, "-M=", 3) == 0) {
|
} else if (strncasecmp(*argv, "-M=", 3) == 0) {
|
||||||
int m = atoi(*argv + 3);
|
long m = strtol(argv+3, NULL, 10);
|
||||||
switch(m) {
|
switch(m) {
|
||||||
case 1: url = URL_1M;
|
case 1: url = URL_1M;
|
||||||
break;
|
break;
|
||||||
|
@@ -53,7 +53,7 @@ main(void)
|
|||||||
if (curl) {
|
if (curl) {
|
||||||
char nline[256];
|
char nline[256];
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com/"); /* google.com sets "PREF" cookie */
|
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
|
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
@@ -118,7 +118,7 @@ int main(void)
|
|||||||
/* the DEBUGFUNCTION has no effect until we enable VERBOSE */
|
/* the DEBUGFUNCTION has no effect until we enable VERBOSE */
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
/* always cleanup */
|
/* always cleanup */
|
||||||
|
@@ -68,7 +68,6 @@ typedef struct _GlobalInfo
|
|||||||
struct ev_io fifo_event;
|
struct ev_io fifo_event;
|
||||||
struct ev_timer timer_event;
|
struct ev_timer timer_event;
|
||||||
CURLM *multi;
|
CURLM *multi;
|
||||||
int prev_running;
|
|
||||||
int still_running;
|
int still_running;
|
||||||
FILE* input;
|
FILE* input;
|
||||||
} GlobalInfo;
|
} GlobalInfo;
|
||||||
@@ -122,7 +121,6 @@ static void mcode_or_die(const char *where, CURLMcode code)
|
|||||||
switch ( code )
|
switch ( code )
|
||||||
{
|
{
|
||||||
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
||||||
case CURLM_OK: s="CURLM_OK"; break;
|
|
||||||
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
||||||
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_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_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
|
||||||
@@ -144,54 +142,33 @@ static void mcode_or_die(const char *where, CURLMcode code)
|
|||||||
|
|
||||||
|
|
||||||
/* Check for completed transfers, and remove their easy handles */
|
/* Check for completed transfers, and remove their easy handles */
|
||||||
static void check_run_count(GlobalInfo *g)
|
static void check_multi_info(GlobalInfo *g)
|
||||||
{
|
{
|
||||||
DPRINT("%s prev %i still %i\n", __PRETTY_FUNCTION__,
|
char *eff_url;
|
||||||
g->prev_running, g->still_running);
|
CURLMsg *msg;
|
||||||
if ( g->prev_running > g->still_running )
|
int msgs_left;
|
||||||
{
|
ConnInfo *conn;
|
||||||
char *eff_url=NULL;
|
CURL *easy;
|
||||||
CURLMsg *msg;
|
CURLcode res;
|
||||||
int msgs_left;
|
|
||||||
ConnInfo *conn=NULL;
|
|
||||||
CURL*easy;
|
|
||||||
CURLcode res;
|
|
||||||
|
|
||||||
fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running);
|
fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running);
|
||||||
/*
|
while ((msg = curl_multi_info_read(g->multi, &msgs_left))) {
|
||||||
I am still uncertain whether it is safe to remove an easy
|
if (msg->msg == CURLMSG_DONE) {
|
||||||
handle from inside the curl_multi_info_read loop, so here I
|
easy = msg->easy_handle;
|
||||||
will search for completed transfers in the inner "while"
|
res = msg->data.result;
|
||||||
loop, and then remove them in the outer "do-while" loop...
|
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
|
||||||
*/
|
curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url);
|
||||||
do
|
fprintf(MSG_OUT, "DONE: %s => (%d) %s\n", eff_url, res, conn->error);
|
||||||
{
|
curl_multi_remove_handle(g->multi, easy);
|
||||||
easy=NULL;
|
free(conn->url);
|
||||||
while ( (msg = curl_multi_info_read(g->multi, &msgs_left)) )
|
curl_easy_cleanup(easy);
|
||||||
{
|
free(conn);
|
||||||
if ( msg->msg == CURLMSG_DONE )
|
}
|
||||||
{
|
|
||||||
easy=msg->easy_handle;
|
|
||||||
res=msg->data.result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( easy )
|
|
||||||
{
|
|
||||||
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
|
|
||||||
curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url);
|
|
||||||
fprintf(MSG_OUT, "DONE: %s => (%d) %s\n", eff_url, res, conn->error);
|
|
||||||
curl_multi_remove_handle(g->multi, easy);
|
|
||||||
free(conn->url);
|
|
||||||
curl_easy_cleanup(easy);
|
|
||||||
free(conn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while ( easy );
|
|
||||||
}
|
}
|
||||||
g->prev_running = g->still_running;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Called by libevent when we get action on a multi socket */
|
/* Called by libevent when we get action on a multi socket */
|
||||||
static void event_cb(EV_P_ struct ev_io *w, int revents)
|
static void event_cb(EV_P_ struct ev_io *w, int revents)
|
||||||
{
|
{
|
||||||
@@ -201,12 +178,9 @@ static void event_cb(EV_P_ struct ev_io *w, int revents)
|
|||||||
|
|
||||||
int action = (revents&EV_READ?CURL_POLL_IN:0)|
|
int action = (revents&EV_READ?CURL_POLL_IN:0)|
|
||||||
(revents&EV_WRITE?CURL_POLL_OUT:0);
|
(revents&EV_WRITE?CURL_POLL_OUT:0);
|
||||||
do
|
rc = curl_multi_socket_action(g->multi, w->fd, action, &g->still_running);
|
||||||
{
|
mcode_or_die("event_cb: curl_multi_socket_action", rc);
|
||||||
rc = curl_multi_socket_action(g->multi, w->fd, action, &g->still_running);
|
check_multi_info(g);
|
||||||
} while ( rc == CURLM_CALL_MULTI_PERFORM );
|
|
||||||
mcode_or_die("event_cb: curl_multi_socket", rc);
|
|
||||||
check_run_count(g);
|
|
||||||
if ( g->still_running <= 0 )
|
if ( g->still_running <= 0 )
|
||||||
{
|
{
|
||||||
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
|
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
|
||||||
@@ -222,12 +196,9 @@ static void timer_cb(EV_P_ struct ev_timer *w, int revents)
|
|||||||
GlobalInfo *g = (GlobalInfo *)w->data;
|
GlobalInfo *g = (GlobalInfo *)w->data;
|
||||||
CURLMcode rc;
|
CURLMcode rc;
|
||||||
|
|
||||||
do
|
rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running);
|
||||||
{
|
mcode_or_die("timer_cb: curl_multi_socket_action", rc);
|
||||||
rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running);
|
check_multi_info(g);
|
||||||
} while ( rc == CURLM_CALL_MULTI_PERFORM );
|
|
||||||
mcode_or_die("timer_cb: curl_multi_socket", rc);
|
|
||||||
check_run_count(g);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clean up the SockInfo structure */
|
/* Clean up the SockInfo structure */
|
||||||
@@ -364,11 +335,11 @@ static void new_conn(char *url, GlobalInfo *g )
|
|||||||
|
|
||||||
fprintf(MSG_OUT,
|
fprintf(MSG_OUT,
|
||||||
"Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
|
"Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
|
||||||
rc =curl_multi_add_handle(g->multi, conn->easy);
|
rc = curl_multi_add_handle(g->multi, conn->easy);
|
||||||
mcode_or_die("new_conn: curl_multi_add_handle", rc);
|
mcode_or_die("new_conn: curl_multi_add_handle", rc);
|
||||||
|
|
||||||
mcode_or_die("new_conn: curl_multi_socket_all", rc);
|
/* note that the add_handle() will set a time-out to trigger very soon so
|
||||||
check_run_count(g);
|
that the necessary socket_action() call will be called by this app */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This gets called whenever data is received from the fifo */
|
/* This gets called whenever data is received from the fifo */
|
||||||
@@ -448,10 +419,9 @@ int main(int argc, char **argv)
|
|||||||
curl_multi_setopt(g.multi, CURLMOPT_SOCKETDATA, &g);
|
curl_multi_setopt(g.multi, CURLMOPT_SOCKETDATA, &g);
|
||||||
curl_multi_setopt(g.multi, CURLMOPT_TIMERFUNCTION, multi_timer_cb);
|
curl_multi_setopt(g.multi, CURLMOPT_TIMERFUNCTION, multi_timer_cb);
|
||||||
curl_multi_setopt(g.multi, CURLMOPT_TIMERDATA, &g);
|
curl_multi_setopt(g.multi, CURLMOPT_TIMERDATA, &g);
|
||||||
do
|
|
||||||
{
|
/* we don't call any curl_multi_socket*() function yet as we have no handles
|
||||||
rc = curl_multi_socket_all(g.multi, &g.still_running);
|
added! */
|
||||||
} while ( CURLM_CALL_MULTI_PERFORM == rc );
|
|
||||||
|
|
||||||
ev_loop(g.loop, 0);
|
ev_loop(g.loop, 0);
|
||||||
curl_multi_cleanup(g.multi);
|
curl_multi_cleanup(g.multi);
|
||||||
|
@@ -53,20 +53,24 @@
|
|||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
enum fcurl_type_e { CFTYPE_NONE=0, CFTYPE_FILE=1, CFTYPE_CURL=2 };
|
enum fcurl_type_e {
|
||||||
|
CFTYPE_NONE=0,
|
||||||
|
CFTYPE_FILE=1,
|
||||||
|
CFTYPE_CURL=2
|
||||||
|
};
|
||||||
|
|
||||||
struct fcurl_data
|
struct fcurl_data
|
||||||
{
|
{
|
||||||
enum fcurl_type_e type; /* type of handle */
|
enum fcurl_type_e type; /* type of handle */
|
||||||
union {
|
union {
|
||||||
CURL *curl;
|
CURL *curl;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
} handle; /* handle */
|
} handle; /* handle */
|
||||||
|
|
||||||
char *buffer; /* buffer to store cached data*/
|
char *buffer; /* buffer to store cached data*/
|
||||||
int buffer_len; /* currently allocated buffers length */
|
int buffer_len; /* currently allocated buffers length */
|
||||||
int buffer_pos; /* end of data in buffer*/
|
int buffer_pos; /* end of data in buffer*/
|
||||||
int still_running; /* Is background url fetch still in progress */
|
int still_running; /* Is background url fetch still in progress */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct fcurl_data URL_FILE;
|
typedef struct fcurl_data URL_FILE;
|
||||||
@@ -83,497 +87,441 @@ void url_rewind(URL_FILE *file);
|
|||||||
CURLM *multi_handle;
|
CURLM *multi_handle;
|
||||||
|
|
||||||
/* curl calls this routine to get more data */
|
/* curl calls this routine to get more data */
|
||||||
static size_t
|
static size_t write_callback(char *buffer,
|
||||||
write_callback(char *buffer,
|
size_t size,
|
||||||
size_t size,
|
size_t nitems,
|
||||||
size_t nitems,
|
void *userp)
|
||||||
void *userp)
|
|
||||||
{
|
{
|
||||||
char *newbuff;
|
char *newbuff;
|
||||||
int rembuff;
|
int rembuff;
|
||||||
|
|
||||||
URL_FILE *url = (URL_FILE *)userp;
|
URL_FILE *url = (URL_FILE *)userp;
|
||||||
size *= nitems;
|
size *= nitems;
|
||||||
|
|
||||||
rembuff=url->buffer_len - url->buffer_pos; /* remaining space in buffer */
|
rembuff=url->buffer_len - url->buffer_pos; /* remaining space in buffer */
|
||||||
|
|
||||||
if(size > rembuff)
|
if(size > rembuff) {
|
||||||
{
|
/* not enough space in buffer */
|
||||||
/* not enough space in buffer */
|
newbuff=realloc(url->buffer,url->buffer_len + (size - rembuff));
|
||||||
newbuff=realloc(url->buffer,url->buffer_len + (size - rembuff));
|
if(newbuff==NULL) {
|
||||||
if(newbuff==NULL)
|
fprintf(stderr,"callback buffer grow failed\n");
|
||||||
{
|
size=rembuff;
|
||||||
fprintf(stderr,"callback buffer grow failed\n");
|
|
||||||
size=rembuff;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* realloc suceeded increase buffer size*/
|
|
||||||
url->buffer_len+=size - rembuff;
|
|
||||||
url->buffer=newbuff;
|
|
||||||
|
|
||||||
/*printf("Callback buffer grown to %d bytes\n",url->buffer_len);*/
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
/* realloc suceeded increase buffer size*/
|
||||||
|
url->buffer_len+=size - rembuff;
|
||||||
|
url->buffer=newbuff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(&url->buffer[url->buffer_pos], buffer, size);
|
memcpy(&url->buffer[url->buffer_pos], buffer, size);
|
||||||
url->buffer_pos += size;
|
url->buffer_pos += size;
|
||||||
|
|
||||||
/*fprintf(stderr, "callback %d size bytes\n", size);*/
|
return size;
|
||||||
|
|
||||||
return size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* use to attempt to fill the read buffer up to requested number of bytes */
|
/* use to attempt to fill the read buffer up to requested number of bytes */
|
||||||
static int
|
static int fill_buffer(URL_FILE *file,int want,int waittime)
|
||||||
fill_buffer(URL_FILE *file,int want,int waittime)
|
|
||||||
{
|
{
|
||||||
fd_set fdread;
|
fd_set fdread;
|
||||||
fd_set fdwrite;
|
fd_set fdwrite;
|
||||||
fd_set fdexcep;
|
fd_set fdexcep;
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/* only attempt to fill buffer if transactions still running and buffer
|
/* only attempt to fill buffer if transactions still running and buffer
|
||||||
* doesnt exceed required size already
|
* doesnt exceed required size already
|
||||||
*/
|
*/
|
||||||
if((!file->still_running) || (file->buffer_pos > want))
|
if((!file->still_running) || (file->buffer_pos > want))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* attempt to fill buffer */
|
/* attempt to fill buffer */
|
||||||
do
|
do {
|
||||||
{
|
int maxfd = -1;
|
||||||
int maxfd = -1;
|
long curl_timeo = -1;
|
||||||
long curl_timeo = -1;
|
|
||||||
|
|
||||||
FD_ZERO(&fdread);
|
FD_ZERO(&fdread);
|
||||||
FD_ZERO(&fdwrite);
|
FD_ZERO(&fdwrite);
|
||||||
FD_ZERO(&fdexcep);
|
FD_ZERO(&fdexcep);
|
||||||
|
|
||||||
/* set a suitable timeout to fail on */
|
/* set a suitable timeout to fail on */
|
||||||
timeout.tv_sec = 60; /* 1 minute */
|
timeout.tv_sec = 60; /* 1 minute */
|
||||||
timeout.tv_usec = 0;
|
timeout.tv_usec = 0;
|
||||||
|
|
||||||
curl_multi_timeout(multi_handle, &curl_timeo);
|
curl_multi_timeout(multi_handle, &curl_timeo);
|
||||||
if(curl_timeo >= 0) {
|
if(curl_timeo >= 0) {
|
||||||
timeout.tv_sec = curl_timeo / 1000;
|
timeout.tv_sec = curl_timeo / 1000;
|
||||||
if(timeout.tv_sec > 1)
|
if(timeout.tv_sec > 1)
|
||||||
timeout.tv_sec = 1;
|
timeout.tv_sec = 1;
|
||||||
else
|
else
|
||||||
timeout.tv_usec = (curl_timeo % 1000) * 1000;
|
timeout.tv_usec = (curl_timeo % 1000) * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get file descriptors from the transfers */
|
/* get file descriptors from the transfers */
|
||||||
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||||
|
|
||||||
/* In a real-world program you OF COURSE check the return code of the
|
/* In a real-world program you OF COURSE check the return code of the
|
||||||
function calls. On success, the value of maxfd is guaranteed to be
|
function calls. On success, the value of maxfd is guaranteed to be
|
||||||
greater or equal than -1. We call select(maxfd + 1, ...), specially
|
greater or equal than -1. We call select(maxfd + 1, ...), specially
|
||||||
in case of (maxfd == -1), we call select(0, ...), which is basically
|
in case of (maxfd == -1), we call select(0, ...), which is basically
|
||||||
equal to sleep. */
|
equal to sleep. */
|
||||||
|
|
||||||
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||||
|
|
||||||
switch(rc) {
|
switch(rc) {
|
||||||
case -1:
|
case -1:
|
||||||
/* select error */
|
/* select error */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
default:
|
||||||
|
/* timeout or readable/writable sockets */
|
||||||
default:
|
curl_multi_perform(multi_handle, &file->still_running);
|
||||||
/* timeout or readable/writable sockets */
|
break;
|
||||||
/* note we *could* be more efficient and not wait for
|
}
|
||||||
* CURLM_CALL_MULTI_PERFORM to clear here and check it on re-entry
|
} while(file->still_running && (file->buffer_pos < want));
|
||||||
* but that gets messy */
|
return 1;
|
||||||
while(curl_multi_perform(multi_handle, &file->still_running) ==
|
|
||||||
CURLM_CALL_MULTI_PERFORM);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while(file->still_running && (file->buffer_pos < want));
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* use to remove want bytes from the front of a files buffer */
|
/* use to remove want bytes from the front of a files buffer */
|
||||||
static int
|
static int use_buffer(URL_FILE *file,int want)
|
||||||
use_buffer(URL_FILE *file,int want)
|
|
||||||
{
|
{
|
||||||
/* sort out buffer */
|
/* sort out buffer */
|
||||||
if((file->buffer_pos - want) <=0)
|
if((file->buffer_pos - want) <=0) {
|
||||||
{
|
/* ditch buffer - write will recreate */
|
||||||
/* ditch buffer - write will recreate */
|
|
||||||
if(file->buffer)
|
|
||||||
free(file->buffer);
|
|
||||||
|
|
||||||
file->buffer=NULL;
|
|
||||||
file->buffer_pos=0;
|
|
||||||
file->buffer_len=0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* move rest down make it available for later */
|
|
||||||
memmove(file->buffer,
|
|
||||||
&file->buffer[want],
|
|
||||||
(file->buffer_pos - want));
|
|
||||||
|
|
||||||
file->buffer_pos -= want;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
URL_FILE *
|
|
||||||
url_fopen(const char *url,const char *operation)
|
|
||||||
{
|
|
||||||
/* this code could check for URLs or types in the 'url' and
|
|
||||||
basicly use the real fopen() for standard files */
|
|
||||||
|
|
||||||
URL_FILE *file;
|
|
||||||
(void)operation;
|
|
||||||
|
|
||||||
file = malloc(sizeof(URL_FILE));
|
|
||||||
if(!file)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
memset(file, 0, sizeof(URL_FILE));
|
|
||||||
|
|
||||||
if((file->handle.file=fopen(url,operation)))
|
|
||||||
{
|
|
||||||
file->type = CFTYPE_FILE; /* marked as URL */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
file->type = CFTYPE_CURL; /* marked as URL */
|
|
||||||
file->handle.curl = curl_easy_init();
|
|
||||||
|
|
||||||
curl_easy_setopt(file->handle.curl, CURLOPT_URL, url);
|
|
||||||
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEDATA, file);
|
|
||||||
curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, 0L);
|
|
||||||
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEFUNCTION, write_callback);
|
|
||||||
|
|
||||||
if(!multi_handle)
|
|
||||||
multi_handle = curl_multi_init();
|
|
||||||
|
|
||||||
curl_multi_add_handle(multi_handle, file->handle.curl);
|
|
||||||
|
|
||||||
/* lets start the fetch */
|
|
||||||
while(curl_multi_perform(multi_handle, &file->still_running) ==
|
|
||||||
CURLM_CALL_MULTI_PERFORM );
|
|
||||||
|
|
||||||
if((file->buffer_pos == 0) && (!file->still_running))
|
|
||||||
{
|
|
||||||
/* if still_running is 0 now, we should return NULL */
|
|
||||||
|
|
||||||
/* make sure the easy handle is not in the multi handle anymore */
|
|
||||||
curl_multi_remove_handle(multi_handle, file->handle.curl);
|
|
||||||
|
|
||||||
/* cleanup */
|
|
||||||
curl_easy_cleanup(file->handle.curl);
|
|
||||||
|
|
||||||
free(file);
|
|
||||||
|
|
||||||
file = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
url_fclose(URL_FILE *file)
|
|
||||||
{
|
|
||||||
int ret=0;/* default is good return */
|
|
||||||
|
|
||||||
switch(file->type)
|
|
||||||
{
|
|
||||||
case CFTYPE_FILE:
|
|
||||||
ret=fclose(file->handle.file); /* passthrough */
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CFTYPE_CURL:
|
|
||||||
/* make sure the easy handle is not in the multi handle anymore */
|
|
||||||
curl_multi_remove_handle(multi_handle, file->handle.curl);
|
|
||||||
|
|
||||||
/* cleanup */
|
|
||||||
curl_easy_cleanup(file->handle.curl);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default: /* unknown or supported type - oh dear */
|
|
||||||
ret=EOF;
|
|
||||||
errno=EBADF;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(file->buffer)
|
if(file->buffer)
|
||||||
free(file->buffer);/* free any allocated buffer space */
|
free(file->buffer);
|
||||||
|
|
||||||
free(file);
|
file->buffer=NULL;
|
||||||
|
file->buffer_pos=0;
|
||||||
|
file->buffer_len=0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* move rest down make it available for later */
|
||||||
|
memmove(file->buffer,
|
||||||
|
&file->buffer[want],
|
||||||
|
(file->buffer_pos - want));
|
||||||
|
|
||||||
return ret;
|
file->buffer_pos -= want;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
URL_FILE *url_fopen(const char *url,const char *operation)
|
||||||
url_feof(URL_FILE *file)
|
|
||||||
{
|
{
|
||||||
int ret=0;
|
/* this code could check for URLs or types in the 'url' and
|
||||||
|
basicly use the real fopen() for standard files */
|
||||||
|
|
||||||
switch(file->type)
|
URL_FILE *file;
|
||||||
{
|
(void)operation;
|
||||||
case CFTYPE_FILE:
|
|
||||||
ret=feof(file->handle.file);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CFTYPE_CURL:
|
file = malloc(sizeof(URL_FILE));
|
||||||
if((file->buffer_pos == 0) && (!file->still_running))
|
if(!file)
|
||||||
ret = 1;
|
return NULL;
|
||||||
break;
|
|
||||||
default: /* unknown or supported type - oh dear */
|
memset(file, 0, sizeof(URL_FILE));
|
||||||
ret=-1;
|
|
||||||
errno=EBADF;
|
if((file->handle.file=fopen(url,operation)))
|
||||||
break;
|
file->type = CFTYPE_FILE; /* marked as URL */
|
||||||
|
|
||||||
|
else {
|
||||||
|
file->type = CFTYPE_CURL; /* marked as URL */
|
||||||
|
file->handle.curl = curl_easy_init();
|
||||||
|
|
||||||
|
curl_easy_setopt(file->handle.curl, CURLOPT_URL, url);
|
||||||
|
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEDATA, file);
|
||||||
|
curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, 0L);
|
||||||
|
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEFUNCTION, write_callback);
|
||||||
|
|
||||||
|
if(!multi_handle)
|
||||||
|
multi_handle = curl_multi_init();
|
||||||
|
|
||||||
|
curl_multi_add_handle(multi_handle, file->handle.curl);
|
||||||
|
|
||||||
|
/* lets start the fetch */
|
||||||
|
curl_multi_perform(multi_handle, &file->still_running);
|
||||||
|
|
||||||
|
if((file->buffer_pos == 0) && (!file->still_running)) {
|
||||||
|
/* if still_running is 0 now, we should return NULL */
|
||||||
|
|
||||||
|
/* make sure the easy handle is not in the multi handle anymore */
|
||||||
|
curl_multi_remove_handle(multi_handle, file->handle.curl);
|
||||||
|
|
||||||
|
/* cleanup */
|
||||||
|
curl_easy_cleanup(file->handle.curl);
|
||||||
|
|
||||||
|
free(file);
|
||||||
|
|
||||||
|
file = NULL;
|
||||||
}
|
}
|
||||||
return ret;
|
}
|
||||||
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
int url_fclose(URL_FILE *file)
|
||||||
url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file)
|
|
||||||
{
|
{
|
||||||
size_t want;
|
int ret=0;/* default is good return */
|
||||||
|
|
||||||
switch(file->type)
|
switch(file->type) {
|
||||||
{
|
case CFTYPE_FILE:
|
||||||
case CFTYPE_FILE:
|
ret=fclose(file->handle.file); /* passthrough */
|
||||||
want=fread(ptr,size,nmemb,file->handle.file);
|
break;
|
||||||
break;
|
|
||||||
|
|
||||||
case CFTYPE_CURL:
|
case CFTYPE_CURL:
|
||||||
want = nmemb * size;
|
/* make sure the easy handle is not in the multi handle anymore */
|
||||||
|
curl_multi_remove_handle(multi_handle, file->handle.curl);
|
||||||
|
|
||||||
fill_buffer(file,want,1);
|
/* cleanup */
|
||||||
|
curl_easy_cleanup(file->handle.curl);
|
||||||
|
break;
|
||||||
|
|
||||||
/* check if theres data in the buffer - if not fill_buffer()
|
default: /* unknown or supported type - oh dear */
|
||||||
* either errored or EOF */
|
ret=EOF;
|
||||||
if(!file->buffer_pos)
|
errno=EBADF;
|
||||||
return 0;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* ensure only available data is considered */
|
if(file->buffer)
|
||||||
if(file->buffer_pos < want)
|
free(file->buffer);/* free any allocated buffer space */
|
||||||
want = file->buffer_pos;
|
|
||||||
|
|
||||||
/* xfer data to caller */
|
free(file);
|
||||||
memcpy(ptr, file->buffer, want);
|
|
||||||
|
|
||||||
use_buffer(file,want);
|
return ret;
|
||||||
|
|
||||||
want = want / size; /* number of items - nb correct op - checked
|
|
||||||
* with glibc code*/
|
|
||||||
|
|
||||||
/*printf("(fread) return %d bytes %d left\n", want,file->buffer_pos);*/
|
|
||||||
break;
|
|
||||||
|
|
||||||
default: /* unknown or supported type - oh dear */
|
|
||||||
want=0;
|
|
||||||
errno=EBADF;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
return want;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
int url_feof(URL_FILE *file)
|
||||||
url_fgets(char *ptr, int size, URL_FILE *file)
|
|
||||||
{
|
{
|
||||||
int want = size - 1;/* always need to leave room for zero termination */
|
int ret=0;
|
||||||
int loop;
|
|
||||||
|
|
||||||
switch(file->type)
|
switch(file->type) {
|
||||||
{
|
case CFTYPE_FILE:
|
||||||
case CFTYPE_FILE:
|
ret=feof(file->handle.file);
|
||||||
ptr = fgets(ptr,size,file->handle.file);
|
break;
|
||||||
break;
|
|
||||||
|
case CFTYPE_CURL:
|
||||||
case CFTYPE_CURL:
|
if((file->buffer_pos == 0) && (!file->still_running))
|
||||||
fill_buffer(file,want,1);
|
ret = 1;
|
||||||
|
break;
|
||||||
/* check if theres data in the buffer - if not fill either errored or
|
|
||||||
* EOF */
|
default: /* unknown or supported type - oh dear */
|
||||||
if(!file->buffer_pos)
|
ret=-1;
|
||||||
return NULL;
|
errno=EBADF;
|
||||||
|
break;
|
||||||
/* ensure only available data is considered */
|
}
|
||||||
if(file->buffer_pos < want)
|
return ret;
|
||||||
want = file->buffer_pos;
|
}
|
||||||
|
|
||||||
/*buffer contains data */
|
size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file)
|
||||||
/* look for newline or eof */
|
{
|
||||||
for(loop=0;loop < want;loop++)
|
size_t want;
|
||||||
{
|
|
||||||
if(file->buffer[loop] == '\n')
|
switch(file->type) {
|
||||||
{
|
case CFTYPE_FILE:
|
||||||
want=loop+1;/* include newline */
|
want=fread(ptr,size,nmemb,file->handle.file);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
case CFTYPE_CURL:
|
||||||
|
want = nmemb * size;
|
||||||
/* xfer data to caller */
|
|
||||||
memcpy(ptr, file->buffer, want);
|
fill_buffer(file,want,1);
|
||||||
ptr[want]=0;/* allways null terminate */
|
|
||||||
|
/* check if theres data in the buffer - if not fill_buffer()
|
||||||
use_buffer(file,want);
|
* either errored or EOF */
|
||||||
|
if(!file->buffer_pos)
|
||||||
/*printf("(fgets) return %d bytes %d left\n", want,file->buffer_pos);*/
|
return 0;
|
||||||
break;
|
|
||||||
|
/* ensure only available data is considered */
|
||||||
default: /* unknown or supported type - oh dear */
|
if(file->buffer_pos < want)
|
||||||
ptr=NULL;
|
want = file->buffer_pos;
|
||||||
errno=EBADF;
|
|
||||||
|
/* xfer data to caller */
|
||||||
|
memcpy(ptr, file->buffer, want);
|
||||||
|
|
||||||
|
use_buffer(file,want);
|
||||||
|
|
||||||
|
want = want / size; /* number of items */
|
||||||
|
break;
|
||||||
|
|
||||||
|
default: /* unknown or supported type - oh dear */
|
||||||
|
want=0;
|
||||||
|
errno=EBADF;
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
return want;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *url_fgets(char *ptr, int size, URL_FILE *file)
|
||||||
|
{
|
||||||
|
int want = size - 1;/* always need to leave room for zero termination */
|
||||||
|
int loop;
|
||||||
|
|
||||||
|
switch(file->type) {
|
||||||
|
case CFTYPE_FILE:
|
||||||
|
ptr = fgets(ptr,size,file->handle.file);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CFTYPE_CURL:
|
||||||
|
fill_buffer(file,want,1);
|
||||||
|
|
||||||
|
/* check if theres data in the buffer - if not fill either errored or
|
||||||
|
* EOF */
|
||||||
|
if(!file->buffer_pos)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* ensure only available data is considered */
|
||||||
|
if(file->buffer_pos < want)
|
||||||
|
want = file->buffer_pos;
|
||||||
|
|
||||||
|
/*buffer contains data */
|
||||||
|
/* look for newline or eof */
|
||||||
|
for(loop=0;loop < want;loop++) {
|
||||||
|
if(file->buffer[loop] == '\n') {
|
||||||
|
want=loop+1;/* include newline */
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ptr;/*success */
|
/* xfer data to caller */
|
||||||
|
memcpy(ptr, file->buffer, want);
|
||||||
|
ptr[want]=0;/* allways null terminate */
|
||||||
|
|
||||||
|
use_buffer(file,want);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default: /* unknown or supported type - oh dear */
|
||||||
|
ptr=NULL;
|
||||||
|
errno=EBADF;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ptr;/*success */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void url_rewind(URL_FILE *file)
|
||||||
url_rewind(URL_FILE *file)
|
|
||||||
{
|
{
|
||||||
switch(file->type)
|
switch(file->type) {
|
||||||
{
|
case CFTYPE_FILE:
|
||||||
case CFTYPE_FILE:
|
rewind(file->handle.file); /* passthrough */
|
||||||
rewind(file->handle.file); /* passthrough */
|
break;
|
||||||
break;
|
|
||||||
|
|
||||||
case CFTYPE_CURL:
|
case CFTYPE_CURL:
|
||||||
/* halt transaction */
|
/* halt transaction */
|
||||||
curl_multi_remove_handle(multi_handle, file->handle.curl);
|
curl_multi_remove_handle(multi_handle, file->handle.curl);
|
||||||
|
|
||||||
/* restart */
|
/* restart */
|
||||||
curl_multi_add_handle(multi_handle, file->handle.curl);
|
curl_multi_add_handle(multi_handle, file->handle.curl);
|
||||||
|
|
||||||
/* ditch buffer - write will recreate - resets stream pos*/
|
/* ditch buffer - write will recreate - resets stream pos*/
|
||||||
if(file->buffer)
|
if(file->buffer)
|
||||||
free(file->buffer);
|
free(file->buffer);
|
||||||
|
|
||||||
file->buffer=NULL;
|
file->buffer=NULL;
|
||||||
file->buffer_pos=0;
|
file->buffer_pos=0;
|
||||||
file->buffer_len=0;
|
file->buffer_len=0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: /* unknown or supported type - oh dear */
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
default: /* unknown or supported type - oh dear */
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Small main program to retrive from a url using fgets and fread saving the
|
/* Small main program to retrive from a url using fgets and fread saving the
|
||||||
* output to two test files (note the fgets method will corrupt binary files if
|
* output to two test files (note the fgets method will corrupt binary files if
|
||||||
* they contain 0 chars */
|
* they contain 0 chars */
|
||||||
int
|
int main(int argc, char *argv[])
|
||||||
main(int argc, char *argv[])
|
|
||||||
{
|
{
|
||||||
URL_FILE *handle;
|
URL_FILE *handle;
|
||||||
FILE *outf;
|
FILE *outf;
|
||||||
|
|
||||||
int nread;
|
int nread;
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
const char *url;
|
const char *url;
|
||||||
|
|
||||||
if(argc < 2)
|
if(argc < 2)
|
||||||
{
|
url="http://192.168.7.3/testfile";/* default to testurl */
|
||||||
url="http://192.168.7.3/testfile";/* default to testurl */
|
else
|
||||||
}
|
url=argv[1];/* use passed url */
|
||||||
else
|
|
||||||
{
|
|
||||||
url=argv[1];/* use passed url */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* copy from url line by line with fgets */
|
/* copy from url line by line with fgets */
|
||||||
outf=fopen("fgets.test","w+");
|
outf=fopen("fgets.test","w+");
|
||||||
if(!outf)
|
if(!outf) {
|
||||||
{
|
perror("couldn't open fgets output file\n");
|
||||||
perror("couldn't open fgets output file\n");
|
return 1;
|
||||||
return 1;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
handle = url_fopen(url, "r");
|
|
||||||
if(!handle)
|
|
||||||
{
|
|
||||||
printf("couldn't url_fopen() %s\n", url);
|
|
||||||
fclose(outf);
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(!url_feof(handle))
|
|
||||||
{
|
|
||||||
url_fgets(buffer,sizeof(buffer),handle);
|
|
||||||
fwrite(buffer,1,strlen(buffer),outf);
|
|
||||||
}
|
|
||||||
|
|
||||||
url_fclose(handle);
|
|
||||||
|
|
||||||
|
handle = url_fopen(url, "r");
|
||||||
|
if(!handle) {
|
||||||
|
printf("couldn't url_fopen() %s\n", url);
|
||||||
fclose(outf);
|
fclose(outf);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
while(!url_feof(handle)) {
|
||||||
|
url_fgets(buffer,sizeof(buffer),handle);
|
||||||
|
fwrite(buffer,1,strlen(buffer),outf);
|
||||||
|
}
|
||||||
|
|
||||||
|
url_fclose(handle);
|
||||||
|
|
||||||
|
fclose(outf);
|
||||||
|
|
||||||
|
|
||||||
/* Copy from url with fread */
|
/* Copy from url with fread */
|
||||||
outf=fopen("fread.test","w+");
|
outf=fopen("fread.test","w+");
|
||||||
if(!outf)
|
if(!outf) {
|
||||||
{
|
perror("couldn't open fread output file\n");
|
||||||
perror("couldn't open fread output file\n");
|
return 1;
|
||||||
return 1;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
handle = url_fopen("testfile", "r");
|
|
||||||
if(!handle) {
|
|
||||||
printf("couldn't url_fopen() testfile\n");
|
|
||||||
fclose(outf);
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
do {
|
|
||||||
nread = url_fread(buffer, 1,sizeof(buffer), handle);
|
|
||||||
fwrite(buffer,1,nread,outf);
|
|
||||||
} while(nread);
|
|
||||||
|
|
||||||
url_fclose(handle);
|
|
||||||
|
|
||||||
|
handle = url_fopen("testfile", "r");
|
||||||
|
if(!handle) {
|
||||||
|
printf("couldn't url_fopen() testfile\n");
|
||||||
fclose(outf);
|
fclose(outf);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
nread = url_fread(buffer, 1,sizeof(buffer), handle);
|
||||||
|
fwrite(buffer,1,nread,outf);
|
||||||
|
} while(nread);
|
||||||
|
|
||||||
|
url_fclose(handle);
|
||||||
|
|
||||||
|
fclose(outf);
|
||||||
|
|
||||||
|
|
||||||
/* Test rewind */
|
/* Test rewind */
|
||||||
outf=fopen("rewind.test","w+");
|
outf=fopen("rewind.test","w+");
|
||||||
if(!outf)
|
if(!outf) {
|
||||||
{
|
perror("couldn't open fread output file\n");
|
||||||
perror("couldn't open fread output file\n");
|
return 1;
|
||||||
return 1;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
handle = url_fopen("testfile", "r");
|
|
||||||
if(!handle) {
|
|
||||||
printf("couldn't url_fopen() testfile\n");
|
|
||||||
fclose(outf);
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
nread = url_fread(buffer, 1,sizeof(buffer), handle);
|
|
||||||
fwrite(buffer,1,nread,outf);
|
|
||||||
url_rewind(handle);
|
|
||||||
|
|
||||||
buffer[0]='\n';
|
|
||||||
fwrite(buffer,1,1,outf);
|
|
||||||
|
|
||||||
nread = url_fread(buffer, 1,sizeof(buffer), handle);
|
|
||||||
fwrite(buffer,1,nread,outf);
|
|
||||||
|
|
||||||
|
|
||||||
url_fclose(handle);
|
|
||||||
|
|
||||||
|
handle = url_fopen("testfile", "r");
|
||||||
|
if(!handle) {
|
||||||
|
printf("couldn't url_fopen() testfile\n");
|
||||||
fclose(outf);
|
fclose(outf);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
nread = url_fread(buffer, 1,sizeof(buffer), handle);
|
||||||
|
fwrite(buffer,1,nread,outf);
|
||||||
|
url_rewind(handle);
|
||||||
|
|
||||||
|
buffer[0]='\n';
|
||||||
|
fwrite(buffer,1,1,outf);
|
||||||
|
|
||||||
|
nread = url_fread(buffer, 1,sizeof(buffer), handle);
|
||||||
|
fwrite(buffer,1,nread,outf);
|
||||||
|
|
||||||
|
|
||||||
return 0;/* all done */
|
url_fclose(handle);
|
||||||
|
|
||||||
|
fclose(outf);
|
||||||
|
|
||||||
|
|
||||||
|
return 0;/* all done */
|
||||||
}
|
}
|
||||||
|
@@ -67,8 +67,7 @@ int main(int argc, char **argv)
|
|||||||
if(argc == 2)
|
if(argc == 2)
|
||||||
curl_easy_setopt(handle, CURLOPT_URL, argv[1]);
|
curl_easy_setopt(handle, CURLOPT_URL, argv[1]);
|
||||||
else
|
else
|
||||||
curl_easy_setopt(handle, CURLOPT_URL,
|
curl_easy_setopt(handle, CURLOPT_URL, "ftp://example.com/test/*");
|
||||||
"ftp://curltest.howto.cz:123456@curltest.howto.cz/test/*");
|
|
||||||
|
|
||||||
/* and start transfer! */
|
/* and start transfer! */
|
||||||
rc = curl_easy_perform(handle);
|
rc = curl_easy_perform(handle);
|
||||||
|
@@ -52,12 +52,10 @@ int main(void)
|
|||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
/*
|
/*
|
||||||
* Get curl 7.9.2 from sunet.se's FTP site. curl 7.9.2 is most likely not
|
* You better replace the URL with one that works!
|
||||||
* present there by the time you read this, so you'd better replace the
|
|
||||||
* URL with one that works!
|
|
||||||
*/
|
*/
|
||||||
curl_easy_setopt(curl, CURLOPT_URL,
|
curl_easy_setopt(curl, CURLOPT_URL,
|
||||||
"ftp://ftp.sunet.se/pub/www/utilities/curl/curl-7.9.2.tar.gz");
|
"ftp://ftp.example.com/pub/www/utilities/curl/curl-7.9.2.tar.gz");
|
||||||
/* Define our callback to get called when there's data to be written */
|
/* Define our callback to get called when there's data to be written */
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
|
||||||
/* Set a pointer to our struct to pass to the callback */
|
/* Set a pointer to our struct to pass to the callback */
|
||||||
|
@@ -28,8 +28,7 @@ static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
/* Check for binutils 2.19.1 from ftp.gnu.org's FTP site. */
|
char ftpurl[] = "ftp://ftp.example.com/gnu/binutils/binutils-2.19.1.tar.bz2";
|
||||||
char ftpurl[] = "ftp://ftp.gnu.org/gnu/binutils/binutils-2.19.1.tar.bz2";
|
|
||||||
CURL *curl;
|
CURL *curl;
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
const time_t filetime;
|
const time_t filetime;
|
||||||
|
@@ -43,7 +43,7 @@ int main(int argc, char **argv)
|
|||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
/* Get a file listing from sunet */
|
/* Get a file listing from sunet */
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.sunet.se/");
|
curl_easy_setopt(curl, CURLOPT_URL, "ftp://ftp.example.com/");
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, ftpfile);
|
||||||
/* If you intend to use this on windows with a libcurl DLL, you must use
|
/* If you intend to use this on windows with a libcurl DLL, you must use
|
||||||
CURLOPT_WRITEFUNCTION as well */
|
CURLOPT_WRITEFUNCTION as well */
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#define LOCAL_FILE "/tmp/uploadthis.txt"
|
#define LOCAL_FILE "/tmp/uploadthis.txt"
|
||||||
#define UPLOAD_FILE_AS "while-uploading.txt"
|
#define UPLOAD_FILE_AS "while-uploading.txt"
|
||||||
#define REMOTE_URL "ftp://localhost/" UPLOAD_FILE_AS
|
#define REMOTE_URL "ftp://example.com/" UPLOAD_FILE_AS
|
||||||
#define RENAME_FILE_TO "renamed-and-fine.txt"
|
#define RENAME_FILE_TO "renamed-and-fine.txt"
|
||||||
|
|
||||||
/* NOTE: if you want this example to work on Windows with libcurl as a
|
/* NOTE: if you want this example to work on Windows with libcurl as a
|
||||||
|
@@ -32,7 +32,8 @@ int __cdecl _snscanf(const char * input, size_t length, const char * format, ...
|
|||||||
|
|
||||||
|
|
||||||
/* parse headers for Content-Length */
|
/* parse headers for Content-Length */
|
||||||
size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream) {
|
size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||||
|
{
|
||||||
int r;
|
int r;
|
||||||
long len = 0;
|
long len = 0;
|
||||||
|
|
||||||
@@ -46,7 +47,8 @@ size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* discard downloaded data */
|
/* discard downloaded data */
|
||||||
size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream) {
|
size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||||
|
{
|
||||||
return size * nmemb;
|
return size * nmemb;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,13 +145,14 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int c, char **argv) {
|
int main(int c, char **argv)
|
||||||
|
{
|
||||||
CURL *curlhandle = NULL;
|
CURL *curlhandle = NULL;
|
||||||
|
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
curlhandle = curl_easy_init();
|
curlhandle = curl_easy_init();
|
||||||
|
|
||||||
upload(curlhandle, "ftp://user:pass@host/path/file", "C:\\file", 0, 3);
|
upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file", 0, 3);
|
||||||
|
|
||||||
curl_easy_cleanup(curlhandle);
|
curl_easy_cleanup(curlhandle);
|
||||||
curl_global_cleanup();
|
curl_global_cleanup();
|
||||||
|
@@ -19,7 +19,7 @@ int main(void)
|
|||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
/* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTURL */
|
/* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTURL */
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
|
||||||
/* http://curl.haxx.se/libcurl/c/curl_easy_perform.html */
|
/* http://curl.haxx.se/libcurl/c/curl_easy_perform.html */
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
|
@@ -8,8 +8,6 @@
|
|||||||
*
|
*
|
||||||
* Example source code to show how the callback function can be used to
|
* Example source code to show how the callback function can be used to
|
||||||
* download data into a chunk of memory instead of storing it in a file.
|
* download data into a chunk of memory instead of storing it in a file.
|
||||||
*
|
|
||||||
* This exact source code has not been verified to work.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -17,25 +15,12 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include <curl/types.h>
|
|
||||||
#include <curl/easy.h>
|
|
||||||
|
|
||||||
struct MemoryStruct {
|
struct MemoryStruct {
|
||||||
char *memory;
|
char *memory;
|
||||||
size_t size;
|
size_t size;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *myrealloc(void *ptr, size_t size);
|
|
||||||
|
|
||||||
static void *myrealloc(void *ptr, size_t size)
|
|
||||||
{
|
|
||||||
/* There might be a realloc() out there that doesn't like reallocing
|
|
||||||
NULL pointers, so we take care of it here */
|
|
||||||
if(ptr)
|
|
||||||
return realloc(ptr, size);
|
|
||||||
else
|
|
||||||
return malloc(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static size_t
|
static size_t
|
||||||
WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||||
@@ -43,22 +28,28 @@ WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
|||||||
size_t realsize = size * nmemb;
|
size_t realsize = size * nmemb;
|
||||||
struct MemoryStruct *mem = (struct MemoryStruct *)data;
|
struct MemoryStruct *mem = (struct MemoryStruct *)data;
|
||||||
|
|
||||||
mem->memory = myrealloc(mem->memory, mem->size + realsize + 1);
|
mem->memory = realloc(mem->memory, mem->size + realsize + 1);
|
||||||
if (mem->memory) {
|
if (mem->memory == NULL) {
|
||||||
memcpy(&(mem->memory[mem->size]), ptr, realsize);
|
/* out of memory! */
|
||||||
mem->size += realsize;
|
printf("not enough memory (realloc returned NULL)\n");
|
||||||
mem->memory[mem->size] = 0;
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memcpy(&(mem->memory[mem->size]), ptr, realsize);
|
||||||
|
mem->size += realsize;
|
||||||
|
mem->memory[mem->size] = 0;
|
||||||
|
|
||||||
return realsize;
|
return realsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
CURL *curl_handle;
|
CURL *curl_handle;
|
||||||
|
|
||||||
struct MemoryStruct chunk;
|
struct MemoryStruct chunk;
|
||||||
|
|
||||||
chunk.memory=NULL; /* we expect realloc(NULL, size) to work */
|
chunk.memory = malloc(1); /* will be grown as needed by the realloc above */
|
||||||
chunk.size = 0; /* no data at this point */
|
chunk.size = 0; /* no data at this point */
|
||||||
|
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
@@ -67,7 +58,7 @@ int main(int argc, char **argv)
|
|||||||
curl_handle = curl_easy_init();
|
curl_handle = curl_easy_init();
|
||||||
|
|
||||||
/* specify URL to get */
|
/* specify URL to get */
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://cool.haxx.se/");
|
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://www.example.com/");
|
||||||
|
|
||||||
/* send all data to this function */
|
/* send all data to this function */
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
|
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
|
||||||
@@ -96,6 +87,8 @@ int main(int argc, char **argv)
|
|||||||
* you're done with it, you should free() it as a nice application.
|
* you're done with it, you should free() it as a nice application.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
printf("%lu bytes retrieved\n", chunk.size);
|
||||||
|
|
||||||
if(chunk.memory)
|
if(chunk.memory)
|
||||||
free(chunk.memory);
|
free(chunk.memory);
|
||||||
|
|
||||||
|
@@ -58,10 +58,7 @@ callback.
|
|||||||
typedef struct _GlobalInfo {
|
typedef struct _GlobalInfo {
|
||||||
CURLM *multi;
|
CURLM *multi;
|
||||||
guint timer_event;
|
guint timer_event;
|
||||||
int prev_running;
|
|
||||||
int still_running;
|
int still_running;
|
||||||
int requested; /* count: curl_easy_init() */
|
|
||||||
int completed; /* count: curl_easy_cleanup() */
|
|
||||||
} GlobalInfo;
|
} GlobalInfo;
|
||||||
|
|
||||||
|
|
||||||
@@ -95,7 +92,6 @@ static void mcode_or_die(const char *where, CURLMcode code) {
|
|||||||
const char *s;
|
const char *s;
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
||||||
case CURLM_OK: s="CURLM_OK"; break;
|
|
||||||
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
||||||
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_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_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
|
||||||
@@ -113,62 +109,43 @@ static void mcode_or_die(const char *where, CURLMcode code) {
|
|||||||
|
|
||||||
|
|
||||||
/* Check for completed transfers, and remove their easy handles */
|
/* Check for completed transfers, and remove their easy handles */
|
||||||
static void check_run_count(GlobalInfo *g)
|
static void check_multi_info(GlobalInfo *g)
|
||||||
{
|
{
|
||||||
if (g->prev_running > g->still_running) {
|
char *eff_url;
|
||||||
char *eff_url=NULL;
|
CURLMsg *msg;
|
||||||
CURLMsg *msg;
|
int msgs_left;
|
||||||
int msgs_left;
|
ConnInfo *conn;
|
||||||
ConnInfo *conn=NULL;
|
CURL *easy;
|
||||||
CURL*easy;
|
CURLcode res;
|
||||||
CURLcode res;
|
|
||||||
|
|
||||||
MSG_OUT("REMAINING: %d\n", g->still_running);
|
MSG_OUT("REMAINING: %d\n", g->still_running);
|
||||||
/*
|
while ((msg = curl_multi_info_read(g->multi, &msgs_left))) {
|
||||||
I am still uncertain whether it is safe to remove an easy handle
|
if (msg->msg == CURLMSG_DONE) {
|
||||||
from inside the curl_multi_info_read loop, so here I will search
|
easy = msg->easy_handle;
|
||||||
for completed transfers in the inner "while" loop, and then remove
|
res = msg->data.result;
|
||||||
them in the outer "do-while" loop...
|
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
|
||||||
*/
|
curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url);
|
||||||
do {
|
MSG_OUT("DONE: %s => (%d) %s\n", eff_url, res, conn->error);
|
||||||
easy=NULL;
|
curl_multi_remove_handle(g->multi, easy);
|
||||||
while ((msg = curl_multi_info_read(g->multi, &msgs_left))) {
|
free(conn->url);
|
||||||
if (msg->msg == CURLMSG_DONE) {
|
curl_easy_cleanup(easy);
|
||||||
easy=msg->easy_handle;
|
free(conn);
|
||||||
res=msg->data.result;
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (easy) {
|
|
||||||
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
|
|
||||||
curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url);
|
|
||||||
MSG_OUT("DONE: %s => (%d) %s\n", eff_url, res, conn->error);
|
|
||||||
curl_multi_remove_handle(g->multi, easy);
|
|
||||||
g_free(conn->url);
|
|
||||||
curl_easy_cleanup(easy);
|
|
||||||
g_free(conn);
|
|
||||||
g->completed++;
|
|
||||||
}
|
|
||||||
} while ( easy );
|
|
||||||
MSG_OUT("Requested: %d Completed:%d\n", g->requested, g->completed);
|
|
||||||
}
|
}
|
||||||
g->prev_running = g->still_running;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Called by glib when our timeout expires */
|
/* Called by glib when our timeout expires */
|
||||||
static gboolean timer_cb(gpointer data)
|
static gboolean timer_cb(gpointer data)
|
||||||
{
|
{
|
||||||
GlobalInfo *g = (GlobalInfo *)data;
|
GlobalInfo *g = (GlobalInfo *)data;
|
||||||
CURLMcode rc;
|
CURLMcode rc;
|
||||||
|
|
||||||
do {
|
rc = curl_multi_socket_action(g->multi,
|
||||||
rc = curl_multi_socket(g->multi, CURL_SOCKET_TIMEOUT, &g->still_running);
|
CURL_SOCKET_TIMEOUT, 0, &g->still_running);
|
||||||
} while (rc == CURLM_CALL_MULTI_PERFORM);
|
mcode_or_die("timer_cb: curl_multi_socket_action", rc);
|
||||||
mcode_or_die("timer_cb: curl_multi_socket", rc);
|
check_multi_info(g);
|
||||||
check_run_count(g);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,11 +175,15 @@ static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
|
|||||||
GlobalInfo *g = (GlobalInfo*) data;
|
GlobalInfo *g = (GlobalInfo*) data;
|
||||||
CURLMcode rc;
|
CURLMcode rc;
|
||||||
int fd=g_io_channel_unix_get_fd(ch);
|
int fd=g_io_channel_unix_get_fd(ch);
|
||||||
do {
|
|
||||||
rc = curl_multi_socket(g->multi, fd, &g->still_running);
|
int action =
|
||||||
} while (rc == CURLM_CALL_MULTI_PERFORM);
|
(condition & G_IO_IN ? CURL_CSELECT_IN : 0) |
|
||||||
mcode_or_die("event_cb: curl_multi_socket", rc);
|
(condition & G_IO_OUT ? CURL_CSELECT_OUT : 0);
|
||||||
check_run_count(g);
|
|
||||||
|
rc = curl_multi_socket_action(g->multi, fd, action, &g->still_running);
|
||||||
|
mcode_or_die("event_cb: curl_multi_socket_action", rc);
|
||||||
|
|
||||||
|
check_multi_info(g);
|
||||||
if(g->still_running) {
|
if(g->still_running) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
@@ -338,12 +319,9 @@ static void new_conn(char *url, GlobalInfo *g )
|
|||||||
MSG_OUT("Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
|
MSG_OUT("Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
|
||||||
rc =curl_multi_add_handle(g->multi, conn->easy);
|
rc =curl_multi_add_handle(g->multi, conn->easy);
|
||||||
mcode_or_die("new_conn: curl_multi_add_handle", rc);
|
mcode_or_die("new_conn: curl_multi_add_handle", rc);
|
||||||
g->requested++;
|
|
||||||
do {
|
/* note that the add_handle() will set a time-out to trigger very soon so
|
||||||
rc = curl_multi_socket_all(g->multi, &g->still_running);
|
that the necessary socket_action() call will be called by this app */
|
||||||
} while (CURLM_CALL_MULTI_PERFORM == rc);
|
|
||||||
mcode_or_die("new_conn: curl_multi_socket_all", rc);
|
|
||||||
check_run_count(g);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -451,9 +429,10 @@ int main(int argc, char **argv)
|
|||||||
curl_multi_setopt(g->multi, CURLMOPT_SOCKETDATA, g);
|
curl_multi_setopt(g->multi, CURLMOPT_SOCKETDATA, g);
|
||||||
curl_multi_setopt(g->multi, CURLMOPT_TIMERFUNCTION, update_timeout_cb);
|
curl_multi_setopt(g->multi, CURLMOPT_TIMERFUNCTION, update_timeout_cb);
|
||||||
curl_multi_setopt(g->multi, CURLMOPT_TIMERDATA, g);
|
curl_multi_setopt(g->multi, CURLMOPT_TIMERDATA, g);
|
||||||
do {
|
|
||||||
rc = curl_multi_socket_all(g->multi, &g->still_running);
|
/* we don't call any curl_multi_socket*() function yet as we have no handles
|
||||||
} while (CURLM_CALL_MULTI_PERFORM == rc);
|
added! */
|
||||||
|
|
||||||
g_main_loop_run(gmain);
|
g_main_loop_run(gmain);
|
||||||
curl_multi_cleanup(g->multi);
|
curl_multi_cleanup(g->multi);
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -62,7 +62,6 @@ typedef struct _GlobalInfo {
|
|||||||
struct event fifo_event;
|
struct event fifo_event;
|
||||||
struct event timer_event;
|
struct event timer_event;
|
||||||
CURLM *multi;
|
CURLM *multi;
|
||||||
int prev_running;
|
|
||||||
int still_running;
|
int still_running;
|
||||||
FILE* input;
|
FILE* input;
|
||||||
} GlobalInfo;
|
} GlobalInfo;
|
||||||
@@ -110,7 +109,6 @@ static void mcode_or_die(const char *where, CURLMcode code)
|
|||||||
const char *s;
|
const char *s;
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
||||||
case CURLM_OK: s="CURLM_OK"; break;
|
|
||||||
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
||||||
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_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_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
|
||||||
@@ -132,44 +130,29 @@ static void mcode_or_die(const char *where, CURLMcode code)
|
|||||||
|
|
||||||
|
|
||||||
/* Check for completed transfers, and remove their easy handles */
|
/* Check for completed transfers, and remove their easy handles */
|
||||||
static void check_run_count(GlobalInfo *g)
|
static void check_multi_info(GlobalInfo *g)
|
||||||
{
|
{
|
||||||
if (g->prev_running > g->still_running) {
|
char *eff_url;
|
||||||
char *eff_url=NULL;
|
CURLMsg *msg;
|
||||||
CURLMsg *msg;
|
int msgs_left;
|
||||||
int msgs_left;
|
ConnInfo *conn;
|
||||||
ConnInfo *conn=NULL;
|
CURL *easy;
|
||||||
CURL*easy;
|
CURLcode res;
|
||||||
CURLcode res;
|
|
||||||
|
|
||||||
fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running);
|
fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running);
|
||||||
/*
|
while ((msg = curl_multi_info_read(g->multi, &msgs_left))) {
|
||||||
I am still uncertain whether it is safe to remove an easy handle
|
if (msg->msg == CURLMSG_DONE) {
|
||||||
from inside the curl_multi_info_read loop, so here I will search
|
easy = msg->easy_handle;
|
||||||
for completed transfers in the inner "while" loop, and then remove
|
res = msg->data.result;
|
||||||
them in the outer "do-while" loop...
|
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
|
||||||
*/
|
curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url);
|
||||||
do {
|
fprintf(MSG_OUT, "DONE: %s => (%d) %s\n", eff_url, res, conn->error);
|
||||||
easy=NULL;
|
curl_multi_remove_handle(g->multi, easy);
|
||||||
while ((msg = curl_multi_info_read(g->multi, &msgs_left))) {
|
free(conn->url);
|
||||||
if (msg->msg == CURLMSG_DONE) {
|
curl_easy_cleanup(easy);
|
||||||
easy=msg->easy_handle;
|
free(conn);
|
||||||
res=msg->data.result;
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (easy) {
|
|
||||||
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
|
|
||||||
curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url);
|
|
||||||
fprintf(MSG_OUT, "DONE: %s => (%d) %s\n", eff_url, res, conn->error);
|
|
||||||
curl_multi_remove_handle(g->multi, easy);
|
|
||||||
free(conn->url);
|
|
||||||
curl_easy_cleanup(easy);
|
|
||||||
free(conn);
|
|
||||||
}
|
|
||||||
} while ( easy );
|
|
||||||
}
|
}
|
||||||
g->prev_running = g->still_running;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -181,16 +164,13 @@ static void event_cb(int fd, short kind, void *userp)
|
|||||||
CURLMcode rc;
|
CURLMcode rc;
|
||||||
|
|
||||||
int action =
|
int action =
|
||||||
(kind&EV_READ?CURL_CSELECT_IN:0)|
|
(kind & EV_READ ? CURL_CSELECT_IN : 0) |
|
||||||
(kind&EV_WRITE?CURL_CSELECT_OUT:0);
|
(kind & EV_WRITE ? CURL_CSELECT_OUT : 0);
|
||||||
|
|
||||||
do {
|
|
||||||
rc = curl_multi_socket_action(g->multi, fd, action, &g->still_running);
|
|
||||||
} while (rc == CURLM_CALL_MULTI_PERFORM);
|
|
||||||
|
|
||||||
|
rc = curl_multi_socket_action(g->multi, fd, action, &g->still_running);
|
||||||
mcode_or_die("event_cb: curl_multi_socket_action", rc);
|
mcode_or_die("event_cb: curl_multi_socket_action", rc);
|
||||||
|
|
||||||
check_run_count(g);
|
check_multi_info(g);
|
||||||
if ( g->still_running <= 0 ) {
|
if ( g->still_running <= 0 ) {
|
||||||
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
|
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
|
||||||
if (evtimer_pending(&g->timer_event, NULL)) {
|
if (evtimer_pending(&g->timer_event, NULL)) {
|
||||||
@@ -209,12 +189,10 @@ static void timer_cb(int fd, short kind, void *userp)
|
|||||||
(void)fd;
|
(void)fd;
|
||||||
(void)kind;
|
(void)kind;
|
||||||
|
|
||||||
do {
|
rc = curl_multi_socket_action(g->multi,
|
||||||
rc = curl_multi_socket_action(g->multi,
|
|
||||||
CURL_SOCKET_TIMEOUT, 0, &g->still_running);
|
CURL_SOCKET_TIMEOUT, 0, &g->still_running);
|
||||||
} while (rc == CURLM_CALL_MULTI_PERFORM);
|
|
||||||
mcode_or_die("timer_cb: curl_multi_socket_action", rc);
|
mcode_or_die("timer_cb: curl_multi_socket_action", rc);
|
||||||
check_run_count(g);
|
check_multi_info(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -340,7 +318,7 @@ static void new_conn(char *url, GlobalInfo *g )
|
|||||||
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
|
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
|
||||||
fprintf(MSG_OUT,
|
fprintf(MSG_OUT,
|
||||||
"Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
|
"Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
|
||||||
rc =curl_multi_add_handle(g->multi, conn->easy);
|
rc = curl_multi_add_handle(g->multi, conn->easy);
|
||||||
mcode_or_die("new_conn: curl_multi_add_handle", rc);
|
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
|
/* note that the add_handle() will set a time-out to trigger very soon so
|
||||||
|
@@ -17,7 +17,7 @@ int main(void)
|
|||||||
|
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "https://sourceforge.net/");
|
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
|
||||||
|
|
||||||
#ifdef SKIP_PEER_VERIFICATION
|
#ifdef SKIP_PEER_VERIFICATION
|
||||||
/*
|
/*
|
||||||
|
@@ -43,9 +43,9 @@ int main(int argc, char **argv)
|
|||||||
handles[i] = curl_easy_init();
|
handles[i] = curl_easy_init();
|
||||||
|
|
||||||
/* set the options (I left out a few, you'll get the point anyway) */
|
/* set the options (I left out a few, you'll get the point anyway) */
|
||||||
curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "http://website.com");
|
curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "http://example.com");
|
||||||
|
|
||||||
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://ftpsite.com");
|
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://example.com");
|
||||||
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_UPLOAD, 1L);
|
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_UPLOAD, 1L);
|
||||||
|
|
||||||
/* init a multi stack */
|
/* init a multi stack */
|
||||||
@@ -56,8 +56,7 @@ int main(int argc, char **argv)
|
|||||||
curl_multi_add_handle(multi_handle, handles[i]);
|
curl_multi_add_handle(multi_handle, handles[i]);
|
||||||
|
|
||||||
/* we start some action by calling perform right away */
|
/* we start some action by calling perform right away */
|
||||||
while(CURLM_CALL_MULTI_PERFORM ==
|
curl_multi_perform(multi_handle, &still_running);
|
||||||
curl_multi_perform(multi_handle, &still_running));
|
|
||||||
|
|
||||||
while(still_running) {
|
while(still_running) {
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
@@ -102,14 +101,9 @@ int main(int argc, char **argv)
|
|||||||
case -1:
|
case -1:
|
||||||
/* select error */
|
/* select error */
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0: /* timeout */
|
||||||
/* timeout, do something else */
|
default: /* action */
|
||||||
break;
|
curl_multi_perform(multi_handle, &still_running);
|
||||||
default:
|
|
||||||
/* one or more of curl's file descriptors say there's data to read
|
|
||||||
or write */
|
|
||||||
while(CURLM_CALL_MULTI_PERFORM ==
|
|
||||||
curl_multi_perform(multi_handle, &still_running));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
|
|||||||
http_handle = curl_easy_init();
|
http_handle = curl_easy_init();
|
||||||
|
|
||||||
/* set the options (I left out a few, you'll get the point anyway) */
|
/* set the options (I left out a few, you'll get the point anyway) */
|
||||||
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
|
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/");
|
||||||
|
|
||||||
curl_easy_setopt(http_handle, CURLOPT_DEBUGFUNCTION, my_trace);
|
curl_easy_setopt(http_handle, CURLOPT_DEBUGFUNCTION, my_trace);
|
||||||
curl_easy_setopt(http_handle, CURLOPT_VERBOSE, 1L);
|
curl_easy_setopt(http_handle, CURLOPT_VERBOSE, 1L);
|
||||||
@@ -130,8 +130,7 @@ int main(int argc, char **argv)
|
|||||||
curl_multi_add_handle(multi_handle, http_handle);
|
curl_multi_add_handle(multi_handle, http_handle);
|
||||||
|
|
||||||
/* we start some action by calling perform right away */
|
/* we start some action by calling perform right away */
|
||||||
while(CURLM_CALL_MULTI_PERFORM ==
|
curl_multi_perform(multi_handle, &still_running);
|
||||||
curl_multi_perform(multi_handle, &still_running));
|
|
||||||
|
|
||||||
while(still_running) {
|
while(still_running) {
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
@@ -181,8 +180,7 @@ int main(int argc, char **argv)
|
|||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
/* timeout or readable/writable sockets */
|
/* timeout or readable/writable sockets */
|
||||||
while(CURLM_CALL_MULTI_PERFORM ==
|
curl_multi_perform(multi_handle, &still_running);
|
||||||
curl_multi_perform(multi_handle, &still_running));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@ int main(int argc, char **argv)
|
|||||||
http_handle2 = curl_easy_init();
|
http_handle2 = curl_easy_init();
|
||||||
|
|
||||||
/* set options */
|
/* set options */
|
||||||
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
|
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/");
|
||||||
|
|
||||||
/* set options */
|
/* set options */
|
||||||
curl_easy_setopt(http_handle2, CURLOPT_URL, "http://localhost/");
|
curl_easy_setopt(http_handle2, CURLOPT_URL, "http://localhost/");
|
||||||
@@ -47,8 +47,7 @@ int main(int argc, char **argv)
|
|||||||
curl_multi_add_handle(multi_handle, http_handle2);
|
curl_multi_add_handle(multi_handle, http_handle2);
|
||||||
|
|
||||||
/* we start some action by calling perform right away */
|
/* we start some action by calling perform right away */
|
||||||
while(CURLM_CALL_MULTI_PERFORM ==
|
curl_multi_perform(multi_handle, &still_running);
|
||||||
curl_multi_perform(multi_handle, &still_running));
|
|
||||||
|
|
||||||
while(still_running) {
|
while(still_running) {
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
@@ -96,8 +95,7 @@ int main(int argc, char **argv)
|
|||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
/* timeout or readable/writable sockets */
|
/* timeout or readable/writable sockets */
|
||||||
while(CURLM_CALL_MULTI_PERFORM ==
|
curl_multi_perform(multi_handle, &still_running);
|
||||||
curl_multi_perform(multi_handle, &still_running));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -58,8 +58,7 @@ int main(int argc, char *argv[])
|
|||||||
if(curl && multi_handle) {
|
if(curl && multi_handle) {
|
||||||
|
|
||||||
/* what URL that receives this POST */
|
/* what URL that receives this POST */
|
||||||
curl_easy_setopt(curl, CURLOPT_URL,
|
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/upload.cgi");
|
||||||
"http://www.fillinyoururl.com/upload.cgi");
|
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
|
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
|
||||||
@@ -67,8 +66,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
curl_multi_add_handle(multi_handle, curl);
|
curl_multi_add_handle(multi_handle, curl);
|
||||||
|
|
||||||
while(CURLM_CALL_MULTI_PERFORM ==
|
curl_multi_perform(multi_handle, &still_running);
|
||||||
curl_multi_perform(multi_handle, &still_running));
|
|
||||||
|
|
||||||
while(still_running) {
|
while(still_running) {
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
@@ -114,12 +112,10 @@ int main(int argc, char *argv[])
|
|||||||
/* select error */
|
/* select error */
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
printf("timeout!\n");
|
|
||||||
default:
|
default:
|
||||||
/* timeout or readable/writable sockets */
|
/* timeout or readable/writable sockets */
|
||||||
printf("perform!\n");
|
printf("perform!\n");
|
||||||
while(CURLM_CALL_MULTI_PERFORM ==
|
curl_multi_perform(multi_handle, &still_running);
|
||||||
curl_multi_perform(multi_handle, &still_running));
|
|
||||||
printf("running: %d!\n", still_running);
|
printf("running: %d!\n", still_running);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
|
|||||||
http_handle = curl_easy_init();
|
http_handle = curl_easy_init();
|
||||||
|
|
||||||
/* set the options (I left out a few, you'll get the point anyway) */
|
/* set the options (I left out a few, you'll get the point anyway) */
|
||||||
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
|
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.example.com/");
|
||||||
|
|
||||||
/* init a multi stack */
|
/* init a multi stack */
|
||||||
multi_handle = curl_multi_init();
|
multi_handle = curl_multi_init();
|
||||||
@@ -41,8 +41,7 @@ int main(int argc, char **argv)
|
|||||||
curl_multi_add_handle(multi_handle, http_handle);
|
curl_multi_add_handle(multi_handle, http_handle);
|
||||||
|
|
||||||
/* we start some action by calling perform right away */
|
/* we start some action by calling perform right away */
|
||||||
while(CURLM_CALL_MULTI_PERFORM ==
|
curl_multi_perform(multi_handle, &still_running);
|
||||||
curl_multi_perform(multi_handle, &still_running));
|
|
||||||
|
|
||||||
while(still_running) {
|
while(still_running) {
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
@@ -92,8 +91,7 @@ int main(int argc, char **argv)
|
|||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
/* timeout or readable/writable sockets */
|
/* timeout or readable/writable sockets */
|
||||||
while(CURLM_CALL_MULTI_PERFORM ==
|
curl_multi_perform(multi_handle, &still_running);
|
||||||
curl_multi_perform(multi_handle, &still_running));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,12 +24,12 @@ int main(int argc, char **argv)
|
|||||||
curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
|
curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
|
||||||
|
|
||||||
/* get the first document */
|
/* get the first document */
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
/* get another document from the same server using the same
|
/* get another document from the same server using the same
|
||||||
connection */
|
connection */
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/docs/");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/docs/");
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
/* always cleanup */
|
/* always cleanup */
|
||||||
|
@@ -51,8 +51,8 @@ int main(void)
|
|||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
/* First set the URL that is about to receive our POST. */
|
/* First set the URL that is about to receive our POST. */
|
||||||
curl_easy_setopt(curl, CURLOPT_URL,
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/index.cgi");
|
||||||
"http://receivingsite.com.pooh/index.cgi");
|
|
||||||
/* Now specify we want to POST data */
|
/* Now specify we want to POST data */
|
||||||
curl_easy_setopt(curl, CURLOPT_POST, 1L);
|
curl_easy_setopt(curl, CURLOPT_POST, 1L);
|
||||||
|
|
||||||
|
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
|
|||||||
headerlist = curl_slist_append(headerlist, buf);
|
headerlist = curl_slist_append(headerlist, buf);
|
||||||
if(curl) {
|
if(curl) {
|
||||||
/* what URL that receives this POST */
|
/* what URL that receives this POST */
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/examplepost.cgi");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/examplepost.cgi");
|
||||||
if ( (argc == 2) && (!strcmp(argv[1], "noexpectheader")) )
|
if ( (argc == 2) && (!strcmp(argv[1], "noexpectheader")) )
|
||||||
/* only disable 100-continue header if explicitly requested */
|
/* only disable 100-continue header if explicitly requested */
|
||||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
|
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
|
||||||
|
@@ -75,7 +75,7 @@ int main(void)
|
|||||||
|
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||||
|
|
||||||
/* use platform-specific functions for codeset conversions */
|
/* use platform-specific functions for codeset conversions */
|
||||||
curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION,
|
curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION,
|
||||||
|
@@ -48,13 +48,13 @@ int main(void)
|
|||||||
CURL *curl;
|
CURL *curl;
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
/* Minimalistic http request */
|
/* Minimalistic http request */
|
||||||
const char *request = "GET / HTTP/1.0\r\nHost: curl.haxx.se\r\n\r\n";
|
const char *request = "GET / HTTP/1.0\r\nHost: example.com\r\n\r\n";
|
||||||
int sockfd; /* socket */
|
int sockfd; /* socket */
|
||||||
size_t iolen;
|
size_t iolen;
|
||||||
|
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||||
/* Do not do the transfer - only connect to host */
|
/* Do not do the transfer - only connect to host */
|
||||||
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
|
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
@@ -35,7 +35,7 @@ int main(int argc, char **argv)
|
|||||||
curl_handle = curl_easy_init();
|
curl_handle = curl_easy_init();
|
||||||
|
|
||||||
/* set URL to get */
|
/* set URL to get */
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://curl.haxx.se");
|
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://example.com");
|
||||||
|
|
||||||
/* no progress meter please */
|
/* no progress meter please */
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);
|
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);
|
||||||
|
@@ -17,7 +17,7 @@ int main(void)
|
|||||||
|
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
/* always cleanup */
|
/* always cleanup */
|
||||||
|
@@ -20,7 +20,7 @@ int main(void)
|
|||||||
|
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "http://posthere.com");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postthis);
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postthis);
|
||||||
|
|
||||||
/* if we don't provide POSTFIELDSIZE, libcurl will strlen() by
|
/* if we don't provide POSTFIELDSIZE, libcurl will strlen() by
|
||||||
|
192
docs/examples/smtp-multi.c
Normal file
192
docs/examples/smtp-multi.c
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This is an example application source code sending SMTP mail using the
|
||||||
|
* multi interface.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <curl/curl.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is the list of basic details you need to tweak to get things right.
|
||||||
|
*/
|
||||||
|
#define USERNAME "user@example.com"
|
||||||
|
#define PASSWORD "123qwerty"
|
||||||
|
#define SMTPSERVER "smtp.example.com"
|
||||||
|
#define SMTPPORT ":587" /* it is a colon+port string, but you can set it
|
||||||
|
to "" to use the default port */
|
||||||
|
#define RECEPIENT "receipient@example.com"
|
||||||
|
#define MAILFROM "<realuser@example.com>"
|
||||||
|
|
||||||
|
#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
|
||||||
|
|
||||||
|
/* Note that you should include the actual meta data headers here as well if
|
||||||
|
you want the mail to have a Subject, another From:, show a To: or whatever
|
||||||
|
you think your mail should feature! */
|
||||||
|
static const char *text[]={
|
||||||
|
"one\n",
|
||||||
|
"two\n",
|
||||||
|
"three\n",
|
||||||
|
" Hello, this is CURL email SMTP\n",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
struct WriteThis {
|
||||||
|
int counter;
|
||||||
|
};
|
||||||
|
|
||||||
|
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
|
||||||
|
{
|
||||||
|
struct WriteThis *pooh = (struct WriteThis *)userp;
|
||||||
|
const char *data;
|
||||||
|
|
||||||
|
if(size*nmemb < 1)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
data = text[pooh->counter];
|
||||||
|
|
||||||
|
if(data) {
|
||||||
|
size_t len = strlen(data);
|
||||||
|
memcpy(ptr, data, len);
|
||||||
|
pooh->counter++; /* advance pointer */
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
return 0; /* no more data left to deliver */
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct timeval tvnow(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
** time() returns the value of time in seconds since the Epoch.
|
||||||
|
*/
|
||||||
|
struct timeval now;
|
||||||
|
now.tv_sec = (long)time(NULL);
|
||||||
|
now.tv_usec = 0;
|
||||||
|
return now;
|
||||||
|
}
|
||||||
|
|
||||||
|
static long tvdiff(struct timeval newer, struct timeval older)
|
||||||
|
{
|
||||||
|
return (newer.tv_sec-older.tv_sec)*1000+
|
||||||
|
(newer.tv_usec-older.tv_usec)/1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
CURL *curl;
|
||||||
|
CURLM *mcurl;
|
||||||
|
int still_running = 1;
|
||||||
|
struct timeval mp_start;
|
||||||
|
char mp_timedout = 0;
|
||||||
|
struct WriteThis pooh;
|
||||||
|
struct curl_slist* rcpt_list = NULL;
|
||||||
|
|
||||||
|
pooh.counter = 0;
|
||||||
|
|
||||||
|
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||||
|
|
||||||
|
curl = curl_easy_init();
|
||||||
|
if(!curl)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
mcurl = curl_multi_init();
|
||||||
|
if(!mcurl)
|
||||||
|
return 2;
|
||||||
|
|
||||||
|
rcpt_list = curl_slist_append(rcpt_list, RECEPIENT);
|
||||||
|
/* more addresses can be added here
|
||||||
|
rcpt_list = curl_slist_append(rcpt_list, "others@example.com");
|
||||||
|
*/
|
||||||
|
|
||||||
|
curl_easy_setopt(curl, CURLOPT_URL, "smtp://" SMTPSERVER SMTPPORT);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_USERNAME, USERNAME);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_PASSWORD, PASSWORD);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_MAIL_FROM, MAILFROM);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, rcpt_list);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER,0);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_READDATA, &pooh);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_SSLVERSION, 0);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, 0);
|
||||||
|
curl_multi_add_handle(mcurl, curl);
|
||||||
|
|
||||||
|
mp_timedout = 0;
|
||||||
|
mp_start = tvnow();
|
||||||
|
|
||||||
|
/* we start some action by calling perform right away */
|
||||||
|
curl_multi_perform(mcurl, &still_running);
|
||||||
|
|
||||||
|
while(still_running) {
|
||||||
|
struct timeval timeout;
|
||||||
|
int rc; /* select() return code */
|
||||||
|
|
||||||
|
fd_set fdread;
|
||||||
|
fd_set fdwrite;
|
||||||
|
fd_set fdexcep;
|
||||||
|
int maxfd = -1;
|
||||||
|
|
||||||
|
long curl_timeo = -1;
|
||||||
|
|
||||||
|
FD_ZERO(&fdread);
|
||||||
|
FD_ZERO(&fdwrite);
|
||||||
|
FD_ZERO(&fdexcep);
|
||||||
|
|
||||||
|
/* set a suitable timeout to play around with */
|
||||||
|
timeout.tv_sec = 1;
|
||||||
|
timeout.tv_usec = 0;
|
||||||
|
|
||||||
|
curl_multi_timeout(mcurl, &curl_timeo);
|
||||||
|
if(curl_timeo >= 0) {
|
||||||
|
timeout.tv_sec = curl_timeo / 1000;
|
||||||
|
if(timeout.tv_sec > 1)
|
||||||
|
timeout.tv_sec = 1;
|
||||||
|
else
|
||||||
|
timeout.tv_usec = (curl_timeo % 1000) * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* get file descriptors from the transfers */
|
||||||
|
curl_multi_fdset(mcurl, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||||
|
|
||||||
|
/* In a real-world program you OF COURSE check the return code of the
|
||||||
|
function calls. On success, the value of maxfd is guaranteed to be
|
||||||
|
greater or equal than -1. We call select(maxfd + 1, ...), specially in
|
||||||
|
case of (maxfd == -1), we call select(0, ...), which is basically equal
|
||||||
|
to sleep. */
|
||||||
|
|
||||||
|
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||||
|
|
||||||
|
if (tvdiff(tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) {
|
||||||
|
fprintf(stderr, "ABORTING TEST, since it seems "
|
||||||
|
"that it would have run forever.\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(rc) {
|
||||||
|
case -1:
|
||||||
|
/* select error */
|
||||||
|
break;
|
||||||
|
case 0: /* timeout */
|
||||||
|
default: /* action */
|
||||||
|
curl_multi_perform(mcurl, &still_running);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
curl_slist_free_all(rcpt_list);
|
||||||
|
curl_multi_remove_handle(mcurl, curl);
|
||||||
|
curl_multi_cleanup(mcurl);
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
|
curl_global_cleanup();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@@ -91,10 +91,10 @@ void init_locks(void)
|
|||||||
|
|
||||||
/* List of URLs to fetch.*/
|
/* List of URLs to fetch.*/
|
||||||
const char * const urls[]= {
|
const char * const urls[]= {
|
||||||
"https://www.sf.net/",
|
"https://www.example.com/",
|
||||||
"https://www.openssl.org/",
|
"https://www2.example.com/",
|
||||||
"https://www.sf.net/",
|
"https://www3.example.com/",
|
||||||
"https://www.openssl.org/",
|
"https://www4.example.com/",
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *pull_one_url(void *url)
|
static void *pull_one_url(void *url)
|
||||||
|
105
docs/examples/version-check.pl
Executable file
105
docs/examples/version-check.pl
Executable file
@@ -0,0 +1,105 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
#***************************************************************************
|
||||||
|
# _ _ ____ _
|
||||||
|
# Project ___| | | | _ \| |
|
||||||
|
# / __| | | | |_) | |
|
||||||
|
# | (__| |_| | _ <| |___
|
||||||
|
# \___|\___/|_| \_\_____|
|
||||||
|
#
|
||||||
|
# Copyright (C) 1998 - 2010, 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 script accepts a source file as input on the command line.
|
||||||
|
#
|
||||||
|
# It first loads the 'symbols-in-versions' document and stores a lookup
|
||||||
|
# table for all known symbols for which version they were introduced.
|
||||||
|
#
|
||||||
|
# It then scans the given source file to dig up all symbols starting with CURL.
|
||||||
|
# Finally, it sorts the internal list of found symbols (using the version
|
||||||
|
# number as sort key) and then it outputs the most recent version number and
|
||||||
|
# the symbols from that version that are used.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
#
|
||||||
|
# version-check.pl [source file]
|
||||||
|
#
|
||||||
|
|
||||||
|
open(S, "<../libcurl/symbols-in-versions") || die;
|
||||||
|
|
||||||
|
my %doc;
|
||||||
|
my %rem;
|
||||||
|
while(<S>) {
|
||||||
|
if(/(^CURL[^ \n]*) *(.*)/) {
|
||||||
|
my ($sym, $rest)=($1, $2);
|
||||||
|
my @a=split(/ +/, $rest);
|
||||||
|
|
||||||
|
$doc{$sym}=$a[0]; # when it was introduced
|
||||||
|
|
||||||
|
if($a[2]) {
|
||||||
|
# this symbol is documented to have been present the last time
|
||||||
|
# in this release
|
||||||
|
$rem{$sym}=$a[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
close(S);
|
||||||
|
|
||||||
|
sub age {
|
||||||
|
my ($ver)=@_;
|
||||||
|
|
||||||
|
my @s=split(/\./, $ver);
|
||||||
|
return $s[0]*10000+$s[1]*100+$s[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
my %used;
|
||||||
|
open(C, "<$ARGV[0]") || die;
|
||||||
|
|
||||||
|
while(<C>) {
|
||||||
|
if(/\W(CURL[_A-Z0-9v]+)\W/) {
|
||||||
|
#print "$1\n";
|
||||||
|
$used{$1}++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
close(C);
|
||||||
|
|
||||||
|
sub sortversions {
|
||||||
|
my $r = age($doc{$a}) <=> age($doc{$b});
|
||||||
|
if(!$r) {
|
||||||
|
$r = $a cmp $b;
|
||||||
|
}
|
||||||
|
return $r;
|
||||||
|
}
|
||||||
|
|
||||||
|
my @recent = reverse sort sortversions keys %used;
|
||||||
|
|
||||||
|
# the most recent symbol
|
||||||
|
my $newsym = $recent[0];
|
||||||
|
# the most recent version
|
||||||
|
my $newver = $doc{$newsym};
|
||||||
|
|
||||||
|
print "The scanned source uses these symbols introduced in $newver:\n";
|
||||||
|
|
||||||
|
for my $w (@recent) {
|
||||||
|
if($doc{$w} eq $newver) {
|
||||||
|
printf " $w\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@@ -84,6 +84,13 @@ If this option is set and libcurl has been built with the standard name
|
|||||||
resolver, timeouts will not occur while the name resolve takes place.
|
resolver, timeouts will not occur while the name resolve takes place.
|
||||||
Consider building libcurl with c-ares support to enable asynchronous DNS
|
Consider building libcurl with c-ares support to enable asynchronous DNS
|
||||||
lookups, which enables nice timeouts for name resolves without signals.
|
lookups, which enables nice timeouts for name resolves without signals.
|
||||||
|
|
||||||
|
Setting \fICURLOPT_NOSIGNAL\fP to 1 makes libcurl NOT ask the system to ignore
|
||||||
|
SIGPIPE signals, which otherwise are sent by the system when trying to send
|
||||||
|
data to a socket which is closed in the other end. libcurl makes an effort to
|
||||||
|
never cause such SIGPIPEs to trigger, but some operating systems have no way
|
||||||
|
to avoid them and even on those that have there are some corner cases when
|
||||||
|
they may still happen, contrary to our desire.
|
||||||
.IP CURLOPT_WILDCARDMATCH
|
.IP CURLOPT_WILDCARDMATCH
|
||||||
Set this option to 1 if you want to transfer multiple files according to a
|
Set this option to 1 if you want to transfer multiple files according to a
|
||||||
file name pattern. The pattern can be specified as part of the
|
file name pattern. The pattern can be specified as part of the
|
||||||
@@ -858,6 +865,10 @@ secure.
|
|||||||
This is a convenience macro that sets all bits except Basic and thus makes
|
This is a convenience macro that sets all bits except Basic and thus makes
|
||||||
libcurl pick any it finds suitable. libcurl will automatically select the one
|
libcurl pick any it finds suitable. libcurl will automatically select the one
|
||||||
it finds most secure.
|
it finds most secure.
|
||||||
|
.IP CURLAUTH_ONLY
|
||||||
|
This is a meta symbol. Or this value together with a single specific auth
|
||||||
|
value to force libcurl to probe for un-restricted auth and if not, only that
|
||||||
|
single auth algorithm is acceptable. (Added in 7.21.3)
|
||||||
.RE
|
.RE
|
||||||
.IP CURLOPT_PROXYAUTH
|
.IP CURLOPT_PROXYAUTH
|
||||||
Pass a long as parameter, which is set to a bitmask, to tell libcurl which
|
Pass a long as parameter, which is set to a bitmask, to tell libcurl which
|
||||||
@@ -1259,9 +1270,15 @@ A parameter set to 1 tells the library to just list the names of files in a
|
|||||||
directory, instead of doing a full directory listing that would include file
|
directory, instead of doing a full directory listing that would include file
|
||||||
sizes, dates etc. This works for FTP and SFTP URLs.
|
sizes, dates etc. This works for FTP and SFTP URLs.
|
||||||
|
|
||||||
This causes an FTP NLST command to be sent on an FTP server. Beware
|
This causes an FTP NLST command to be sent on an FTP server. Beware that some
|
||||||
that some FTP servers list only files in their response to NLST; they
|
FTP servers list only files in their response to NLST; they might not include
|
||||||
might not include subdirectories and symbolic links.
|
subdirectories and symbolic links.
|
||||||
|
|
||||||
|
Setting this option to 1 also implies a directory listing even if the URL
|
||||||
|
doesn't end with a slash, which otherwise is necessary.
|
||||||
|
|
||||||
|
Do NOT use this option if you also use \fICURLOPT_WILDCARDMATCH\fP as it will
|
||||||
|
effectively break that feature then.
|
||||||
|
|
||||||
(This option was known as CURLOPT_FTPLISTONLY up to 7.16.4)
|
(This option was known as CURLOPT_FTPLISTONLY up to 7.16.4)
|
||||||
.IP CURLOPT_APPEND
|
.IP CURLOPT_APPEND
|
||||||
@@ -1331,22 +1348,6 @@ it already uses for the control connection. But it will use the port number
|
|||||||
from the 227-response. (Added in 7.14.2)
|
from the 227-response. (Added in 7.14.2)
|
||||||
|
|
||||||
This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
|
This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
|
||||||
.IP CURLOPT_USE_SSL
|
|
||||||
Pass a long using one of the values from below, to make libcurl use your
|
|
||||||
desired level of SSL for the FTP transfer. (Added in 7.11.0)
|
|
||||||
|
|
||||||
(This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants
|
|
||||||
were known as CURLFTPSSL_*)
|
|
||||||
.RS
|
|
||||||
.IP CURLUSESSL_NONE
|
|
||||||
Don't attempt to use SSL.
|
|
||||||
.IP CURLUSESSL_TRY
|
|
||||||
Try using SSL, proceed as normal otherwise.
|
|
||||||
.IP CURLUSESSL_CONTROL
|
|
||||||
Require SSL for the control connection or fail with \fICURLE_USE_SSL_FAILED\fP.
|
|
||||||
.IP CURLUSESSL_ALL
|
|
||||||
Require SSL for all communication or fail with \fICURLE_USE_SSL_FAILED\fP.
|
|
||||||
.RE
|
|
||||||
.IP CURLOPT_FTPSSLAUTH
|
.IP CURLOPT_FTPSSLAUTH
|
||||||
Pass a long using one of the values from below, to alter how libcurl issues
|
Pass a long using one of the values from below, to alter how libcurl issues
|
||||||
\&"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see
|
\&"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see
|
||||||
@@ -1518,7 +1519,9 @@ to 0 (zero, the default), \fICURLOPT_TRANSFERTEXT\fP has no effect when doing
|
|||||||
FTP via a proxy. Beware that not all proxies support this feature. (Added in
|
FTP via a proxy. Beware that not all proxies support this feature. (Added in
|
||||||
7.18.0)
|
7.18.0)
|
||||||
.IP CURLOPT_CRLF
|
.IP CURLOPT_CRLF
|
||||||
Convert Unix newlines to CRLF newlines on transfers.
|
Pass a long. If the value is set to 1 (one), libcurl converts Unix newlines to
|
||||||
|
CRLF newlines on transfers. Disable this option again by setting the value to
|
||||||
|
0 (zero).
|
||||||
.IP CURLOPT_RANGE
|
.IP CURLOPT_RANGE
|
||||||
Pass a char * as parameter, which should contain the specified range you
|
Pass a char * as parameter, which should contain the specified range you
|
||||||
want. It should be in the format "X-Y", where X or Y may be left out. HTTP
|
want. It should be in the format "X-Y", where X or Y may be left out. HTTP
|
||||||
@@ -1539,6 +1542,10 @@ want the transfer to start from. Set this option to 0 to make the transfer
|
|||||||
start from the beginning (effectively disabling resume). For FTP, set this
|
start from the beginning (effectively disabling resume). For FTP, set this
|
||||||
option to -1 to make the transfer start from the end of the target file
|
option to -1 to make the transfer start from the end of the target file
|
||||||
(useful to continue an interrupted upload).
|
(useful to continue an interrupted upload).
|
||||||
|
|
||||||
|
When doing uploads with FTP, the resume position is where in the local/source
|
||||||
|
file libcurl should try to resume the upload from and it will then append the
|
||||||
|
source file to the remote target file.
|
||||||
.IP CURLOPT_RESUME_FROM_LARGE
|
.IP CURLOPT_RESUME_FROM_LARGE
|
||||||
Pass a curl_off_t as parameter. It contains the offset in number of bytes that
|
Pass a curl_off_t as parameter. It contains the offset in number of bytes that
|
||||||
you want the transfer to start from. (Added in 7.11.0)
|
you want the transfer to start from. (Added in 7.11.0)
|
||||||
@@ -1753,6 +1760,47 @@ 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
|
\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
|
application can obtain the most recently used socket for special data
|
||||||
transfers. (Added in 7.15.2)
|
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
|
||||||
|
desired level of SSL for the transfer. (Added in 7.11.0)
|
||||||
|
|
||||||
|
This is for enabling SSL/TLS when you use FTP, SMTP, POP3, IMAP etc.
|
||||||
|
|
||||||
|
(This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants
|
||||||
|
were known as CURLFTPSSL_*)
|
||||||
|
.RS
|
||||||
|
.IP CURLUSESSL_NONE
|
||||||
|
Don't attempt to use SSL.
|
||||||
|
.IP CURLUSESSL_TRY
|
||||||
|
Try using SSL, proceed as normal otherwise.
|
||||||
|
.IP CURLUSESSL_CONTROL
|
||||||
|
Require SSL for the control connection or fail with \fICURLE_USE_SSL_FAILED\fP.
|
||||||
|
.IP CURLUSESSL_ALL
|
||||||
|
Require SSL for all communication or fail with \fICURLE_USE_SSL_FAILED\fP.
|
||||||
|
.RE
|
||||||
|
.IP CURLOPT_RESOLVE
|
||||||
|
Pass a pointer to a linked list of strings with host name resolve information
|
||||||
|
to use for requests with this handle. The linked list should be a fully valid
|
||||||
|
list of \fBstruct curl_slist\fP structs properly filled in. Use
|
||||||
|
\fIcurl_slist_append(3)\fP to create the list and \fIcurl_slist_free_all(3)\fP
|
||||||
|
to clean up an entire list.
|
||||||
|
|
||||||
|
Each single name resolve string should be written using the format
|
||||||
|
HOST:PORT:ADDRESS where HOST is the name libcurl will try to resolve, PORT is
|
||||||
|
the port number of the service where libcurl wants to connect to the HOST and
|
||||||
|
ADDRESS is the numerical IP address. If libcurl is built to support IPv6,
|
||||||
|
ADDRESS can of course be either IPv4 or IPv6 style addressing.
|
||||||
|
|
||||||
|
This option effectively pre-populates the DNS cache with entries for the
|
||||||
|
host+port pair so redirects and everything that operations against the
|
||||||
|
HOST+PORT will instead use your provided ADDRESS.
|
||||||
|
|
||||||
|
You can remove names from the DNS cache again, to stop providing these fake
|
||||||
|
resolves, by including a string in the linked list that uses the format
|
||||||
|
\&"-HOST:PORT". The host name must be prefixed with a dash, and the host name
|
||||||
|
and port number must exactly match what was already added previously.
|
||||||
|
|
||||||
|
(Added in 7.12.3)
|
||||||
.SH SSL and SECURITY OPTIONS
|
.SH SSL and SECURITY OPTIONS
|
||||||
.IP CURLOPT_SSLCERT
|
.IP CURLOPT_SSLCERT
|
||||||
Pass a pointer to a zero terminated string as parameter. The string should be
|
Pass a pointer to a zero terminated string as parameter. The string should be
|
||||||
|
@@ -275,6 +275,10 @@ NSS
|
|||||||
|
|
||||||
is claimed to be thread-safe already without anything required.
|
is claimed to be thread-safe already without anything required.
|
||||||
|
|
||||||
|
PolarSSL
|
||||||
|
|
||||||
|
Required actions unknown.
|
||||||
|
|
||||||
yassl
|
yassl
|
||||||
|
|
||||||
Required actions unknown.
|
Required actions unknown.
|
||||||
@@ -1233,6 +1237,15 @@ are used to generate structured data. Characters like embedded carriage
|
|||||||
returns or ampersands could allow the user to create additional headers or
|
returns or ampersands could allow the user to create additional headers or
|
||||||
fields that could cause malicious transactions.
|
fields that could cause malicious transactions.
|
||||||
|
|
||||||
|
.IP "Server-supplied Names"
|
||||||
|
A server can supply data which the application may, in some cases, use as
|
||||||
|
a file name. The curl command-line tool does this with --remote-header-name,
|
||||||
|
using the Content-disposition: header to generate a file name. An application
|
||||||
|
could also use CURLINFO_EFFECTIVE_URL to generate a file name from a
|
||||||
|
server-supplied redirect URL. Special care must be taken to sanitize such
|
||||||
|
names to avoid the possibility of a malicious server supplying one like
|
||||||
|
"/etc/passwd", "\autoexec.bat" or even ".bashrc".
|
||||||
|
|
||||||
.IP "Server Certificates"
|
.IP "Server Certificates"
|
||||||
A secure application should never use the CURLOPT_SSL_VERIFYPEER option to
|
A secure application should never use the CURLOPT_SSL_VERIFYPEER option to
|
||||||
disable certificate validation. There are numerous attacks that are enabled
|
disable certificate validation. There are numerous attacks that are enabled
|
||||||
|
@@ -61,7 +61,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
|
|||||||
AH_TEMPLATE([LIBCURL_PROTOCOL_SMTP],[Defined if libcurl supports SMTP])
|
AH_TEMPLATE([LIBCURL_PROTOCOL_SMTP],[Defined if libcurl supports SMTP])
|
||||||
|
|
||||||
AC_ARG_WITH(libcurl,
|
AC_ARG_WITH(libcurl,
|
||||||
AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
|
AC_HELP_STRING([--with-libcurl=PREFIX],[look for the curl library in PREFIX/lib and headers in PREFIX/include]),
|
||||||
[_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
|
[_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
|
||||||
|
|
||||||
if test "$_libcurl_with" != "no" ; then
|
if test "$_libcurl_with" != "no" ; then
|
||||||
@@ -75,10 +75,10 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
|
|||||||
if test -d "$_libcurl_with" ; then
|
if test -d "$_libcurl_with" ; then
|
||||||
LIBCURL_CPPFLAGS="-I$withval/include"
|
LIBCURL_CPPFLAGS="-I$withval/include"
|
||||||
_libcurl_ldflags="-L$withval/lib"
|
_libcurl_ldflags="-L$withval/lib"
|
||||||
AC_PATH_PROG([_libcurl_config],[curl-config],["$withval/bin"],
|
AC_PATH_PROG([_libcurl_config],[curl-config],[],
|
||||||
["$withval/bin"])
|
["$withval/bin"])
|
||||||
else
|
else
|
||||||
AC_PATH_PROG([_libcurl_config],[curl-config])
|
AC_PATH_PROG([_libcurl_config],[curl-config],[],[$PATH])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x$_libcurl_config != "x" ; then
|
if test x$_libcurl_config != "x" ; then
|
||||||
|
@@ -18,18 +18,26 @@ CURLAUTH_BASIC 7.10.6
|
|||||||
CURLAUTH_DIGEST 7.10.6
|
CURLAUTH_DIGEST 7.10.6
|
||||||
CURLAUTH_DIGEST_IE 7.19.3
|
CURLAUTH_DIGEST_IE 7.19.3
|
||||||
CURLAUTH_GSSNEGOTIATE 7.10.6
|
CURLAUTH_GSSNEGOTIATE 7.10.6
|
||||||
|
CURLAUTH_NONE 7.10.6
|
||||||
CURLAUTH_NTLM 7.10.6
|
CURLAUTH_NTLM 7.10.6
|
||||||
|
CURLAUTH_ONLY 7.21.3
|
||||||
CURLCLOSEPOLICY_CALLBACK 7.7
|
CURLCLOSEPOLICY_CALLBACK 7.7
|
||||||
CURLCLOSEPOLICY_LEAST_RECENTLY_USED 7.7
|
CURLCLOSEPOLICY_LEAST_RECENTLY_USED 7.7
|
||||||
CURLCLOSEPOLICY_LEAST_TRAFFIC 7.7
|
CURLCLOSEPOLICY_LEAST_TRAFFIC 7.7
|
||||||
|
CURLCLOSEPOLICY_NONE 7.7
|
||||||
CURLCLOSEPOLICY_OLDEST 7.7
|
CURLCLOSEPOLICY_OLDEST 7.7
|
||||||
CURLCLOSEPOLICY_SLOWEST 7.7
|
CURLCLOSEPOLICY_SLOWEST 7.7
|
||||||
CURLE_ABORTED_BY_CALLBACK 7.1
|
CURLE_ABORTED_BY_CALLBACK 7.1
|
||||||
CURLE_AGAIN 7.18.2
|
CURLE_AGAIN 7.18.2
|
||||||
|
CURLE_ALREADY_COMPLETE 7.7.2
|
||||||
CURLE_BAD_CALLING_ORDER 7.1 7.17.0
|
CURLE_BAD_CALLING_ORDER 7.1 7.17.0
|
||||||
CURLE_BAD_CONTENT_ENCODING 7.10
|
CURLE_BAD_CONTENT_ENCODING 7.10
|
||||||
|
CURLE_BAD_DOWNLOAD_RESUME 7.10
|
||||||
CURLE_BAD_FUNCTION_ARGUMENT 7.1
|
CURLE_BAD_FUNCTION_ARGUMENT 7.1
|
||||||
CURLE_BAD_PASSWORD_ENTERED - 7.17.0
|
CURLE_BAD_PASSWORD_ENTERED - 7.17.0
|
||||||
|
CURLE_CHUNK_FAILED 7.20.1
|
||||||
|
CURLE_CONV_FAILED 7.15.4
|
||||||
|
CURLE_CONV_REQD 7.15.4
|
||||||
CURLE_COULDNT_CONNECT 7.1
|
CURLE_COULDNT_CONNECT 7.1
|
||||||
CURLE_COULDNT_RESOLVE_HOST 7.1
|
CURLE_COULDNT_RESOLVE_HOST 7.1
|
||||||
CURLE_COULDNT_RESOLVE_PROXY 7.1
|
CURLE_COULDNT_RESOLVE_PROXY 7.1
|
||||||
@@ -37,7 +45,9 @@ CURLE_FAILED_INIT 7.1
|
|||||||
CURLE_FILESIZE_EXCEEDED 7.10.8
|
CURLE_FILESIZE_EXCEEDED 7.10.8
|
||||||
CURLE_FILE_COULDNT_READ_FILE 7.1
|
CURLE_FILE_COULDNT_READ_FILE 7.1
|
||||||
CURLE_FTP_ACCESS_DENIED 7.1
|
CURLE_FTP_ACCESS_DENIED 7.1
|
||||||
|
CURLE_FTP_BAD_DOWNLOAD_RESUME 7.1
|
||||||
CURLE_FTP_BAD_DOWNLOAD_RESUME 7.1 7.1
|
CURLE_FTP_BAD_DOWNLOAD_RESUME 7.1 7.1
|
||||||
|
CURLE_FTP_BAD_FILE_LIST 7.20.1
|
||||||
CURLE_FTP_CANT_GET_HOST 7.1
|
CURLE_FTP_CANT_GET_HOST 7.1
|
||||||
CURLE_FTP_CANT_RECONNECT 7.1 7.17.0
|
CURLE_FTP_CANT_RECONNECT 7.1 7.17.0
|
||||||
CURLE_FTP_COULDNT_GET_SIZE 7.1 7.17.0
|
CURLE_FTP_COULDNT_GET_SIZE 7.1 7.17.0
|
||||||
@@ -65,11 +75,13 @@ CURLE_HTTP_NOT_FOUND 7.1
|
|||||||
CURLE_HTTP_PORT_FAILED - 7.12.0
|
CURLE_HTTP_PORT_FAILED - 7.12.0
|
||||||
CURLE_HTTP_POST_ERROR 7.1
|
CURLE_HTTP_POST_ERROR 7.1
|
||||||
CURLE_HTTP_RANGE_ERROR 7.1 7.17.0
|
CURLE_HTTP_RANGE_ERROR 7.1 7.17.0
|
||||||
|
CURLE_HTTP_RETURNED_ERROR 7.10.3
|
||||||
CURLE_INTERFACE_FAILED 7.12.0
|
CURLE_INTERFACE_FAILED 7.12.0
|
||||||
CURLE_LDAP_CANNOT_BIND 7.1
|
CURLE_LDAP_CANNOT_BIND 7.1
|
||||||
CURLE_LDAP_INVALID_URL 7.10.8
|
CURLE_LDAP_INVALID_URL 7.10.8
|
||||||
CURLE_LDAP_SEARCH_FAILED 7.1
|
CURLE_LDAP_SEARCH_FAILED 7.1
|
||||||
CURLE_LIBRARY_NOT_FOUND 7.1 7.17.0
|
CURLE_LIBRARY_NOT_FOUND 7.1 7.17.0
|
||||||
|
CURLE_LOGIN_DENIED 7.13.1
|
||||||
CURLE_MALFORMAT_USER 7.1 7.17.0
|
CURLE_MALFORMAT_USER 7.1 7.17.0
|
||||||
CURLE_OK 7.1
|
CURLE_OK 7.1
|
||||||
CURLE_OPERATION_TIMEDOUT 7.17.0
|
CURLE_OPERATION_TIMEDOUT 7.17.0
|
||||||
@@ -83,12 +95,16 @@ CURLE_READ_ERROR 7.1
|
|||||||
CURLE_RECV_ERROR 7.13.0
|
CURLE_RECV_ERROR 7.13.0
|
||||||
CURLE_REMOTE_ACCESS_DENIED 7.17.0
|
CURLE_REMOTE_ACCESS_DENIED 7.17.0
|
||||||
CURLE_REMOTE_DISK_FULL 7.17.0
|
CURLE_REMOTE_DISK_FULL 7.17.0
|
||||||
|
CURLE_REMOTE_FILE_EXISTS 7.17.0
|
||||||
|
CURLE_REMOTE_FILE_NOT_FOUND 7.16.1
|
||||||
CURLE_RTSP_CSEQ_ERROR 7.20.0
|
CURLE_RTSP_CSEQ_ERROR 7.20.0
|
||||||
CURLE_RTSP_SESSION_ERROR 7.20.0
|
CURLE_RTSP_SESSION_ERROR 7.20.0
|
||||||
CURLE_SEND_ERROR 7.13.0
|
CURLE_SEND_ERROR 7.13.0
|
||||||
|
CURLE_SEND_FAIL_REWIND 7.12.3
|
||||||
CURLE_SHARE_IN_USE - 7.17.0
|
CURLE_SHARE_IN_USE - 7.17.0
|
||||||
CURLE_SSH 7.16.1
|
CURLE_SSH 7.16.1
|
||||||
CURLE_SSL_CACERT 7.10
|
CURLE_SSL_CACERT 7.10
|
||||||
|
CURLE_SSL_CACERT_BADFILE 7.16.0
|
||||||
CURLE_SSL_CERTPROBLEM 7.10
|
CURLE_SSL_CERTPROBLEM 7.10
|
||||||
CURLE_SSL_CIPHER 7.10
|
CURLE_SSL_CIPHER 7.10
|
||||||
CURLE_SSL_CONNECT_ERROR 7.1
|
CURLE_SSL_CONNECT_ERROR 7.1
|
||||||
@@ -104,20 +120,59 @@ CURLE_TFTP_DISKFULL 7.15.0 7.17.0
|
|||||||
CURLE_TFTP_EXISTS 7.15.0 7.17.0
|
CURLE_TFTP_EXISTS 7.15.0 7.17.0
|
||||||
CURLE_TFTP_ILLEGAL 7.15.0
|
CURLE_TFTP_ILLEGAL 7.15.0
|
||||||
CURLE_TFTP_NOSUCHUSER 7.15.0
|
CURLE_TFTP_NOSUCHUSER 7.15.0
|
||||||
|
CURLE_TFTP_NOTFOUND 7.15.0
|
||||||
|
CURLE_TFTP_PERM 7.15.0
|
||||||
CURLE_TFTP_UNKNOWNID 7.15.0
|
CURLE_TFTP_UNKNOWNID 7.15.0
|
||||||
CURLE_TOO_MANY_REDIRECTS 7.5
|
CURLE_TOO_MANY_REDIRECTS 7.5
|
||||||
CURLE_UNKNOWN_TELNET_OPTION 7.7
|
CURLE_UNKNOWN_TELNET_OPTION 7.7
|
||||||
CURLE_UNSUPPORTED_PROTOCOL 7.1
|
CURLE_UNSUPPORTED_PROTOCOL 7.1
|
||||||
|
CURLE_UPLOAD_FAILED 7.16.3
|
||||||
CURLE_URL_MALFORMAT 7.1
|
CURLE_URL_MALFORMAT 7.1
|
||||||
CURLE_URL_MALFORMAT_USER 7.1 7.17.0
|
CURLE_URL_MALFORMAT_USER 7.1 7.17.0
|
||||||
CURLE_USE_SSL_FAILED 7.17.0
|
CURLE_USE_SSL_FAILED 7.17.0
|
||||||
CURLE_WRITE_ERROR 7.1
|
CURLE_WRITE_ERROR 7.1
|
||||||
|
CURLFILETYPE_DEVICE_BLOCK 7.21.0
|
||||||
|
CURLFILETYPE_DEVICE_CHAR 7.21.0
|
||||||
|
CURLFILETYPE_DIRECTORY 7.21.0
|
||||||
|
CURLFILETYPE_DOOR 7.21.0
|
||||||
|
CURLFILETYPE_FILE 7.21.0
|
||||||
|
CURLFILETYPE_NAMEDPIPE 7.21.0
|
||||||
|
CURLFILETYPE_SOCKET 7.21.0
|
||||||
|
CURLFILETYPE_SYMLINK 7.21.0
|
||||||
|
CURLFILETYPE_UNKNOWN 7.21.0
|
||||||
|
CURLFINFOFLAG_KNOWN_FILENAME 7.21.0
|
||||||
|
CURLFINFOFLAG_KNOWN_FILETYPE 7.21.0
|
||||||
|
CURLFINFOFLAG_KNOWN_GID 7.21.0
|
||||||
|
CURLFINFOFLAG_KNOWN_HLINKCOUNT 7.21.0
|
||||||
|
CURLFINFOFLAG_KNOWN_PERM 7.21.0
|
||||||
|
CURLFINFOFLAG_KNOWN_SIZE 7.21.0
|
||||||
|
CURLFINFOFLAG_KNOWN_TIME 7.21.0
|
||||||
|
CURLFINFOFLAG_KNOWN_UID 7.21.0
|
||||||
|
CURLFORM_ARRAY 7.9.1
|
||||||
|
CURLFORM_BUFFER 7.9.8
|
||||||
|
CURLFORM_BUFFERLENGTH 7.9.8
|
||||||
|
CURLFORM_BUFFERPTR 7.9.8
|
||||||
|
CURLFORM_CONTENTHEADER 7.9.3
|
||||||
|
CURLFORM_CONTENTSLENGTH 7.9.1
|
||||||
|
CURLFORM_CONTENTTYPE 7.9.1
|
||||||
|
CURLFORM_COPYCONTENTS 7.9.1
|
||||||
|
CURLFORM_COPYNAME 7.9.1
|
||||||
|
CURLFORM_END 7.9.1
|
||||||
|
CURLFORM_FILE 7.9.1
|
||||||
|
CURLFORM_FILECONTENT 7.9.1
|
||||||
|
CURLFORM_FILENAME 7.9.6
|
||||||
|
CURLFORM_NAMELENGTH 7.9.1
|
||||||
|
CURLFORM_NOTHING 7.9.1
|
||||||
|
CURLFORM_PTRCONTENTS 7.9.1
|
||||||
|
CURLFORM_PTRNAME 7.9.1
|
||||||
|
CURLFORM_STREAM 7.18.2
|
||||||
CURLFTPAUTH_DEFAULT 7.12.2
|
CURLFTPAUTH_DEFAULT 7.12.2
|
||||||
CURLFTPAUTH_DEFAULT 7.12.2
|
CURLFTPAUTH_DEFAULT 7.12.2
|
||||||
CURLFTPAUTH_SSL 7.12.2
|
CURLFTPAUTH_SSL 7.12.2
|
||||||
CURLFTPAUTH_SSL 7.12.2
|
CURLFTPAUTH_SSL 7.12.2
|
||||||
CURLFTPAUTH_TLS 7.12.2
|
CURLFTPAUTH_TLS 7.12.2
|
||||||
CURLFTPAUTH_TLS 7.12.2
|
CURLFTPAUTH_TLS 7.12.2
|
||||||
|
CURLFTPMETHOD_DEFAULT 7.15.1
|
||||||
CURLFTPMETHOD_MULTICWD 7.15.1
|
CURLFTPMETHOD_MULTICWD 7.15.1
|
||||||
CURLFTPMETHOD_NOCWD 7.15.1
|
CURLFTPMETHOD_NOCWD 7.15.1
|
||||||
CURLFTPMETHOD_SINGLECWD 7.15.1
|
CURLFTPMETHOD_SINGLECWD 7.15.1
|
||||||
@@ -141,7 +196,9 @@ CURLINFO_CONTENT_TYPE 7.9.4
|
|||||||
CURLINFO_COOKIELIST 7.14.1
|
CURLINFO_COOKIELIST 7.14.1
|
||||||
CURLINFO_DATA_IN 7.9.6
|
CURLINFO_DATA_IN 7.9.6
|
||||||
CURLINFO_DATA_OUT 7.9.6
|
CURLINFO_DATA_OUT 7.9.6
|
||||||
|
CURLINFO_DOUBLE 7.4.1
|
||||||
CURLINFO_EFFECTIVE_URL 7.3
|
CURLINFO_EFFECTIVE_URL 7.3
|
||||||
|
CURLINFO_END 7.4.1
|
||||||
CURLINFO_FILETIME 7.5
|
CURLINFO_FILETIME 7.5
|
||||||
CURLINFO_FTP_ENTRY_PATH 7.15.4
|
CURLINFO_FTP_ENTRY_PATH 7.15.4
|
||||||
CURLINFO_HEADER_IN 7.9.6
|
CURLINFO_HEADER_IN 7.9.6
|
||||||
@@ -150,10 +207,14 @@ CURLINFO_HEADER_SIZE 7.4.1
|
|||||||
CURLINFO_HTTPAUTH_AVAIL 7.10.8
|
CURLINFO_HTTPAUTH_AVAIL 7.10.8
|
||||||
CURLINFO_HTTP_CODE 7.4.1 7.10.8
|
CURLINFO_HTTP_CODE 7.4.1 7.10.8
|
||||||
CURLINFO_HTTP_CONNECTCODE 7.10.7
|
CURLINFO_HTTP_CONNECTCODE 7.10.7
|
||||||
|
CURLINFO_LASTONE 7.4.1
|
||||||
CURLINFO_LASTSOCKET 7.15.2
|
CURLINFO_LASTSOCKET 7.15.2
|
||||||
CURLINFO_LOCAL_IP 7.21.0
|
CURLINFO_LOCAL_IP 7.21.0
|
||||||
CURLINFO_LOCAL_PORT 7.21.0
|
CURLINFO_LOCAL_PORT 7.21.0
|
||||||
|
CURLINFO_LONG 7.4.1
|
||||||
|
CURLINFO_MASK 7.4.1
|
||||||
CURLINFO_NAMELOOKUP_TIME 7.4.1
|
CURLINFO_NAMELOOKUP_TIME 7.4.1
|
||||||
|
CURLINFO_NONE 7.4.1
|
||||||
CURLINFO_NUM_CONNECTS 7.12.3
|
CURLINFO_NUM_CONNECTS 7.12.3
|
||||||
CURLINFO_OS_ERRNO 7.12.2
|
CURLINFO_OS_ERRNO 7.12.2
|
||||||
CURLINFO_PRETRANSFER_TIME 7.4.1
|
CURLINFO_PRETRANSFER_TIME 7.4.1
|
||||||
@@ -167,23 +228,61 @@ CURLINFO_REDIRECT_TIME 7.9.7
|
|||||||
CURLINFO_REDIRECT_URL 7.18.2
|
CURLINFO_REDIRECT_URL 7.18.2
|
||||||
CURLINFO_REQUEST_SIZE 7.4.1
|
CURLINFO_REQUEST_SIZE 7.4.1
|
||||||
CURLINFO_RESPONSE_CODE 7.10.8
|
CURLINFO_RESPONSE_CODE 7.10.8
|
||||||
|
CURLINFO_RTSP_CLIENT_CSEQ 7.20.0
|
||||||
|
CURLINFO_RTSP_CSEQ_RECV 7.20.0
|
||||||
|
CURLINFO_RTSP_SERVER_CSEQ 7.20.0
|
||||||
|
CURLINFO_RTSP_SESSION_ID 7.20.0
|
||||||
CURLINFO_SIZE_DOWNLOAD 7.4.1
|
CURLINFO_SIZE_DOWNLOAD 7.4.1
|
||||||
CURLINFO_SIZE_UPLOAD 7.4.1
|
CURLINFO_SIZE_UPLOAD 7.4.1
|
||||||
|
CURLINFO_SLIST 7.12.3
|
||||||
CURLINFO_SPEED_DOWNLOAD 7.4.1
|
CURLINFO_SPEED_DOWNLOAD 7.4.1
|
||||||
CURLINFO_SPEED_UPLOAD 7.4.1
|
CURLINFO_SPEED_UPLOAD 7.4.1
|
||||||
|
CURLINFO_SSL_DATA_IN 7.12.1
|
||||||
|
CURLINFO_SSL_DATA_OUT 7.12.1
|
||||||
CURLINFO_SSL_ENGINES 7.12.3
|
CURLINFO_SSL_ENGINES 7.12.3
|
||||||
CURLINFO_SSL_VERIFYRESULT 7.5
|
CURLINFO_SSL_VERIFYRESULT 7.5
|
||||||
CURLINFO_STARTTRANSFER_TIME 7.9.2
|
CURLINFO_STARTTRANSFER_TIME 7.9.2
|
||||||
|
CURLINFO_STRING 7.4.1
|
||||||
CURLINFO_TEXT 7.9.6
|
CURLINFO_TEXT 7.9.6
|
||||||
CURLINFO_TOTAL_TIME 7.4.1
|
CURLINFO_TOTAL_TIME 7.4.1
|
||||||
|
CURLINFO_TYPEMASK 7.4.1
|
||||||
|
CURLIOCMD_NOP 7.12.3
|
||||||
|
CURLIOCMD_RESTARTREAD 7.12.3
|
||||||
|
CURLIOE_FAILRESTART 7.12.3
|
||||||
|
CURLIOE_OK 7.12.3
|
||||||
|
CURLIOE_UNKNOWNCMD 7.12.3
|
||||||
|
CURLKHMATCH_MISMATCH 7.19.6
|
||||||
|
CURLKHMATCH_MISSING 7.19.6
|
||||||
|
CURLKHMATCH_OK 7.19.6
|
||||||
|
CURLKHSTAT_DEFER 7.19.6
|
||||||
|
CURLKHSTAT_FINE 7.19.6
|
||||||
|
CURLKHSTAT_FINE_ADD_TO_FILE 7.19.6
|
||||||
|
CURLKHSTAT_REJECT 7.19.6
|
||||||
|
CURLKHTYPE_DSS 7.19.6
|
||||||
|
CURLKHTYPE_RSA 7.19.6
|
||||||
|
CURLKHTYPE_RSA1 7.19.6
|
||||||
|
CURLKHTYPE_UNKNOWN 7.19.6
|
||||||
|
CURLMOPT_MAXCONNECTS 7.16.3
|
||||||
|
CURLMOPT_PIPELINING 7.16.0
|
||||||
|
CURLMOPT_SOCKETDATA 7.15.4
|
||||||
|
CURLMOPT_SOCKETFUNCTION 7.15.4
|
||||||
|
CURLMOPT_TIMERDATA 7.16.0
|
||||||
|
CURLMOPT_TIMERFUNCTION 7.16.0
|
||||||
CURLMSG_DONE 7.9.6
|
CURLMSG_DONE 7.9.6
|
||||||
|
CURLMSG_NONE 7.9.6
|
||||||
CURLM_BAD_EASY_HANDLE 7.9.6
|
CURLM_BAD_EASY_HANDLE 7.9.6
|
||||||
CURLM_BAD_HANDLE 7.9.6
|
CURLM_BAD_HANDLE 7.9.6
|
||||||
|
CURLM_BAD_SOCKET 7.15.4
|
||||||
CURLM_CALL_MULTI_PERFORM 7.9.6
|
CURLM_CALL_MULTI_PERFORM 7.9.6
|
||||||
CURLM_CALL_MULTI_SOCKET 7.15.5
|
CURLM_CALL_MULTI_SOCKET 7.15.5
|
||||||
CURLM_INTERNAL_ERROR 7.9.6
|
CURLM_INTERNAL_ERROR 7.9.6
|
||||||
CURLM_OK 7.9.6
|
CURLM_OK 7.9.6
|
||||||
CURLM_OUT_OF_MEMORY 7.9.6
|
CURLM_OUT_OF_MEMORY 7.9.6
|
||||||
|
CURLM_UNKNOWN_OPTION 7.15.4
|
||||||
|
CURLOPTTYPE_FUNCTIONPOINT 7.1
|
||||||
|
CURLOPTTYPE_LONG 7.1
|
||||||
|
CURLOPTTYPE_OBJECTPOINT 7.1
|
||||||
|
CURLOPTTYPE_OFF_T 7.11.0
|
||||||
CURLOPT_ADDRESS_SCOPE 7.19.0
|
CURLOPT_ADDRESS_SCOPE 7.19.0
|
||||||
CURLOPT_APPEND 7.16.4
|
CURLOPT_APPEND 7.16.4
|
||||||
CURLOPT_AUTOREFERER 7.1
|
CURLOPT_AUTOREFERER 7.1
|
||||||
@@ -268,7 +367,7 @@ CURLOPT_IOCTLDATA 7.12.3
|
|||||||
CURLOPT_IOCTLFUNCTION 7.12.3
|
CURLOPT_IOCTLFUNCTION 7.12.3
|
||||||
CURLOPT_IPRESOLVE 7.10.8
|
CURLOPT_IPRESOLVE 7.10.8
|
||||||
CURLOPT_ISSUERCERT 7.19.0
|
CURLOPT_ISSUERCERT 7.19.0
|
||||||
CURLOPT_KEYPASSWD - 7.17.0
|
CURLOPT_KEYPASSWD 7.17.0
|
||||||
CURLOPT_KRB4LEVEL 7.3 7.17.0
|
CURLOPT_KRB4LEVEL 7.3 7.17.0
|
||||||
CURLOPT_KRBLEVEL 7.17.0
|
CURLOPT_KRBLEVEL 7.17.0
|
||||||
CURLOPT_LOCALPORT 7.15.2
|
CURLOPT_LOCALPORT 7.15.2
|
||||||
@@ -328,8 +427,10 @@ CURLOPT_READDATA 7.9.7
|
|||||||
CURLOPT_READFUNCTION 7.1
|
CURLOPT_READFUNCTION 7.1
|
||||||
CURLOPT_REDIR_PROTOCOLS 7.19.4
|
CURLOPT_REDIR_PROTOCOLS 7.19.4
|
||||||
CURLOPT_REFERER 7.1
|
CURLOPT_REFERER 7.1
|
||||||
|
CURLOPT_RESOLVE 7.21.3
|
||||||
CURLOPT_RESUME_FROM 7.1
|
CURLOPT_RESUME_FROM 7.1
|
||||||
CURLOPT_RESUME_FROM_LARGE 7.11.0
|
CURLOPT_RESUME_FROM_LARGE 7.11.0
|
||||||
|
CURLOPT_RTSPHEADER 7.20.0
|
||||||
CURLOPT_RTSP_CLIENT_CSEQ 7.20.0
|
CURLOPT_RTSP_CLIENT_CSEQ 7.20.0
|
||||||
CURLOPT_RTSP_REQUEST 7.20.0
|
CURLOPT_RTSP_REQUEST 7.20.0
|
||||||
CURLOPT_RTSP_SERVER_CSEQ 7.20.0
|
CURLOPT_RTSP_SERVER_CSEQ 7.20.0
|
||||||
@@ -338,6 +439,7 @@ CURLOPT_RTSP_STREAM_URI 7.20.0
|
|||||||
CURLOPT_RTSP_TRANSPORT 7.20.0
|
CURLOPT_RTSP_TRANSPORT 7.20.0
|
||||||
CURLOPT_SEEKDATA 7.18.1
|
CURLOPT_SEEKDATA 7.18.1
|
||||||
CURLOPT_SEEKFUNCTION 7.18.1
|
CURLOPT_SEEKFUNCTION 7.18.1
|
||||||
|
CURLOPT_SERVER_RESPONSE_TIMEOUT 7.20.0
|
||||||
CURLOPT_SHARE 7.10
|
CURLOPT_SHARE 7.10
|
||||||
CURLOPT_SOCKOPTDATA 7.16.0
|
CURLOPT_SOCKOPTDATA 7.16.0
|
||||||
CURLOPT_SOCKOPTFUNCTION 7.16.0
|
CURLOPT_SOCKOPTFUNCTION 7.16.0
|
||||||
@@ -353,6 +455,9 @@ CURLOPT_SOURCE_URL 7.13.0 - 7.15.4
|
|||||||
CURLOPT_SOURCE_USERPWD 7.12.1 - 7.15.4
|
CURLOPT_SOURCE_USERPWD 7.12.1 - 7.15.4
|
||||||
CURLOPT_SSH_AUTH_TYPES 7.16.1
|
CURLOPT_SSH_AUTH_TYPES 7.16.1
|
||||||
CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 7.17.1
|
CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 7.17.1
|
||||||
|
CURLOPT_SSH_KEYDATA 7.19.6
|
||||||
|
CURLOPT_SSH_KEYFUNCTION 7.19.6
|
||||||
|
CURLOPT_SSH_KNOWNHOSTS 7.19.6
|
||||||
CURLOPT_SSH_PRIVATE_KEYFILE 7.16.1
|
CURLOPT_SSH_PRIVATE_KEYFILE 7.16.1
|
||||||
CURLOPT_SSH_PUBLIC_KEYFILE 7.16.1
|
CURLOPT_SSH_PUBLIC_KEYFILE 7.16.1
|
||||||
CURLOPT_SSLCERT 7.1
|
CURLOPT_SSLCERT 7.1
|
||||||
@@ -374,7 +479,7 @@ CURLOPT_SSL_VERIFYPEER 7.4.2
|
|||||||
CURLOPT_STDERR 7.1
|
CURLOPT_STDERR 7.1
|
||||||
CURLOPT_TCP_NODELAY 7.11.2
|
CURLOPT_TCP_NODELAY 7.11.2
|
||||||
CURLOPT_TELNETOPTIONS 7.7
|
CURLOPT_TELNETOPTIONS 7.7
|
||||||
CURLOPT_TFTPBLKSIZE 7.19.4
|
CURLOPT_TFTP_BLKSIZE 7.19.4
|
||||||
CURLOPT_TIMECONDITION 7.1
|
CURLOPT_TIMECONDITION 7.1
|
||||||
CURLOPT_TIMEOUT 7.1
|
CURLOPT_TIMEOUT 7.1
|
||||||
CURLOPT_TIMEOUT_MS 7.16.2
|
CURLOPT_TIMEOUT_MS 7.16.2
|
||||||
@@ -392,11 +497,19 @@ CURLOPT_WILDCARDMATCH 7.21.0
|
|||||||
CURLOPT_WRITEDATA 7.9.7
|
CURLOPT_WRITEDATA 7.9.7
|
||||||
CURLOPT_WRITEFUNCTION 7.1
|
CURLOPT_WRITEFUNCTION 7.1
|
||||||
CURLOPT_WRITEHEADER 7.1
|
CURLOPT_WRITEHEADER 7.1
|
||||||
|
CURLOPT_WRITEINFO 7.1
|
||||||
|
CURLPAUSE_ALL 7.18.0
|
||||||
|
CURLPAUSE_CONT 7.18.0
|
||||||
|
CURLPAUSE_RECV 7.18.0
|
||||||
|
CURLPAUSE_RECV_CONT 7.18.0
|
||||||
|
CURLPAUSE_SEND 7.18.0
|
||||||
|
CURLPAUSE_SEND_CONT 7.18.0
|
||||||
CURLPROTO_ALL 7.19.4
|
CURLPROTO_ALL 7.19.4
|
||||||
CURLPROTO_DICT 7.19.4
|
CURLPROTO_DICT 7.19.4
|
||||||
CURLPROTO_FILE 7.19.4
|
CURLPROTO_FILE 7.19.4
|
||||||
CURLPROTO_FTP 7.19.4
|
CURLPROTO_FTP 7.19.4
|
||||||
CURLPROTO_FTPS 7.19.4
|
CURLPROTO_FTPS 7.19.4
|
||||||
|
CURLPROTO_GOPHER 7.21.2
|
||||||
CURLPROTO_HTTP 7.19.4
|
CURLPROTO_HTTP 7.19.4
|
||||||
CURLPROTO_HTTPS 7.19.4
|
CURLPROTO_HTTPS 7.19.4
|
||||||
CURLPROTO_IMAP 7.20.0
|
CURLPROTO_IMAP 7.20.0
|
||||||
@@ -424,6 +537,19 @@ CURLPROXY_SOCKS4 7.10
|
|||||||
CURLPROXY_SOCKS4A 7.18.0
|
CURLPROXY_SOCKS4A 7.18.0
|
||||||
CURLPROXY_SOCKS5 7.10
|
CURLPROXY_SOCKS5 7.10
|
||||||
CURLPROXY_SOCKS5_HOSTNAME 7.18.0
|
CURLPROXY_SOCKS5_HOSTNAME 7.18.0
|
||||||
|
CURLSHE_BAD_OPTION 7.10.3
|
||||||
|
CURLSHE_INVALID 7.10.3
|
||||||
|
CURLSHE_IN_USE 7.10.3
|
||||||
|
CURLSHE_NOMEM 7.10.3
|
||||||
|
CURLSHE_OK 7.10.3
|
||||||
|
CURLSHOPT_LOCKFUNC 7.10.3
|
||||||
|
CURLSHOPT_NONE 7.10.3
|
||||||
|
CURLSHOPT_SHARE 7.10.3
|
||||||
|
CURLSHOPT_UNLOCKFUNC 7.10.3
|
||||||
|
CURLSHOPT_UNSHARE 7.10.3
|
||||||
|
CURLSHOPT_USERDATA 7.10.3
|
||||||
|
CURLSOCKTYPE_IPCXN 7.15.6
|
||||||
|
CURLSSH_AUTH_ANY 7.16.1
|
||||||
CURLSSH_AUTH_DEFAULT 7.16.1
|
CURLSSH_AUTH_DEFAULT 7.16.1
|
||||||
CURLSSH_AUTH_HOST 7.16.1
|
CURLSSH_AUTH_HOST 7.16.1
|
||||||
CURLSSH_AUTH_KEYBOARD 7.16.1
|
CURLSSH_AUTH_KEYBOARD 7.16.1
|
||||||
@@ -439,6 +565,7 @@ CURLUSESSL_NONE 7.17.0
|
|||||||
CURLUSESSL_TRY 7.17.0
|
CURLUSESSL_TRY 7.17.0
|
||||||
CURLUSESSL_TRY 7.17.0
|
CURLUSESSL_TRY 7.17.0
|
||||||
CURLVERSION_FIRST 7.10
|
CURLVERSION_FIRST 7.10
|
||||||
|
CURLVERSION_FOURTH 7.16.1
|
||||||
CURLVERSION_NOW 7.10
|
CURLVERSION_NOW 7.10
|
||||||
CURLVERSION_SECOND 7.11.1
|
CURLVERSION_SECOND 7.11.1
|
||||||
CURLVERSION_THIRD 7.12.0
|
CURLVERSION_THIRD 7.12.0
|
||||||
@@ -447,21 +574,74 @@ CURL_CHUNK_BGN_FUNC_OK 7.21.0
|
|||||||
CURL_CHUNK_BGN_FUNC_SKIP 7.21.0
|
CURL_CHUNK_BGN_FUNC_SKIP 7.21.0
|
||||||
CURL_CHUNK_END_FUNC_FAIL 7.21.0
|
CURL_CHUNK_END_FUNC_FAIL 7.21.0
|
||||||
CURL_CHUNK_END_FUNC_OK 7.21.0
|
CURL_CHUNK_END_FUNC_OK 7.21.0
|
||||||
|
CURL_CSELECT_ERR 7.16.3
|
||||||
|
CURL_CSELECT_IN 7.16.3
|
||||||
|
CURL_CSELECT_OUT 7.16.3
|
||||||
|
CURL_ERROR_SIZE 7.1
|
||||||
CURL_FNMATCHFUNC_FAIL 7.21.0
|
CURL_FNMATCHFUNC_FAIL 7.21.0
|
||||||
CURL_FNMATCHFUNC_MATCH 7.21.0
|
CURL_FNMATCHFUNC_MATCH 7.21.0
|
||||||
CURL_FNMATCHFUNC_NOMATCH 7.21.0
|
CURL_FNMATCHFUNC_NOMATCH 7.21.0
|
||||||
|
CURL_FORMADD_DISABLED 7.12.1
|
||||||
|
CURL_FORMADD_ILLEGAL_ARRAY 7.9.8
|
||||||
|
CURL_FORMADD_INCOMPLETE 7.9.8
|
||||||
|
CURL_FORMADD_MEMORY 7.9.8
|
||||||
|
CURL_FORMADD_NULL 7.9.8
|
||||||
|
CURL_FORMADD_OK 7.9.8
|
||||||
|
CURL_FORMADD_OPTION_TWICE 7.9.8
|
||||||
|
CURL_FORMADD_UNKNOWN_OPTION 7.9.8
|
||||||
|
CURL_GLOBAL_ALL 7.8
|
||||||
|
CURL_GLOBAL_DEFAULT 7.8
|
||||||
|
CURL_GLOBAL_NOTHING 7.8
|
||||||
|
CURL_GLOBAL_SSL 7.8
|
||||||
|
CURL_GLOBAL_WIN32 7.8.1
|
||||||
CURL_HTTP_VERSION_1_0 7.9.1
|
CURL_HTTP_VERSION_1_0 7.9.1
|
||||||
CURL_HTTP_VERSION_1_1 7.9.1
|
CURL_HTTP_VERSION_1_1 7.9.1
|
||||||
CURL_HTTP_VERSION_NONE 7.9.1
|
CURL_HTTP_VERSION_NONE 7.9.1
|
||||||
CURL_IPRESOLVE_V4 7.10.8
|
CURL_IPRESOLVE_V4 7.10.8
|
||||||
CURL_IPRESOLVE_V6 7.10.8
|
CURL_IPRESOLVE_V6 7.10.8
|
||||||
CURL_IPRESOLVE_WHATEVER 7.10.8
|
CURL_IPRESOLVE_WHATEVER 7.10.8
|
||||||
|
CURL_LOCK_ACCESS_NONE 7.10.3
|
||||||
|
CURL_LOCK_ACCESS_SHARED 7.10.3
|
||||||
|
CURL_LOCK_ACCESS_SINGLE 7.10.3
|
||||||
|
CURL_LOCK_DATA_CONNECT 7.10.3
|
||||||
|
CURL_LOCK_DATA_COOKIE 7.10.3
|
||||||
|
CURL_LOCK_DATA_DNS 7.10.3
|
||||||
|
CURL_LOCK_DATA_NONE 7.10.3
|
||||||
|
CURL_LOCK_DATA_SHARE 7.10.4
|
||||||
|
CURL_LOCK_DATA_SSL_SESSION 7.10.3
|
||||||
|
CURL_MAX_HTTP_HEADER 7.19.7
|
||||||
|
CURL_MAX_WRITE_SIZE 7.9.7
|
||||||
CURL_NETRC_IGNORED 7.9.8
|
CURL_NETRC_IGNORED 7.9.8
|
||||||
CURL_NETRC_OPTIONAL 7.9.8
|
CURL_NETRC_OPTIONAL 7.9.8
|
||||||
CURL_NETRC_REQUIRED 7.9.8
|
CURL_NETRC_REQUIRED 7.9.8
|
||||||
|
CURL_POLL_IN 7.14.0
|
||||||
|
CURL_POLL_INOUT 7.14.0
|
||||||
|
CURL_POLL_NONE 7.14.0
|
||||||
|
CURL_POLL_OUT 7.14.0
|
||||||
|
CURL_POLL_REMOVE 7.14.0
|
||||||
|
CURL_READFUNC_ABORT 7.12.1
|
||||||
|
CURL_READFUNC_PAUSE 7.18.0
|
||||||
|
CURL_REDIR_GET_ALL 7.19.1
|
||||||
|
CURL_REDIR_POST_301 7.19.1
|
||||||
|
CURL_REDIR_POST_302 7.19.1
|
||||||
|
CURL_REDIR_POST_ALL 7.19.1
|
||||||
|
CURL_RTSPREQ_ANNOUNCE 7.20.0
|
||||||
|
CURL_RTSPREQ_DESCRIBE 7.20.0
|
||||||
|
CURL_RTSPREQ_GET_PARAMETER 7.20.0
|
||||||
|
CURL_RTSPREQ_NONE 7.20.0
|
||||||
|
CURL_RTSPREQ_OPTIONS 7.20.0
|
||||||
|
CURL_RTSPREQ_PAUSE 7.20.0
|
||||||
|
CURL_RTSPREQ_PLAY 7.20.0
|
||||||
|
CURL_RTSPREQ_RECEIVE 7.20.0
|
||||||
|
CURL_RTSPREQ_RECORD 7.20.0
|
||||||
|
CURL_RTSPREQ_SETUP 7.20.0
|
||||||
|
CURL_RTSPREQ_SET_PARAMETER 7.20.0
|
||||||
|
CURL_RTSPREQ_TEARDOWN 7.20.0
|
||||||
CURL_SEEKFUNC_CANTSEEK 7.19.5
|
CURL_SEEKFUNC_CANTSEEK 7.19.5
|
||||||
CURL_SEEKFUNC_FAIL 7.19.5
|
CURL_SEEKFUNC_FAIL 7.19.5
|
||||||
CURL_SEEKFUNC_OK 7.19.5
|
CURL_SEEKFUNC_OK 7.19.5
|
||||||
|
CURL_SOCKET_BAD 7.14.0
|
||||||
|
CURL_SOCKET_TIMEOUT 7.14.0
|
||||||
CURL_SSLVERSION_DEFAULT 7.9.2
|
CURL_SSLVERSION_DEFAULT 7.9.2
|
||||||
CURL_SSLVERSION_SSLv2 7.9.2
|
CURL_SSLVERSION_SSLv2 7.9.2
|
||||||
CURL_SSLVERSION_SSLv3 7.9.2
|
CURL_SSLVERSION_SSLv3 7.9.2
|
||||||
@@ -469,6 +649,7 @@ CURL_SSLVERSION_TLSv1 7.9.2
|
|||||||
CURL_TIMECOND_IFMODSINCE 7.9.7
|
CURL_TIMECOND_IFMODSINCE 7.9.7
|
||||||
CURL_TIMECOND_IFUNMODSINCE 7.9.7
|
CURL_TIMECOND_IFUNMODSINCE 7.9.7
|
||||||
CURL_TIMECOND_LASTMOD 7.9.7
|
CURL_TIMECOND_LASTMOD 7.9.7
|
||||||
|
CURL_TIMECOND_NONE 7.9.7
|
||||||
CURL_VERSION_ASYNCHDNS 7.10.7
|
CURL_VERSION_ASYNCHDNS 7.10.7
|
||||||
CURL_VERSION_CONV 7.15.4
|
CURL_VERSION_CONV 7.15.4
|
||||||
CURL_VERSION_CURLDEBUG 7.19.6
|
CURL_VERSION_CURLDEBUG 7.19.6
|
||||||
@@ -483,3 +664,4 @@ CURL_VERSION_NTLM 7.10.6
|
|||||||
CURL_VERSION_SPNEGO 7.10.8
|
CURL_VERSION_SPNEGO 7.10.8
|
||||||
CURL_VERSION_SSL 7.10
|
CURL_VERSION_SSL 7.10
|
||||||
CURL_VERSION_SSPI 7.13.2
|
CURL_VERSION_SSPI 7.13.2
|
||||||
|
CURL_WRITEFUNC_PAUSE 7.18.0
|
||||||
|
@@ -585,6 +585,9 @@ typedef enum {
|
|||||||
#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */
|
#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */
|
||||||
#define CURLAUTH_NTLM (1<<3) /* NTLM */
|
#define CURLAUTH_NTLM (1<<3) /* NTLM */
|
||||||
#define CURLAUTH_DIGEST_IE (1<<4) /* Digest with IE flavour */
|
#define CURLAUTH_DIGEST_IE (1<<4) /* Digest with IE flavour */
|
||||||
|
#define CURLAUTH_ONLY (1<<31) /* used together with a single other
|
||||||
|
type to force no auth or just that
|
||||||
|
single type */
|
||||||
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */
|
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */
|
||||||
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
|
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
|
||||||
|
|
||||||
@@ -722,6 +725,7 @@ typedef enum {
|
|||||||
#define CURLPROTO_RTMPTE (1<<22)
|
#define CURLPROTO_RTMPTE (1<<22)
|
||||||
#define CURLPROTO_RTMPS (1<<23)
|
#define CURLPROTO_RTMPS (1<<23)
|
||||||
#define CURLPROTO_RTMPTS (1<<24)
|
#define CURLPROTO_RTMPTS (1<<24)
|
||||||
|
#define CURLPROTO_GOPHER (1<<25)
|
||||||
#define CURLPROTO_ALL (~0) /* enable everything */
|
#define CURLPROTO_ALL (~0) /* enable everything */
|
||||||
|
|
||||||
/* long may be 32 or 64 bits, but we should never depend on anything else
|
/* long may be 32 or 64 bits, but we should never depend on anything else
|
||||||
@@ -1435,6 +1439,9 @@ typedef enum {
|
|||||||
/* FNMATCH_FUNCTION user pointer */
|
/* FNMATCH_FUNCTION user pointer */
|
||||||
CINIT(FNMATCH_DATA, OBJECTPOINT, 202),
|
CINIT(FNMATCH_DATA, OBJECTPOINT, 202),
|
||||||
|
|
||||||
|
/* send linked-list of name:port:address sets */
|
||||||
|
CINIT(RESOLVE, OBJECTPOINT, 203),
|
||||||
|
|
||||||
CURLOPT_LASTENTRY /* the last unused */
|
CURLOPT_LASTENTRY /* the last unused */
|
||||||
} CURLoption;
|
} CURLoption;
|
||||||
|
|
||||||
|
@@ -30,13 +30,13 @@
|
|||||||
|
|
||||||
/* This is the version number of the libcurl package from which this header
|
/* This is the version number of the libcurl package from which this header
|
||||||
file origins: */
|
file origins: */
|
||||||
#define LIBCURL_VERSION "7.21.1-DEV"
|
#define LIBCURL_VERSION "7.21.3-DEV"
|
||||||
|
|
||||||
/* The numeric version number is also available "in parts" by using these
|
/* The numeric version number is also available "in parts" by using these
|
||||||
defines: */
|
defines: */
|
||||||
#define LIBCURL_VERSION_MAJOR 7
|
#define LIBCURL_VERSION_MAJOR 7
|
||||||
#define LIBCURL_VERSION_MINOR 21
|
#define LIBCURL_VERSION_MINOR 21
|
||||||
#define LIBCURL_VERSION_PATCH 1
|
#define LIBCURL_VERSION_PATCH 3
|
||||||
|
|
||||||
/* This is the numeric version of the libcurl version number, meant for easier
|
/* This is the numeric version of the libcurl version number, meant for easier
|
||||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
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
|
and it is always a greater number in a more recent release. It makes
|
||||||
comparisons with greater than and less than work.
|
comparisons with greater than and less than work.
|
||||||
*/
|
*/
|
||||||
#define LIBCURL_VERSION_NUM 0x071501
|
#define LIBCURL_VERSION_NUM 0x071503
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the date and time when the full source package was created. The
|
* This is the date and time when the full source package was created. The
|
||||||
|
@@ -25,11 +25,16 @@
|
|||||||
/* wraps curl_easy_setopt() with typechecking */
|
/* wraps curl_easy_setopt() with typechecking */
|
||||||
|
|
||||||
/* To add a new kind of warning, add an
|
/* To add a new kind of warning, add an
|
||||||
* if(_curl_is_sometype_option(_curl_opt) && ! _curl_is_sometype(value))
|
* if(_curl_is_sometype_option(_curl_opt))
|
||||||
* _curl_easy_setopt_err_sometype();
|
* if(!_curl_is_sometype(value))
|
||||||
|
* _curl_easy_setopt_err_sometype();
|
||||||
* block and define _curl_is_sometype_option, _curl_is_sometype and
|
* block and define _curl_is_sometype_option, _curl_is_sometype and
|
||||||
* _curl_easy_setopt_err_sometype below
|
* _curl_easy_setopt_err_sometype below
|
||||||
*
|
*
|
||||||
|
* NOTE: We use two nested 'if' statements here instead of the && operator, in
|
||||||
|
* order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x
|
||||||
|
* when compiling with -Wlogical-op.
|
||||||
|
*
|
||||||
* To add an option that uses the same type as an existing option, you'll just
|
* To add an option that uses the same type as an existing option, you'll just
|
||||||
* need to extend the appropriate _curl_*_option macro
|
* need to extend the appropriate _curl_*_option macro
|
||||||
*/
|
*/
|
||||||
@@ -37,51 +42,66 @@
|
|||||||
__extension__ ({ \
|
__extension__ ({ \
|
||||||
__typeof__ (option) _curl_opt = option; \
|
__typeof__ (option) _curl_opt = option; \
|
||||||
if (__builtin_constant_p(_curl_opt)) { \
|
if (__builtin_constant_p(_curl_opt)) { \
|
||||||
if (_curl_is_long_option(_curl_opt) && !_curl_is_long(value)) \
|
if (_curl_is_long_option(_curl_opt)) \
|
||||||
_curl_easy_setopt_err_long(); \
|
if (!_curl_is_long(value)) \
|
||||||
if (_curl_is_off_t_option(_curl_opt) && !_curl_is_off_t(value)) \
|
_curl_easy_setopt_err_long(); \
|
||||||
_curl_easy_setopt_err_curl_off_t(); \
|
if (_curl_is_off_t_option(_curl_opt)) \
|
||||||
if (_curl_is_string_option(_curl_opt) && !_curl_is_string(value)) \
|
if (!_curl_is_off_t(value)) \
|
||||||
_curl_easy_setopt_err_string(); \
|
_curl_easy_setopt_err_curl_off_t(); \
|
||||||
if (_curl_is_write_cb_option(_curl_opt) && !_curl_is_write_cb(value)) \
|
if (_curl_is_string_option(_curl_opt)) \
|
||||||
_curl_easy_setopt_err_write_callback(); \
|
if (!_curl_is_string(value)) \
|
||||||
if ((_curl_opt) == CURLOPT_READFUNCTION && !_curl_is_read_cb(value)) \
|
_curl_easy_setopt_err_string(); \
|
||||||
_curl_easy_setopt_err_read_cb(); \
|
if (_curl_is_write_cb_option(_curl_opt)) \
|
||||||
if ((_curl_opt) == CURLOPT_IOCTLFUNCTION && !_curl_is_ioctl_cb(value)) \
|
if (!_curl_is_write_cb(value)) \
|
||||||
_curl_easy_setopt_err_ioctl_cb(); \
|
_curl_easy_setopt_err_write_callback(); \
|
||||||
if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION && !_curl_is_sockopt_cb(value))\
|
if ((_curl_opt) == CURLOPT_READFUNCTION) \
|
||||||
_curl_easy_setopt_err_sockopt_cb(); \
|
if (!_curl_is_read_cb(value)) \
|
||||||
if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION && \
|
_curl_easy_setopt_err_read_cb(); \
|
||||||
!_curl_is_opensocket_cb(value)) \
|
if ((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
|
||||||
_curl_easy_setopt_err_opensocket_cb(); \
|
if (!_curl_is_ioctl_cb(value)) \
|
||||||
if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION && \
|
_curl_easy_setopt_err_ioctl_cb(); \
|
||||||
!_curl_is_progress_cb(value)) \
|
if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
|
||||||
_curl_easy_setopt_err_progress_cb(); \
|
if (!_curl_is_sockopt_cb(value)) \
|
||||||
if ((_curl_opt) == CURLOPT_DEBUGFUNCTION && !_curl_is_debug_cb(value)) \
|
_curl_easy_setopt_err_sockopt_cb(); \
|
||||||
_curl_easy_setopt_err_debug_cb(); \
|
if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
|
||||||
if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION && \
|
if (!_curl_is_opensocket_cb(value)) \
|
||||||
!_curl_is_ssl_ctx_cb(value)) \
|
_curl_easy_setopt_err_opensocket_cb(); \
|
||||||
_curl_easy_setopt_err_ssl_ctx_cb(); \
|
if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
|
||||||
if (_curl_is_conv_cb_option(_curl_opt) && !_curl_is_conv_cb(value)) \
|
if (!_curl_is_progress_cb(value)) \
|
||||||
_curl_easy_setopt_err_conv_cb(); \
|
_curl_easy_setopt_err_progress_cb(); \
|
||||||
if ((_curl_opt) == CURLOPT_SEEKFUNCTION && !_curl_is_seek_cb(value)) \
|
if ((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
|
||||||
_curl_easy_setopt_err_seek_cb(); \
|
if (!_curl_is_debug_cb(value)) \
|
||||||
if (_curl_is_cb_data_option(_curl_opt) && !_curl_is_cb_data(value)) \
|
_curl_easy_setopt_err_debug_cb(); \
|
||||||
_curl_easy_setopt_err_cb_data(); \
|
if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
|
||||||
if ((_curl_opt) == CURLOPT_ERRORBUFFER && !_curl_is_error_buffer(value)) \
|
if (!_curl_is_ssl_ctx_cb(value)) \
|
||||||
_curl_easy_setopt_err_error_buffer(); \
|
_curl_easy_setopt_err_ssl_ctx_cb(); \
|
||||||
if ((_curl_opt) == CURLOPT_STDERR && !_curl_is_FILE(value)) \
|
if (_curl_is_conv_cb_option(_curl_opt)) \
|
||||||
_curl_easy_setopt_err_FILE(); \
|
if (!_curl_is_conv_cb(value)) \
|
||||||
if (_curl_is_postfields_option(_curl_opt) && !_curl_is_postfields(value)) \
|
_curl_easy_setopt_err_conv_cb(); \
|
||||||
_curl_easy_setopt_err_postfields(); \
|
if ((_curl_opt) == CURLOPT_SEEKFUNCTION) \
|
||||||
if ((_curl_opt) == CURLOPT_HTTPPOST && \
|
if (!_curl_is_seek_cb(value)) \
|
||||||
!_curl_is_arr((value), struct curl_httppost)) \
|
_curl_easy_setopt_err_seek_cb(); \
|
||||||
_curl_easy_setopt_err_curl_httpost(); \
|
if (_curl_is_cb_data_option(_curl_opt)) \
|
||||||
if (_curl_is_slist_option(_curl_opt) && \
|
if (!_curl_is_cb_data(value)) \
|
||||||
!_curl_is_arr((value), struct curl_slist)) \
|
_curl_easy_setopt_err_cb_data(); \
|
||||||
_curl_easy_setopt_err_curl_slist(); \
|
if ((_curl_opt) == CURLOPT_ERRORBUFFER) \
|
||||||
if ((_curl_opt) == CURLOPT_SHARE && !_curl_is_ptr((value), CURLSH)) \
|
if (!_curl_is_error_buffer(value)) \
|
||||||
_curl_easy_setopt_err_CURLSH(); \
|
_curl_easy_setopt_err_error_buffer(); \
|
||||||
|
if ((_curl_opt) == CURLOPT_STDERR) \
|
||||||
|
if (!_curl_is_FILE(value)) \
|
||||||
|
_curl_easy_setopt_err_FILE(); \
|
||||||
|
if (_curl_is_postfields_option(_curl_opt)) \
|
||||||
|
if (!_curl_is_postfields(value)) \
|
||||||
|
_curl_easy_setopt_err_postfields(); \
|
||||||
|
if ((_curl_opt) == CURLOPT_HTTPPOST) \
|
||||||
|
if (!_curl_is_arr((value), struct curl_httppost)) \
|
||||||
|
_curl_easy_setopt_err_curl_httpost(); \
|
||||||
|
if (_curl_is_slist_option(_curl_opt)) \
|
||||||
|
if (!_curl_is_arr((value), struct curl_slist)) \
|
||||||
|
_curl_easy_setopt_err_curl_slist(); \
|
||||||
|
if ((_curl_opt) == CURLOPT_SHARE) \
|
||||||
|
if (!_curl_is_ptr((value), CURLSH)) \
|
||||||
|
_curl_easy_setopt_err_CURLSH(); \
|
||||||
} \
|
} \
|
||||||
curl_easy_setopt(handle, _curl_opt, value); \
|
curl_easy_setopt(handle, _curl_opt, value); \
|
||||||
})
|
})
|
||||||
@@ -92,15 +112,18 @@ __extension__ ({ \
|
|||||||
__extension__ ({ \
|
__extension__ ({ \
|
||||||
__typeof__ (info) _curl_info = info; \
|
__typeof__ (info) _curl_info = info; \
|
||||||
if (__builtin_constant_p(_curl_info)) { \
|
if (__builtin_constant_p(_curl_info)) { \
|
||||||
if (_curl_is_string_info(_curl_info) && !_curl_is_arr((arg), char *)) \
|
if (_curl_is_string_info(_curl_info)) \
|
||||||
_curl_easy_getinfo_err_string(); \
|
if (!_curl_is_arr((arg), char *)) \
|
||||||
if (_curl_is_long_info(_curl_info) && !_curl_is_arr((arg), long)) \
|
_curl_easy_getinfo_err_string(); \
|
||||||
_curl_easy_getinfo_err_long(); \
|
if (_curl_is_long_info(_curl_info)) \
|
||||||
if (_curl_is_double_info(_curl_info) && !_curl_is_arr((arg), double)) \
|
if (!_curl_is_arr((arg), long)) \
|
||||||
_curl_easy_getinfo_err_double(); \
|
_curl_easy_getinfo_err_long(); \
|
||||||
if (_curl_is_slist_info(_curl_info) && \
|
if (_curl_is_double_info(_curl_info)) \
|
||||||
!_curl_is_arr((arg), struct curl_slist *)) \
|
if (!_curl_is_arr((arg), double)) \
|
||||||
_curl_easy_getinfo_err_curl_slist(); \
|
_curl_easy_getinfo_err_double(); \
|
||||||
|
if (_curl_is_slist_info(_curl_info)) \
|
||||||
|
if (!_curl_is_arr((arg), struct curl_slist *)) \
|
||||||
|
_curl_easy_getinfo_err_curl_slist(); \
|
||||||
} \
|
} \
|
||||||
curl_easy_getinfo(handle, _curl_info, arg); \
|
curl_easy_getinfo(handle, _curl_info, arg); \
|
||||||
})
|
})
|
||||||
|
1
lib/.gitignore
vendored
1
lib/.gitignore
vendored
@@ -9,3 +9,4 @@ Makefile.vc9.dist
|
|||||||
libcurl.plist.dist
|
libcurl.plist.dist
|
||||||
libcurl.vcproj
|
libcurl.vcproj
|
||||||
vc6libcurl.dsp
|
vc6libcurl.dsp
|
||||||
|
Makefile.vc10.dist
|
||||||
|
@@ -5,9 +5,6 @@
|
|||||||
|
|
||||||
!ifndef %watcom
|
!ifndef %watcom
|
||||||
!error WATCOM environment variable not set!
|
!error WATCOM environment variable not set!
|
||||||
!else
|
|
||||||
SYS_INCL = -I$(%watcom)\h\nt -I$(%watcom)\h
|
|
||||||
SYS_LIBS = $(%watcom)\lib386\nt;$(%watcom)\lib386
|
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!ifdef %libname
|
!ifdef %libname
|
||||||
@@ -33,18 +30,30 @@ RC = wrc
|
|||||||
! endif
|
! endif
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
!ifdef __LINUX__
|
||||||
|
DS = /
|
||||||
|
CP = cp
|
||||||
|
MD = mkdir -p
|
||||||
|
RD = rmdir -p
|
||||||
|
RM = rm -f
|
||||||
|
!else
|
||||||
|
DS = $(X)\$(X)
|
||||||
|
CP = copy 2>NUL
|
||||||
|
MD = mkdir
|
||||||
|
RD = rmdir /q /s 2>NUL
|
||||||
!if $(__VERSION__) < 1250
|
!if $(__VERSION__) < 1250
|
||||||
RM = del /q /f >NUL 2>&1
|
RM = del /q /f 2>NUL
|
||||||
!else
|
!else
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
!endif
|
!endif
|
||||||
MD = mkdir
|
!endif
|
||||||
RD = rmdir /q /s >NUL 2>&1
|
|
||||||
CP = copy
|
SYS_INCL = -I$(%watcom)$(DS)h$(DS)nt -I$(%watcom)$(DS)h
|
||||||
|
SYS_LIBS = $(%watcom)$(DS)lib386$(DS)nt;$(%watcom)$(DS)lib386
|
||||||
|
|
||||||
CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm &
|
CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm &
|
||||||
-wcd=201 -bt=nt -d+ -dWIN32 -dCURL_WANTS_CA_BUNDLE_ENV &
|
-wcd=201 -bt=nt -d+ -dWIN32 -dCURL_WANTS_CA_BUNDLE_ENV &
|
||||||
-dBUILDING_LIBCURL -dHAVE_SPNEGO=1 -I. -I..\include $(SYS_INCL)
|
-dBUILDING_LIBCURL -dHAVE_SPNEGO=1 -I. -I..$(DS)include $(SYS_INCL)
|
||||||
|
|
||||||
!ifdef %debug
|
!ifdef %debug
|
||||||
DEBUG = -dDEBUG=1 -dDEBUGBUILD
|
DEBUG = -dDEBUG=1 -dDEBUGBUILD
|
||||||
@@ -57,33 +66,57 @@ CFLAGS += -d0
|
|||||||
CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6
|
CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
!ifdef %use_sspi
|
||||||
|
CFLAGS += -dUSE_WINDOWS_SSPI
|
||||||
|
!endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# Change to suite.
|
# Change to suite.
|
||||||
#
|
#
|
||||||
!ifdef %zlib_root
|
!ifdef %zlib_root
|
||||||
ZLIB_ROOT = $(%zlib_root)
|
ZLIB_ROOT = $(%zlib_root)
|
||||||
!else
|
!else
|
||||||
ZLIB_ROOT = ..\..\zlib-1.2.5
|
ZLIB_ROOT = ..$(DS)..$(DS)zlib-1.2.5
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!ifdef %libssh2_root
|
||||||
|
LIBSSH2_ROOT = $(%libssh2_root)
|
||||||
|
!else
|
||||||
|
LIBSSH2_ROOT = ..$(DS)..$(DS)libssh2-1.2.7
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!ifdef %librtmp_root
|
||||||
|
LIBRTMP_ROOT = $(%librtmp_root)
|
||||||
|
!else
|
||||||
|
LIBRTMP_ROOT = ..$(DS)..$(DS)rtmpdump-2.3
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!ifdef %openssl_root
|
!ifdef %openssl_root
|
||||||
OPENSSL_ROOT = $(%openssl_root)
|
OPENSSL_ROOT = $(%openssl_root)
|
||||||
!else
|
!else
|
||||||
OPENSSL_ROOT = ..\..\openssl-0.9.8o
|
OPENSSL_ROOT = ..$(DS)..$(DS)openssl-0.9.8q
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!ifdef %ares_root
|
!ifdef %ares_root
|
||||||
ARES_ROOT = $(%ares_root)
|
ARES_ROOT = $(%ares_root)
|
||||||
!else
|
!else
|
||||||
ARES_ROOT = ..\ares
|
ARES_ROOT = ..$(DS)ares
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!ifdef %use_zlib
|
!ifdef %use_zlib
|
||||||
CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I$(ZLIB_ROOT)
|
CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I$(ZLIB_ROOT)
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
!ifdef %use_rtmp
|
||||||
|
CFLAGS += -dUSE_LIBRTMP -I$(LIBRTMP_ROOT)
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!ifdef %use_ssh2
|
||||||
|
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H -I$(LIBSSH2_ROOT)$(DS)include -I$(LIBSSH2_ROOT)$(DS)win32
|
||||||
|
!endif
|
||||||
|
|
||||||
!ifdef %use_ssl
|
!ifdef %use_ssl
|
||||||
CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_SSLEAY -I$(OPENSSL_ROOT)\inc32
|
CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_SSLEAY -I$(OPENSSL_ROOT)$(DS)inc32
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!ifdef %use_ares
|
!ifdef %use_ares
|
||||||
@@ -91,12 +124,12 @@ CFLAGS += -dUSE_ARES -I$(ARES_ROOT)
|
|||||||
!endif
|
!endif
|
||||||
|
|
||||||
!ifdef %use_watt32
|
!ifdef %use_watt32
|
||||||
CFLAGS += -dUSE_WATT32 -I$(%watt_root)\inc
|
CFLAGS += -dUSE_WATT32 -I$(%watt_root)$(DS)inc
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
OBJ_BASE = WC_Win32.obj
|
OBJ_BASE = WC_Win32.obj
|
||||||
LINK_ARG = $(OBJ_BASE)\dyn\wlink.arg
|
LINK_ARG = $(OBJ_BASE)$(DS)dyn$(DS)wlink.arg
|
||||||
LIB_ARG = $(OBJ_BASE)\stat\wlib.arg
|
LIB_ARG = $(OBJ_BASE)$(DS)stat$(DS)wlib.arg
|
||||||
|
|
||||||
# In order to process Makefile.inc wmake must be called with -u switch!
|
# In order to process Makefile.inc wmake must be called with -u switch!
|
||||||
!ifndef %MAKEFLAGS
|
!ifndef %MAKEFLAGS
|
||||||
@@ -106,19 +139,24 @@ LIB_ARG = $(OBJ_BASE)\stat\wlib.arg
|
|||||||
!endif
|
!endif
|
||||||
|
|
||||||
OBJS = $(CSOURCES:.c=.obj)
|
OBJS = $(CSOURCES:.c=.obj)
|
||||||
|
!ifdef __LINUX__
|
||||||
|
OBJS = $OBJ_DIR/$(OBJS: = $OBJ_DIR/)
|
||||||
|
|
||||||
|
!else
|
||||||
OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\)
|
OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\)
|
||||||
|
!endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# Use $(OBJS) as a template to generate $(OBJS_STAT) and $(OBJS_DYN).
|
# Use $(OBJS) as a template to generate $(OBJS_STAT) and $(OBJS_DYN).
|
||||||
#
|
#
|
||||||
OBJ_DIR = $(OBJ_BASE)\stat
|
OBJ_DIR = $(OBJ_BASE)$(DS)stat
|
||||||
OBJS_STAT = $+ $(OBJS) $-
|
OBJS_STAT = $+ $(OBJS) $-
|
||||||
|
|
||||||
OBJ_DIR = $(OBJ_BASE)\dyn
|
OBJ_DIR = $(OBJ_BASE)$(DS)dyn
|
||||||
OBJS_DYN = $+ $(OBJS) $-
|
OBJS_DYN = $+ $(OBJS) $-
|
||||||
|
|
||||||
CURLBUILDH = ..\include\curl\curlbuild.h
|
CURLBUILDH = ..$(DS)include$(DS)curl$(DS)curlbuild.h
|
||||||
RESOURCE = $(OBJ_BASE)\dyn\libcurl.res
|
RESOURCE = $(OBJ_BASE)$(DS)dyn$(DS)libcurl.res
|
||||||
|
|
||||||
all: $(CURLBUILDH) $(OBJ_BASE) $(TARGETS) .SYMBOLIC
|
all: $(CURLBUILDH) $(OBJ_BASE) $(TARGETS) .SYMBOLIC
|
||||||
@echo Welcome to libcurl
|
@echo Welcome to libcurl
|
||||||
@@ -128,16 +166,16 @@ clean: .SYMBOLIC
|
|||||||
-$(RM) $(OBJS_DYN)
|
-$(RM) $(OBJS_DYN)
|
||||||
-$(RM) $(RESOURCE) $(LINK_ARG) $(LIB_ARG)
|
-$(RM) $(RESOURCE) $(LINK_ARG) $(LIB_ARG)
|
||||||
|
|
||||||
vclean realclean: clean .SYMBOLIC
|
vclean distclean: clean .SYMBOLIC
|
||||||
-$(RM) $(TARGETS) $(LIBNAME).map $(LIBNAME).sym
|
-$(RM) $(TARGETS) $(LIBNAME).map $(LIBNAME).sym
|
||||||
-$(RD) $(OBJ_BASE)\stat
|
-$(RD) $(OBJ_BASE)$(DS)stat
|
||||||
-$(RD) $(OBJ_BASE)\dyn
|
-$(RD) $(OBJ_BASE)$(DS)dyn
|
||||||
-$(RD) $(OBJ_BASE)
|
-$(RD) $(OBJ_BASE)
|
||||||
|
|
||||||
$(OBJ_BASE):
|
$(OBJ_BASE):
|
||||||
-$(MD) $^@
|
-$(MD) $^@
|
||||||
-$(MD) $^@\stat
|
-$(MD) $^@$(DS)stat
|
||||||
-$(MD) $^@\dyn
|
-$(MD) $^@$(DS)dyn
|
||||||
|
|
||||||
$(CURLBUILDH): .EXISTSONLY
|
$(CURLBUILDH): .EXISTSONLY
|
||||||
$(CP) $^@.dist $^@
|
$(CP) $^@.dist $^@
|
||||||
@@ -150,14 +188,14 @@ $(LIBNAME).lib: $(OBJS_STAT) $(LIB_ARG)
|
|||||||
|
|
||||||
.ERASE
|
.ERASE
|
||||||
$(RESOURCE): libcurl.rc
|
$(RESOURCE): libcurl.rc
|
||||||
$(RC) $(DEBUG) -q -r -zm -I..\include $(SYS_INCL) $[@ -fo=$^@
|
$(RC) $(DEBUG) -q -r -zm -bt=nt -I..$(DS)include $(SYS_INCL) $[@ -fo=$^@
|
||||||
|
|
||||||
.ERASE
|
.ERASE
|
||||||
.c{$(OBJ_BASE)\dyn}.obj:
|
.c{$(OBJ_BASE)$(DS)dyn}.obj:
|
||||||
$(CC) $(CFLAGS) -bd -br $[@ -fo=$^@
|
$(CC) $(CFLAGS) -bd -br $[@ -fo=$^@
|
||||||
|
|
||||||
.ERASE
|
.ERASE
|
||||||
.c{$(OBJ_BASE)\stat}.obj:
|
.c{$(OBJ_BASE)$(DS)stat}.obj:
|
||||||
$(CC) $(CFLAGS) -DCURL_STATICLIB $[@ -fo=$^@
|
$(CC) $(CFLAGS) -DCURL_STATICLIB $[@ -fo=$^@
|
||||||
|
|
||||||
$(LINK_ARG): $(__MAKEFILES__)
|
$(LINK_ARG): $(__MAKEFILES__)
|
||||||
@@ -172,18 +210,24 @@ $(LINK_ARG): $(__MAKEFILES__)
|
|||||||
@%append $^@ res=$(RESOURCE) libpath $(SYS_LIBS)
|
@%append $^@ res=$(RESOURCE) libpath $(SYS_LIBS)
|
||||||
@%append $^@ library wldap32.lib
|
@%append $^@ library wldap32.lib
|
||||||
!ifdef %use_watt32
|
!ifdef %use_watt32
|
||||||
@%append $^@ library $(%watt_root)\lib\wattcpw_imp.lib
|
@%append $^@ library $(%watt_root)$(DS)lib$(DS)wattcpw_imp.lib
|
||||||
!else
|
!else
|
||||||
@%append $^@ library ws2_32.lib
|
@%append $^@ library ws2_32.lib
|
||||||
!endif
|
!endif
|
||||||
!ifdef %use_zlib
|
!ifdef %use_zlib
|
||||||
@%append $^@ library $(ZLIB_ROOT)\zlib.lib
|
@%append $^@ library $(ZLIB_ROOT)$(DS)zlib.lib
|
||||||
|
!endif
|
||||||
|
!ifdef %use_rtmp
|
||||||
|
@%append $^@ library $(LIBRTMP_ROOT)$(DS)librtmp$(DS)librtmp.lib
|
||||||
|
!endif
|
||||||
|
!ifdef %use_ssh2
|
||||||
|
@%append $^@ library $(LIBSSH2_ROOT)$(DS)win32$(DS)libssh2.lib
|
||||||
!endif
|
!endif
|
||||||
!ifdef %use_ssl
|
!ifdef %use_ssl
|
||||||
@%append $^@ library $(OPENSSL_ROOT)\out32\libeay32.lib, $(OPENSSL_ROOT)\out32\ssleay32.lib
|
@%append $^@ library $(OPENSSL_ROOT)$(DS)out32$(DS)libeay32.lib, $(OPENSSL_ROOT)$(DS)out32$(DS)ssleay32.lib
|
||||||
!endif
|
!endif
|
||||||
!ifdef %use_ares
|
!ifdef %use_ares
|
||||||
@%append $^@ library $(ARES_ROOT)\cares.lib
|
@%append $^@ library $(ARES_ROOT)$(DS)cares.lib
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
$(LIB_ARG): $(__MAKEFILES__)
|
$(LIB_ARG): $(__MAKEFILES__)
|
||||||
|
@@ -30,14 +30,15 @@ DOCS = README.encoding README.memoryleak README.ares README.curlx \
|
|||||||
|
|
||||||
CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
|
CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
|
||||||
|
|
||||||
EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 Makefile.riscos $(DSP) \
|
EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 $(DSP) \
|
||||||
vc6libcurl.dsw config-win32.h config-win32ce.h config-riscos.h \
|
vc6libcurl.dsw config-win32.h config-win32ce.h config-riscos.h \
|
||||||
config-mac.h curl_config.h.in makefile.dj config.dos libcurl.plist \
|
config-mac.h curl_config.h.in makefile.dj config-dos.h libcurl.plist \
|
||||||
libcurl.rc config-amigaos.h amigaos.c amigaos.h makefile.amiga \
|
libcurl.rc config-amigaos.h amigaos.c amigaos.h makefile.amiga \
|
||||||
Makefile.netware nwlib.c nwos.c libcurl.imp msvcproj.head msvcproj.foot \
|
Makefile.netware nwlib.c nwos.c libcurl.imp msvcproj.head msvcproj.foot \
|
||||||
config-win32ce.h config-os400.h setup-os400.h config-symbian.h \
|
config-win32ce.h config-os400.h setup-os400.h config-symbian.h \
|
||||||
Makefile.Watcom config-tpf.h $(DOCS) $(VCPROJ) mk-ca-bundle.pl \
|
Makefile.Watcom config-tpf.h $(DOCS) $(VCPROJ) mk-ca-bundle.pl \
|
||||||
firefox-db2pem.sh $(CMAKE_DIST) config-vxworks.h Makefile.vxworks
|
mk-ca-bundle.vbs firefox-db2pem.sh $(CMAKE_DIST) config-vxworks.h \
|
||||||
|
Makefile.vxworks config-vms.h
|
||||||
|
|
||||||
CLEANFILES = $(DSP) $(VCPROJ)
|
CLEANFILES = $(DSP) $(VCPROJ)
|
||||||
|
|
||||||
|
@@ -20,7 +20,8 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
|
|||||||
strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c \
|
strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c \
|
||||||
socks_gssapi.c socks_sspi.c curl_sspi.c slist.c nonblock.c \
|
socks_gssapi.c socks_sspi.c curl_sspi.c slist.c nonblock.c \
|
||||||
curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c \
|
curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c \
|
||||||
warnless.c hmac.c polarssl.c curl_rtmp.c openldap.c curl_gethostname.c
|
warnless.c hmac.c polarssl.c curl_rtmp.c openldap.c curl_gethostname.c\
|
||||||
|
gopher.c
|
||||||
|
|
||||||
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
|
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 \
|
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
|
||||||
@@ -34,5 +35,6 @@ HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.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 setup_once.h socks.h ssh.h nssg.h \
|
||||||
curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h slist.h nonblock.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 \
|
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
|
warnless.h curl_hmac.h polarssl.h curl_rtmp.h curl_gethostname.h \
|
||||||
|
gopher.h
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
## and optionally OpenSSL (0.9.8), libssh2 (1.2), zlib (1.2.5)
|
## and optionally OpenSSL (0.9.8), libssh2 (1.2), zlib (1.2.5)
|
||||||
##
|
##
|
||||||
## Usage:
|
## Usage:
|
||||||
## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [IDN=1] [SSPI=1] [IPV6=1] [LDAPS=1] [DYN=1]
|
## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [IDN=1] [SSPI=1] [IPV6=1] [LDAPS=1] [RTMP=1] [DYN=1]
|
||||||
##
|
##
|
||||||
## Hint: you can also set environment vars to control the build, f.e.:
|
## Hint: you can also set environment vars to control the build, f.e.:
|
||||||
## set ZLIB_PATH=c:/zlib-1.2.5
|
## set ZLIB_PATH=c:/zlib-1.2.5
|
||||||
@@ -20,16 +20,20 @@ ZLIB_PATH = ../../zlib-1.2.5
|
|||||||
endif
|
endif
|
||||||
# Edit the path below to point to the base of your OpenSSL package.
|
# Edit the path below to point to the base of your OpenSSL package.
|
||||||
ifndef OPENSSL_PATH
|
ifndef OPENSSL_PATH
|
||||||
OPENSSL_PATH = ../../openssl-0.9.8o
|
OPENSSL_PATH = ../../openssl-0.9.8q
|
||||||
endif
|
endif
|
||||||
# Edit the path below to point to the base of your LibSSH2 package.
|
# Edit the path below to point to the base of your LibSSH2 package.
|
||||||
ifndef LIBSSH2_PATH
|
ifndef LIBSSH2_PATH
|
||||||
LIBSSH2_PATH = ../../libssh2-1.2.6
|
LIBSSH2_PATH = ../../libssh2-1.2.7
|
||||||
endif
|
endif
|
||||||
# Edit the path below to point to the base of your libidn package.
|
# Edit the path below to point to the base of your libidn package.
|
||||||
ifndef LIBIDN_PATH
|
ifndef LIBIDN_PATH
|
||||||
LIBIDN_PATH = ../../libidn-1.18
|
LIBIDN_PATH = ../../libidn-1.18
|
||||||
endif
|
endif
|
||||||
|
# Edit the path below to point to the base of your librtmp package.
|
||||||
|
ifndef LIBRTMP_PATH
|
||||||
|
LIBRTMP_PATH = ../../librtmp-2.3
|
||||||
|
endif
|
||||||
# Edit the path below to point to the base of your Novell LDAP NDK.
|
# Edit the path below to point to the base of your Novell LDAP NDK.
|
||||||
ifndef LDAP_SDK
|
ifndef LDAP_SDK
|
||||||
LDAP_SDK = c:/novell/ndk/cldapsdk/win32
|
LDAP_SDK = c:/novell/ndk/cldapsdk/win32
|
||||||
@@ -47,7 +51,7 @@ LDFLAGS = -s
|
|||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
RC = windres
|
RC = windres
|
||||||
RCFLAGS = --include-dir=../include -DDEBUGBUILD=0 -O COFF -i
|
RCFLAGS = --include-dir=../include -DDEBUGBUILD=0 -O COFF -i
|
||||||
RM = del /q /f > NUL 2>&1
|
RM = del /q /f 2>NUL
|
||||||
STRIP = strip -g
|
STRIP = strip -g
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
@@ -61,6 +65,11 @@ ifdef ARES
|
|||||||
DLL_LIBS += -L$(LIBCARES_PATH) -lcares
|
DLL_LIBS += -L$(LIBCARES_PATH) -lcares
|
||||||
libcurl_dll_DEPENDENCIES = $(LIBCARES_PATH)/libcares.a
|
libcurl_dll_DEPENDENCIES = $(LIBCARES_PATH)/libcares.a
|
||||||
endif
|
endif
|
||||||
|
ifdef RTMP
|
||||||
|
INCLUDES += -I"$(LIBRTMP_PATH)"
|
||||||
|
CFLAGS += -DUSE_LIBRTMP
|
||||||
|
DLL_LIBS += -L"$(LIBRTMP_PATH)/librtmp" -lrtmp -lwinmm
|
||||||
|
endif
|
||||||
ifdef SSH2
|
ifdef SSH2
|
||||||
INCLUDES += -I"$(LIBSSH2_PATH)/include" -I"$(LIBSSH2_PATH)/win32"
|
INCLUDES += -I"$(LIBSSH2_PATH)/include" -I"$(LIBSSH2_PATH)/win32"
|
||||||
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
|
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
|
||||||
@@ -148,7 +157,7 @@ $(libcurl_dll_LIBRARY): $(libcurl_a_OBJECTS) $(RESOURCE) $(libcurl_dll_DEPENDENC
|
|||||||
clean:
|
clean:
|
||||||
-$(RM) $(libcurl_a_OBJECTS) $(RESOURCE)
|
-$(RM) $(libcurl_a_OBJECTS) $(RESOURCE)
|
||||||
|
|
||||||
distrib: clean
|
distclean vclean: clean
|
||||||
-$(RM) $(libcurl_a_LIBRARY) $(libcurl_dll_LIBRARY) $(libcurl_dll_a_LIBRARY)
|
-$(RM) $(libcurl_a_LIBRARY) $(libcurl_dll_LIBRARY) $(libcurl_dll_a_LIBRARY)
|
||||||
|
|
||||||
FORCE: ;
|
FORCE: ;
|
||||||
@@ -156,4 +165,3 @@ FORCE: ;
|
|||||||
$(LIBCARES_PATH)/libcares.a:
|
$(LIBCARES_PATH)/libcares.a:
|
||||||
$(MAKE) -C $(LIBCARES_PATH) -f Makefile.m32
|
$(MAKE) -C $(LIBCARES_PATH) -f Makefile.m32
|
||||||
|
|
||||||
|
|
||||||
|
@@ -19,12 +19,12 @@ endif
|
|||||||
|
|
||||||
# Edit the path below to point to the base of your OpenSSL package.
|
# Edit the path below to point to the base of your OpenSSL package.
|
||||||
ifndef OPENSSL_PATH
|
ifndef OPENSSL_PATH
|
||||||
OPENSSL_PATH = ../../openssl-0.9.8o
|
OPENSSL_PATH = ../../openssl-0.9.8q
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Edit the path below to point to the base of your LibSSH2 package.
|
# Edit the path below to point to the base of your LibSSH2 package.
|
||||||
ifndef LIBSSH2_PATH
|
ifndef LIBSSH2_PATH
|
||||||
LIBSSH2_PATH = ../../libssh2-1.2.6
|
LIBSSH2_PATH = ../../libssh2-1.2.7
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Edit the path below to point to the base of your libidn package.
|
# Edit the path below to point to the base of your libidn package.
|
||||||
@@ -32,6 +32,11 @@ ifndef LIBIDN_PATH
|
|||||||
LIBIDN_PATH = ../../libidn-1.18
|
LIBIDN_PATH = ../../libidn-1.18
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Edit the path below to point to the base of your librtmp package.
|
||||||
|
ifndef LIBRTMP_PATH
|
||||||
|
LIBRTMP_PATH = ../../librtmp-2.3
|
||||||
|
endif
|
||||||
|
|
||||||
# Edit the path below to point to the base of your c-ares package.
|
# Edit the path below to point to the base of your c-ares package.
|
||||||
ifndef LIBCARES_PATH
|
ifndef LIBCARES_PATH
|
||||||
LIBCARES_PATH = ../ares
|
LIBCARES_PATH = ../ares
|
||||||
@@ -84,14 +89,13 @@ else
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
endif
|
endif
|
||||||
PERL = perl
|
PERL = perl
|
||||||
# a native win32 awk can be downloaded from here:
|
# Here you can find a native Win32 binary of the original awk:
|
||||||
# http://www.gknw.net/development/prgtools/awk-20070501.zip
|
# http://www.gknw.net/development/prgtools/awk-20070501.zip
|
||||||
AWK = awk
|
AWK = awk
|
||||||
YACC = bison -y
|
|
||||||
CP = cp -afv
|
CP = cp -afv
|
||||||
MKDIR = mkdir
|
MKDIR = mkdir
|
||||||
# RM = rm -f
|
# RM = rm -f
|
||||||
# if you want to mark the target as MTSAFE you will need a tool for
|
# If you want to mark the target as MTSAFE you will need a tool for
|
||||||
# generating the xdc data for the linker; here's a minimal tool:
|
# generating the xdc data for the linker; here's a minimal tool:
|
||||||
# http://www.gknw.net/development/prgtools/mkxdc.zip
|
# http://www.gknw.net/development/prgtools/mkxdc.zip
|
||||||
MPKXDC = mkxdc
|
MPKXDC = mkxdc
|
||||||
@@ -117,13 +121,13 @@ CFLAGS += -relax_pointers
|
|||||||
#CFLAGS += -w on
|
#CFLAGS += -w on
|
||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
ifeq ($(POSIXFL),1)
|
ifeq ($(POSIXFL),1)
|
||||||
PRELUDE = $(SDK_LIBC)/imports/posixpre.o
|
PRELUDE = $(NDK_LIBC)/imports/posixpre.o
|
||||||
else
|
else
|
||||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.o
|
PRELUDE = $(NDK_LIBC)/imports/libcpre.o
|
||||||
endif
|
endif
|
||||||
CFLAGS += -align 4
|
CFLAGS += -align 4
|
||||||
else
|
else
|
||||||
# PRELUDE = $(SDK_CLIB)/imports/clibpre.o
|
# PRELUDE = $(NDK_CLIB)/imports/clibpre.o
|
||||||
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
||||||
PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
|
PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
|
||||||
# CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
|
# CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
|
||||||
@@ -140,12 +144,12 @@ CFLAGS += -fno-builtin -fpcc-struct-return -fno-strict-aliasing
|
|||||||
CFLAGS += -Wall # -pedantic
|
CFLAGS += -Wall # -pedantic
|
||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
ifeq ($(POSIXFL),1)
|
ifeq ($(POSIXFL),1)
|
||||||
PRELUDE = $(SDK_LIBC)/imports/posixpre.gcc.o
|
PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
|
||||||
else
|
else
|
||||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
|
PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
|
||||||
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
|
||||||
# http://www.gknw.net/development/mk_nlm/gcc_pre.zip
|
# http://www.gknw.net/development/mk_nlm/gcc_pre.zip
|
||||||
# PRELUDE = $(NDK_ROOT)/pre/prelude.o
|
# PRELUDE = $(NDK_ROOT)/pre/prelude.o
|
||||||
@@ -154,9 +158,15 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
NDK_ROOT = $(NDKBASE)/ndk
|
NDK_ROOT = $(NDKBASE)/ndk
|
||||||
SDK_CLIB = $(NDK_ROOT)/nwsdk
|
ifndef NDK_CLIB
|
||||||
SDK_LIBC = $(NDK_ROOT)/libc
|
NDK_CLIB = $(NDK_ROOT)/nwsdk
|
||||||
SDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
|
endif
|
||||||
|
ifndef NDK_LIBC
|
||||||
|
NDK_LIBC = $(NDK_ROOT)/libc
|
||||||
|
endif
|
||||||
|
ifndef NDK_LDAP
|
||||||
|
NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
|
||||||
|
endif
|
||||||
CURL_INC = ../include
|
CURL_INC = ../include
|
||||||
CURL_LIB = ../lib
|
CURL_LIB = ../lib
|
||||||
|
|
||||||
@@ -175,6 +185,10 @@ else
|
|||||||
IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
|
IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifdef WITH_RTMP
|
||||||
|
INCLUDES += -I$(LIBRTMP_PATH)
|
||||||
|
LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
|
||||||
|
endif
|
||||||
ifdef WITH_SSL
|
ifdef WITH_SSL
|
||||||
INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
|
INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
|
||||||
LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
|
LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
|
||||||
@@ -197,17 +211,17 @@ ifdef WITH_IDN
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
INCLUDES += -I$(SDK_LIBC)/include
|
INCLUDES += -I$(NDK_LIBC)/include
|
||||||
# INCLUDES += -I$(SDK_LIBC)/include/nks
|
# INCLUDES += -I$(NDK_LIBC)/include/nks
|
||||||
# INCLUDES += -I$(SDK_LIBC)/include/winsock
|
# INCLUDES += -I$(NDK_LIBC)/include/winsock
|
||||||
CFLAGS += -D_POSIX_SOURCE
|
CFLAGS += -D_POSIX_SOURCE
|
||||||
else
|
else
|
||||||
INCLUDES += -I$(SDK_CLIB)/include/nlm
|
INCLUDES += -I$(NDK_CLIB)/include/nlm
|
||||||
# INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
|
# INCLUDES += -I$(NDK_CLIB)/include/nlm/obsolete
|
||||||
# INCLUDES += -I$(SDK_CLIB)/include
|
# INCLUDES += -I$(NDK_CLIB)/include
|
||||||
endif
|
endif
|
||||||
ifndef DISABLE_LDAP
|
ifndef DISABLE_LDAP
|
||||||
INCLUDES += -I$(SDK_LDAP)/$(LIBARCH_L)/inc
|
INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
|
||||||
endif
|
endif
|
||||||
CFLAGS += $(INCLUDES)
|
CFLAGS += $(INCLUDES)
|
||||||
|
|
||||||
@@ -269,7 +283,7 @@ clean:
|
|||||||
-$(RM) curl_config.h
|
-$(RM) curl_config.h
|
||||||
-$(RM) -r $(OBJDIR)
|
-$(RM) -r $(OBJDIR)
|
||||||
|
|
||||||
distclean: clean
|
distclean vclean: clean
|
||||||
-$(RM) $(TARGET).$(LIBEXT) $(TARGET).nlm
|
-$(RM) $(TARGET).$(LIBEXT) $(TARGET).nlm
|
||||||
-$(RM) certdata.txt ca-bundle.crt
|
-$(RM) certdata.txt ca-bundle.crt
|
||||||
|
|
||||||
@@ -323,15 +337,15 @@ endif
|
|||||||
ifeq ($(LIBARCH),CLIB)
|
ifeq ($(LIBARCH),CLIB)
|
||||||
@echo $(DL)start _Prelude$(DL) >> $@
|
@echo $(DL)start _Prelude$(DL) >> $@
|
||||||
@echo $(DL)exit _Stop$(DL) >> $@
|
@echo $(DL)exit _Stop$(DL) >> $@
|
||||||
@echo $(DL)import @$(SDK_CLIB)/imports/clib.imp$(DL) >> $@
|
@echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
|
||||||
@echo $(DL)import @$(SDK_CLIB)/imports/threads.imp$(DL) >> $@
|
@echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
|
||||||
@echo $(DL)import @$(SDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
|
@echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
|
||||||
@echo $(DL)import @$(SDK_CLIB)/imports/socklib.imp$(DL) >> $@
|
@echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
|
||||||
@echo $(DL)module clib$(DL) >> $@
|
@echo $(DL)module clib$(DL) >> $@
|
||||||
ifndef DISABLE_LDAP
|
ifndef DISABLE_LDAP
|
||||||
@echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
|
@echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
|
||||||
@echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
|
@echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
|
||||||
# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
|
# @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
|
||||||
@echo $(DL)module ldapsdk ldapssl$(DL) >> $@
|
@echo $(DL)module ldapsdk ldapssl$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
@@ -348,13 +362,13 @@ else
|
|||||||
@echo $(DL)exit _LibCPostlude$(DL) >> $@
|
@echo $(DL)exit _LibCPostlude$(DL) >> $@
|
||||||
@echo $(DL)check _LibCCheckUnload$(DL) >> $@
|
@echo $(DL)check _LibCCheckUnload$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
@echo $(DL)import @$(SDK_LIBC)/imports/libc.imp$(DL) >> $@
|
@echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
|
||||||
@echo $(DL)import @$(SDK_LIBC)/imports/netware.imp$(DL) >> $@
|
@echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
|
||||||
@echo $(DL)module libc$(DL) >> $@
|
@echo $(DL)module libc$(DL) >> $@
|
||||||
ifndef DISABLE_LDAP
|
ifndef DISABLE_LDAP
|
||||||
@echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
|
@echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
|
||||||
@echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
|
@echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
|
||||||
# @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
|
# @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
|
||||||
@echo $(DL)module lldapsdk lldapssl$(DL) >> $@
|
@echo $(DL)module lldapsdk lldapssl$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -410,6 +424,7 @@ ifeq ($(LIBARCH),CLIB)
|
|||||||
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
||||||
|
@echo $(DL)#define SIZEOF_SIZE_T 4$(DL) >> $@
|
||||||
@echo $(DL)#define pressanykey PressAnyKeyToContinue$(DL) >> $@
|
@echo $(DL)#define pressanykey PressAnyKeyToContinue$(DL) >> $@
|
||||||
else
|
else
|
||||||
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
|
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
|
||||||
@@ -425,13 +440,6 @@ else
|
|||||||
@echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG2 void *$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG2 void *$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
|
||||||
@@ -451,11 +459,20 @@ else
|
|||||||
@echo $(DL)#define SEND_TYPE_ARG3 size_t$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG3 size_t$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_RETV ssize_t$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_RETV ssize_t$(DL) >> $@
|
||||||
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
|
||||||
@echo $(DL)#define SIZEOF_OFF_T 8$(DL) >> $@
|
@echo $(DL)#define SIZEOF_OFF_T 8$(DL) >> $@
|
||||||
|
@echo $(DL)#define SIZEOF_SIZE_T 8$(DL) >> $@
|
||||||
@echo $(DL)#define _LARGEFILE 1$(DL) >> $@
|
@echo $(DL)#define _LARGEFILE 1$(DL) >> $@
|
||||||
ifdef ENABLE_IPV6
|
ifdef ENABLE_IPV6
|
||||||
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
|
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRUCT_ADDRINFO 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@echo $(DL)#define USE_MANUAL 1$(DL) >> $@
|
@echo $(DL)#define USE_MANUAL 1$(DL) >> $@
|
||||||
@@ -491,7 +508,6 @@ endif
|
|||||||
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRUCT_ADDRINFO 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SYS_IOCTL_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SYS_IOCTL_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
|
||||||
@@ -555,6 +571,9 @@ endif
|
|||||||
ifdef WITH_IDN
|
ifdef WITH_IDN
|
||||||
@echo $(DL)#define HAVE_LIBIDN 1$(DL) >> $@
|
@echo $(DL)#define HAVE_LIBIDN 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_TLD_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_TLD_H 1$(DL) >> $@
|
||||||
|
endif
|
||||||
|
ifdef WITH_RTMP
|
||||||
|
@echo $(DL)#define USE_LIBRTMP 1$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
@echo $(DL)#ifdef __GNUC__$(DL) >> $@
|
@echo $(DL)#ifdef __GNUC__$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_VARIADIC_MACROS_GCC 1$(DL) >> $@
|
@echo $(DL)#define HAVE_VARIADIC_MACROS_GCC 1$(DL) >> $@
|
||||||
|
@@ -1,229 +0,0 @@
|
|||||||
# Makefile for project libcurl
|
|
||||||
|
|
||||||
# Project objects:
|
|
||||||
objs = o.base64 o.connect o.cookie o.dict \
|
|
||||||
o.dllinit o.easy o.escape o.file \
|
|
||||||
o.formdata o.ftp o.getenv \
|
|
||||||
o.getinfo o.getpass o.hostip \
|
|
||||||
o.hostip4 o.hostsyn o.http \
|
|
||||||
o.http_chunks o.inet_ntop o.inet_pton o.if2ip o.krb4 o.ldap \
|
|
||||||
o.curl_fnmatch o.fileinfo o.ftplistparser o.wildcard \
|
|
||||||
o.memdebug o.mprintf o.netrc o.parsedate o.progress \
|
|
||||||
o.security o.select o.sendf o.speedcheck o.ssluse \
|
|
||||||
o.strequal o.strtok o.telnet o.timeval \
|
|
||||||
o.transfer o.url o.version o.strtoofft o.sslgen o.gtls \
|
|
||||||
o.rawstr o.curl_addrinfo o.slist o.nonblock o.curl_rand \
|
|
||||||
o.curl_memrchr o.imap o.pop3 o.smtp o.pingpong o.rtsp \
|
|
||||||
o.curl_threads o.warnless o.hmac o.md5 o.curl_rtmp \
|
|
||||||
o.openldap o.polarssl o.md4 o.curl_gethostname
|
|
||||||
|
|
||||||
|
|
||||||
# Compile options:
|
|
||||||
linkopts = -o libcurl
|
|
||||||
compileropts = -mpoke-function-name -IUtilLib: -mthrowback
|
|
||||||
|
|
||||||
# Project target:
|
|
||||||
libcurl: $(objs)
|
|
||||||
makealf $(linkopts) $(objs)
|
|
||||||
|
|
||||||
# Static dependancies:
|
|
||||||
o.base64: c.base64
|
|
||||||
gcc $(compileropts) -c -o base64.o c.base64
|
|
||||||
|
|
||||||
o.connect: c.connect
|
|
||||||
gcc $(compileropts) -c -o connect.o c.connect
|
|
||||||
|
|
||||||
o.cookie: c.cookie
|
|
||||||
gcc $(compileropts) -c -o cookie.o c.cookie
|
|
||||||
|
|
||||||
o.curl_addrinfo: c.curl_addrinfo
|
|
||||||
gcc $(compileropts) -c -o curl_addrinfo.o c.curl_addrinfo
|
|
||||||
|
|
||||||
o.curl_gethostname: c.curl_gethostname
|
|
||||||
gcc $(compileropts) -c -o curl_gethostname.o c.curl_gethostname
|
|
||||||
|
|
||||||
o.curl_memrchr: c.curl_memrchr
|
|
||||||
gcc $(compileropts) -c -o curl_memrchr.o c.curl_memrchr
|
|
||||||
|
|
||||||
o.curl_rand: c.curl_rand
|
|
||||||
gcc $(compileropts) -c -o curl_rand.o c.curl_rand
|
|
||||||
|
|
||||||
o.curl_rtmp: c.curl_rtmp
|
|
||||||
gcc $(compileropts) -c -o curl_rtmp.o c.curl_rtmp
|
|
||||||
|
|
||||||
o.curl_threads: c.curl_threads
|
|
||||||
gcc $(compileropts) -c -o curl_threads.o c.curl_threads
|
|
||||||
|
|
||||||
o.dict: c.dict
|
|
||||||
gcc $(compileropts) -c -o dict.o c.dict
|
|
||||||
|
|
||||||
o.dllinit: c.dllinit
|
|
||||||
gcc $(compileropts) -c -o dllinit.o c.dllinit
|
|
||||||
|
|
||||||
o.easy: c.easy
|
|
||||||
gcc $(compileropts) -c -o easy.o c.easy
|
|
||||||
|
|
||||||
o.escape: c.escape
|
|
||||||
gcc $(compileropts) -c -o escape.o c.escape
|
|
||||||
|
|
||||||
o.file: c.file
|
|
||||||
gcc $(compileropts) -c -o file.o c.file
|
|
||||||
|
|
||||||
o.formdata: c.formdata
|
|
||||||
gcc $(compileropts) -c -o formdata.o c.formdata
|
|
||||||
|
|
||||||
o.ftp: c.ftp
|
|
||||||
gcc $(compileropts) -c -o ftp.o c.ftp
|
|
||||||
|
|
||||||
o.getenv: c.getenv
|
|
||||||
gcc $(compileropts) -c -o getenv.o c.getenv
|
|
||||||
|
|
||||||
o.getinfo: c.getinfo
|
|
||||||
gcc $(compileropts) -c -o getinfo.o c.getinfo
|
|
||||||
|
|
||||||
o.getpass: c.getpass
|
|
||||||
gcc $(compileropts) -c -o getpass.o c.getpass
|
|
||||||
|
|
||||||
o.hmac: c.hmac
|
|
||||||
gcc $(compileropts) -c -o hmac.o c.hmac
|
|
||||||
|
|
||||||
o.hostip: c.hostip
|
|
||||||
gcc $(compileropts) -c -o hostip.o c.hostip
|
|
||||||
|
|
||||||
o.hostip4: c.hostip4
|
|
||||||
gcc $(compileropts) -c -o hostip4.o c.hostip4
|
|
||||||
|
|
||||||
o.hostsyn: c.hostsyn
|
|
||||||
gcc $(compileropts) -c -o hostsyn.o c.hostsyn
|
|
||||||
|
|
||||||
o.http: c.http
|
|
||||||
gcc $(compileropts) -c -o http.o c.http
|
|
||||||
|
|
||||||
o.http_chunks: c.http_chunks
|
|
||||||
gcc $(compileropts) -c -o http_chunks.o c.http_chunks
|
|
||||||
|
|
||||||
o.if2ip: c.if2ip
|
|
||||||
gcc $(compileropts) -c -o if2ip.o c.if2ip
|
|
||||||
|
|
||||||
o.imap: c.imap
|
|
||||||
gcc $(compileropts) -c -o imap.o c.imap
|
|
||||||
|
|
||||||
o.inet_ntop: c.inet_ntop
|
|
||||||
gcc $(compileropts) -c -o inet_ntop.o c.inet_ntop
|
|
||||||
|
|
||||||
o.inet_pton: c.inet_pton
|
|
||||||
gcc $(compileropts) -c -o inet_pton.o c.inet_pton
|
|
||||||
|
|
||||||
o.krb4: c.krb4
|
|
||||||
gcc $(compileropts) -c -o krb4.o c.krb4
|
|
||||||
|
|
||||||
o.ldap: c.ldap
|
|
||||||
gcc $(compileropts) -IOpenLDAP: -c -o ldap.o c.ldap
|
|
||||||
|
|
||||||
o.md4: c.md4
|
|
||||||
gcc $(compileropts) -c -o md4.o c.md4
|
|
||||||
|
|
||||||
o.md5: c.md5
|
|
||||||
gcc $(compileropts) -c -o md5.o c.md5
|
|
||||||
|
|
||||||
o.memdebug: c.memdebug
|
|
||||||
gcc $(compileropts) -c -o memdebug.o c.memdebug
|
|
||||||
|
|
||||||
o.mprintf: c.mprintf
|
|
||||||
gcc $(compileropts) -c -o mprintf.o c.mprintf
|
|
||||||
|
|
||||||
o.netrc: c.netrc
|
|
||||||
gcc $(compileropts) -c -o netrc.o c.netrc
|
|
||||||
|
|
||||||
o.openldap: c.openldap
|
|
||||||
gcc $(compileropts) -c -o openldap.o c.openldap
|
|
||||||
|
|
||||||
o.parsedate: c.parsedate
|
|
||||||
gcc $(compileropts) -c -o parsedate.o c.parsedate
|
|
||||||
|
|
||||||
o.pingpong: c.pingpong
|
|
||||||
gcc $(compileropts) -c -o pingpong.o c.pingpong
|
|
||||||
|
|
||||||
o.polarssl: c.polarssl
|
|
||||||
gcc $(compileropts) -c -o polarssl.o c.polarssl
|
|
||||||
|
|
||||||
o.pop3: c.pop3
|
|
||||||
gcc $(compileropts) -c -o pop3.o c.pop3
|
|
||||||
|
|
||||||
o.progress: c.progress
|
|
||||||
gcc $(compileropts) -c -o progress.o c.progress
|
|
||||||
|
|
||||||
o.rtsp: c.rtsp
|
|
||||||
gcc $(compileropts) -c -o rtsp.o c.rtsp
|
|
||||||
|
|
||||||
o.security: c.security
|
|
||||||
gcc $(compileropts) -c -o security.o c.security
|
|
||||||
|
|
||||||
o.select: c.select
|
|
||||||
gcc $(compileropts) -c -o select.o c.select
|
|
||||||
|
|
||||||
o.sendf: c.sendf
|
|
||||||
gcc $(compileropts) -c -o sendf.o c.sendf
|
|
||||||
|
|
||||||
o.slist: c.slist
|
|
||||||
gcc $(compileropts) -c -o slist.o c.slist
|
|
||||||
|
|
||||||
o.smtp: c.smtp
|
|
||||||
gcc $(compileropts) -c -o smtp.o c.smtp
|
|
||||||
|
|
||||||
o.speedcheck: c.speedcheck
|
|
||||||
gcc $(compileropts) -c -o speedcheck.o c.speedcheck
|
|
||||||
|
|
||||||
o.gtls: c.gtls
|
|
||||||
gcc $(compileropts) -c -o gtls.o c.gtls
|
|
||||||
|
|
||||||
o.sslgen: c.sslgen
|
|
||||||
gcc $(compileropts) -c -o sslgen.o c.sslgen
|
|
||||||
|
|
||||||
o.ssluse: c.ssluse
|
|
||||||
gcc $(compileropts) -c -o ssluse.o c.ssluse
|
|
||||||
|
|
||||||
o.nonblock: c.nonblock
|
|
||||||
gcc $(compileropts) -c -o nonblock.o c.nonblock
|
|
||||||
|
|
||||||
o.rawstr: c.rawstr
|
|
||||||
gcc $(compileropts) -c -o rawstr.o c.rawstr
|
|
||||||
|
|
||||||
o.strequal: c.strequal
|
|
||||||
gcc $(compileropts) -c -o strequal.o c.strequal
|
|
||||||
|
|
||||||
o.strtok: c.strtok
|
|
||||||
gcc $(compileropts) -c -o strtok.o c.strtok
|
|
||||||
|
|
||||||
o.strtoofft: c.strtoofft
|
|
||||||
gcc $(compileropts) -c -o strtoofft.o c.strtoofft
|
|
||||||
|
|
||||||
o.telnet: c.telnet
|
|
||||||
gcc $(compileropts) -c -o telnet.o c.telnet
|
|
||||||
|
|
||||||
o.timeval: c.timeval
|
|
||||||
gcc $(compileropts) -c -o timeval.o c.timeval
|
|
||||||
|
|
||||||
o.transfer: c.transfer
|
|
||||||
gcc $(compileropts) -c -o transfer.o c.transfer
|
|
||||||
|
|
||||||
o.url: c.url
|
|
||||||
gcc $(compileropts) -c -o url.o c.url
|
|
||||||
|
|
||||||
o.version: c.version
|
|
||||||
gcc $(compileropts) -c -o version.o c.version
|
|
||||||
|
|
||||||
o.warnless: c.warnless
|
|
||||||
gcc $(compileropts) -c -o warnless.o c.warnless
|
|
||||||
|
|
||||||
o.curl_fnmatch: c.curl_fnmatch
|
|
||||||
gcc $(compileropts) -c -o curl_fnmatch.o c.curl_fnmatch
|
|
||||||
|
|
||||||
o.fileinfo: c.fileinfo
|
|
||||||
gcc $(compileropts) -c -o fileinfo.o c.fileinfo
|
|
||||||
|
|
||||||
o.ftplistparser: c.ftplistparser
|
|
||||||
gcc $(compileropts) -c -o ftplistparser.o c.ftplistparser
|
|
||||||
|
|
||||||
o.wildcard: c.wildcard
|
|
||||||
gcc $(compileropts) -c -o wildcard.o c.wildcard
|
|
@@ -471,6 +471,7 @@ X_OBJS= \
|
|||||||
$(DIROBJ)\getenv.obj \
|
$(DIROBJ)\getenv.obj \
|
||||||
$(DIROBJ)\getinfo.obj \
|
$(DIROBJ)\getinfo.obj \
|
||||||
$(DIROBJ)\gtls.obj \
|
$(DIROBJ)\gtls.obj \
|
||||||
|
$(DIROBJ)\gopher.obj \
|
||||||
$(DIROBJ)\hash.obj \
|
$(DIROBJ)\hash.obj \
|
||||||
$(DIROBJ)\hmac.obj \
|
$(DIROBJ)\hmac.obj \
|
||||||
$(DIROBJ)\hostares.obj \
|
$(DIROBJ)\hostares.obj \
|
||||||
|
@@ -11,7 +11,7 @@ c-ares:
|
|||||||
http://c-ares.haxx.se/
|
http://c-ares.haxx.se/
|
||||||
|
|
||||||
NOTE
|
NOTE
|
||||||
The latest libcurl version requires c-ares 1.4.0 or later.
|
The latest libcurl version requires c-ares 1.6.0 or later.
|
||||||
|
|
||||||
Once upon the time libcurl built fine with the "original" ares. That is no
|
Once upon the time libcurl built fine with the "original" ares. That is no
|
||||||
longer true. You need to use c-ares.
|
longer true. You need to use c-ares.
|
||||||
|
@@ -86,6 +86,7 @@
|
|||||||
|
|
||||||
#define SIZEOF_INT 4
|
#define SIZEOF_INT 4
|
||||||
#define SIZEOF_SHORT 2
|
#define SIZEOF_SHORT 2
|
||||||
|
#define SIZEOF_SIZE_T 4
|
||||||
|
|
||||||
#define USE_OPENSSL 1
|
#define USE_OPENSSL 1
|
||||||
#define USE_SSLEAY 1
|
#define USE_SSLEAY 1
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* ================================================================ */
|
/* ================================================================ */
|
||||||
/* lib/config.dos - Hand crafted config file for DOS */
|
/* lib/config-dos.h - Hand crafted config file for DOS */
|
||||||
/* ================================================================ */
|
/* ================================================================ */
|
||||||
|
|
||||||
#if defined(DJGPP)
|
#if defined(DJGPP)
|
||||||
@@ -67,6 +67,7 @@
|
|||||||
#define SIZEOF_INT 4
|
#define SIZEOF_INT 4
|
||||||
#define SIZEOF_LONG_DOUBLE 16
|
#define SIZEOF_LONG_DOUBLE 16
|
||||||
#define SIZEOF_SHORT 2
|
#define SIZEOF_SHORT 2
|
||||||
|
#define SIZEOF_SIZE_T 4
|
||||||
#define STDC_HEADERS 1
|
#define STDC_HEADERS 1
|
||||||
#define TIME_WITH_SYS_TIME 1
|
#define TIME_WITH_SYS_TIME 1
|
||||||
|
|
@@ -61,6 +61,7 @@
|
|||||||
|
|
||||||
#define SIZEOF_INT 4
|
#define SIZEOF_INT 4
|
||||||
#define SIZEOF_SHORT 2
|
#define SIZEOF_SHORT 2
|
||||||
|
#define SIZEOF_SIZE_T 4
|
||||||
|
|
||||||
#define HAVE_GETNAMEINFO 1
|
#define HAVE_GETNAMEINFO 1
|
||||||
#define GETNAMEINFO_QUAL_ARG1 const
|
#define GETNAMEINFO_QUAL_ARG1 const
|
||||||
|
@@ -364,6 +364,9 @@
|
|||||||
/* The size of `short', as computed by sizeof. */
|
/* The size of `short', as computed by sizeof. */
|
||||||
#define SIZEOF_SHORT 2
|
#define SIZEOF_SHORT 2
|
||||||
|
|
||||||
|
/* The size of `size_t', as computed by sizeof. */
|
||||||
|
#define SIZEOF_SIZE_T 8
|
||||||
|
|
||||||
/* Whether long long constants must be suffixed by LL. */
|
/* Whether long long constants must be suffixed by LL. */
|
||||||
|
|
||||||
#define HAVE_LL
|
#define HAVE_LL
|
||||||
|
@@ -350,6 +350,9 @@
|
|||||||
/* The size of `short', as computed by sizeof. */
|
/* The size of `short', as computed by sizeof. */
|
||||||
#define SIZEOF_SHORT 2
|
#define SIZEOF_SHORT 2
|
||||||
|
|
||||||
|
/* The size of `size_t', as computed by sizeof. */
|
||||||
|
#define SIZEOF_SIZE_T 4
|
||||||
|
|
||||||
/* Define if you have the ANSI C header files. */
|
/* Define if you have the ANSI C header files. */
|
||||||
#undef STDC_HEADERS
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
@@ -41,6 +41,9 @@
|
|||||||
/* The size of `short', as computed by sizeof. */
|
/* The size of `short', as computed by sizeof. */
|
||||||
#define SIZEOF_SHORT 2
|
#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 if you have the alarm function. */
|
||||||
#define HAVE_ALARM 1
|
#define HAVE_ALARM 1
|
||||||
|
|
@@ -345,6 +345,13 @@
|
|||||||
/* The size of `short', as computed by sizeof. */
|
/* The size of `short', as computed by sizeof. */
|
||||||
#define SIZEOF_SHORT 2
|
#define SIZEOF_SHORT 2
|
||||||
|
|
||||||
|
/* The size of `size_t', as computed by sizeof. */
|
||||||
|
#if defined(_WIN64)
|
||||||
|
# define SIZEOF_SIZE_T 8
|
||||||
|
#else
|
||||||
|
# define SIZEOF_SIZE_T 4
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ---------------------------------------------------------------- */
|
/* ---------------------------------------------------------------- */
|
||||||
/* STRUCT RELATED */
|
/* STRUCT RELATED */
|
||||||
/* ---------------------------------------------------------------- */
|
/* ---------------------------------------------------------------- */
|
||||||
|
@@ -322,6 +322,13 @@
|
|||||||
/* The size of `short', as computed by sizeof. */
|
/* The size of `short', as computed by sizeof. */
|
||||||
#define SIZEOF_SHORT 2
|
#define SIZEOF_SHORT 2
|
||||||
|
|
||||||
|
/* The size of `size_t', as computed by sizeof. */
|
||||||
|
#if defined(_WIN64)
|
||||||
|
# define SIZEOF_SIZE_T 8
|
||||||
|
#else
|
||||||
|
# define SIZEOF_SIZE_T 4
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ---------------------------------------------------------------- */
|
/* ---------------------------------------------------------------- */
|
||||||
/* STRUCT RELATED */
|
/* STRUCT RELATED */
|
||||||
/* ---------------------------------------------------------------- */
|
/* ---------------------------------------------------------------- */
|
||||||
|
252
lib/connect.c
252
lib/connect.c
@@ -174,6 +174,9 @@ long Curl_timeleft(struct connectdata *conn,
|
|||||||
|
|
||||||
/* substract elapsed time */
|
/* substract elapsed time */
|
||||||
timeout_ms -= Curl_tvdiff(*nowp, data->progress.t_startsingle);
|
timeout_ms -= Curl_tvdiff(*nowp, data->progress.t_startsingle);
|
||||||
|
if(!timeout_ms)
|
||||||
|
/* avoid returning 0 as that means no timeout! */
|
||||||
|
return -1;
|
||||||
|
|
||||||
return timeout_ms;
|
return timeout_ms;
|
||||||
}
|
}
|
||||||
@@ -307,20 +310,20 @@ static CURLcode bindlocal(struct connectdata *conn,
|
|||||||
* of the connection. The resolve functions should really be changed
|
* of the connection. The resolve functions should really be changed
|
||||||
* to take a type parameter instead.
|
* to take a type parameter instead.
|
||||||
*/
|
*/
|
||||||
long ipver = data->set.ip_version;
|
long ipver = conn->ip_version;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (af == AF_INET)
|
if (af == AF_INET)
|
||||||
data->set.ip_version = CURL_IPRESOLVE_V4;
|
conn->ip_version = CURL_IPRESOLVE_V4;
|
||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
else if (af == AF_INET6)
|
else if (af == AF_INET6)
|
||||||
data->set.ip_version = CURL_IPRESOLVE_V6;
|
conn->ip_version = CURL_IPRESOLVE_V6;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rc = Curl_resolv(conn, dev, 0, &h);
|
rc = Curl_resolv(conn, dev, 0, &h);
|
||||||
if(rc == CURLRESOLV_PENDING)
|
if(rc == CURLRESOLV_PENDING)
|
||||||
(void)Curl_wait_for_resolv(conn, &h);
|
(void)Curl_wait_for_resolv(conn, &h);
|
||||||
data->set.ip_version = ipver;
|
conn->ip_version = ipver;
|
||||||
|
|
||||||
if(h) {
|
if(h) {
|
||||||
/* convert the resolved address, sizeof myhost >= INET_ADDRSTRLEN */
|
/* convert the resolved address, sizeof myhost >= INET_ADDRSTRLEN */
|
||||||
@@ -529,6 +532,16 @@ static CURLcode trynextip(struct connectdata *conn,
|
|||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Copies connection info into the session handle to make it available
|
||||||
|
when the session handle is no longer associated with a connection. */
|
||||||
|
void Curl_persistconninfo(struct connectdata *conn)
|
||||||
|
{
|
||||||
|
memcpy(conn->data->info.conn_primary_ip, conn->primary_ip, MAX_IPADR_LEN);
|
||||||
|
memcpy(conn->data->info.conn_local_ip, conn->local_ip, MAX_IPADR_LEN);
|
||||||
|
conn->data->info.conn_primary_port = conn->primary_port;
|
||||||
|
conn->data->info.conn_local_port = conn->local_port;
|
||||||
|
}
|
||||||
|
|
||||||
/* retrieves ip address and port from a sockaddr structure */
|
/* retrieves ip address and port from a sockaddr structure */
|
||||||
static bool getaddressinfo(struct sockaddr* sa, char* addr,
|
static bool getaddressinfo(struct sockaddr* sa, char* addr,
|
||||||
long* port)
|
long* port)
|
||||||
@@ -538,31 +551,46 @@ static bool getaddressinfo(struct sockaddr* sa, char* addr,
|
|||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
struct sockaddr_in6* si6 = NULL;
|
struct sockaddr_in6* si6 = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_SYS_UN_H) && defined(AF_UNIX)
|
||||||
|
struct sockaddr_un* su = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (sa->sa_family) {
|
switch (sa->sa_family) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
si = (struct sockaddr_in*) sa;
|
si = (struct sockaddr_in*) sa;
|
||||||
if(Curl_inet_ntop(sa->sa_family, &si->sin_addr,
|
if(Curl_inet_ntop(sa->sa_family, &si->sin_addr,
|
||||||
addr, MAX_IPADR_LEN) == NULL)
|
addr, MAX_IPADR_LEN)) {
|
||||||
return FALSE;
|
us_port = ntohs(si->sin_port);
|
||||||
us_port = ntohs(si->sin_port);
|
*port = us_port;
|
||||||
*port = us_port;
|
return TRUE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
si6 = (struct sockaddr_in6*)sa;
|
si6 = (struct sockaddr_in6*)sa;
|
||||||
if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr,
|
if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr,
|
||||||
addr, MAX_IPADR_LEN) == NULL)
|
addr, MAX_IPADR_LEN)) {
|
||||||
return FALSE;
|
us_port = ntohs(si6->sin6_port);
|
||||||
us_port = ntohs(si6->sin6_port);
|
*port = us_port;
|
||||||
*port = us_port;
|
return TRUE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
#if defined(HAVE_SYS_UN_H) && defined(AF_UNIX)
|
||||||
addr[0] = '\0';
|
case AF_UNIX:
|
||||||
|
su = (struct sockaddr_un*)sa;
|
||||||
|
snprintf(addr, MAX_IPADR_LEN, "%s", su->sun_path);
|
||||||
*port = 0;
|
*port = 0;
|
||||||
|
return TRUE;
|
||||||
|
#endif
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
|
addr[0] = '\0';
|
||||||
|
*port = 0;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* retrieves the start/end point information of a socket of an established
|
/* retrieves the start/end point information of a socket of an established
|
||||||
@@ -574,43 +602,45 @@ void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
|
|||||||
struct Curl_sockaddr_storage ssrem;
|
struct Curl_sockaddr_storage ssrem;
|
||||||
struct Curl_sockaddr_storage ssloc;
|
struct Curl_sockaddr_storage ssloc;
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
struct PureInfo *info = &conn->data->info;
|
|
||||||
|
|
||||||
if(conn->bits.reuse)
|
if(!conn->bits.reuse) {
|
||||||
/* reusing same connection */
|
|
||||||
return;
|
len = sizeof(struct Curl_sockaddr_storage);
|
||||||
|
if(getpeername(sockfd, (struct sockaddr*) &ssrem, &len)) {
|
||||||
|
error = SOCKERRNO;
|
||||||
|
failf(data, "getpeername() failed with errno %d: %s",
|
||||||
|
error, Curl_strerror(conn, error));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
len = sizeof(struct Curl_sockaddr_storage);
|
||||||
|
if(getsockname(sockfd, (struct sockaddr*) &ssloc, &len)) {
|
||||||
|
error = SOCKERRNO;
|
||||||
|
failf(data, "getsockname() failed with errno %d: %s",
|
||||||
|
error, Curl_strerror(conn, error));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!getaddressinfo((struct sockaddr*)&ssrem,
|
||||||
|
conn->primary_ip, &conn->primary_port)) {
|
||||||
|
error = ERRNO;
|
||||||
|
failf(data, "ssrem inet_ntop() failed with errno %d: %s",
|
||||||
|
error, Curl_strerror(conn, error));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!getaddressinfo((struct sockaddr*)&ssloc,
|
||||||
|
conn->local_ip, &conn->local_port)) {
|
||||||
|
error = ERRNO;
|
||||||
|
failf(data, "ssloc inet_ntop() failed with errno %d: %s",
|
||||||
|
error, Curl_strerror(conn, error));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
len = sizeof(struct Curl_sockaddr_storage);
|
|
||||||
if(getpeername(sockfd, (struct sockaddr*) &ssrem, &len)) {
|
|
||||||
error = SOCKERRNO;
|
|
||||||
failf(data, "getpeername() failed with errno %d: %s",
|
|
||||||
error, Curl_strerror(conn, error));
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
len = sizeof(struct Curl_sockaddr_storage);
|
/* persist connection info in session handle */
|
||||||
if(getsockname(sockfd, (struct sockaddr*) &ssloc, &len)) {
|
Curl_persistconninfo(conn);
|
||||||
error = SOCKERRNO;
|
|
||||||
failf(data, "getsockname() failed with errno %d: %s",
|
|
||||||
error, Curl_strerror(conn, error));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!getaddressinfo((struct sockaddr*)&ssrem,
|
|
||||||
info->ip, &info->port)) {
|
|
||||||
error = ERRNO;
|
|
||||||
failf(data, "ssrem inet_ntop() failed with errno %d: %s",
|
|
||||||
error, Curl_strerror(conn, error));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!getaddressinfo((struct sockaddr*)&ssloc,
|
|
||||||
info->localip, &info->localport)) {
|
|
||||||
error = ERRNO;
|
|
||||||
failf(data, "ssloc inet_ntop() failed with errno %d: %s",
|
|
||||||
error, Curl_strerror(conn, error));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -627,6 +657,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
|||||||
CURLcode code = CURLE_OK;
|
CURLcode code = CURLE_OK;
|
||||||
curl_socket_t sockfd = conn->sock[sockindex];
|
curl_socket_t sockfd = conn->sock[sockindex];
|
||||||
long allow = DEFAULT_CONNECT_TIMEOUT;
|
long allow = DEFAULT_CONNECT_TIMEOUT;
|
||||||
|
int error = 0;
|
||||||
|
|
||||||
DEBUGASSERT(sockindex >= FIRSTSOCKET && sockindex <= SECONDARYSOCKET);
|
DEBUGASSERT(sockindex >= FIRSTSOCKET && sockindex <= SECONDARYSOCKET);
|
||||||
|
|
||||||
@@ -634,13 +665,6 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
|||||||
|
|
||||||
if(conn->bits.tcpconnect) {
|
if(conn->bits.tcpconnect) {
|
||||||
/* we are connected already! */
|
/* we are connected already! */
|
||||||
long allow_total = 0;
|
|
||||||
|
|
||||||
/* subtract the most strict timeout of the ones */
|
|
||||||
if(data->set.timeout)
|
|
||||||
allow_total = data->set.timeout;
|
|
||||||
|
|
||||||
Curl_expire(data, allow_total);
|
|
||||||
*connected = TRUE;
|
*connected = TRUE;
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
@@ -654,13 +678,13 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
|||||||
return CURLE_OPERATION_TIMEDOUT;
|
return CURLE_OPERATION_TIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
Curl_expire(data, allow);
|
|
||||||
|
|
||||||
/* check for connect without timeout as we want to return immediately */
|
/* check for connect without timeout as we want to return immediately */
|
||||||
rc = waitconnect(conn, sockfd, 0);
|
rc = waitconnect(conn, sockfd, 0);
|
||||||
|
if(WAITCONN_TIMEOUT == rc)
|
||||||
|
/* not an error, but also no connection yet */
|
||||||
|
return code;
|
||||||
|
|
||||||
if(WAITCONN_CONNECTED == rc) {
|
if(WAITCONN_CONNECTED == rc) {
|
||||||
int error;
|
|
||||||
if(verifyconnect(sockfd, &error)) {
|
if(verifyconnect(sockfd, &error)) {
|
||||||
/* we are connected, awesome! */
|
/* we are connected, awesome! */
|
||||||
conn->bits.tcpconnect = TRUE;
|
conn->bits.tcpconnect = TRUE;
|
||||||
@@ -672,38 +696,34 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
/* nope, not connected for real */
|
/* nope, not connected for real */
|
||||||
data->state.os_errno = error;
|
|
||||||
infof(data, "Connection failed\n");
|
|
||||||
code = trynextip(conn, sockindex, connected);
|
|
||||||
if(code)
|
|
||||||
failf(data, "Failed connect to %s:%ld; %s",
|
|
||||||
conn->host.name, conn->port, Curl_strerror(conn, error));
|
|
||||||
}
|
}
|
||||||
else if(WAITCONN_TIMEOUT != rc) {
|
else {
|
||||||
int error = 0;
|
|
||||||
|
|
||||||
/* nope, not connected */
|
/* nope, not connected */
|
||||||
if(WAITCONN_FDSET_ERROR == rc) {
|
if(WAITCONN_FDSET_ERROR == rc) {
|
||||||
(void)verifyconnect(sockfd, &error);
|
(void)verifyconnect(sockfd, &error);
|
||||||
data->state.os_errno = error;
|
infof(data, "%s\n",Curl_strerror(conn, error));
|
||||||
infof(data, "%s\n",Curl_strerror(conn,error));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
infof(data, "Connection failed\n");
|
infof(data, "Connection failed\n");
|
||||||
|
|
||||||
code = trynextip(conn, sockindex, connected);
|
|
||||||
|
|
||||||
if(code) {
|
|
||||||
error = SOCKERRNO;
|
|
||||||
data->state.os_errno = error;
|
|
||||||
failf(data, "Failed connect to %s:%ld; %s",
|
|
||||||
conn->host.name, conn->port, Curl_strerror(conn, error));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the connection failed here, we should attempt to connect to the "next
|
* The connection failed here, we should attempt to connect to the "next
|
||||||
* address" for the given host.
|
* address" for the given host. But first remember the latest error.
|
||||||
*/
|
*/
|
||||||
|
if(error) {
|
||||||
|
data->state.os_errno = error;
|
||||||
|
SET_SOCKERRNO(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
code = trynextip(conn, sockindex, connected);
|
||||||
|
|
||||||
|
if(code) {
|
||||||
|
error = SOCKERRNO;
|
||||||
|
data->state.os_errno = error;
|
||||||
|
failf(data, "Failed connect to %s:%ld; %s",
|
||||||
|
conn->host.name, conn->port, Curl_strerror(conn, error));
|
||||||
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
@@ -802,16 +822,13 @@ singleipconnect(struct connectdata *conn,
|
|||||||
bool *connected)
|
bool *connected)
|
||||||
{
|
{
|
||||||
struct Curl_sockaddr_ex addr;
|
struct Curl_sockaddr_ex addr;
|
||||||
char addr_buf[128];
|
|
||||||
int rc;
|
int rc;
|
||||||
int error;
|
int error;
|
||||||
bool isconnected;
|
bool isconnected;
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
curl_socket_t sockfd;
|
curl_socket_t sockfd;
|
||||||
CURLcode res = CURLE_OK;
|
CURLcode res = CURLE_OK;
|
||||||
const void *iptoprint;
|
#if defined(ENABLE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
|
||||||
struct sockaddr_in * const sa4 = (void *)&addr.sa_addr;
|
|
||||||
#ifdef ENABLE_IPV6
|
|
||||||
struct sockaddr_in6 * const sa6 = (void *)&addr.sa_addr;
|
struct sockaddr_in6 * const sa6 = (void *)&addr.sa_addr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -862,37 +879,25 @@ singleipconnect(struct connectdata *conn,
|
|||||||
sa6->sin6_scope_id = conn->scope;
|
sa6->sin6_scope_id = conn->scope;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FIXME: do we have Curl_printable_address-like with struct sockaddr* as
|
/* store remote address and port used in this connection attempt */
|
||||||
argument? */
|
if(!getaddressinfo((struct sockaddr*)&addr.sa_addr,
|
||||||
#if defined(HAVE_SYS_UN_H) && defined(AF_UNIX)
|
conn->primary_ip, &conn->primary_port)) {
|
||||||
if(addr.family == AF_UNIX) {
|
/* malformed address or bug in inet_ntop, try next address */
|
||||||
infof(data, " Trying %s... ",
|
error = ERRNO;
|
||||||
((const struct sockaddr_un*)(&addr.sa_addr))->sun_path);
|
failf(data, "sa_addr inet_ntop() failed with errno %d: %s",
|
||||||
snprintf(data->info.ip, MAX_IPADR_LEN, "%s",
|
error, Curl_strerror(conn, error));
|
||||||
((const struct sockaddr_un*)(&addr.sa_addr))->sun_path);
|
sclose(sockfd);
|
||||||
strcpy(conn->ip_addr_str, data->info.ip);
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
else
|
memcpy(conn->ip_addr_str, conn->primary_ip, MAX_IPADR_LEN);
|
||||||
#endif
|
infof(data, " Trying %s... ", conn->ip_addr_str);
|
||||||
{
|
|
||||||
#ifdef ENABLE_IPV6
|
|
||||||
if(addr.family == AF_INET6) {
|
|
||||||
iptoprint = &sa6->sin6_addr;
|
|
||||||
conn->bits.ipv6 = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
iptoprint = &sa4->sin_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(Curl_inet_ntop(addr.family, iptoprint, addr_buf,
|
Curl_persistconninfo(conn);
|
||||||
sizeof(addr_buf)) != NULL) {
|
|
||||||
infof(data, " Trying %s... ", addr_buf);
|
#ifdef ENABLE_IPV6
|
||||||
snprintf(data->info.ip, MAX_IPADR_LEN, "%s", addr_buf);
|
if(addr.family == AF_INET6)
|
||||||
strcpy(conn->ip_addr_str, data->info.ip);
|
conn->bits.ipv6 = TRUE;
|
||||||
}
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
if(data->set.tcp_nodelay)
|
if(data->set.tcp_nodelay)
|
||||||
tcpnodelay(conn, sockfd);
|
tcpnodelay(conn, sockfd);
|
||||||
@@ -952,7 +957,7 @@ singleipconnect(struct connectdata *conn,
|
|||||||
default:
|
default:
|
||||||
/* unknown error, fallthrough and try another address! */
|
/* unknown error, fallthrough and try another address! */
|
||||||
failf(data, "Failed to connect to %s: %s",
|
failf(data, "Failed to connect to %s: %s",
|
||||||
addr_buf, Curl_strerror(conn,error));
|
conn->ip_addr_str, Curl_strerror(conn,error));
|
||||||
data->state.os_errno = error;
|
data->state.os_errno = error;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1029,7 +1034,6 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
|||||||
failf(data, "Connection time-out");
|
failf(data, "Connection time-out");
|
||||||
return CURLE_OPERATION_TIMEDOUT;
|
return CURLE_OPERATION_TIMEDOUT;
|
||||||
}
|
}
|
||||||
Curl_expire(data, timeout_ms);
|
|
||||||
|
|
||||||
/* Max time for each address */
|
/* Max time for each address */
|
||||||
num_addr = Curl_num_addresses(remotehost->addr);
|
num_addr = Curl_num_addresses(remotehost->addr);
|
||||||
@@ -1094,12 +1098,12 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
|||||||
* Used to extract socket and connectdata struct for the most recent
|
* Used to extract socket and connectdata struct for the most recent
|
||||||
* transfer on the given SessionHandle.
|
* transfer on the given SessionHandle.
|
||||||
*
|
*
|
||||||
* The socket 'long' will be -1 in case of failure!
|
* The returned socket will be CURL_SOCKET_BAD in case of failure!
|
||||||
*/
|
*/
|
||||||
CURLcode Curl_getconnectinfo(struct SessionHandle *data,
|
curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
|
||||||
long *param_longp,
|
struct connectdata **connp)
|
||||||
struct connectdata **connp)
|
|
||||||
{
|
{
|
||||||
|
curl_socket_t sockfd;
|
||||||
if((data->state.lastconnect != -1) &&
|
if((data->state.lastconnect != -1) &&
|
||||||
(data->state.connc->connects[data->state.lastconnect] != NULL)) {
|
(data->state.connc->connects[data->state.lastconnect] != NULL)) {
|
||||||
struct connectdata *c =
|
struct connectdata *c =
|
||||||
@@ -1107,13 +1111,13 @@ CURLcode Curl_getconnectinfo(struct SessionHandle *data,
|
|||||||
if(connp)
|
if(connp)
|
||||||
/* only store this if the caller cares for it */
|
/* only store this if the caller cares for it */
|
||||||
*connp = c;
|
*connp = c;
|
||||||
*param_longp = c->sock[FIRSTSOCKET];
|
sockfd = c->sock[FIRSTSOCKET];
|
||||||
/* we have a socket connected, let's determine if the server shut down */
|
/* we have a socket connected, let's determine if the server shut down */
|
||||||
/* determine if ssl */
|
/* determine if ssl */
|
||||||
if(c->ssl[FIRSTSOCKET].use) {
|
if(c->ssl[FIRSTSOCKET].use) {
|
||||||
/* use the SSL context */
|
/* use the SSL context */
|
||||||
if(!Curl_ssl_check_cxn(c))
|
if(!Curl_ssl_check_cxn(c))
|
||||||
*param_longp = -1; /* FIN received */
|
return CURL_SOCKET_BAD; /* FIN received */
|
||||||
}
|
}
|
||||||
/* Minix 3.1 doesn't support any flags on recv; just assume socket is OK */
|
/* Minix 3.1 doesn't support any flags on recv; just assume socket is OK */
|
||||||
#ifdef MSG_PEEK
|
#ifdef MSG_PEEK
|
||||||
@@ -1122,13 +1126,13 @@ CURLcode Curl_getconnectinfo(struct SessionHandle *data,
|
|||||||
char buf;
|
char buf;
|
||||||
if(recv((RECV_TYPE_ARG1)c->sock[FIRSTSOCKET], (RECV_TYPE_ARG2)&buf,
|
if(recv((RECV_TYPE_ARG1)c->sock[FIRSTSOCKET], (RECV_TYPE_ARG2)&buf,
|
||||||
(RECV_TYPE_ARG3)1, (RECV_TYPE_ARG4)MSG_PEEK) == 0) {
|
(RECV_TYPE_ARG3)1, (RECV_TYPE_ARG4)MSG_PEEK) == 0) {
|
||||||
*param_longp = -1; /* FIN received */
|
return CURL_SOCKET_BAD; /* FIN received */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*param_longp = -1;
|
return CURL_SOCKET_BAD;
|
||||||
|
|
||||||
return CURLE_OK;
|
return sockfd;
|
||||||
}
|
}
|
||||||
|
@@ -47,11 +47,10 @@ long Curl_timeleft(struct connectdata *conn,
|
|||||||
* Used to extract socket and connectdata struct for the most recent
|
* Used to extract socket and connectdata struct for the most recent
|
||||||
* transfer on the given SessionHandle.
|
* transfer on the given SessionHandle.
|
||||||
*
|
*
|
||||||
* The socket 'long' will be -1 in case of failure!
|
* The returned socket will be CURL_SOCKET_BAD in case of failure!
|
||||||
*/
|
*/
|
||||||
CURLcode Curl_getconnectinfo(struct SessionHandle *data,
|
curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
|
||||||
long *param_longp,
|
struct connectdata **connp);
|
||||||
struct connectdata **connp);
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
/* When you run a program that uses the Windows Sockets API, you may
|
/* When you run a program that uses the Windows Sockets API, you may
|
||||||
@@ -70,4 +69,6 @@ void Curl_sndbufset(curl_socket_t sockfd);
|
|||||||
|
|
||||||
void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd);
|
void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd);
|
||||||
|
|
||||||
|
void Curl_persistconninfo(struct connectdata *conn);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -123,7 +123,9 @@ inflate_stream(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Done with these bytes, exit */
|
/* Done with these bytes, exit */
|
||||||
if(status == Z_OK && z->avail_in == 0) {
|
|
||||||
|
/* status is always Z_OK at this point! */
|
||||||
|
if(z->avail_in == 0) {
|
||||||
free(decomp);
|
free(decomp);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -353,8 +353,8 @@ Curl_cookie_add(struct SessionHandle *data,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
co->expires =
|
co->expires =
|
||||||
atoi((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0]) +
|
strtol((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0],NULL,10)
|
||||||
(long)now;
|
+ (long)now;
|
||||||
}
|
}
|
||||||
else if(Curl_raw_equal("expires", name)) {
|
else if(Curl_raw_equal("expires", name)) {
|
||||||
strstore(&co->expirestr, whatptr);
|
strstore(&co->expirestr, whatptr);
|
||||||
|
@@ -49,6 +49,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "curl_addrinfo.h"
|
#include "curl_addrinfo.h"
|
||||||
|
#include "inet_pton.h"
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
@@ -117,12 +118,12 @@ Curl_getaddrinfo_ex(const char *nodename,
|
|||||||
const struct addrinfo *hints,
|
const struct addrinfo *hints,
|
||||||
Curl_addrinfo **result)
|
Curl_addrinfo **result)
|
||||||
{
|
{
|
||||||
const struct addrinfo *ainext;
|
|
||||||
const struct addrinfo *ai;
|
const struct addrinfo *ai;
|
||||||
struct addrinfo *aihead;
|
struct addrinfo *aihead;
|
||||||
Curl_addrinfo *cafirst = NULL;
|
Curl_addrinfo *cafirst = NULL;
|
||||||
Curl_addrinfo *calast = NULL;
|
Curl_addrinfo *calast = NULL;
|
||||||
Curl_addrinfo *ca;
|
Curl_addrinfo *ca;
|
||||||
|
size_t ss_size;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
*result = NULL; /* assume failure */
|
*result = NULL; /* assume failure */
|
||||||
@@ -131,7 +132,28 @@ Curl_getaddrinfo_ex(const char *nodename,
|
|||||||
if(error)
|
if(error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
for(ai = aihead; ai != NULL; ai = ainext) {
|
/* traverse the addrinfo list */
|
||||||
|
|
||||||
|
for(ai = aihead; ai != NULL; ai = ai->ai_next) {
|
||||||
|
|
||||||
|
/* ignore elements with unsupported address family, */
|
||||||
|
/* settle family-specific sockaddr structure size. */
|
||||||
|
if(ai->ai_family == AF_INET)
|
||||||
|
ss_size = sizeof(struct sockaddr_in);
|
||||||
|
#ifdef ENABLE_IPV6
|
||||||
|
else if(ai->ai_family == AF_INET6)
|
||||||
|
ss_size = sizeof(struct sockaddr_in6);
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* ignore elements without required address info */
|
||||||
|
if((ai->ai_addr == NULL) || !(ai->ai_addrlen > 0))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* ignore elements with bogus address size */
|
||||||
|
if((size_t)ai->ai_addrlen < ss_size)
|
||||||
|
continue;
|
||||||
|
|
||||||
if((ca = malloc(sizeof(Curl_addrinfo))) == NULL) {
|
if((ca = malloc(sizeof(Curl_addrinfo))) == NULL) {
|
||||||
error = EAI_MEMORY;
|
error = EAI_MEMORY;
|
||||||
@@ -139,35 +161,28 @@ Curl_getaddrinfo_ex(const char *nodename,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* copy each structure member individually, member ordering, */
|
/* copy each structure member individually, member ordering, */
|
||||||
/* size, or padding might be different for each structure. */
|
/* size, or padding might be different for each platform. */
|
||||||
|
|
||||||
ca->ai_flags = ai->ai_flags;
|
ca->ai_flags = ai->ai_flags;
|
||||||
ca->ai_family = ai->ai_family;
|
ca->ai_family = ai->ai_family;
|
||||||
ca->ai_socktype = ai->ai_socktype;
|
ca->ai_socktype = ai->ai_socktype;
|
||||||
ca->ai_protocol = ai->ai_protocol;
|
ca->ai_protocol = ai->ai_protocol;
|
||||||
ca->ai_addrlen = 0;
|
ca->ai_addrlen = (curl_socklen_t)ss_size;
|
||||||
ca->ai_addr = NULL;
|
ca->ai_addr = NULL;
|
||||||
ca->ai_canonname = NULL;
|
ca->ai_canonname = NULL;
|
||||||
ca->ai_next = NULL;
|
ca->ai_next = NULL;
|
||||||
|
|
||||||
if((ai->ai_addrlen > 0) && (ai->ai_addr != NULL)) {
|
if((ca->ai_addr = malloc(ss_size)) == NULL) {
|
||||||
/* typecast below avoid warning on at least win64:
|
error = EAI_MEMORY;
|
||||||
conversion from 'size_t' to 'curl_socklen_t', possible loss of data
|
free(ca);
|
||||||
*/
|
break;
|
||||||
ca->ai_addrlen = (curl_socklen_t)ai->ai_addrlen;
|
|
||||||
if((ca->ai_addr = malloc(ca->ai_addrlen)) == NULL) {
|
|
||||||
error = EAI_MEMORY;
|
|
||||||
free(ca);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
memcpy(ca->ai_addr, ai->ai_addr, ca->ai_addrlen);
|
|
||||||
}
|
}
|
||||||
|
memcpy(ca->ai_addr, ai->ai_addr, ss_size);
|
||||||
|
|
||||||
if(ai->ai_canonname != NULL) {
|
if(ai->ai_canonname != NULL) {
|
||||||
if((ca->ai_canonname = strdup(ai->ai_canonname)) == NULL) {
|
if((ca->ai_canonname = strdup(ai->ai_canonname)) == NULL) {
|
||||||
error = EAI_MEMORY;
|
error = EAI_MEMORY;
|
||||||
if(ca->ai_addr)
|
free(ca->ai_addr);
|
||||||
free(ca->ai_addr);
|
|
||||||
free(ca);
|
free(ca);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -182,8 +197,6 @@ Curl_getaddrinfo_ex(const char *nodename,
|
|||||||
calast->ai_next = ca;
|
calast->ai_next = ca;
|
||||||
calast = ca;
|
calast = ca;
|
||||||
|
|
||||||
/* fetch next element fom the addrinfo list */
|
|
||||||
ainext = ai->ai_next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* destroy the addrinfo list */
|
/* destroy the addrinfo list */
|
||||||
@@ -195,6 +208,18 @@ Curl_getaddrinfo_ex(const char *nodename,
|
|||||||
Curl_freeaddrinfo(cafirst);
|
Curl_freeaddrinfo(cafirst);
|
||||||
cafirst = NULL;
|
cafirst = NULL;
|
||||||
}
|
}
|
||||||
|
else if(!cafirst) {
|
||||||
|
#ifdef EAI_NONAME
|
||||||
|
/* rfc3493 conformant */
|
||||||
|
error = EAI_NONAME;
|
||||||
|
#else
|
||||||
|
/* rfc3493 obsoleted */
|
||||||
|
error = EAI_NODATA;
|
||||||
|
#endif
|
||||||
|
#ifdef USE_WINSOCK
|
||||||
|
SET_SOCKERRNO(error);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
*result = cafirst;
|
*result = cafirst;
|
||||||
|
|
||||||
@@ -434,6 +459,26 @@ Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port)
|
|||||||
return ai;
|
return ai;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Given an IPv4 or IPv6 dotted string address, this converts it to a proper
|
||||||
|
* allocated Curl_addrinfo struct and returns it.
|
||||||
|
*/
|
||||||
|
Curl_addrinfo *Curl_str2addr(char *address, int port)
|
||||||
|
{
|
||||||
|
struct in_addr in;
|
||||||
|
if(Curl_inet_pton(AF_INET, address, &in) > 0)
|
||||||
|
/* This is a dotted IP address 123.123.123.123-style */
|
||||||
|
return Curl_ip2addr(AF_INET, &in, address, port);
|
||||||
|
#ifdef ENABLE_IPV6
|
||||||
|
else {
|
||||||
|
struct in6_addr in6;
|
||||||
|
if(Curl_inet_pton(AF_INET6, address, &in6) > 0)
|
||||||
|
/* This is a dotted IPv6 address ::1-style */
|
||||||
|
return Curl_ip2addr(AF_INET6, &in6, address, port);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return NULL; /* bad input format */
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO)
|
#if defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO)
|
||||||
/*
|
/*
|
||||||
|
@@ -80,6 +80,8 @@ Curl_he2ai(const struct hostent *he, int port);
|
|||||||
Curl_addrinfo *
|
Curl_addrinfo *
|
||||||
Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port);
|
Curl_ip2addr(int af, const void *inaddr, const char *hostname, int port);
|
||||||
|
|
||||||
|
Curl_addrinfo *Curl_str2addr(char *dotted, int port);
|
||||||
|
|
||||||
#if defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO)
|
#if defined(CURLDEBUG) && defined(HAVE_FREEADDRINFO)
|
||||||
void
|
void
|
||||||
curl_dofreeaddrinfo(struct addrinfo *freethis,
|
curl_dofreeaddrinfo(struct addrinfo *freethis,
|
||||||
|
@@ -51,7 +51,7 @@ static CURLcode rtmp_setup(struct connectdata *conn);
|
|||||||
static CURLcode rtmp_do(struct connectdata *conn, bool *done);
|
static CURLcode rtmp_do(struct connectdata *conn, bool *done);
|
||||||
static CURLcode rtmp_done(struct connectdata *conn, CURLcode, bool premature);
|
static CURLcode rtmp_done(struct connectdata *conn, CURLcode, bool premature);
|
||||||
static CURLcode rtmp_connect(struct connectdata *conn, bool *done);
|
static CURLcode rtmp_connect(struct connectdata *conn, bool *done);
|
||||||
static CURLcode rtmp_disconnect(struct connectdata *conn);
|
static CURLcode rtmp_disconnect(struct connectdata *conn, bool dead_connection);
|
||||||
|
|
||||||
static Curl_recv rtmp_recv;
|
static Curl_recv rtmp_recv;
|
||||||
static Curl_send rtmp_send;
|
static Curl_send rtmp_send;
|
||||||
@@ -236,9 +236,11 @@ static CURLcode rtmp_done(struct connectdata *conn, CURLcode status,
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CURLcode rtmp_disconnect(struct connectdata *conn)
|
static CURLcode rtmp_disconnect(struct connectdata *conn,
|
||||||
|
bool dead_connection)
|
||||||
{
|
{
|
||||||
RTMP *r = conn->proto.generic;
|
RTMP *r = conn->proto.generic;
|
||||||
|
(void)dead_connection;
|
||||||
if (r) {
|
if (r) {
|
||||||
conn->proto.generic = NULL;
|
conn->proto.generic = NULL;
|
||||||
RTMP_Close(r);
|
RTMP_Close(r);
|
||||||
|
@@ -36,6 +36,9 @@
|
|||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* We use our own typedef here since some headers might lack these */
|
||||||
|
typedef PSecurityFunctionTableA (APIENTRY *INITSECURITYINTERFACE_FN_A)(VOID);
|
||||||
|
|
||||||
/* Handle of security.dll or secur32.dll, depending on Windows version */
|
/* Handle of security.dll or secur32.dll, depending on Windows version */
|
||||||
HMODULE s_hSecDll = NULL;
|
HMODULE s_hSecDll = NULL;
|
||||||
|
|
||||||
@@ -59,7 +62,7 @@ CURLcode
|
|||||||
Curl_sspi_global_init(void)
|
Curl_sspi_global_init(void)
|
||||||
{
|
{
|
||||||
OSVERSIONINFO osver;
|
OSVERSIONINFO osver;
|
||||||
INIT_SECURITY_INTERFACE_A pInitSecurityInterface;
|
INITSECURITYINTERFACE_FN_A pInitSecurityInterface;
|
||||||
|
|
||||||
/* If security interface is not yet initialized try to do this */
|
/* If security interface is not yet initialized try to do this */
|
||||||
if(s_hSecDll == NULL) {
|
if(s_hSecDll == NULL) {
|
||||||
@@ -84,7 +87,7 @@ Curl_sspi_global_init(void)
|
|||||||
return CURLE_FAILED_INIT;
|
return CURLE_FAILED_INIT;
|
||||||
|
|
||||||
/* Get address of the InitSecurityInterfaceA function from the SSPI dll */
|
/* Get address of the InitSecurityInterfaceA function from the SSPI dll */
|
||||||
pInitSecurityInterface = (INIT_SECURITY_INTERFACE_A)
|
pInitSecurityInterface = (INITSECURITYINTERFACE_FN_A)
|
||||||
GetProcAddress(s_hSecDll, "InitSecurityInterfaceA");
|
GetProcAddress(s_hSecDll, "InitSecurityInterfaceA");
|
||||||
if(! pInitSecurityInterface)
|
if(! pInitSecurityInterface)
|
||||||
return CURLE_FAILED_INIT;
|
return CURLE_FAILED_INIT;
|
||||||
|
183
lib/easy.c
183
lib/easy.c
@@ -626,124 +626,117 @@ CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...)
|
|||||||
*/
|
*/
|
||||||
CURL *curl_easy_duphandle(CURL *incurl)
|
CURL *curl_easy_duphandle(CURL *incurl)
|
||||||
{
|
{
|
||||||
bool fail = TRUE;
|
|
||||||
struct SessionHandle *data=(struct SessionHandle *)incurl;
|
struct SessionHandle *data=(struct SessionHandle *)incurl;
|
||||||
|
|
||||||
struct SessionHandle *outcurl = calloc(1, sizeof(struct SessionHandle));
|
struct SessionHandle *outcurl = calloc(1, sizeof(struct SessionHandle));
|
||||||
|
|
||||||
if(NULL == outcurl)
|
if(NULL == outcurl)
|
||||||
return NULL; /* failure */
|
goto fail;
|
||||||
|
|
||||||
do {
|
/*
|
||||||
|
* We setup a few buffers we need. We should probably make them
|
||||||
|
* get setup on-demand in the code, as that would probably decrease
|
||||||
|
* the likeliness of us forgetting to init a buffer here in the future.
|
||||||
|
*/
|
||||||
|
outcurl->state.headerbuff = malloc(HEADERSIZE);
|
||||||
|
if(!outcurl->state.headerbuff)
|
||||||
|
goto fail;
|
||||||
|
outcurl->state.headersize = HEADERSIZE;
|
||||||
|
|
||||||
/*
|
/* copy all userdefined values */
|
||||||
* We setup a few buffers we need. We should probably make them
|
if(Curl_dupset(outcurl, data) != CURLE_OK)
|
||||||
* get setup on-demand in the code, as that would probably decrease
|
goto fail;
|
||||||
* the likeliness of us forgetting to init a buffer here in the future.
|
|
||||||
*/
|
|
||||||
outcurl->state.headerbuff = malloc(HEADERSIZE);
|
|
||||||
if(!outcurl->state.headerbuff) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
outcurl->state.headersize=HEADERSIZE;
|
|
||||||
|
|
||||||
/* copy all userdefined values */
|
/* the connection cache is setup on demand */
|
||||||
if(Curl_dupset(outcurl, data) != CURLE_OK)
|
outcurl->state.connc = NULL;
|
||||||
break;
|
|
||||||
|
|
||||||
/* the connection cache is setup on demand */
|
outcurl->state.lastconnect = -1;
|
||||||
outcurl->state.connc = NULL;
|
|
||||||
|
|
||||||
outcurl->state.lastconnect = -1;
|
outcurl->progress.flags = data->progress.flags;
|
||||||
|
outcurl->progress.callback = data->progress.callback;
|
||||||
outcurl->progress.flags = data->progress.flags;
|
|
||||||
outcurl->progress.callback = data->progress.callback;
|
|
||||||
|
|
||||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
||||||
if(data->cookies) {
|
if(data->cookies) {
|
||||||
/* If cookies are enabled in the parent handle, we enable them
|
/* If cookies are enabled in the parent handle, we enable them
|
||||||
in the clone as well! */
|
in the clone as well! */
|
||||||
outcurl->cookies = Curl_cookie_init(data,
|
outcurl->cookies = Curl_cookie_init(data,
|
||||||
data->cookies->filename,
|
data->cookies->filename,
|
||||||
outcurl->cookies,
|
outcurl->cookies,
|
||||||
data->set.cookiesession);
|
data->set.cookiesession);
|
||||||
if(!outcurl->cookies) {
|
if(!outcurl->cookies)
|
||||||
break;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif /* CURL_DISABLE_HTTP */
|
#endif /* CURL_DISABLE_HTTP */
|
||||||
|
|
||||||
/* duplicate all values in 'change' */
|
/* duplicate all values in 'change' */
|
||||||
|
|
||||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
||||||
if(data->change.cookielist) {
|
if(data->change.cookielist) {
|
||||||
outcurl->change.cookielist =
|
outcurl->change.cookielist =
|
||||||
Curl_slist_duplicate(data->change.cookielist);
|
Curl_slist_duplicate(data->change.cookielist);
|
||||||
|
if(!outcurl->change.cookielist)
|
||||||
if (!outcurl->change.cookielist)
|
goto fail;
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
#endif /* CURL_DISABLE_HTTP */
|
#endif /* CURL_DISABLE_HTTP */
|
||||||
|
|
||||||
if(data->change.url) {
|
if(data->change.url) {
|
||||||
outcurl->change.url = strdup(data->change.url);
|
outcurl->change.url = strdup(data->change.url);
|
||||||
if(!outcurl->change.url)
|
if(!outcurl->change.url)
|
||||||
break;
|
goto fail;
|
||||||
outcurl->change.url_alloc = TRUE;
|
outcurl->change.url_alloc = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data->change.referer) {
|
if(data->change.referer) {
|
||||||
outcurl->change.referer = strdup(data->change.referer);
|
outcurl->change.referer = strdup(data->change.referer);
|
||||||
if(!outcurl->change.referer)
|
if(!outcurl->change.referer)
|
||||||
break;
|
goto fail;
|
||||||
outcurl->change.referer_alloc = TRUE;
|
outcurl->change.referer_alloc = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_ARES
|
#ifdef USE_ARES
|
||||||
/* If we use ares, we setup a new ares channel for the new handle */
|
/* If we use ares, we clone the ares channel for the new handle */
|
||||||
if(ARES_SUCCESS != ares_init(&outcurl->state.areschannel))
|
if(ARES_SUCCESS != ares_dup(&outcurl->state.areschannel,
|
||||||
break;
|
data->state.areschannel))
|
||||||
|
goto fail;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV)
|
#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV)
|
||||||
outcurl->inbound_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST,
|
outcurl->inbound_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST,
|
||||||
CURL_ICONV_CODESET_OF_NETWORK);
|
CURL_ICONV_CODESET_OF_NETWORK);
|
||||||
outcurl->outbound_cd = iconv_open(CURL_ICONV_CODESET_OF_NETWORK,
|
outcurl->outbound_cd = iconv_open(CURL_ICONV_CODESET_OF_NETWORK,
|
||||||
CURL_ICONV_CODESET_OF_HOST);
|
CURL_ICONV_CODESET_OF_HOST);
|
||||||
outcurl->utf8_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST,
|
outcurl->utf8_cd = iconv_open(CURL_ICONV_CODESET_OF_HOST,
|
||||||
CURL_ICONV_CODESET_FOR_UTF8);
|
CURL_ICONV_CODESET_FOR_UTF8);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Curl_easy_initHandleData(outcurl);
|
Curl_easy_initHandleData(outcurl);
|
||||||
|
|
||||||
outcurl->magic = CURLEASY_MAGIC_NUMBER;
|
outcurl->magic = CURLEASY_MAGIC_NUMBER;
|
||||||
|
|
||||||
fail = FALSE; /* we reach this point and thus we are OK */
|
/* we reach this point and thus we are OK */
|
||||||
|
|
||||||
} while(0);
|
|
||||||
|
|
||||||
if(fail) {
|
|
||||||
if(outcurl) {
|
|
||||||
if(outcurl->state.connc &&
|
|
||||||
(outcurl->state.connc->type == CONNCACHE_PRIVATE))
|
|
||||||
Curl_rm_connc(outcurl->state.connc);
|
|
||||||
if(outcurl->state.headerbuff)
|
|
||||||
free(outcurl->state.headerbuff);
|
|
||||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
|
||||||
if(outcurl->change.cookielist)
|
|
||||||
curl_slist_free_all(outcurl->change.cookielist);
|
|
||||||
#endif
|
|
||||||
if(outcurl->change.url)
|
|
||||||
free(outcurl->change.url);
|
|
||||||
if(outcurl->change.referer)
|
|
||||||
free(outcurl->change.referer);
|
|
||||||
Curl_freeset(outcurl);
|
|
||||||
free(outcurl); /* free the memory again */
|
|
||||||
outcurl = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return outcurl;
|
return outcurl;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
|
||||||
|
if(outcurl) {
|
||||||
|
if(outcurl->state.connc &&
|
||||||
|
(outcurl->state.connc->type == CONNCACHE_PRIVATE))
|
||||||
|
Curl_rm_connc(outcurl->state.connc);
|
||||||
|
if(outcurl->state.headerbuff)
|
||||||
|
free(outcurl->state.headerbuff);
|
||||||
|
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
||||||
|
if(outcurl->change.cookielist)
|
||||||
|
curl_slist_free_all(outcurl->change.cookielist);
|
||||||
|
#endif
|
||||||
|
if(outcurl->change.url)
|
||||||
|
free(outcurl->change.url);
|
||||||
|
if(outcurl->change.referer)
|
||||||
|
free(outcurl->change.referer);
|
||||||
|
Curl_freeset(outcurl);
|
||||||
|
free(outcurl);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1072,9 +1065,6 @@ static CURLcode easy_connection(struct SessionHandle *data,
|
|||||||
curl_socket_t *sfd,
|
curl_socket_t *sfd,
|
||||||
struct connectdata **connp)
|
struct connectdata **connp)
|
||||||
{
|
{
|
||||||
CURLcode ret;
|
|
||||||
long sockfd;
|
|
||||||
|
|
||||||
if(data == NULL)
|
if(data == NULL)
|
||||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||||
|
|
||||||
@@ -1084,18 +1074,13 @@ static CURLcode easy_connection(struct SessionHandle *data,
|
|||||||
return CURLE_UNSUPPORTED_PROTOCOL;
|
return CURLE_UNSUPPORTED_PROTOCOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = Curl_getconnectinfo(data, &sockfd, connp);
|
*sfd = Curl_getconnectinfo(data, connp);
|
||||||
if(ret != CURLE_OK)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if(sockfd == -1) {
|
if(*sfd == CURL_SOCKET_BAD) {
|
||||||
failf(data, "Failed to get recent socket");
|
failf(data, "Failed to get recent socket");
|
||||||
return CURLE_UNSUPPORTED_PROTOCOL;
|
return CURLE_UNSUPPORTED_PROTOCOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
*sfd = (curl_socket_t)sockfd; /* we know that this is actually a socket
|
|
||||||
descriptor so the typecast is fine here */
|
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,8 +43,10 @@
|
|||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
|
||||||
/* Portable character check (remember EBCDIC). Do not use isalnum() because
|
/* Portable character check (remember EBCDIC). Do not use isalnum() because
|
||||||
its behavior is altered by the current locale. */
|
its behavior is altered by the current locale.
|
||||||
static bool Curl_isalnum(unsigned char in)
|
See http://tools.ietf.org/html/rfc3986#section-2.3
|
||||||
|
*/
|
||||||
|
static bool Curl_isunreserved(unsigned char in)
|
||||||
{
|
{
|
||||||
switch (in) {
|
switch (in) {
|
||||||
case '0': case '1': case '2': case '3': case '4':
|
case '0': case '1': case '2': case '3': case '4':
|
||||||
@@ -59,6 +61,7 @@ static bool Curl_isalnum(unsigned char in)
|
|||||||
case 'K': case 'L': case 'M': case 'N': case 'O':
|
case 'K': case 'L': case 'M': case 'N': case 'O':
|
||||||
case 'P': case 'Q': case 'R': case 'S': case 'T':
|
case 'P': case 'Q': case 'R': case 'S': case 'T':
|
||||||
case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
|
case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
|
||||||
|
case '-': case '.': case '_': case '~':
|
||||||
return TRUE;
|
return TRUE;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -100,7 +103,7 @@ char *curl_easy_escape(CURL *handle, const char *string, int inlength)
|
|||||||
while(length--) {
|
while(length--) {
|
||||||
in = *string;
|
in = *string;
|
||||||
|
|
||||||
if (Curl_isalnum(in)) {
|
if (Curl_isunreserved(in)) {
|
||||||
/* just copy this */
|
/* just copy this */
|
||||||
ns[strindex++]=in;
|
ns[strindex++]=in;
|
||||||
}
|
}
|
||||||
|
@@ -146,7 +146,7 @@ static CURLcode file_range(struct connectdata *conn)
|
|||||||
|
|
||||||
if(data->state.use_range && data->state.range) {
|
if(data->state.use_range && data->state.range) {
|
||||||
from=curlx_strtoofft(data->state.range, &ptr, 0);
|
from=curlx_strtoofft(data->state.range, &ptr, 0);
|
||||||
while(*ptr && (isspace((int)*ptr) || (*ptr=='-')))
|
while(*ptr && (ISSPACE(*ptr) || (*ptr=='-')))
|
||||||
ptr++;
|
ptr++;
|
||||||
to=curlx_strtoofft(ptr, &ptr2, 0);
|
to=curlx_strtoofft(ptr, &ptr2, 0);
|
||||||
if(ptr == ptr2) {
|
if(ptr == ptr2) {
|
||||||
|
@@ -123,6 +123,7 @@ Content-Disposition: form-data; name="FILECONTENT"
|
|||||||
#include "curl_rand.h"
|
#include "curl_rand.h"
|
||||||
#include "strequal.h"
|
#include "strequal.h"
|
||||||
#include "curl_memory.h"
|
#include "curl_memory.h"
|
||||||
|
#include "sendf.h"
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
@@ -975,7 +976,7 @@ int curl_formget(struct curl_httppost *form, void *arg,
|
|||||||
curl_off_t size;
|
curl_off_t size;
|
||||||
struct FormData *data, *ptr;
|
struct FormData *data, *ptr;
|
||||||
|
|
||||||
rc = Curl_getFormData(&data, form, NULL, &size);
|
rc = Curl_getformdata(NULL, &data, form, NULL, &size);
|
||||||
if(rc != CURLE_OK)
|
if(rc != CURLE_OK)
|
||||||
return (int)rc;
|
return (int)rc;
|
||||||
|
|
||||||
@@ -1105,15 +1106,20 @@ static char *strippath(const char *fullfile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Curl_getFormData() converts a linked list of "meta data" into a complete
|
* Curl_getformdata() converts a linked list of "meta data" into a complete
|
||||||
* (possibly huge) multipart formdata. The input list is in 'post', while the
|
* (possibly huge) multipart formdata. The input list is in 'post', while the
|
||||||
* output resulting linked lists gets stored in '*finalform'. *sizep will get
|
* output resulting linked lists gets stored in '*finalform'. *sizep will get
|
||||||
* the total size of the whole POST.
|
* the total size of the whole POST.
|
||||||
* A multipart/form_data content-type is built, unless a custom content-type
|
* A multipart/form_data content-type is built, unless a custom content-type
|
||||||
* is passed in 'custom_content_type'.
|
* is passed in 'custom_content_type'.
|
||||||
|
*
|
||||||
|
* This function will not do a failf() for the potential memory failures but
|
||||||
|
* should for all other errors it spots. Just note that this function MAY get
|
||||||
|
* a NULL pointer in the 'data' argument.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CURLcode Curl_getFormData(struct FormData **finalform,
|
CURLcode Curl_getformdata(struct SessionHandle *data,
|
||||||
|
struct FormData **finalform,
|
||||||
struct curl_httppost *post,
|
struct curl_httppost *post,
|
||||||
const char *custom_content_type,
|
const char *custom_content_type,
|
||||||
curl_off_t *sizep)
|
curl_off_t *sizep)
|
||||||
@@ -1271,23 +1277,6 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* The header Content-Transfer-Encoding: seems to confuse some receivers
|
|
||||||
* (like the built-in PHP engine). While I can't see any reason why it
|
|
||||||
* should, I can just as well skip this to the benefit of the users who
|
|
||||||
* are using such confused receivers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if(file->contenttype &&
|
|
||||||
!checkprefix("text/", file->contenttype)) {
|
|
||||||
/* this is not a text content, mention our binary encoding */
|
|
||||||
result = AddFormDataf(&form, &size,
|
|
||||||
"\r\nContent-Transfer-Encoding: binary");
|
|
||||||
if(result)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
result = AddFormDataf(&form, &size, "\r\n\r\n");
|
result = AddFormDataf(&form, &size, "\r\n\r\n");
|
||||||
if(result)
|
if(result)
|
||||||
break;
|
break;
|
||||||
@@ -1327,50 +1316,31 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result) {
|
|
||||||
Curl_formclean(&firstform);
|
|
||||||
free(boundary);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef _FORM_DEBUG
|
if(data)
|
||||||
fprintf(stderr,
|
failf(data, "couldn't open file \"%s\"\n", file->contents);
|
||||||
"\n==> Curl_getFormData couldn't open/read \"%s\"\n",
|
|
||||||
file->contents);
|
|
||||||
#endif
|
|
||||||
Curl_formclean(&firstform);
|
|
||||||
free(boundary);
|
|
||||||
*finalform = NULL;
|
*finalform = NULL;
|
||||||
return CURLE_READ_ERROR;
|
result = CURLE_READ_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(post->flags & HTTPPOST_BUFFER) {
|
else if(post->flags & HTTPPOST_BUFFER)
|
||||||
/* include contents of buffer */
|
/* include contents of buffer */
|
||||||
result = AddFormData(&form, FORM_CONTENT, post->buffer,
|
result = AddFormData(&form, FORM_CONTENT, post->buffer,
|
||||||
post->bufferlength, &size);
|
post->bufferlength, &size);
|
||||||
if(result)
|
else if(post->flags & HTTPPOST_CALLBACK)
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if(post->flags & HTTPPOST_CALLBACK) {
|
|
||||||
/* the contents should be read with the callback and the size
|
/* the contents should be read with the callback and the size
|
||||||
is set with the contentslength */
|
is set with the contentslength */
|
||||||
result = AddFormData(&form, FORM_CALLBACK, post->userp,
|
result = AddFormData(&form, FORM_CALLBACK, post->userp,
|
||||||
post->contentslength, &size);
|
post->contentslength, &size);
|
||||||
if(result)
|
else
|
||||||
break;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* include the contents we got */
|
/* include the contents we got */
|
||||||
result = AddFormData(&form, FORM_CONTENT, post->contents,
|
result = AddFormData(&form, FORM_CONTENT, post->contents,
|
||||||
post->contentslength, &size);
|
post->contentslength, &size);
|
||||||
if(result)
|
|
||||||
break;
|
file = file->more;
|
||||||
}
|
} while(file && !result); /* for each specified file for this field */
|
||||||
} while((file = file->more) != NULL); /* for each specified file for this field */
|
|
||||||
if(result) {
|
if(result) {
|
||||||
Curl_formclean(&firstform);
|
Curl_formclean(&firstform);
|
||||||
free(boundary);
|
free(boundary);
|
||||||
@@ -1666,25 +1636,25 @@ int main(int argc, argv_item_t argv[])
|
|||||||
CURLFORM_END))
|
CURLFORM_END))
|
||||||
++errors;
|
++errors;
|
||||||
|
|
||||||
rc = Curl_getFormData(&form, httppost, NULL, &size);
|
rc = Curl_getformdata(NULL, &form, httppost, NULL, &size);
|
||||||
if(rc != CURLE_OK) {
|
if(rc != CURLE_OK) {
|
||||||
if(rc != CURLE_READ_ERROR) {
|
if(rc != CURLE_READ_ERROR) {
|
||||||
const char *errortext = curl_easy_strerror(rc);
|
const char *errortext = curl_easy_strerror(rc);
|
||||||
fprintf(stdout, "\n==> Curl_getFormData error: %s\n", errortext);
|
fprintf(stdout, "\n==> Curl_getformdata error: %s\n", errortext);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Curl_FormInit(&formread, form);
|
Curl_FormInit(&formread, form);
|
||||||
|
|
||||||
do {
|
for(;;) {
|
||||||
nread = Curl_FormReader(buffer, 1, sizeof(buffer),
|
nread = Curl_FormReader(buffer, 1, sizeof(buffer),
|
||||||
(FILE *)&formread);
|
(FILE *)&formread);
|
||||||
|
|
||||||
if(nread < 1)
|
if(nread < 1)
|
||||||
break;
|
break;
|
||||||
fwrite(buffer, nread, 1, stdout);
|
fwrite(buffer, nread, 1, stdout);
|
||||||
} while(1);
|
}
|
||||||
|
|
||||||
fprintf(stdout, "size: ");
|
fprintf(stdout, "size: ");
|
||||||
fprintf(stdout, "%" FORMAT_OFF_T, size);
|
fprintf(stdout, "%" FORMAT_OFF_T, size);
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@@ -70,11 +70,11 @@ typedef struct FormInfo {
|
|||||||
|
|
||||||
int Curl_FormInit(struct Form *form, struct FormData *formdata );
|
int Curl_FormInit(struct Form *form, struct FormData *formdata );
|
||||||
|
|
||||||
CURLcode
|
CURLcode Curl_getformdata(struct SessionHandle *data,
|
||||||
Curl_getFormData(struct FormData **,
|
struct FormData **,
|
||||||
struct curl_httppost *post,
|
struct curl_httppost *post,
|
||||||
const char *custom_contenttype,
|
const char *custom_contenttype,
|
||||||
curl_off_t *size);
|
curl_off_t *size);
|
||||||
|
|
||||||
/* fread() emulation */
|
/* fread() emulation */
|
||||||
size_t Curl_FormReader(char *buffer,
|
size_t Curl_FormReader(char *buffer,
|
||||||
|
99
lib/ftp.c
99
lib/ftp.c
@@ -136,7 +136,7 @@ static CURLcode ftp_do(struct connectdata *conn, bool *done);
|
|||||||
static CURLcode ftp_done(struct connectdata *conn,
|
static CURLcode ftp_done(struct connectdata *conn,
|
||||||
CURLcode, bool premature);
|
CURLcode, bool premature);
|
||||||
static CURLcode ftp_connect(struct connectdata *conn, bool *done);
|
static CURLcode ftp_connect(struct connectdata *conn, bool *done);
|
||||||
static CURLcode ftp_disconnect(struct connectdata *conn);
|
static CURLcode ftp_disconnect(struct connectdata *conn, bool dead_connection);
|
||||||
static CURLcode ftp_nextconnect(struct connectdata *conn);
|
static CURLcode ftp_nextconnect(struct connectdata *conn);
|
||||||
static CURLcode ftp_multi_statemach(struct connectdata *conn, bool *done);
|
static CURLcode ftp_multi_statemach(struct connectdata *conn, bool *done);
|
||||||
static int ftp_getsock(struct connectdata *conn,
|
static int ftp_getsock(struct connectdata *conn,
|
||||||
@@ -324,7 +324,7 @@ static CURLcode AllowServerConnect(struct connectdata *conn)
|
|||||||
for(;;) {
|
for(;;) {
|
||||||
timeout_ms = Curl_timeleft(conn, NULL, TRUE);
|
timeout_ms = Curl_timeleft(conn, NULL, TRUE);
|
||||||
|
|
||||||
if(timeout_ms <= 0) {
|
if(timeout_ms < 0) {
|
||||||
/* if a timeout was already reached, bail out */
|
/* if a timeout was already reached, bail out */
|
||||||
failf(data, "Timeout while waiting for server connect");
|
failf(data, "Timeout while waiting for server connect");
|
||||||
return CURLE_OPERATION_TIMEDOUT;
|
return CURLE_OPERATION_TIMEDOUT;
|
||||||
@@ -379,7 +379,7 @@ static int ftp_endofresp(struct pingpong *pp,
|
|||||||
size_t len = pp->nread_resp;
|
size_t len = pp->nread_resp;
|
||||||
|
|
||||||
if((len > 3) && LASTLINE(line)) {
|
if((len > 3) && LASTLINE(line)) {
|
||||||
*code = atoi(line);
|
*code = curlx_sltosi(strtol(line, NULL, 10));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -405,13 +405,13 @@ static CURLcode ftp_readresp(curl_socket_t sockfd,
|
|||||||
/* FIXME: some errorchecking perhaps... ***/
|
/* FIXME: some errorchecking perhaps... ***/
|
||||||
switch(code) {
|
switch(code) {
|
||||||
case 631:
|
case 631:
|
||||||
code = Curl_sec_read_msg(conn, buf, prot_safe);
|
code = Curl_sec_read_msg(conn, buf, PROT_SAFE);
|
||||||
break;
|
break;
|
||||||
case 632:
|
case 632:
|
||||||
code = Curl_sec_read_msg(conn, buf, prot_private);
|
code = Curl_sec_read_msg(conn, buf, PROT_PRIVATE);
|
||||||
break;
|
break;
|
||||||
case 633:
|
case 633:
|
||||||
code = Curl_sec_read_msg(conn, buf, prot_confidential);
|
code = Curl_sec_read_msg(conn, buf, PROT_CONFIDENTIAL);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* normal ftp stuff we pass through! */
|
/* normal ftp stuff we pass through! */
|
||||||
@@ -425,6 +425,12 @@ static CURLcode ftp_readresp(curl_socket_t sockfd,
|
|||||||
if(ftpcode)
|
if(ftpcode)
|
||||||
*ftpcode = code;
|
*ftpcode = code;
|
||||||
|
|
||||||
|
if(421 == code)
|
||||||
|
/* 421 means "Service not available, closing control connection." and FTP
|
||||||
|
* servers use it to signal that idle session timeout has been exceeded.
|
||||||
|
* If we ignored the response, it could end up hanging in some cases. */
|
||||||
|
return CURLE_OPERATION_TIMEDOUT;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1360,18 +1366,16 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn,
|
|||||||
else {
|
else {
|
||||||
curl_off_t passed=0;
|
curl_off_t passed=0;
|
||||||
do {
|
do {
|
||||||
curl_off_t readthisamountnow = (data->state.resume_from - passed);
|
size_t readthisamountnow =
|
||||||
curl_off_t actuallyread;
|
(data->state.resume_from - passed > CURL_OFF_T_C(BUFSIZE)) ?
|
||||||
|
BUFSIZE : curlx_sotouz(data->state.resume_from - passed);
|
||||||
|
|
||||||
if(readthisamountnow > BUFSIZE)
|
size_t actuallyread =
|
||||||
readthisamountnow = BUFSIZE;
|
conn->fread_func(data->state.buffer, 1, readthisamountnow,
|
||||||
|
|
||||||
actuallyread = (curl_off_t)
|
|
||||||
conn->fread_func(data->state.buffer, 1, (size_t)readthisamountnow,
|
|
||||||
conn->fread_in);
|
conn->fread_in);
|
||||||
|
|
||||||
passed += actuallyread;
|
passed += actuallyread;
|
||||||
if((actuallyread <= 0) || (actuallyread > readthisamountnow)) {
|
if((actuallyread == 0) || (actuallyread > readthisamountnow)) {
|
||||||
/* this checks for greater-than only to make sure that the
|
/* this checks for greater-than only to make sure that the
|
||||||
CURL_READFUNC_ABORT return code still aborts */
|
CURL_READFUNC_ABORT return code still aborts */
|
||||||
failf(data, "Failed to read data");
|
failf(data, "Failed to read data");
|
||||||
@@ -2424,7 +2428,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
|
|||||||
set a valid level */
|
set a valid level */
|
||||||
Curl_sec_request_prot(conn, data->set.str[STRING_KRB_LEVEL]);
|
Curl_sec_request_prot(conn, data->set.str[STRING_KRB_LEVEL]);
|
||||||
|
|
||||||
if(Curl_sec_login(conn) != 0)
|
if(Curl_sec_login(conn) != CURLE_OK)
|
||||||
infof(data, "Logging in with password in cleartext!\n");
|
infof(data, "Logging in with password in cleartext!\n");
|
||||||
else
|
else
|
||||||
infof(data, "Authentication successful\n");
|
infof(data, "Authentication successful\n");
|
||||||
@@ -3076,10 +3080,6 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
|
|||||||
/* free the dir tree and file parts */
|
/* free the dir tree and file parts */
|
||||||
freedirs(ftpc);
|
freedirs(ftpc);
|
||||||
|
|
||||||
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
|
||||||
Curl_sec_fflush_fd(conn, conn->sock[SECONDARYSOCKET]);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* shut down the socket to inform the server we're done */
|
/* shut down the socket to inform the server we're done */
|
||||||
|
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
@@ -3087,6 +3087,10 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD) {
|
if(conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD) {
|
||||||
|
if(!result && ftpc->dont_check && data->req.maxdownload > 0)
|
||||||
|
/* partial download completed */
|
||||||
|
result = Curl_pp_sendf(pp, "ABOR");
|
||||||
|
|
||||||
if(conn->ssl[SECONDARYSOCKET].use) {
|
if(conn->ssl[SECONDARYSOCKET].use) {
|
||||||
/* The secondary socket is using SSL so we must close down that part
|
/* The secondary socket is using SSL so we must close down that part
|
||||||
first before we close the socket for real */
|
first before we close the socket for real */
|
||||||
@@ -3101,7 +3105,7 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((ftp->transfer == FTPTRANSFER_BODY) && ftpc->ctl_valid &&
|
if(!result && (ftp->transfer == FTPTRANSFER_BODY) && ftpc->ctl_valid &&
|
||||||
pp->pending_resp && !premature) {
|
pp->pending_resp && !premature) {
|
||||||
/*
|
/*
|
||||||
* Let's see what the server says about the transfer we just performed,
|
* Let's see what the server says about the transfer we just performed,
|
||||||
@@ -3127,6 +3131,14 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
|
|||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
if(ftpc->dont_check && data->req.maxdownload > 0) {
|
||||||
|
/* we have just sent ABOR and there is no reliable way to check if it was
|
||||||
|
* successful or not; we have to close the connection now */
|
||||||
|
infof(data, "partial download completed, closing connection\n");
|
||||||
|
conn->bits.close = TRUE; /* mark for closure */
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
if(!ftpc->dont_check) {
|
if(!ftpc->dont_check) {
|
||||||
/* 226 Transfer complete, 250 Requested file action okay, completed. */
|
/* 226 Transfer complete, 250 Requested file action okay, completed. */
|
||||||
if((ftpcode != 226) && (ftpcode != 250)) {
|
if((ftpcode != 226) && (ftpcode != 250)) {
|
||||||
@@ -3566,14 +3578,12 @@ static CURLcode init_wc_data(struct connectdata *conn)
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This is called recursively */
|
||||||
static CURLcode wc_statemach(struct connectdata *conn)
|
static CURLcode wc_statemach(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
struct WildcardData * const wildcard = &(conn->data->wildcard);
|
||||||
struct WildcardData *wildcard = &(conn->data->wildcard);
|
|
||||||
struct ftp_wc_tmpdata *ftp_tmp = wildcard->tmp;
|
|
||||||
char *tmp_path;
|
|
||||||
CURLcode ret = CURLE_OK;
|
CURLcode ret = CURLE_OK;
|
||||||
long userresponse = 0;
|
|
||||||
switch (wildcard->state) {
|
switch (wildcard->state) {
|
||||||
case CURLWC_INIT:
|
case CURLWC_INIT:
|
||||||
ret = init_wc_data(conn);
|
ret = init_wc_data(conn);
|
||||||
@@ -3584,10 +3594,10 @@ static CURLcode wc_statemach(struct connectdata *conn)
|
|||||||
wildcard->state = ret ? CURLWC_ERROR : CURLWC_MATCHING;
|
wildcard->state = ret ? CURLWC_ERROR : CURLWC_MATCHING;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLWC_MATCHING:
|
case CURLWC_MATCHING: {
|
||||||
/* In this state is LIST response successfully parsed, so lets restore
|
/* In this state is LIST response successfully parsed, so lets restore
|
||||||
previous WRITEFUNCTION callback and WRITEDATA pointer */
|
previous WRITEFUNCTION callback and WRITEDATA pointer */
|
||||||
ftp_tmp = wildcard->tmp;
|
struct ftp_wc_tmpdata *ftp_tmp = wildcard->tmp;
|
||||||
conn->data->set.fwrite_func = ftp_tmp->backup.write_function;
|
conn->data->set.fwrite_func = ftp_tmp->backup.write_function;
|
||||||
conn->data->set.out = ftp_tmp->backup.file_descriptor;
|
conn->data->set.out = ftp_tmp->backup.file_descriptor;
|
||||||
wildcard->state = CURLWC_DOWNLOADING;
|
wildcard->state = CURLWC_DOWNLOADING;
|
||||||
@@ -3602,13 +3612,14 @@ static CURLcode wc_statemach(struct connectdata *conn)
|
|||||||
wildcard->state = CURLWC_CLEAN;
|
wildcard->state = CURLWC_CLEAN;
|
||||||
return CURLE_REMOTE_FILE_NOT_FOUND;
|
return CURLE_REMOTE_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
ret = wc_statemach(conn);
|
return wc_statemach(conn);
|
||||||
break;
|
}
|
||||||
|
|
||||||
case CURLWC_DOWNLOADING: {
|
case CURLWC_DOWNLOADING: {
|
||||||
/* filelist has at least one file, lets get first one */
|
/* filelist has at least one file, lets get first one */
|
||||||
|
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||||
struct curl_fileinfo *finfo = wildcard->filelist->head->ptr;
|
struct curl_fileinfo *finfo = wildcard->filelist->head->ptr;
|
||||||
tmp_path = malloc(strlen(conn->data->state.path) +
|
char *tmp_path = malloc(strlen(conn->data->state.path) +
|
||||||
strlen(finfo->filename) + 1);
|
strlen(finfo->filename) + 1);
|
||||||
if(!tmp_path) {
|
if(!tmp_path) {
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
@@ -3627,7 +3638,7 @@ static CURLcode wc_statemach(struct connectdata *conn)
|
|||||||
|
|
||||||
infof(conn->data, "Wildcard - START of \"%s\"\n", finfo->filename);
|
infof(conn->data, "Wildcard - START of \"%s\"\n", finfo->filename);
|
||||||
if(conn->data->set.chunk_bgn) {
|
if(conn->data->set.chunk_bgn) {
|
||||||
userresponse = conn->data->set.chunk_bgn(
|
long userresponse = conn->data->set.chunk_bgn(
|
||||||
finfo, wildcard->customptr, (int)wildcard->filelist->size);
|
finfo, wildcard->customptr, (int)wildcard->filelist->size);
|
||||||
switch(userresponse) {
|
switch(userresponse) {
|
||||||
case CURL_CHUNK_BGN_FUNC_SKIP:
|
case CURL_CHUNK_BGN_FUNC_SKIP:
|
||||||
@@ -3670,16 +3681,17 @@ static CURLcode wc_statemach(struct connectdata *conn)
|
|||||||
Curl_llist_remove(wildcard->filelist, wildcard->filelist->head, NULL);
|
Curl_llist_remove(wildcard->filelist, wildcard->filelist->head, NULL);
|
||||||
wildcard->state = (wildcard->filelist->size == 0) ?
|
wildcard->state = (wildcard->filelist->size == 0) ?
|
||||||
CURLWC_CLEAN : CURLWC_DOWNLOADING;
|
CURLWC_CLEAN : CURLWC_DOWNLOADING;
|
||||||
ret = wc_statemach(conn);
|
return wc_statemach(conn);
|
||||||
} break;
|
}
|
||||||
|
|
||||||
case CURLWC_CLEAN:
|
case CURLWC_CLEAN: {
|
||||||
|
struct ftp_wc_tmpdata *ftp_tmp = wildcard->tmp;
|
||||||
ret = CURLE_OK;
|
ret = CURLE_OK;
|
||||||
if(ftp_tmp) {
|
if(ftp_tmp) {
|
||||||
ret = Curl_ftp_parselist_geterror(ftp_tmp->parser);
|
ret = Curl_ftp_parselist_geterror(ftp_tmp->parser);
|
||||||
}
|
}
|
||||||
wildcard->state = ret ? CURLWC_ERROR : CURLWC_DONE;
|
wildcard->state = ret ? CURLWC_ERROR : CURLWC_DONE;
|
||||||
break;
|
} break;
|
||||||
|
|
||||||
case CURLWC_DONE:
|
case CURLWC_DONE:
|
||||||
case CURLWC_ERROR:
|
case CURLWC_ERROR:
|
||||||
@@ -3770,11 +3782,12 @@ CURLcode Curl_ftpsendf(struct connectdata *conn,
|
|||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
conn->data_prot = prot_cmd;
|
conn->data_prot = PROT_CMD;
|
||||||
#endif
|
#endif
|
||||||
res = Curl_write(conn, conn->sock[FIRSTSOCKET], sptr, write_len,
|
res = Curl_write(conn, conn->sock[FIRSTSOCKET], sptr, write_len,
|
||||||
&bytes_written);
|
&bytes_written);
|
||||||
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
DEBUGASSERT(data_sec > PROT_NONE && data_sec < PROT_LAST);
|
||||||
conn->data_prot = data_sec;
|
conn->data_prot = data_sec;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3827,7 +3840,7 @@ static CURLcode ftp_quit(struct connectdata *conn)
|
|||||||
* Disconnect from an FTP server. Cleanup protocol-specific per-connection
|
* Disconnect from an FTP server. Cleanup protocol-specific per-connection
|
||||||
* resources. BLOCKING.
|
* resources. BLOCKING.
|
||||||
*/
|
*/
|
||||||
static CURLcode ftp_disconnect(struct connectdata *conn)
|
static CURLcode ftp_disconnect(struct connectdata *conn, bool dead_connection)
|
||||||
{
|
{
|
||||||
struct ftp_conn *ftpc= &conn->proto.ftpc;
|
struct ftp_conn *ftpc= &conn->proto.ftpc;
|
||||||
struct pingpong *pp = &ftpc->pp;
|
struct pingpong *pp = &ftpc->pp;
|
||||||
@@ -3839,6 +3852,8 @@ static CURLcode ftp_disconnect(struct connectdata *conn)
|
|||||||
ftp_quit() will check the state of ftp->ctl_valid. If it's ok it
|
ftp_quit() will check the state of ftp->ctl_valid. If it's ok it
|
||||||
will try to send the QUIT command, otherwise it will just return.
|
will try to send the QUIT command, otherwise it will just return.
|
||||||
*/
|
*/
|
||||||
|
if(dead_connection)
|
||||||
|
ftpc->ctl_valid = FALSE;
|
||||||
|
|
||||||
/* The FTP session may or may not have been allocated/setup at this point! */
|
/* The FTP session may or may not have been allocated/setup at this point! */
|
||||||
(void)ftp_quit(conn); /* ignore errors on the QUIT */
|
(void)ftp_quit(conn); /* ignore errors on the QUIT */
|
||||||
@@ -3864,6 +3879,10 @@ static CURLcode ftp_disconnect(struct connectdata *conn)
|
|||||||
|
|
||||||
Curl_pp_disconnect(pp);
|
Curl_pp_disconnect(pp);
|
||||||
|
|
||||||
|
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||||
|
Curl_sec_end(conn);
|
||||||
|
#endif
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3959,9 +3978,9 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
else {
|
else {
|
||||||
/* parse the URL path into separate path components */
|
/* parse the URL path into separate path components */
|
||||||
while((slash_pos = strchr(cur_pos, '/')) != NULL) {
|
while((slash_pos = strchr(cur_pos, '/')) != NULL) {
|
||||||
/* 1 or 0 to indicate absolute directory */
|
/* 1 or 0 pointer offset to indicate absolute directory */
|
||||||
bool absolute_dir = (bool)((cur_pos - data->state.path > 0) &&
|
ssize_t absolute_dir = ((cur_pos - data->state.path > 0) &&
|
||||||
(ftpc->dirdepth == 0));
|
(ftpc->dirdepth == 0))?1:0;
|
||||||
|
|
||||||
/* seek out the next path component */
|
/* seek out the next path component */
|
||||||
if(slash_pos-cur_pos) {
|
if(slash_pos-cur_pos) {
|
||||||
|
@@ -67,10 +67,10 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
|
|||||||
info->request_size = 0;
|
info->request_size = 0;
|
||||||
info->numconnects = 0;
|
info->numconnects = 0;
|
||||||
|
|
||||||
info->ip[0] = 0;
|
info->conn_primary_ip[0] = '\0';
|
||||||
info->port = 0;
|
info->conn_local_ip[0] = '\0';
|
||||||
info->localip[0] = 0;
|
info->conn_primary_port = 0;
|
||||||
info->localport = 0;
|
info->conn_local_port = 0;
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
@@ -83,6 +83,7 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
|
|||||||
char **param_charp=NULL;
|
char **param_charp=NULL;
|
||||||
struct curl_slist **param_slistp=NULL;
|
struct curl_slist **param_slistp=NULL;
|
||||||
int type;
|
int type;
|
||||||
|
curl_socket_t sockfd;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
struct curl_certinfo * to_certinfo;
|
struct curl_certinfo * to_certinfo;
|
||||||
@@ -219,7 +220,16 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
|
|||||||
*param_charp = data->state.most_recent_ftp_entrypath;
|
*param_charp = data->state.most_recent_ftp_entrypath;
|
||||||
break;
|
break;
|
||||||
case CURLINFO_LASTSOCKET:
|
case CURLINFO_LASTSOCKET:
|
||||||
(void)Curl_getconnectinfo(data, param_longp, NULL);
|
sockfd = Curl_getconnectinfo(data, NULL);
|
||||||
|
|
||||||
|
/* note: this is not a good conversion for systems with 64 bit sockets and
|
||||||
|
32 bit longs */
|
||||||
|
if(sockfd != CURL_SOCKET_BAD)
|
||||||
|
*param_longp = (long)sockfd;
|
||||||
|
else
|
||||||
|
/* this interface is documented to return -1 in case of badness, which
|
||||||
|
may not be the same as the CURL_SOCKET_BAD value */
|
||||||
|
*param_longp = -1;
|
||||||
break;
|
break;
|
||||||
case CURLINFO_REDIRECT_URL:
|
case CURLINFO_REDIRECT_URL:
|
||||||
/* Return the URL this request would have been redirected to if that
|
/* Return the URL this request would have been redirected to if that
|
||||||
@@ -228,20 +238,20 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
|
|||||||
break;
|
break;
|
||||||
case CURLINFO_PRIMARY_IP:
|
case CURLINFO_PRIMARY_IP:
|
||||||
/* Return the ip address of the most recent (primary) connection */
|
/* Return the ip address of the most recent (primary) connection */
|
||||||
*param_charp = data->info.ip;
|
*param_charp = data->info.conn_primary_ip;
|
||||||
break;
|
break;
|
||||||
case CURLINFO_PRIMARY_PORT:
|
case CURLINFO_PRIMARY_PORT:
|
||||||
/* Return the (remote) port of the most recent (primary) connection */
|
/* Return the (remote) port of the most recent (primary) connection */
|
||||||
*param_longp = data->info.port;
|
*param_longp = data->info.conn_primary_port;
|
||||||
break;
|
break;
|
||||||
case CURLINFO_LOCAL_IP:
|
case CURLINFO_LOCAL_IP:
|
||||||
/* Return the source/local ip address of the most recent (primary)
|
/* Return the source/local ip address of the most recent (primary)
|
||||||
connection */
|
connection */
|
||||||
*param_charp = data->info.localip;
|
*param_charp = data->info.conn_local_ip;
|
||||||
break;
|
break;
|
||||||
case CURLINFO_LOCAL_PORT:
|
case CURLINFO_LOCAL_PORT:
|
||||||
/* Return the local port of the most recent (primary) connection */
|
/* Return the local port of the most recent (primary) connection */
|
||||||
*param_longp = data->info.localport;
|
*param_longp = data->info.conn_local_port;
|
||||||
break;
|
break;
|
||||||
case CURLINFO_CERTINFO:
|
case CURLINFO_CERTINFO:
|
||||||
/* Return the a pointer to the certinfo struct. Not really an slist
|
/* Return the a pointer to the certinfo struct. Not really an slist
|
||||||
|
209
lib/gopher.c
Normal file
209
lib/gopher.c
Normal file
@@ -0,0 +1,209 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
* Copyright (C) 1998 - 2010, 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 "setup.h"
|
||||||
|
|
||||||
|
#ifndef CURL_DISABLE_GOPHER
|
||||||
|
|
||||||
|
/* -- WIN32 approved -- */
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <time.h>
|
||||||
|
#include <io.h>
|
||||||
|
#else
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#ifdef HAVE_SYS_TIME_H
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
#include <netdb.h>
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NET_IF_H
|
||||||
|
#include <net/if.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_PARAM_H
|
||||||
|
#include <sys/param.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_SELECT_H
|
||||||
|
#include <sys/select.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "urldata.h"
|
||||||
|
#include <curl/curl.h>
|
||||||
|
#include "transfer.h"
|
||||||
|
#include "sendf.h"
|
||||||
|
|
||||||
|
#include "progress.h"
|
||||||
|
#include "strequal.h"
|
||||||
|
#include "gopher.h"
|
||||||
|
#include "rawstr.h"
|
||||||
|
#include "select.h"
|
||||||
|
#include "url.h"
|
||||||
|
#include "warnless.h"
|
||||||
|
|
||||||
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
|
#include <curl/mprintf.h>
|
||||||
|
|
||||||
|
/* The last #include file should be: */
|
||||||
|
#include "memdebug.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Forward declarations.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static CURLcode gopher_do(struct connectdata *conn, bool *done);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gopher protocol handler.
|
||||||
|
* This is also a nice simple template to build off for simple
|
||||||
|
* connect-command-download protocols.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const struct Curl_handler Curl_handler_gopher = {
|
||||||
|
"GOPHER", /* scheme */
|
||||||
|
ZERO_NULL, /* setup_connection */
|
||||||
|
gopher_do, /* do_it */
|
||||||
|
ZERO_NULL, /* done */
|
||||||
|
ZERO_NULL, /* do_more */
|
||||||
|
ZERO_NULL, /* connect_it */
|
||||||
|
ZERO_NULL, /* connecting */
|
||||||
|
ZERO_NULL, /* doing */
|
||||||
|
ZERO_NULL, /* proto_getsock */
|
||||||
|
ZERO_NULL, /* doing_getsock */
|
||||||
|
ZERO_NULL, /* perform_getsock */
|
||||||
|
ZERO_NULL, /* disconnect */
|
||||||
|
PORT_GOPHER, /* defport */
|
||||||
|
PROT_GOPHER /* protocol */
|
||||||
|
};
|
||||||
|
|
||||||
|
static CURLcode gopher_do(struct connectdata *conn, bool *done)
|
||||||
|
{
|
||||||
|
CURLcode result=CURLE_OK;
|
||||||
|
struct SessionHandle *data=conn->data;
|
||||||
|
curl_socket_t sockfd = conn->sock[FIRSTSOCKET];
|
||||||
|
|
||||||
|
curl_off_t *bytecount = &data->req.bytecount;
|
||||||
|
char *path = data->state.path;
|
||||||
|
char *sel;
|
||||||
|
char *sel_org = NULL;
|
||||||
|
ssize_t amount, k;
|
||||||
|
|
||||||
|
*done = TRUE; /* unconditionally */
|
||||||
|
|
||||||
|
/* Create selector. Degenerate cases: / and /1 => convert to "" */
|
||||||
|
if (strlen(path) <= 2)
|
||||||
|
sel = (char *)"";
|
||||||
|
else {
|
||||||
|
char *newp;
|
||||||
|
size_t j, i;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
/* Otherwise, drop / and the first character (i.e., item type) ... */
|
||||||
|
newp = path;
|
||||||
|
newp+=2;
|
||||||
|
|
||||||
|
/* ... then turn ? into TAB for search servers, Veronica, etc. ... */
|
||||||
|
j = strlen(newp);
|
||||||
|
for(i=0; i<j; i++)
|
||||||
|
if(newp[i] == '?')
|
||||||
|
newp[i] = '\x09';
|
||||||
|
|
||||||
|
/* ... and finally unescape */
|
||||||
|
sel = curl_easy_unescape(data, newp, 0, &len);
|
||||||
|
if (!sel)
|
||||||
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
sel_org = sel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We use Curl_write instead of Curl_sendf to make sure the entire buffer is
|
||||||
|
sent, which could be sizeable with long selectors. */
|
||||||
|
k = curlx_uztosz(strlen(sel));
|
||||||
|
|
||||||
|
for(;;) {
|
||||||
|
result = Curl_write(conn, sockfd, sel, k, &amount);
|
||||||
|
if (CURLE_OK == result) { /* Which may not have written it all! */
|
||||||
|
result = Curl_client_write(conn, CLIENTWRITE_HEADER, sel, amount);
|
||||||
|
if(result) {
|
||||||
|
Curl_safefree(sel_org);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
k -= amount;
|
||||||
|
sel += amount;
|
||||||
|
if (k < 1)
|
||||||
|
break; /* but it did write it all */
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
failf(data, "Failed sending Gopher request");
|
||||||
|
Curl_safefree(sel_org);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/* Don't busyloop. The entire loop thing is a work-around as it causes a
|
||||||
|
BLOCKING behavior which is a NO-NO. This function should rather be
|
||||||
|
split up in a do and a doing piece where the pieces that aren't
|
||||||
|
possible to send now will be sent in the doing function repeatedly
|
||||||
|
until the entire request is sent.
|
||||||
|
|
||||||
|
Wait a while for the socket to be writable. Note that this doesn't
|
||||||
|
acknowledge the timeout.
|
||||||
|
*/
|
||||||
|
Curl_socket_ready(CURL_SOCKET_BAD, sockfd, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
Curl_safefree(sel_org);
|
||||||
|
|
||||||
|
/* We can use Curl_sendf to send the terminal \r\n relatively safely and
|
||||||
|
save allocing another string/doing another _write loop. */
|
||||||
|
result = Curl_sendf(sockfd, conn, "\r\n");
|
||||||
|
if (result != CURLE_OK) {
|
||||||
|
failf(data, "Failed sending Gopher request");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
result = Curl_client_write(conn, CLIENTWRITE_HEADER, (char *)"\r\n", 2);
|
||||||
|
if(result)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
|
||||||
|
-1, NULL); /* no upload */
|
||||||
|
return CURLE_OK;
|
||||||
|
}
|
||||||
|
#endif /*CURL_DISABLE_GOPHER*/
|
29
lib/gopher.h
Normal file
29
lib/gopher.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#ifndef HEADER_CURL_GOPHER_H
|
||||||
|
#define HEADER_CURL_GOPHER_H
|
||||||
|
/***************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
* Copyright (C) 1998 - 2009, 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.
|
||||||
|
*
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef CURL_DISABLE_GOPHER
|
||||||
|
extern const struct Curl_handler Curl_handler_gopher;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* HEADER_CURL_GOPHER_H */
|
65
lib/gtls.c
65
lib/gtls.c
@@ -78,6 +78,7 @@ static void tls_log_func(int level, const char *str)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
static bool gtls_inited = FALSE;
|
static bool gtls_inited = FALSE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Custom push and pull callback functions used by GNU TLS to read and write
|
* Custom push and pull callback functions used by GNU TLS to read and write
|
||||||
* to the socket. These functions are simple wrappers to send() and recv()
|
* to the socket. These functions are simple wrappers to send() and recv()
|
||||||
@@ -85,15 +86,54 @@ static bool gtls_inited = FALSE;
|
|||||||
* We use custom functions rather than the GNU TLS defaults because it allows
|
* We use custom functions rather than the GNU TLS defaults because it allows
|
||||||
* us to get specific about the fourth "flags" argument, and to use arbitrary
|
* us to get specific about the fourth "flags" argument, and to use arbitrary
|
||||||
* private data with gnutls_transport_set_ptr if we wish.
|
* private data with gnutls_transport_set_ptr if we wish.
|
||||||
|
*
|
||||||
|
* When these custom push and pull callbacks fail, GNU TLS checks its own
|
||||||
|
* session-specific error variable, and when not set also its own global
|
||||||
|
* errno variable, in order to take appropriate action. GNU TLS does not
|
||||||
|
* require that the transport is actually a socket. This implies that for
|
||||||
|
* Windows builds these callbacks should ideally set the session-specific
|
||||||
|
* error variable using function gnutls_transport_set_errno or as a last
|
||||||
|
* resort global errno variable using gnutls_transport_set_global_errno,
|
||||||
|
* with a transport agnostic error value. This implies that some winsock
|
||||||
|
* error translation must take place in these callbacks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef USE_WINSOCK
|
||||||
|
# define gtls_EINTR 4
|
||||||
|
# define gtls_EIO 5
|
||||||
|
# define gtls_EAGAIN 11
|
||||||
|
static int gtls_mapped_sockerrno(void)
|
||||||
|
{
|
||||||
|
switch(SOCKERRNO) {
|
||||||
|
case WSAEWOULDBLOCK:
|
||||||
|
return gtls_EAGAIN;
|
||||||
|
case WSAEINTR:
|
||||||
|
return gtls_EINTR;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return gtls_EIO;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static ssize_t Curl_gtls_push(void *s, const void *buf, size_t len)
|
static ssize_t Curl_gtls_push(void *s, const void *buf, size_t len)
|
||||||
{
|
{
|
||||||
return swrite(GNUTLS_POINTER_TO_INT_CAST(s), buf, len);
|
ssize_t ret = swrite(GNUTLS_POINTER_TO_INT_CAST(s), buf, len);
|
||||||
|
#ifdef USE_WINSOCK
|
||||||
|
if(ret < 0)
|
||||||
|
gnutls_transport_set_global_errno(gtls_mapped_sockerrno());
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t Curl_gtls_pull(void *s, void *buf, size_t len)
|
static ssize_t Curl_gtls_pull(void *s, void *buf, size_t len)
|
||||||
{
|
{
|
||||||
return sread(GNUTLS_POINTER_TO_INT_CAST(s), buf, len);
|
ssize_t ret = sread(GNUTLS_POINTER_TO_INT_CAST(s), buf, len);
|
||||||
|
#ifdef USE_WINSOCK
|
||||||
|
if(ret < 0)
|
||||||
|
gnutls_transport_set_global_errno(gtls_mapped_sockerrno());
|
||||||
|
#endif
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Curl_gtls_init()
|
/* Curl_gtls_init()
|
||||||
@@ -196,7 +236,7 @@ static CURLcode handshake(struct connectdata *conn,
|
|||||||
int rc;
|
int rc;
|
||||||
int what;
|
int what;
|
||||||
|
|
||||||
while(1) {
|
for(;;) {
|
||||||
/* check allowed time left */
|
/* check allowed time left */
|
||||||
timeout_ms = Curl_timeleft(conn, NULL, duringconnect);
|
timeout_ms = Curl_timeleft(conn, NULL, duringconnect);
|
||||||
|
|
||||||
@@ -216,19 +256,18 @@ static CURLcode handshake(struct connectdata *conn,
|
|||||||
connssl->connecting_state?sockfd:CURL_SOCKET_BAD;
|
connssl->connecting_state?sockfd:CURL_SOCKET_BAD;
|
||||||
|
|
||||||
what = Curl_socket_ready(readfd, writefd,
|
what = Curl_socket_ready(readfd, writefd,
|
||||||
nonblocking?0:(int)timeout_ms);
|
nonblocking?0:(int)timeout_ms?1000:timeout_ms);
|
||||||
if(what < 0) {
|
if(what < 0) {
|
||||||
/* fatal error */
|
/* fatal error */
|
||||||
failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO);
|
failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO);
|
||||||
return CURLE_SSL_CONNECT_ERROR;
|
return CURLE_SSL_CONNECT_ERROR;
|
||||||
}
|
}
|
||||||
else if(0 == what) {
|
else if(0 == what) {
|
||||||
if(nonblocking) {
|
if(nonblocking)
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
else if(timeout_ms) {
|
||||||
else {
|
|
||||||
/* timeout */
|
/* timeout */
|
||||||
failf(data, "SSL connection timeout");
|
failf(data, "SSL connection timeout at %ld", timeout_ms);
|
||||||
return CURLE_OPERATION_TIMEDOUT;
|
return CURLE_OPERATION_TIMEDOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,12 +280,14 @@ static CURLcode handshake(struct connectdata *conn,
|
|||||||
connssl->connecting_state =
|
connssl->connecting_state =
|
||||||
gnutls_record_get_direction(session)?
|
gnutls_record_get_direction(session)?
|
||||||
ssl_connect_2_writing:ssl_connect_2_reading;
|
ssl_connect_2_writing:ssl_connect_2_reading;
|
||||||
if(nonblocking) {
|
if(nonblocking)
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
} else if (rc < 0) {
|
else if (rc < 0) {
|
||||||
failf(data, "gnutls_handshake() failed: %s", gnutls_strerror(rc));
|
failf(data, "gnutls_handshake() failed: %s", gnutls_strerror(rc));
|
||||||
} else {
|
return CURLE_SSL_CONNECT_ERROR;
|
||||||
|
}
|
||||||
|
else {
|
||||||
/* Reset our connect state machine */
|
/* Reset our connect state machine */
|
||||||
connssl->connecting_state = ssl_connect_1;
|
connssl->connecting_state = ssl_connect_1;
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
|
@@ -60,7 +60,7 @@ Curl_HMAC_init(const HMAC_params * hashparams,
|
|||||||
|
|
||||||
/* Create HMAC context. */
|
/* Create HMAC context. */
|
||||||
i = sizeof *ctxt + 2 * hashparams->hmac_ctxtsize + hashparams->hmac_resultlen;
|
i = sizeof *ctxt + 2 * hashparams->hmac_ctxtsize + hashparams->hmac_resultlen;
|
||||||
ctxt = (HMAC_context *) malloc(i);
|
ctxt = malloc(i);
|
||||||
|
|
||||||
if(!ctxt)
|
if(!ctxt)
|
||||||
return ctxt;
|
return ctxt;
|
||||||
@@ -85,9 +85,9 @@ Curl_HMAC_init(const HMAC_params * hashparams,
|
|||||||
(*hashparams->hmac_hinit)(ctxt->hmac_hashctxt2);
|
(*hashparams->hmac_hinit)(ctxt->hmac_hashctxt2);
|
||||||
|
|
||||||
for (i = 0; i < keylen; i++) {
|
for (i = 0; i < keylen; i++) {
|
||||||
b = *key ^ hmac_ipad;
|
b = (unsigned char)(*key ^ hmac_ipad);
|
||||||
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &b, 1);
|
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &b, 1);
|
||||||
b = *key++ ^ hmac_opad;
|
b = (unsigned char)(*key++ ^ hmac_opad);
|
||||||
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &b, 1);
|
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &b, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -224,17 +224,12 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
|
|||||||
long timeout;
|
long timeout;
|
||||||
struct timeval now = Curl_tvnow();
|
struct timeval now = Curl_tvnow();
|
||||||
|
|
||||||
/* now, see if there's a connect timeout or a regular timeout to
|
timeout = Curl_timeleft(conn, &now, TRUE);
|
||||||
use instead of the default one */
|
if(!timeout)
|
||||||
if(conn->data->set.connecttimeout)
|
|
||||||
timeout = conn->data->set.connecttimeout;
|
|
||||||
else if(conn->data->set.timeout)
|
|
||||||
timeout = conn->data->set.timeout;
|
|
||||||
else
|
|
||||||
timeout = CURL_TIMEOUT_RESOLVE * 1000; /* default name resolve timeout */
|
timeout = CURL_TIMEOUT_RESOLVE * 1000; /* default name resolve timeout */
|
||||||
|
|
||||||
/* Wait for the name resolve query to complete. */
|
/* Wait for the name resolve query to complete. */
|
||||||
while(1) {
|
for(;;) {
|
||||||
struct timeval *tvp, tv, store;
|
struct timeval *tvp, tv, store;
|
||||||
long timediff;
|
long timediff;
|
||||||
int itimeout;
|
int itimeout;
|
||||||
@@ -265,8 +260,10 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
|
|||||||
timeout = -1; /* trigger the cancel below */
|
timeout = -1; /* trigger the cancel below */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
timediff = Curl_tvdiff(Curl_tvnow(), now); /* spent time */
|
struct timeval now2 = Curl_tvnow();
|
||||||
|
timediff = Curl_tvdiff(now2, now); /* spent time */
|
||||||
timeout -= timediff?timediff:1; /* always deduct at least 1 */
|
timeout -= timediff?timediff:1; /* always deduct at least 1 */
|
||||||
|
now = now2; /* for next loop */
|
||||||
}
|
}
|
||||||
if(timeout < 0) {
|
if(timeout < 0) {
|
||||||
/* our timeout, so we cancel the ares operation */
|
/* our timeout, so we cancel the ares operation */
|
||||||
@@ -378,7 +375,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
return Curl_ip2addr(AF_INET6, &in6, hostname, port);
|
return Curl_ip2addr(AF_INET6, &in6, hostname, port);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(data->set.ip_version) {
|
switch(conn->ip_version) {
|
||||||
default:
|
default:
|
||||||
#if ARES_VERSION >= 0x010601
|
#if ARES_VERSION >= 0x010601
|
||||||
family = PF_UNSPEC; /* supported by c-ares since 1.6.1, so for older
|
family = PF_UNSPEC; /* supported by c-ares since 1.6.1, so for older
|
||||||
|
13
lib/hostip.c
13
lib/hostip.c
@@ -67,6 +67,7 @@
|
|||||||
#include "strerror.h"
|
#include "strerror.h"
|
||||||
#include "url.h"
|
#include "url.h"
|
||||||
#include "inet_ntop.h"
|
#include "inet_ntop.h"
|
||||||
|
#include "warnless.h"
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
@@ -366,7 +367,7 @@ Curl_cache_addr(struct SessionHandle *data,
|
|||||||
dns = dns2;
|
dns = dns2;
|
||||||
dns->inuse++; /* mark entry as in-use */
|
dns->inuse++; /* mark entry as in-use */
|
||||||
|
|
||||||
/* free the allocated entry_id again */
|
/* free the allocated entry_id */
|
||||||
free(entry_id);
|
free(entry_id);
|
||||||
|
|
||||||
return dns;
|
return dns;
|
||||||
@@ -421,6 +422,9 @@ int Curl_resolv(struct connectdata *conn,
|
|||||||
/* See if its already in our dns cache */
|
/* See if its already in our dns cache */
|
||||||
dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len+1);
|
dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len+1);
|
||||||
|
|
||||||
|
/* free the allocated entry_id again */
|
||||||
|
free(entry_id);
|
||||||
|
|
||||||
/* See whether the returned entry is stale. Done before we release lock */
|
/* See whether the returned entry is stale. Done before we release lock */
|
||||||
if( remove_entry_if_stale(data, dns) )
|
if( remove_entry_if_stale(data, dns) )
|
||||||
dns = NULL; /* the memory deallocation is being handled by the hash */
|
dns = NULL; /* the memory deallocation is being handled by the hash */
|
||||||
@@ -433,9 +437,6 @@ int Curl_resolv(struct connectdata *conn,
|
|||||||
if(data->share)
|
if(data->share)
|
||||||
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
||||||
|
|
||||||
/* free the allocated entry_id again */
|
|
||||||
free(entry_id);
|
|
||||||
|
|
||||||
if(!dns) {
|
if(!dns) {
|
||||||
/* The entry was not in the cache. Resolve it to IP address */
|
/* The entry was not in the cache. Resolve it to IP address */
|
||||||
|
|
||||||
@@ -444,7 +445,7 @@ int Curl_resolv(struct connectdata *conn,
|
|||||||
|
|
||||||
/* Check what IP specifics the app has requested and if we can provide it.
|
/* Check what IP specifics the app has requested and if we can provide it.
|
||||||
* If not, bail out. */
|
* If not, bail out. */
|
||||||
if(!Curl_ipvalid(data))
|
if(!Curl_ipvalid(conn))
|
||||||
return CURLRESOLV_ERROR;
|
return CURLRESOLV_ERROR;
|
||||||
|
|
||||||
/* If Curl_getaddrinfo() returns NULL, 'respwait' might be set to a
|
/* If Curl_getaddrinfo() returns NULL, 'respwait' might be set to a
|
||||||
@@ -597,7 +598,7 @@ int Curl_resolv_timeout(struct connectdata *conn,
|
|||||||
|
|
||||||
/* alarm() makes a signal get sent when the timeout fires off, and that
|
/* alarm() makes a signal get sent when the timeout fires off, and that
|
||||||
will abort system calls */
|
will abort system calls */
|
||||||
prev_alarm = alarm((unsigned int) (timeout/1000L));
|
prev_alarm = alarm(curlx_sltoui(timeout/1000L));
|
||||||
|
|
||||||
/* This allows us to time-out from the name resolver, as the timeout
|
/* This allows us to time-out from the name resolver, as the timeout
|
||||||
will generate a signal and we will siglongjmp() from that here.
|
will generate a signal and we will siglongjmp() from that here.
|
||||||
|
@@ -111,7 +111,7 @@ int Curl_resolv_timeout(struct connectdata *conn, const char *hostname,
|
|||||||
* Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've
|
* Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've
|
||||||
* been set and returns TRUE if they are OK.
|
* been set and returns TRUE if they are OK.
|
||||||
*/
|
*/
|
||||||
bool Curl_ipvalid(struct SessionHandle *data);
|
bool Curl_ipvalid(struct connectdata *conn);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Curl_getaddrinfo() is the generic low-level name resolve API within this
|
* Curl_getaddrinfo() is the generic low-level name resolve API within this
|
||||||
|
@@ -77,9 +77,9 @@
|
|||||||
* Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've
|
* Curl_ipvalid() checks what CURL_IPRESOLVE_* requirements that might've
|
||||||
* been set and returns TRUE if they are OK.
|
* been set and returns TRUE if they are OK.
|
||||||
*/
|
*/
|
||||||
bool Curl_ipvalid(struct SessionHandle *data)
|
bool Curl_ipvalid(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
if(data->set.ip_version == CURL_IPRESOLVE_V6)
|
if(conn->ip_version == CURL_IPRESOLVE_V6)
|
||||||
/* an ipv6 address was requested and we can't get/use one */
|
/* an ipv6 address was requested and we can't get/use one */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user