Compare commits
320 Commits
curl-7_20_
...
curl-7_21_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8249b0522d | ||
![]() |
a43201e578 | ||
![]() |
3c2ee9c341 | ||
![]() |
8d31d70114 | ||
![]() |
9754b20adb | ||
![]() |
17c1e3bcba | ||
![]() |
6cf90c6a7b | ||
![]() |
67d76dd520 | ||
![]() |
8348dd96dd | ||
![]() |
2596eb6d19 | ||
![]() |
625932d398 | ||
![]() |
37201e3c36 | ||
![]() |
06869597c3 | ||
![]() |
517f3a1b8f | ||
![]() |
495d3e07d4 | ||
![]() |
44e5e37f38 | ||
![]() |
1d594772fd | ||
![]() |
ff26895b5c | ||
![]() |
d7134036b2 | ||
![]() |
7115245f88 | ||
![]() |
dc2157a087 | ||
![]() |
5d5dd08e77 | ||
![]() |
cfbdbf9783 | ||
![]() |
b24e872502 | ||
![]() |
50a1d5ee1c | ||
![]() |
6ccbd1bee4 | ||
![]() |
1267719735 | ||
![]() |
c49e9683b8 | ||
![]() |
6ea043a504 | ||
![]() |
af4eae77ac | ||
![]() |
7d342c723c | ||
![]() |
5c2b6b2d3e | ||
![]() |
11958ed331 | ||
![]() |
15201da4ca | ||
![]() |
59bad26bb2 | ||
![]() |
f91d578674 | ||
![]() |
9df8257301 | ||
![]() |
992ceae386 | ||
![]() |
364fd2f1ad | ||
![]() |
1cbe66fbc8 | ||
![]() |
f8cf037ecf | ||
![]() |
6028fdb305 | ||
![]() |
45456135d5 | ||
![]() |
52beeb2c9f | ||
![]() |
544f15af98 | ||
![]() |
000ac0c975 | ||
![]() |
fc308282ac | ||
![]() |
e9f3513264 | ||
![]() |
a1a5ba3d0a | ||
![]() |
687df5c8c3 | ||
![]() |
40253e32fe | ||
![]() |
f97a7eb400 | ||
![]() |
3cf658fc24 | ||
![]() |
5247266df6 | ||
![]() |
dfa6ee890d | ||
![]() |
bd5df39a29 | ||
![]() |
6f3dc2a726 | ||
![]() |
b01fb30f9c | ||
![]() |
f38e52071e | ||
![]() |
811fcccfc9 | ||
![]() |
b552ca223e | ||
![]() |
a93522f68d | ||
![]() |
425060fed1 | ||
![]() |
fbee86a9e2 | ||
![]() |
2f0c118577 | ||
![]() |
53e47ca947 | ||
![]() |
314117cbf1 | ||
![]() |
d296dd4ee8 | ||
![]() |
04eff9beb9 | ||
![]() |
b5c3feda17 | ||
![]() |
01c309e186 | ||
![]() |
d873c820bd | ||
![]() |
41cf1f4090 | ||
![]() |
6ad0acb608 | ||
![]() |
cfbb351e22 | ||
![]() |
11f53b9a18 | ||
![]() |
eb33f5d1f8 | ||
![]() |
cef30e0924 | ||
![]() |
a13128596c | ||
![]() |
6d2ccfed48 | ||
![]() |
7738b15977 | ||
![]() |
0fa4b41c2b | ||
![]() |
7d166b0ef6 | ||
![]() |
affff47b3d | ||
![]() |
d6981cb508 | ||
![]() |
40ecd6c9b8 | ||
![]() |
181b08babb | ||
![]() |
7abf3b97fe | ||
![]() |
4a1384a8b4 | ||
![]() |
d76874a665 | ||
![]() |
c8d42b2f1c | ||
![]() |
84332b60b9 | ||
![]() |
bc0699f226 | ||
![]() |
157e6d4e7e | ||
![]() |
d4e6404135 | ||
![]() |
3992309285 | ||
![]() |
241b704e1f | ||
![]() |
1dbb9a0ba4 | ||
![]() |
e7743aa7b4 | ||
![]() |
915032ea02 | ||
![]() |
e01cc7737c | ||
![]() |
bd36927f18 | ||
![]() |
0417d34533 | ||
![]() |
a57611e308 | ||
![]() |
12533bb184 | ||
![]() |
9be951a415 | ||
![]() |
7239538d9a | ||
![]() |
18a9ee6bdf | ||
![]() |
f3b77e5611 | ||
![]() |
89924a897d | ||
![]() |
bcefe839c7 | ||
![]() |
458dd4550b | ||
![]() |
f7ae7b3623 | ||
![]() |
31dd8ab1d6 | ||
![]() |
8da56e12c6 | ||
![]() |
0a04078916 | ||
![]() |
1182c8bdcd | ||
![]() |
55d2460fc3 | ||
![]() |
a89d7997b7 | ||
![]() |
d8383220ec | ||
![]() |
8e7ec794f5 | ||
![]() |
bd5d478dd4 | ||
![]() |
1b15b31c86 | ||
![]() |
e6d85923c1 | ||
![]() |
614bae813e | ||
![]() |
bd6a695545 | ||
![]() |
d63bdba097 | ||
![]() |
43edcc4a2e | ||
![]() |
01c2b397aa | ||
![]() |
51a757c11b | ||
![]() |
7a99672042 | ||
![]() |
7eecfb536a | ||
![]() |
a09814138a | ||
![]() |
42432d67cc | ||
![]() |
e91d167ff8 | ||
![]() |
88af6fbf98 | ||
![]() |
6b6fe2a4d5 | ||
![]() |
54aca3c5ec | ||
![]() |
0a9cf4365a | ||
![]() |
343c4c7072 | ||
![]() |
6a0d3233ff | ||
![]() |
d3714b016d | ||
![]() |
da6e992e1d | ||
![]() |
bb60fe0c1a | ||
![]() |
feecf63a96 | ||
![]() |
cbdd1cbcde | ||
![]() |
b3d7161642 | ||
![]() |
3b47d231ac | ||
![]() |
7977bc3dfa | ||
![]() |
00fdafb0a1 | ||
![]() |
f737e94164 | ||
![]() |
a0dd9df9ab | ||
![]() |
4724b9d966 | ||
![]() |
8098d9417c | ||
![]() |
605207a3a6 | ||
![]() |
43d20d81a5 | ||
![]() |
bc0f3dd15e | ||
![]() |
475c19c42b | ||
![]() |
c072bd4609 | ||
![]() |
684830cb2a | ||
![]() |
51248a9bdd | ||
![]() |
3b24076c3b | ||
![]() |
077125e4a2 | ||
![]() |
df06182d86 | ||
![]() |
d939e0f410 | ||
![]() |
69d07feb14 | ||
![]() |
1c4538610b | ||
![]() |
2c72732ebf | ||
![]() |
e1c2c9be1a | ||
![]() |
89da532445 | ||
![]() |
b38189c7b4 | ||
![]() |
1bb04927f3 | ||
![]() |
3fd01be648 | ||
![]() |
5ae6db321f | ||
![]() |
0546d448ce | ||
![]() |
b4fa27ae4b | ||
![]() |
12043e3c9c | ||
![]() |
a324fa7b97 | ||
![]() |
a9483b1f4a | ||
![]() |
40f8aaedb7 | ||
![]() |
374f48675b | ||
![]() |
20ae9d4f71 | ||
![]() |
35955179c6 | ||
![]() |
b1c1b9bb76 | ||
![]() |
123f80ae54 | ||
![]() |
c54ab4dca7 | ||
![]() |
233ec511db | ||
![]() |
4b96e5c70f | ||
![]() |
75743b009b | ||
![]() |
01459828ef | ||
![]() |
99179da4cc | ||
![]() |
645bdd837a | ||
![]() |
c03cbb38ad | ||
![]() |
63661d8e83 | ||
![]() |
4a0493f789 | ||
![]() |
eadeb5bd9a | ||
![]() |
9190e2876e | ||
![]() |
b4f0e1291f | ||
![]() |
dd8568739c | ||
![]() |
97b497a75f | ||
![]() |
d3c813e726 | ||
![]() |
9e480973eb | ||
![]() |
2e056353b0 | ||
![]() |
606b933a4f | ||
![]() |
d17709da31 | ||
![]() |
0bb6deda72 | ||
![]() |
0a29e2445c | ||
![]() |
700335103e | ||
![]() |
368fd5d27b | ||
![]() |
81239edb89 | ||
![]() |
22f3b01478 | ||
![]() |
5f53c9d94a | ||
![]() |
04cfef24a1 | ||
![]() |
1d26151d5f | ||
![]() |
aabd27d9aa | ||
![]() |
dcc061543a | ||
![]() |
2ffe834bff | ||
![]() |
027ceb37a1 | ||
![]() |
510836f80b | ||
![]() |
e4af5d6efc | ||
![]() |
43b816538f | ||
![]() |
77cfeadfa6 | ||
![]() |
ea521cf617 | ||
![]() |
a82c5a39c4 | ||
![]() |
7764795c06 | ||
![]() |
d6706294e0 | ||
![]() |
83305cbf9f | ||
![]() |
76255cfdc9 | ||
![]() |
ad6bc4d82e | ||
![]() |
147609ca6e | ||
![]() |
7871fbad4d | ||
![]() |
46b9719bbb | ||
![]() |
a1a98d5908 | ||
![]() |
a799162bc7 | ||
![]() |
d62ce21249 | ||
![]() |
0825cd80a6 | ||
![]() |
04cb15ae9d | ||
![]() |
bc8fc9803f | ||
![]() |
016ce4b1da | ||
![]() |
3e759f4fb6 | ||
![]() |
2e8b21833a | ||
![]() |
54b0e87796 | ||
![]() |
a784ed6065 | ||
![]() |
d2621445f1 | ||
![]() |
adaf87530d | ||
![]() |
8914857092 | ||
![]() |
aca0fff4e1 | ||
![]() |
d64bd82bdc | ||
![]() |
cb6647ce1c | ||
![]() |
51427e1947 | ||
![]() |
1de6b97a76 | ||
![]() |
f09340de8b | ||
![]() |
82b55efdba | ||
![]() |
16f575ee6c | ||
![]() |
38d2afcefb | ||
![]() |
7f616eb513 | ||
![]() |
fe818c8076 | ||
![]() |
a7b9452a6b | ||
![]() |
2c1b0624ac | ||
![]() |
107146676e | ||
![]() |
79dc74e84d | ||
![]() |
6be508dcc2 | ||
![]() |
82e9b78a38 | ||
![]() |
07f45946b5 | ||
![]() |
7fb7f24131 | ||
![]() |
5b40c11c2f | ||
![]() |
9d6a394c44 | ||
![]() |
d7b82baf97 | ||
![]() |
36e245658b | ||
![]() |
d487ade72c | ||
![]() |
71be565cf4 | ||
![]() |
81512cc02b | ||
![]() |
32236dad5e | ||
![]() |
b30ce34d84 | ||
![]() |
2164b6b463 | ||
![]() |
7af5e3c39e | ||
![]() |
42930155ab | ||
![]() |
e5b3246d0a | ||
![]() |
47dda4a1d4 | ||
![]() |
a5b7e3205d | ||
![]() |
dfce37da23 | ||
![]() |
14bfcb96f5 | ||
![]() |
87fbcb4494 | ||
![]() |
4bfe07640c | ||
![]() |
5d93525f30 | ||
![]() |
b7848e4a72 | ||
![]() |
99ec359b4d | ||
![]() |
dfad8a6dad | ||
![]() |
d841ab82b8 | ||
![]() |
d6be52d80e | ||
![]() |
c0111460b0 | ||
![]() |
93981bb9b5 | ||
![]() |
8f136288c5 | ||
![]() |
9799dbebd6 | ||
![]() |
b025ac16a6 | ||
![]() |
5d43c75c66 | ||
![]() |
15fa5dcfe6 | ||
![]() |
516dfd1705 | ||
![]() |
743bd81e64 | ||
![]() |
520cee3fb7 | ||
![]() |
fa7341143a | ||
![]() |
313a5b05c2 | ||
![]() |
01fc53e027 | ||
![]() |
0a4ccce054 | ||
![]() |
c2888604d7 | ||
![]() |
6632d957e7 | ||
![]() |
c5e539c312 | ||
![]() |
0338994c6a | ||
![]() |
2056ca9fea | ||
![]() |
cca192e58f | ||
![]() |
f3d4b17a9c | ||
![]() |
5bd38b70dd | ||
![]() |
44f1bef668 | ||
![]() |
f38510f4b5 | ||
![]() |
689b6929c3 | ||
![]() |
68aae7f579 | ||
![]() |
a76fa17681 | ||
![]() |
72411118ec | ||
![]() |
5a16df5e04 | ||
![]() |
5a814f6f2c |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -5,6 +5,7 @@
|
||||
*.dll
|
||||
*.exe
|
||||
*.obj
|
||||
*.asc
|
||||
.*.swp
|
||||
Debug
|
||||
Release
|
||||
@@ -26,6 +27,9 @@ curl-config
|
||||
libcurl.pc
|
||||
missing
|
||||
curl-*.tar.gz
|
||||
curl-*.tar.bz2
|
||||
curl-*.tar.lzma
|
||||
curl-*.zip
|
||||
INSTALL
|
||||
install-sh
|
||||
*.o
|
||||
@@ -36,3 +40,4 @@ tags
|
||||
TAGS
|
||||
*~
|
||||
aclocal.m4.bak
|
||||
CHANGES.dist
|
||||
|
49
Android.mk
49
Android.mk
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Place the curl source (including this makefile) into external/curl/ in the
|
||||
# Android source tree. Then build them with 'make curl' or just 'make libcurl'
|
||||
# from the Android root. Tested with Android 1.5
|
||||
# from the Android root. Tested with Android 1.5 and 2.1
|
||||
#
|
||||
# Note: you must first create a curl_config.h file by running configure in the
|
||||
# Android environment. The only way I've found to do this is tricky. Perform a
|
||||
@@ -12,26 +12,37 @@
|
||||
# shown. Now, from the external/curl/ directory, run curl's normal configure
|
||||
# command with flags that match what Android itself uses. This will mean
|
||||
# putting the compiler directory into the PATH, putting the -I, -isystem and
|
||||
# -D options into CPPFLAGS, putting the -m, -f, -O and -nostdlib options into
|
||||
# CFLAGS, and putting the -Wl, -L and -l options into LIBS, along with the path
|
||||
# to the files libgcc.a, crtbegin_dynamic.o, and ccrtend_android.o. Remember
|
||||
# that the paths must be absolute since you will not be running configure from
|
||||
# the same directory as the Android make. The normal cross-compiler options
|
||||
# must also be set.
|
||||
# -D options into CPPFLAGS, putting the -W, -m, -f, -O and -nostdlib options
|
||||
# into CFLAGS, and putting the -Wl, -L and -l options into LIBS, along with the
|
||||
# path to the files libgcc.a, crtbegin_dynamic.o, and ccrtend_android.o.
|
||||
# Remember that the paths must be absolute since you will not be running
|
||||
# configure from the same directory as the Android make. The normal
|
||||
# cross-compiler options must also be set. Note that the -c, -o, -MD and
|
||||
# similar flags must not be set.
|
||||
#
|
||||
# To see all the LIBS options, you'll need to do the "showcommands" trick on an
|
||||
# executable that's already buildable and watch what flags Android uses to link
|
||||
# it (dhcpcd is a good choice to watch). You'll also want to add -L options to
|
||||
# LIBS that point to the out/.../obj/lib/ and out/.../obj/system/lib/
|
||||
# directories so that additional libraries can be found and used by curl.
|
||||
#
|
||||
# The end result will be a configure command that looks something like this
|
||||
# (the environment variable A is set to the Android root path):
|
||||
# (the environment variable A is set to the Android root path which makes the
|
||||
# command shorter):
|
||||
#
|
||||
# A=`realpath ../..` && \
|
||||
# PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/bin:$PATH" \
|
||||
# ./configure --host=arm-linux CC=arm-eabi-gcc \
|
||||
# CPPFLAGS="-I $A/system/core/include ..." \
|
||||
# CFLAGS="-fno-exceptions -Wno-multichar ..." \
|
||||
# LIB="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/lib/gcc/arm-eabi/X\
|
||||
# /interwork/libgcc.a ..." \
|
||||
# CFLAGS="-nostdlib -fno-exceptions -Wno-multichar ..." \
|
||||
# LIBS="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/lib/gcc/arm-eabi/X\
|
||||
# /interwork/libgcc.a ..."
|
||||
#
|
||||
# Finally, copy the file COPYING to NOTICE so that the curl license gets put
|
||||
# into the right place (but see the note about this below).
|
||||
#
|
||||
# Dan Fandrich
|
||||
# September 2009
|
||||
# August 2010
|
||||
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
@@ -63,6 +74,14 @@ LOCAL_COPY_HEADERS := $(addprefix include/curl/,$(CURL_HEADERS))
|
||||
|
||||
LOCAL_MODULE:= libcurl
|
||||
|
||||
# Copy the licence to a place where Android will find it.
|
||||
# Actually, this doesn't quite work because the build system searches
|
||||
# for NOTICE files before it gets to this point, so it will only be seen
|
||||
# on subsequent builds.
|
||||
ALL_PREBUILT += $(LOCAL_PATH)/NOTICE
|
||||
$(LOCAL_PATH)/NOTICE: $(LOCAL_PATH)/COPYING | $(ACP)
|
||||
$(copy-file-to-target)
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
|
||||
@@ -71,7 +90,7 @@ include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
include $(LOCAL_PATH)/src/Makefile.inc
|
||||
LOCAL_SRC_FILES := $(addprefix src/,$(CURL_SOURCES))
|
||||
LOCAL_SRC_FILES := $(addprefix src/,$(CURL_CFILES))
|
||||
|
||||
LOCAL_MODULE := curl
|
||||
LOCAL_STATIC_LIBRARIES := libcurl
|
||||
@@ -79,8 +98,8 @@ LOCAL_SYSTEM_SHARED_LIBRARIES := libc
|
||||
|
||||
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include $(LOCAL_PATH)/lib
|
||||
|
||||
# This will also need to include $(CURLX_ONES) in order to correctly build
|
||||
# a dynamic library
|
||||
# This may also need to include $(CURLX_ONES) in order to correctly link
|
||||
# if libcurl is changed to be built as a dynamic library
|
||||
LOCAL_CFLAGS += $(common_CFLAGS)
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
@@ -120,16 +120,11 @@ if(WIN32)
|
||||
if( NOT HAVE_WLDAP32)
|
||||
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
|
||||
message(STATUS "wldap32 not found CURL_DISABLE_LDAP set ON")
|
||||
option(CURL_LDAP_WIN "Use W$ LDAP implementation" OFF)
|
||||
option(CURL_LDAP_WIN "Use Windows LDAP implementation" OFF)
|
||||
else()
|
||||
option(CURL_LDAP_WIN "Use W$ LDAP implementation" ON)
|
||||
option(CURL_LDAP_WIN "Use Windows LDAP implementation" ON)
|
||||
endif()
|
||||
mark_as_advanced(CURL_LDAP_WIN)
|
||||
set(CURL_LDAP_HYBRID OFF)
|
||||
else()
|
||||
option(CURL_LDAP_HYBRID "W$ LDAP with non-W$ compiler" OFF)
|
||||
mark_as_advanced(CURL_LDAP_HYBRID)
|
||||
set(CURL_LDAP_WIN OFF)
|
||||
endif()
|
||||
|
||||
if(HTTP_ONLY)
|
||||
|
@@ -5,7 +5,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
|
||||
# you should have received as part of this distribution. The terms
|
||||
@@ -54,17 +54,23 @@ borland-clean:
|
||||
cd ..\src
|
||||
make -f Makefile.b32 clean
|
||||
|
||||
watcom:
|
||||
watcom: .SYMBOLIC
|
||||
cd lib
|
||||
wmake -f Makefile.Watcom
|
||||
wmake -u -f Makefile.Watcom
|
||||
cd ..\src
|
||||
wmake -f Makefile.Watcom
|
||||
wmake -u -f Makefile.Watcom
|
||||
|
||||
watcom-clean:
|
||||
watcom-clean: .SYMBOLIC
|
||||
cd lib
|
||||
wmake -f Makefile.Watcom clean
|
||||
wmake -u -f Makefile.Watcom clean
|
||||
cd ..\src
|
||||
wmake -f Makefile.Watcom clean
|
||||
wmake -u -f Makefile.Watcom clean
|
||||
|
||||
watcom-vclean: .SYMBOLIC
|
||||
cd lib
|
||||
wmake -u -f Makefile.Watcom vclean
|
||||
cd ..\src
|
||||
wmake -u -f Makefile.Watcom vclean
|
||||
|
||||
mingw32:
|
||||
$(MAKE) -C lib -f Makefile.m32
|
||||
@@ -266,22 +272,22 @@ vc8: lib/Makefile.vc8 src/Makefile.vc8
|
||||
|
||||
lib/Makefile.vc8: lib/Makefile.vc6
|
||||
@echo "generate $@"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" lib/Makefile.vc6 > lib/Makefile.vc8
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" lib/Makefile.vc6 > lib/Makefile.vc8
|
||||
|
||||
src/Makefile.vc8: src/Makefile.vc6
|
||||
@echo "generate $@"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" src/Makefile.vc6 > src/Makefile.vc8
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" src/Makefile.vc6 > src/Makefile.vc8
|
||||
|
||||
# VC9 makefiles are for use with VS2008
|
||||
vc9: lib/Makefile.vc9 src/Makefile.vc9
|
||||
|
||||
lib/Makefile.vc9: lib/Makefile.vc6
|
||||
@echo "generate $@"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" lib/Makefile.vc6 > lib/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" lib/Makefile.vc6 > lib/Makefile.vc9
|
||||
|
||||
src/Makefile.vc9: src/Makefile.vc6
|
||||
@echo "generate $@"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.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
|
||||
|
||||
ca-bundle: lib/mk-ca-bundle.pl
|
||||
@echo "generate a fresh ca-bundle.crt"
|
||||
|
@@ -1,51 +1,58 @@
|
||||
Curl and libcurl 7.20.1
|
||||
Curl and libcurl 7.21.1
|
||||
|
||||
Public curl releases: 115
|
||||
Command line options: 136
|
||||
curl_easy_setopt() options: 174
|
||||
Public curl releases: 117
|
||||
Command line options: 138
|
||||
curl_easy_setopt() options: 180
|
||||
Public functions in libcurl: 58
|
||||
Known libcurl bindings: 39
|
||||
Contributors: 776
|
||||
Contributors: 808
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o The 'ares' subtree has been removed from the source repository
|
||||
o smoother rate limiting
|
||||
o allow user+password in the URL for all protocols
|
||||
o POP3: Get message listing if no mailbox in URL
|
||||
o maketgz: produce CHANGES automatically
|
||||
o added support for NTLM authentication when compiled with NSS
|
||||
o build: Enable configure --enable-werror
|
||||
o curl-config: --built-shared returns shared info
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o VMS builder bad behavior when used in a batch job
|
||||
o multiple recepients with SMTP
|
||||
o fixed the CURL_FORMAT_* defines when building with cmake
|
||||
o missing quote in libcurl.m4
|
||||
o SMTP: now waits for 250 after the DATA transfer
|
||||
o SMTP: use angle brackets in RCPT TO
|
||||
o curl --trace-time not using local time
|
||||
o off-by-one in the chunked encoding trailer parser
|
||||
o superfluous blocking for OpenSSL-based SSL connects and multi interface
|
||||
o TFTP upload
|
||||
o FTP timeouts after file transferred completely
|
||||
o skip poll() on Interix
|
||||
o CURLOPT_CERTINFO memory leak
|
||||
o sub-second timeouts improvements
|
||||
o configure fixes for GSSAPI
|
||||
o threaded resolver double free when closing curl handle
|
||||
o configure fixes for building with the clang compiler
|
||||
o easy interix rate limiting logic
|
||||
o curl_multi_remove_handle() caused use after free
|
||||
o TFTP improved error codes
|
||||
o TFTP fixed TSIZE handling for uploads
|
||||
o SSL possible double free when reusing curl handle
|
||||
o alarm()-based DNS timeout bug
|
||||
o re-used FTP connection multi interface crash
|
||||
o chunked-encoding with Content-Length: header problem
|
||||
o multi interface HTTP POST over a proxy using PROXYTUNNEL
|
||||
o RTSP GET_PARAMETER
|
||||
o timeout after last data chunk was handled
|
||||
o SFTP download hang
|
||||
o FTP quote commands prefixed with '*' now can fail without aborting
|
||||
o configure: spell --disable-threaded-resolver correctly
|
||||
o multi: call the progress callback in all states
|
||||
o multi: unmark handle as used when no longer head of pipeline
|
||||
o sendrecv: treat all negative values from send/recv as errors
|
||||
o ftp-wildcard: avoid tight loop when used without any pattern
|
||||
o multi_socket: re-use of same socket without notifying app
|
||||
o ftp wildcard: FTP LIST parser FIX
|
||||
o urlglobbing backslash escaping bug
|
||||
o build: add enable IPV6 option for the VC makefiles
|
||||
o multi: CURLINFO_LASTSOCKET doesn't work after remove_handle
|
||||
o --libcurl: use *_LARGE options with typecasted constants
|
||||
o --libcurl: hide setopt() calls setting default options
|
||||
o curl: avoid setting libcurl options to its default
|
||||
o --libcurl: list the tricky options instead of using [REMARK]
|
||||
o http: don't enable chunked during authentication negotiations
|
||||
o upload: warn users trying to upload from stdin with anyauth
|
||||
o configure: allow environments variable to override internals
|
||||
o threaded resolver: fix timeout issue
|
||||
o multi: fix condition that remove timers before trigger
|
||||
o examples: add curl_multi_timeout
|
||||
o --retry: access violation with URL part sets continued
|
||||
o ssh: Fix compile error on 64-bit systems.
|
||||
o remote-header-name: chop filename at next semicolon
|
||||
o ftp: response timeout bug in "quote" sending
|
||||
o CUSTOMREQUEST: shouldn't be disabled when HTTP is disabled
|
||||
o Watcom makefiles overhaul.
|
||||
o NTLM tests: boost coverage by forcing the hostname
|
||||
o multi: fix FTPS connecting the data connection with OpenSSL
|
||||
o retry: consider retrying even if -f is used
|
||||
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:
|
||||
|
||||
@@ -54,11 +61,11 @@ This release includes the following known bugs:
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Steven M. Schweda, Yang Tse, Jack Zhang, Tom Donovan, Martin Hager,
|
||||
Daniel Fandrich, Patrick Monnerat, Pat Ray, Wesley Miaw, Ben Greear,
|
||||
Ryan Chan, Markus Duft, Andrei Benea, Jacob Moshenko, Daniel Johnson,
|
||||
Constantine Sapuntzakis, Douglas Steinwand, Thomas Lopatic, Hauke Duden,
|
||||
Akos Pasztory, Kenny To, Christopher Conroy, Massimo Callegari,
|
||||
Bob Richmond, Matt Wixson
|
||||
Dan Fandrich, Kamil Dudka, Krister Johansen, Pavel Raiskup, Jon Sargeant,
|
||||
Pierre Joye, Tor Arntsen, Constantine Sapuntzakis, Sidney San Martin,
|
||||
Jeff Pohlmeyer, Jan Van Boghout, Ben Greear, Guenter Knauf, Adam Light,
|
||||
Georg Lippitsch, Mike Power, Robin Cornelius, Mikael Johansson,
|
||||
Yang Tse, Ben Darnell
|
||||
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
To be addressed in 7.20.1 (planned release: April 2010)
|
||||
To be addressed in 7.XX.X
|
||||
=========================
|
||||
|
||||
261 -
|
||||
|
13
buildconf
13
buildconf
@@ -6,7 +6,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
|
||||
# you should have received as part of this distribution. The terms
|
||||
@@ -33,6 +33,17 @@ die(){
|
||||
findtool(){
|
||||
file="$1"
|
||||
|
||||
if { echo $file | grep "/" >/dev/null 2>&1; } then
|
||||
# we only check for the explicit file name if the file is given
|
||||
# including a slash. Use ./ for current dir. Previously this would
|
||||
# otherwise always cause findtool to search the local dir first, which
|
||||
# is wrong.
|
||||
if test -f "$file"; then
|
||||
echo "$file"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
old_IFS=$IFS; IFS=':'
|
||||
for path in $PATH
|
||||
do
|
||||
|
376
configure.ac
376
configure.ac
@@ -40,6 +40,7 @@ AM_MAINTAINER_MODE
|
||||
CURL_CHECK_OPTION_DEBUG
|
||||
CURL_CHECK_OPTION_OPTIMIZE
|
||||
CURL_CHECK_OPTION_WARNINGS
|
||||
CURL_CHECK_OPTION_WERROR
|
||||
CURL_CHECK_OPTION_CURLDEBUG
|
||||
CURL_CHECK_OPTION_ARES
|
||||
|
||||
@@ -51,33 +52,48 @@ CURL_CHECK_PATH_SEPARATOR_REQUIRED
|
||||
CONFIGURE_OPTIONS="\"$ac_configure_args\""
|
||||
AC_SUBST(CONFIGURE_OPTIONS)
|
||||
|
||||
CURL_CFLAG_EXTRAS=""
|
||||
if test X"$want_werror" == Xyes; then
|
||||
CURL_CFLAG_EXTRAS="-Werror"
|
||||
fi
|
||||
AC_SUBST(CURL_CFLAG_EXTRAS)
|
||||
|
||||
dnl SED is mandatory for configure process and libtool.
|
||||
dnl Set it now, allowing it to be changed later.
|
||||
AC_PATH_PROG([SED], [sed], [not_found],
|
||||
[$PATH:/usr/bin:/usr/local/bin])
|
||||
if test -z "$SED" || test "$SED" = "not_found"; then
|
||||
AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
|
||||
if test -z "$SED"; then
|
||||
dnl allow it to be overridden
|
||||
AC_PATH_PROG([SED], [sed], [not_found],
|
||||
[$PATH:/usr/bin:/usr/local/bin])
|
||||
if test -z "$SED" || test "$SED" = "not_found"; then
|
||||
AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([SED])
|
||||
|
||||
dnl GREP is mandatory for configure process and libtool.
|
||||
dnl Set it now, allowing it to be changed later.
|
||||
AC_PATH_PROG([GREP], [grep], [not_found],
|
||||
[$PATH:/usr/bin:/usr/local/bin])
|
||||
if test -z "$GREP" || test "$GREP" = "not_found"; then
|
||||
AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
|
||||
if test -z "$GREP"; then
|
||||
dnl allow it to be overridden
|
||||
AC_PATH_PROG([GREP], [grep], [not_found],
|
||||
[$PATH:/usr/bin:/usr/local/bin])
|
||||
if test -z "$GREP" || test "$GREP" = "not_found"; then
|
||||
AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([GREP])
|
||||
|
||||
dnl EGREP is mandatory for configure process and libtool.
|
||||
dnl Set it now, allowing it to be changed later.
|
||||
if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
|
||||
AC_MSG_CHECKING([for egrep])
|
||||
EGREP="$GREP -E"
|
||||
AC_MSG_RESULT([$EGREP])
|
||||
else
|
||||
AC_PATH_PROG([EGREP], [egrep], [not_found],
|
||||
[$PATH:/usr/bin:/usr/local/bin])
|
||||
if test -z "$EGREP"; then
|
||||
dnl allow it to be overridden
|
||||
if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
|
||||
AC_MSG_CHECKING([for egrep])
|
||||
EGREP="$GREP -E"
|
||||
AC_MSG_RESULT([$EGREP])
|
||||
else
|
||||
AC_PATH_PROG([EGREP], [egrep], [not_found],
|
||||
[$PATH:/usr/bin:/usr/local/bin])
|
||||
fi
|
||||
fi
|
||||
if test -z "$EGREP" || test "$EGREP" = "not_found"; then
|
||||
AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
|
||||
@@ -86,10 +102,13 @@ AC_SUBST([EGREP])
|
||||
|
||||
dnl AR is mandatory for configure process and libtool.
|
||||
dnl This is target dependent, so check it as a tool.
|
||||
AC_PATH_TOOL([AR], [ar], [not_found],
|
||||
[$PATH:/usr/bin:/usr/local/bin])
|
||||
if test -z "$AR" || test "$AR" = "not_found"; then
|
||||
AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
|
||||
if test -z "$AR"; then
|
||||
dnl allow it to be overridden
|
||||
AC_PATH_TOOL([AR], [ar], [not_found],
|
||||
[$PATH:/usr/bin:/usr/local/bin])
|
||||
if test -z "$AR" || test "$AR" = "not_found"; then
|
||||
AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([AR])
|
||||
|
||||
@@ -121,13 +140,13 @@ AC_SUBST(PKGADD_VENDOR)
|
||||
|
||||
dnl
|
||||
dnl initialize all the info variables
|
||||
curl_ssl_msg="no (--with-ssl / --with-gnutls / --with-nss)"
|
||||
curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl} )"
|
||||
curl_ssh_msg="no (--with-libssh2)"
|
||||
curl_zlib_msg="no (--with-zlib)"
|
||||
curl_krb4_msg="no (--with-krb4*)"
|
||||
curl_gss_msg="no (--with-gssapi)"
|
||||
curl_spnego_msg="no (--with-spnego)"
|
||||
curl_ares_msg="no (--enable-ares)"
|
||||
curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
|
||||
curl_ipv6_msg="no (--enable-ipv6)"
|
||||
curl_idn_msg="no (--with-libidn)"
|
||||
curl_manual_msg="no (--enable-manual)"
|
||||
@@ -136,6 +155,7 @@ curl_verbose_msg="enabled (--disable-verbose)"
|
||||
curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
|
||||
curl_ldaps_msg="no (--enable-ldaps)"
|
||||
curl_rtsp_msg="no (--enable-rtsp)"
|
||||
curl_rtmp_msg="no (--with-librtmp)"
|
||||
|
||||
dnl
|
||||
dnl Save anything in $LIBS for later
|
||||
@@ -208,6 +228,9 @@ case $host in
|
||||
esac
|
||||
AC_MSG_RESULT($mimpure)
|
||||
AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
|
||||
|
||||
dnl 'STATICLIB' is, in spite of its name, not generic but only for static-only
|
||||
dnl builds on Windows
|
||||
AM_CONDITIONAL(STATICLIB, false)
|
||||
|
||||
AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
|
||||
@@ -370,28 +393,10 @@ AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
|
||||
AC_SUBST(CURL_DISABLE_LDAP, [1])
|
||||
;;
|
||||
*)
|
||||
case $host in
|
||||
*-*-cygwin*)
|
||||
# Force no ldap. config/build process is broken for cygwin
|
||||
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
|
||||
AC_SUBST(CURL_DISABLE_LDAP, [1])
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(yes)
|
||||
esac
|
||||
AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac ],[
|
||||
case $host in
|
||||
*-*-cygwin*)
|
||||
# Force no ldap. config/build process is broken for cygwin
|
||||
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
|
||||
AC_SUBST(CURL_DISABLE_LDAP, [1])
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(yes)
|
||||
esac ]
|
||||
AC_MSG_RESULT(yes) ]
|
||||
)
|
||||
AC_MSG_CHECKING([whether to support ldaps])
|
||||
AC_ARG_ENABLE(ldaps,
|
||||
@@ -403,20 +408,28 @@ AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
|
||||
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
|
||||
AC_SUBST(CURL_DISABLE_LDAPS, [1])
|
||||
;;
|
||||
*) if test x$CURL_DISABLE_LDAP = x1 ; then
|
||||
AC_MSG_RESULT(LDAP support needs to be enabled in order to enable LDAPS support!)
|
||||
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
|
||||
AC_SUBST(CURL_DISABLE_LDAPS, [1])
|
||||
*) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
|
||||
AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
|
||||
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
|
||||
AC_SUBST(CURL_DISABLE_LDAPS, [1])
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
|
||||
curl_ldaps_msg="enabled"
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
|
||||
AC_SUBST(HAVE_LDAP_SSL, [1])
|
||||
curl_ldaps_msg="enabled"
|
||||
fi
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
|
||||
AC_SUBST(CURL_DISABLE_LDAPS, [1])
|
||||
esac ],[
|
||||
if test "x$CURL_DISABLE_LDAP" = "x1" ; then
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
|
||||
AC_SUBST(CURL_DISABLE_LDAPS, [1])
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
|
||||
AC_SUBST(HAVE_LDAP_SSL, [1])
|
||||
curl_ldaps_msg="enabled"
|
||||
fi ]
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether to support rtsp])
|
||||
@@ -751,6 +764,8 @@ ac_cv_func_strcasecmp="no"
|
||||
|
||||
CURL_CHECK_LIBS_CONNECT
|
||||
|
||||
CURL_NETWORK_LIBS=$LIBS
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl In case that function clock_gettime with monotonic timer is available,
|
||||
dnl check for additional required libraries.
|
||||
@@ -801,13 +816,11 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
|
||||
CURL_CHECK_HEADER_LDAP_SSL
|
||||
|
||||
if test -z "$LDAPLIBNAME" ; then
|
||||
case $host in
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32*)
|
||||
dnl Windows uses a single and unique OpenLDAP DLL name
|
||||
LDAPLIBNAME="wldap32"
|
||||
LBERLIBNAME="no"
|
||||
;;
|
||||
esac
|
||||
if test "$ac_cv_native_windows" = "yes"; then
|
||||
dnl Windows uses a single and unique LDAP library name
|
||||
LDAPLIBNAME="wldap32"
|
||||
LBERLIBNAME="no"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$LDAPLIBNAME" ; then
|
||||
@@ -849,18 +862,17 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
|
||||
fi
|
||||
|
||||
if test x$CURL_DISABLE_LDAP != x1 ; then
|
||||
AC_CHECK_FUNCS([ldap_url_parse])
|
||||
AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
|
||||
|
||||
if test "$LDAPLIBNAME" = "wldap32"; then
|
||||
curl_ldap_msg="enabled (winldap)"
|
||||
AC_DEFINE(CURL_LDAP_WIN, 1, [Use W$ LDAP implementation])
|
||||
case $host in
|
||||
*-*-cygwin* | *-*-pw32*)
|
||||
AC_DEFINE(CURL_LDAP_HYBRID, 1, [W$ LDAP with non-W$ compiler])
|
||||
;;
|
||||
esac
|
||||
AC_DEFINE(CURL_LDAP_WIN, 1, [Use Windows LDAP implementation])
|
||||
else
|
||||
curl_ldap_msg="enabled (OpenLDAP)"
|
||||
if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
|
||||
AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
|
||||
AC_SUBST(USE_OPENLDAP, [1])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1137,10 +1149,17 @@ if test x"$want_gss" = xyes; then
|
||||
],
|
||||
[
|
||||
dnl not found, check Heimdal or MIT
|
||||
AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
|
||||
AC_CHECK_HEADERS(
|
||||
[gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
|
||||
[gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
|
||||
[],
|
||||
[not_mit=1])
|
||||
[not_mit=1],
|
||||
[
|
||||
AC_INCLUDES_DEFAULT
|
||||
#ifdef HAVE_GSSAPI_GSSAPI_H
|
||||
#include <gssapi/gssapi.h>
|
||||
#endif
|
||||
])
|
||||
if test "x$not_mit" = "x1"; then
|
||||
dnl MIT not found, check for Heimdal
|
||||
AC_CHECK_HEADER(gssapi.h,
|
||||
@@ -1699,6 +1718,90 @@ if test "$OPENSSL_ENABLED" != "1"; then
|
||||
|
||||
fi dnl OPENSSL != 1
|
||||
|
||||
dnl ----------------------------------------------------
|
||||
dnl check for PolarSSL
|
||||
dnl ----------------------------------------------------
|
||||
|
||||
dnl Default to compiler & linker defaults for PolarSSL files & libraries.
|
||||
OPT_POLARSSL=no
|
||||
|
||||
_cppflags=$CPPFLAGS
|
||||
_ldflags=$LDFLAGS
|
||||
AC_ARG_WITH(polarssl,dnl
|
||||
AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root (default: /usr/local/)])
|
||||
AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]),
|
||||
OPT_POLARSSL=$withval)
|
||||
|
||||
if test "$OPENSSL_ENABLED" != "1"; then
|
||||
|
||||
if test X"$OPT_POLARSSL" != Xno; then
|
||||
|
||||
if test "$OPT_POLARSSL" = "yes"; then
|
||||
OPT_POLARSSL=""
|
||||
fi
|
||||
|
||||
if test -z "$OPT_POLARSSL" ; then
|
||||
dnl check for lib first without setting any new path
|
||||
|
||||
AC_CHECK_LIB(polarssl, havege_init,
|
||||
dnl libpolarssl found, set the variable
|
||||
[
|
||||
AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
|
||||
AC_SUBST(USE_POLARSSL, [1])
|
||||
POLARSSL_ENABLED=1
|
||||
USE_POLARSSL="yes"
|
||||
curl_ssl_msg="enabled (PolarSSL)"
|
||||
])
|
||||
fi
|
||||
|
||||
if test "x$USE_POLARSSL" != "xyes"; then
|
||||
dnl add the path and test again
|
||||
addld=-L$OPT_POLARSSL/lib$libsuff
|
||||
addcflags=-I$OPT_POLARSSL/include
|
||||
polarssllib=$OPT_POLARSSL/lib$libsuff
|
||||
|
||||
LDFLAGS="$LDFLAGS $addld"
|
||||
if test "$addcflags" != "-I/usr/include"; then
|
||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(polarssl, ssl_init,
|
||||
[
|
||||
AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
|
||||
AC_SUBST(USE_POLARSSL, [1])
|
||||
POLARSSL_ENABLED=1
|
||||
USE_POLARSSL="yes"
|
||||
curl_ssl_msg="enabled (PolarSSL)"
|
||||
],
|
||||
[
|
||||
CPPFLAGS=$_cppflags
|
||||
LDFLAGS=$_ldflags
|
||||
])
|
||||
fi
|
||||
|
||||
if test "x$USE_POLARSSL" = "xyes"; then
|
||||
AC_MSG_NOTICE([detected PolarSSL])
|
||||
|
||||
CURL_LIBS="$CURL_LIBS -lpolarssl"
|
||||
LIBS="$LIBS -lpolarssl"
|
||||
|
||||
if test -n "$polarssllib"; then
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
dnl linker doesn't search through, we need to add it to
|
||||
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
|
||||
dnl due to this
|
||||
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib"
|
||||
export LD_LIBRARY_PATH
|
||||
AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH])
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
fi dnl PolarSSL not disabled
|
||||
|
||||
fi dnl OPENSSL != 1
|
||||
|
||||
dnl ----------------------------------------------------
|
||||
dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
|
||||
dnl ----------------------------------------------------
|
||||
@@ -1795,9 +1898,9 @@ if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
|
||||
|
||||
fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1
|
||||
|
||||
if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED" = "x"; then
|
||||
if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED" = "x"; then
|
||||
AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
|
||||
AC_MSG_WARN([Use --with-ssl, --with-gnutls or --with-nss to address this.])
|
||||
AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl or --with-nss to address this.])
|
||||
else
|
||||
# SSL is enabled, genericly
|
||||
AC_SUBST(SSL_ENABLED)
|
||||
@@ -1882,7 +1985,10 @@ if test X"$OPT_LIBSSH2" != Xno; then
|
||||
dnl to prevent further configure tests to fail due to this
|
||||
|
||||
dnl libssh2_version is a post 1.0 addition
|
||||
AC_CHECK_FUNCS( libssh2_version )
|
||||
dnl libssh2_init and libssh2_exit were added in 1.2.5
|
||||
dnl libssh2_scp_send64 was added in 1.2.6
|
||||
AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \
|
||||
libssh2_scp_send64 )
|
||||
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
|
||||
export LD_LIBRARY_PATH
|
||||
@@ -1896,6 +2002,79 @@ if test X"$OPT_LIBSSH2" != Xno; then
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the presence of LIBRTMP libraries and headers
|
||||
dnl **********************************************************************
|
||||
|
||||
dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
|
||||
OPT_LIBRTMP=off
|
||||
AC_ARG_WITH(librtmp,dnl
|
||||
AC_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation (default: /usr/local/lib); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
|
||||
AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
|
||||
OPT_LIBRTMP=$withval)
|
||||
|
||||
if test X"$OPT_LIBRTMP" != Xno; then
|
||||
dnl backup the pre-librtmp variables
|
||||
CLEANLDFLAGS="$LDFLAGS"
|
||||
CLEANCPPFLAGS="$CPPFLAGS"
|
||||
CLEANLIBS="$LIBS"
|
||||
|
||||
case "$OPT_LIBRTMP" in
|
||||
yes)
|
||||
dnl --with-librtmp (without path) used
|
||||
CURL_CHECK_PKGCONFIG(librtmp)
|
||||
|
||||
if test "$PKGCONFIG" != "no" ; then
|
||||
LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
|
||||
LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
|
||||
CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
|
||||
version=`$PKGCONFIG --modversion librtmp`
|
||||
DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
|
||||
fi
|
||||
|
||||
;;
|
||||
off)
|
||||
dnl no --with-librtmp option given, just check default places
|
||||
;;
|
||||
*)
|
||||
dnl use the given --with-librtmp spot
|
||||
PREFIX_RTMP=$OPT_LIBRTMP
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl if given with a prefix, we set -L and -I based on that
|
||||
if test -n "$PREFIX_RTMP"; then
|
||||
LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
|
||||
CPP_RTMP=-I${PREFIX_RTMP}/include
|
||||
DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
|
||||
fi
|
||||
|
||||
LDFLAGS="$LDFLAGS $LD_RTMP"
|
||||
CPPFLAGS="$CPPFLAGS $CPP_RTMP"
|
||||
LIBS="$LIBS $LIB_RTMP"
|
||||
|
||||
AC_CHECK_LIB(rtmp, RTMP_Init)
|
||||
|
||||
AC_CHECK_HEADERS(librtmp/rtmp.h,
|
||||
curl_rtmp_msg="enabled (librtmp)"
|
||||
LIBRTMP_ENABLED=1
|
||||
AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
|
||||
AC_SUBST(USE_LIBRTMP, [1])
|
||||
)
|
||||
|
||||
if test X"$OPT_LIBRTMP" != Xoff &&
|
||||
test "$LIBRTMP_ENABLED" != "1"; then
|
||||
AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
|
||||
fi
|
||||
|
||||
if test "$LIBRTMP_ENABLED" != "1"; then
|
||||
dnl no librtmp, revert back to clean variables
|
||||
LDFLAGS=$CLEANLDFLAGS
|
||||
CPPFLAGS=$CLEANCPPFLAGS
|
||||
LIBS=$CLEANLIBS
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the presence of IDN libraries and headers
|
||||
dnl **********************************************************************
|
||||
@@ -2282,6 +2461,35 @@ AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
|
||||
CURL_CHECK_LIB_ARES
|
||||
AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
|
||||
|
||||
if test "x$enable_shared" = "xyes"; then
|
||||
build_libhostname=yes
|
||||
else
|
||||
build_libhostname=no
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
|
||||
|
||||
CURL_CHECK_OPTION_THREADED_RESOLVER
|
||||
|
||||
if test "x$want_thres" = xyes && test "x$want_ares" = xyes; then
|
||||
AC_MSG_ERROR(
|
||||
[Options --enable-threaded-resolver and --enable-ares are mutually exclusive])
|
||||
fi
|
||||
|
||||
if test "$want_thres" = "yes"; then
|
||||
AC_CHECK_HEADER(pthread.h,
|
||||
[ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -pthread"
|
||||
AC_CHECK_LIB(pthread, pthread_create,
|
||||
[ AC_MSG_NOTICE([using POSIX threaded DNS lookup])
|
||||
AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
|
||||
USE_THREADS_POSIX=1
|
||||
curl_res_msg="threaded"
|
||||
],
|
||||
[ CFLAGS="$save_CFLAGS"])
|
||||
])
|
||||
fi
|
||||
|
||||
dnl ************************************************************
|
||||
dnl disable verbose text strings
|
||||
dnl
|
||||
@@ -2452,10 +2660,15 @@ LIBCURL_LIBS=$LIBS
|
||||
AC_SUBST(LIBCURL_LIBS)
|
||||
AC_SUBST(CURL_LIBS)
|
||||
AC_SUBST(TEST_SERVER_LIBS)
|
||||
AC_SUBST(CURL_NETWORK_LIBS)
|
||||
LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link
|
||||
|
||||
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
|
||||
|
||||
dnl yes or no
|
||||
ENABLE_SHARED="$enable_shared"
|
||||
AC_SUBST(ENABLE_SHARED)
|
||||
|
||||
dnl
|
||||
dnl For keeping supported features and protocols also in pkg-config file
|
||||
dnl since it is more cross-compile frient than curl-config
|
||||
@@ -2475,7 +2688,7 @@ fi
|
||||
if test "x$HAVE_LIBZ" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
|
||||
fi
|
||||
if test "x$USE_ARES" = "x1"; then
|
||||
if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
|
||||
fi
|
||||
if test "x$IDN_ENABLED" = "x1"; then
|
||||
@@ -2484,7 +2697,8 @@ fi
|
||||
if test "x$USE_WINDOWS_SSPI" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
|
||||
fi
|
||||
if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" -o "x$GNUTLS_ENABLED" = "x1"; then
|
||||
if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
|
||||
-o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
|
||||
fi
|
||||
|
||||
@@ -2511,9 +2725,12 @@ if test "x$CURL_DISABLE_TELNET" != "x1"; then
|
||||
fi
|
||||
if test "x$CURL_DISABLE_LDAP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
|
||||
fi
|
||||
if test "x$CURL_DISABLE_LDAPS" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
|
||||
if test "x$CURL_DISABLE_LDAPS" != "x1"; then
|
||||
if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
|
||||
(test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "x$CURL_DISABLE_DICT" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
|
||||
@@ -2546,6 +2763,9 @@ fi
|
||||
if test "x$CURL_DISABLE_RTSP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
|
||||
fi
|
||||
if test "x$USE_LIBRTMP" = "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
|
||||
fi
|
||||
|
||||
dnl replace spaces with newlines
|
||||
dnl sort the lines
|
||||
@@ -2565,6 +2785,7 @@ squeeze LIBS
|
||||
squeeze CURL_LIBS
|
||||
squeeze LIBCURL_LIBS
|
||||
squeeze TEST_SERVER_LIBS
|
||||
squeeze CURL_NETWORK_LIBS
|
||||
|
||||
squeeze SUPPORT_FEATURES
|
||||
squeeze SUPPORT_PROTOCOLS
|
||||
@@ -2617,7 +2838,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
|
||||
krb4 support: ${curl_krb4_msg}
|
||||
GSSAPI support: ${curl_gss_msg}
|
||||
SPNEGO support: ${curl_spnego_msg}
|
||||
c-ares support: ${curl_ares_msg}
|
||||
resolver: ${curl_res_msg}
|
||||
ipv6 support: ${curl_ipv6_msg}
|
||||
IDN support: ${curl_idn_msg}
|
||||
Build libcurl: Shared=${enable_shared}, Static=${enable_static}
|
||||
@@ -2629,6 +2850,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
|
||||
LDAP support: ${curl_ldap_msg}
|
||||
LDAPS support: ${curl_ldaps_msg}
|
||||
RTSP support: ${curl_rtsp_msg}
|
||||
RTMP support: ${curl_rtmp_msg}
|
||||
Protocols: ${SUPPORT_PROTOCOLS}
|
||||
])
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 2001 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 2001 - 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
|
||||
@@ -32,6 +32,7 @@ Usage: curl-config [OPTION]
|
||||
|
||||
Available values for OPTION include:
|
||||
|
||||
--built-shared says 'yes' if libcurl was built shared
|
||||
--ca ca bundle install path
|
||||
--cc compiler
|
||||
--cflags pre-processor and compiler flags
|
||||
@@ -64,6 +65,10 @@ while test $# -gt 0; do
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
--built-shared)
|
||||
echo @ENABLE_SHARED@
|
||||
;;
|
||||
|
||||
--ca)
|
||||
echo "@CURL_CA_BUNDLE@"
|
||||
;;
|
||||
@@ -87,6 +92,7 @@ while test $# -gt 0; do
|
||||
echo "$protocol"
|
||||
done
|
||||
;;
|
||||
|
||||
--version)
|
||||
echo libcurl @VERSION@
|
||||
exit 0
|
||||
|
2
docs/.gitignore
vendored
Normal file
2
docs/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*.html
|
||||
*.pdf
|
@@ -29,9 +29,11 @@
|
||||
2.11 Test Cases
|
||||
|
||||
3. Pushing Out Your Changes
|
||||
3.1 Write Access to git Repository
|
||||
3.2 How To Make a Patch with git
|
||||
3.3 How To Make a Patch without git
|
||||
3.4 How to get your changes into the main sources
|
||||
3.5 Write good commit messages
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -114,7 +116,7 @@
|
||||
|
||||
2.4 Line Lengths
|
||||
|
||||
We try to keep source lines shorter than 80 columns.
|
||||
We write source lines shorter than 80 columns.
|
||||
|
||||
2.5 General Style
|
||||
|
||||
@@ -197,7 +199,8 @@
|
||||
git commit [file]
|
||||
|
||||
As usual, group your commits so that you commit all changes that at once that
|
||||
constitutes a logical change.
|
||||
constitutes a logical change. See also section "3.5 Write good commit
|
||||
messages".
|
||||
|
||||
Once you have done all your commits and you're happy with what you see, you
|
||||
can make patches out of your changes that are suitable for mailing:
|
||||
@@ -255,3 +258,22 @@
|
||||
5. If you've followed the above mentioned paragraphs and your patch still
|
||||
hasn't been incorporated after some weeks, consider resubmitting it to the
|
||||
list.
|
||||
|
||||
3.5 Write good commit messages
|
||||
|
||||
A short guide to how to do fine commit messages in the curl project.
|
||||
|
||||
---- start ----
|
||||
[area]: [short line describing the main effect]
|
||||
|
||||
[separate the above single line from the rest with an empty line]
|
||||
|
||||
[full description, no wider than 72 columns that describe as much as
|
||||
possible as to why this change is made, and possibly what things
|
||||
it fixes and everything else that is related]
|
||||
---- stop ----
|
||||
|
||||
Don't forget to use commit --author="" if you commit someone else's work,
|
||||
and make sure that you have your own user and email setup correctly in git
|
||||
before you commit
|
||||
|
||||
|
55
docs/FAQ
55
docs/FAQ
@@ -1,4 +1,4 @@
|
||||
Updated: Nov 7, 2009 (http://curl.haxx.se/docs/faq.html)
|
||||
Updated: June 30, 2010 (http://curl.haxx.se/docs/faq.html)
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
@@ -74,6 +74,7 @@ FAQ
|
||||
4.16 My HTTP POST or PUT requests are slow!
|
||||
4.17 Non-functional connect timeouts on Windows
|
||||
4.18 file:// URLs containing drive letters (Windows, NetWare)
|
||||
4.19 Why doesn't cURL return an error when the network cable is unplugged?
|
||||
|
||||
5. libcurl Issues
|
||||
5.1 Is libcurl thread-safe?
|
||||
@@ -83,7 +84,7 @@ FAQ
|
||||
5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on win32 ?
|
||||
5.6 What about Keep-Alive or persistent connections?
|
||||
5.7 Link errors when building libcurl on Windows!
|
||||
5.8 libcurl.so.3: open failed: No such file or directory
|
||||
5.8 libcurl.so.X: open failed: No such file or directory
|
||||
5.9 How does libcurl resolve host names?
|
||||
5.10 How do I prevent libcurl from writing the response to stdout?
|
||||
5.11 How do I make libcurl not receive the whole HTTP response?
|
||||
@@ -399,10 +400,10 @@ FAQ
|
||||
|
||||
2.2 Does curl work/build with other SSL libraries?
|
||||
|
||||
Curl has been written to use OpenSSL, GnuTLS, yassl or NSS, although there
|
||||
should not be many problems using a different library. If anyone does "port"
|
||||
curl to use a different SSL library, we are of course very interested in
|
||||
getting the patch!
|
||||
Curl has been written to use OpenSSL, GnuTLS, yassl, NSS or PolarSSL,
|
||||
although there should not be many problems using a different library. If
|
||||
anyone does "port" curl to use a different SSL library, we are of course
|
||||
very interested in getting the patch!
|
||||
|
||||
2.3 Where can I find a copy of LIBEAY32.DLL?
|
||||
|
||||
@@ -944,6 +945,31 @@ FAQ
|
||||
|
||||
In either case, cURL should now be looking for the correct file.
|
||||
|
||||
4.19 Why doesn't cURL return an error when the network cable is unplugged?
|
||||
|
||||
Unplugging the cable is not an error situation. The TCP/IP protocol stack
|
||||
was designed to be fault tolerant, so even though there may be a physical
|
||||
break somewhere the connection shouldn't be affected, just possibly
|
||||
delayed. Eventually, the physical break will be fixed or the data will be
|
||||
re-routed around the physical problem.
|
||||
|
||||
In such cases, the TCP/IP stack is responsible for detecting when the
|
||||
network connection is irrevocably lost. Since with some protocols it is
|
||||
perfectly legal for the client wait indefinitely for data, the stack may
|
||||
never report a problem, and even when it does, it can take up to 20 minutes
|
||||
for it to detect an issue. The curl option --keepalive-time enables
|
||||
keep-alive support in the TCP/IP stack which makes it periodically probe the
|
||||
connection to make sure it is still available to send data. That should
|
||||
reliably detect any TCP/IP network failure.
|
||||
|
||||
But even that won't detect the network going down before the TCP/IP
|
||||
connection is established (e.g. during a DNS lookup) or using protocols that
|
||||
don't use TCP. To handle those situations, curl offers a number of timeouts
|
||||
on its own. --speed-limit/--speed-time will abort if the data transfer rate
|
||||
falls too low, and --connect-timeout and --max-time can be used to put an
|
||||
overall timeout on the connection phase or the entire transfer.
|
||||
|
||||
|
||||
5. libcurl Issues
|
||||
|
||||
5.1 Is libcurl thread-safe?
|
||||
@@ -1058,13 +1084,14 @@ FAQ
|
||||
Borland: libcurl.lib libcurl_imp.lib
|
||||
|
||||
|
||||
5.8 libcurl.so.3: open failed: No such file or directory
|
||||
5.8 libcurl.so.X: open failed: No such file or directory
|
||||
|
||||
This is an error message you might get when you try to run a program linked
|
||||
with a shared version of libcurl and your run-time linker (ld.so) couldn't
|
||||
find the shared library named libcurl.so.3.
|
||||
find the shared library named libcurl.so.X. (Where X is the number of the
|
||||
current libcurl ABI, typically 3 or 4).
|
||||
|
||||
You need to make sure that ld.so finds libcurl.so.3. You can do that
|
||||
You need to make sure that ld.so finds libcurl.so.X. You can do that
|
||||
multiple ways, and it differs somewhat between different operating systems,
|
||||
but they are usually:
|
||||
|
||||
@@ -1100,10 +1127,10 @@ FAQ
|
||||
Using this offers asynchronous name resolves but it currently has no IPv6
|
||||
support.
|
||||
|
||||
- The Windows threaded resolver. It use:
|
||||
- The threaded resolver (default option on Windows). It uses:
|
||||
|
||||
A - gethostbyname() on plain ipv4 windows hosts
|
||||
B - getaddrinfo() on ipv6-enabled windows hosts
|
||||
A - gethostbyname() on plain ipv4 hosts
|
||||
B - getaddrinfo() on ipv6-enabled hosts
|
||||
|
||||
Also note that libcurl never resolves or reverse-lookups addresses given as
|
||||
pure numbers, such as 127.0.0.1 or ::1.
|
||||
@@ -1182,7 +1209,9 @@ FAQ
|
||||
to do "LIST -a" or similar to see them.
|
||||
|
||||
The application thus needs to parse the LIST output. One such existing
|
||||
list parser is available at http://cr.yp.to/ftpparse.html
|
||||
list parser is available at http://cr.yp.to/ftpparse.html Versions of
|
||||
libcurl since 7.21.0 also provide the ability to specify a wildcard to
|
||||
download multiple files from one FTP directory.
|
||||
|
||||
|
||||
6. License Issues
|
||||
|
@@ -43,7 +43,7 @@ HTTP
|
||||
- POST
|
||||
- Pipelining
|
||||
- multipart formpost (RFC1867-style)
|
||||
- authentication: Basic, Digest, NTLM(*1), GSS-Negotiate/Negotiate(*3) and
|
||||
- authentication: Basic, Digest, NTLM(*9), GSS-Negotiate/Negotiate(*3) and
|
||||
SPNEGO (*4) to server and proxy
|
||||
- resume (both GET and PUT)
|
||||
- follow redirects
|
||||
@@ -125,7 +125,7 @@ FILE
|
||||
FOOTNOTES
|
||||
=========
|
||||
|
||||
*1 = requires OpenSSL, GnuTLS, NSS or yassl
|
||||
*1 = requires OpenSSL, GnuTLS, NSS, yassl or PolarSSL
|
||||
*2 = requires OpenLDAP
|
||||
*3 = requires a GSSAPI-compliant library, such as Heimdal or similar.
|
||||
*4 = requires FBopenssl
|
||||
@@ -133,3 +133,4 @@ FOOTNOTES
|
||||
*6 = requires c-ares
|
||||
*7 = requires OpenSSL or NSS, as GnuTLS only supports SSLv3 and TLSv1
|
||||
*8 = requires libssh2
|
||||
*9 = requires OpenSSL, GnuTLS, NSS or yassl
|
||||
|
51
docs/HISTORY
51
docs/HISTORY
@@ -157,6 +157,14 @@ September 2005:
|
||||
|
||||
More than 100,000 unique visitors of the curl web site. 25 mirrors.
|
||||
|
||||
December 2005:
|
||||
|
||||
security vulnerability: libcurl URL Buffer Overflow
|
||||
|
||||
March 2006:
|
||||
|
||||
security vulnerability: libcurl TFTP Packet Buffer Overflow
|
||||
|
||||
April 2006:
|
||||
|
||||
Added the multi_socket() API
|
||||
@@ -174,6 +182,10 @@ February 2007:
|
||||
|
||||
Added support for the Mozilla NSS library to do the SSL/TLS stuff
|
||||
|
||||
July 2007:
|
||||
|
||||
security vulnerability: libcurl GnuTLS insufficient cert verification
|
||||
|
||||
November 2008:
|
||||
|
||||
Command line options: 128
|
||||
@@ -184,3 +196,42 @@ November 2008:
|
||||
|
||||
145,000 unique visitors. >100 GB downloaded.
|
||||
|
||||
March 2009:
|
||||
|
||||
security vulnerability: libcurl Arbitrary File Access
|
||||
|
||||
August 2009:
|
||||
|
||||
security vulnerability: libcurl embedded zero in cert name
|
||||
|
||||
December 2009:
|
||||
|
||||
Added support for IMAP, POP3 and SMTP
|
||||
|
||||
January 2010:
|
||||
|
||||
Added support for RTSP
|
||||
|
||||
February 2010:
|
||||
|
||||
security vulnerability: libcurl data callback excessive length
|
||||
|
||||
March 2010:
|
||||
|
||||
The project switched over to use git instead of CVS for source code control
|
||||
|
||||
May 2010:
|
||||
|
||||
Added support for RTMP
|
||||
|
||||
Added support for PolarSSL to do the SSL/TLS stuff
|
||||
|
||||
August 2010:
|
||||
|
||||
Public curl releases: 117
|
||||
Command line options: 138
|
||||
curl_easy_setopt() options: 180
|
||||
Public functions in libcurl: 58
|
||||
Known libcurl bindings: 39
|
||||
Contributors: 808
|
||||
|
||||
|
10
docs/INSTALL
10
docs/INSTALL
@@ -139,6 +139,9 @@ UNIX
|
||||
To build with NSS support instead of OpenSSL for SSL/TLS, note that
|
||||
you need to use both --without-ssl and --with-nss.
|
||||
|
||||
To build with PolarSSL support instead of OpenSSL for SSL/TLS, note that
|
||||
you need to use both --without-ssl and --with-polarssl.
|
||||
|
||||
To get GSSAPI support, build with --with-gssapi and have the MIT or
|
||||
Heimdal Kerberos 5 packages installed.
|
||||
|
||||
@@ -779,6 +782,11 @@ VxWorks
|
||||
To clean the build results type 'make -f ./Makefile.vxworks clean'.
|
||||
|
||||
|
||||
Android
|
||||
=======
|
||||
See the build notes in the Android.mk file.
|
||||
|
||||
|
||||
CROSS COMPILE
|
||||
=============
|
||||
(This section was graciously brought to us by Jim Duey, with additions by
|
||||
@@ -908,7 +916,7 @@ PORTS
|
||||
- Alpha OpenVMS V7.1-1H2
|
||||
- Alpha Tru64 v5.0 5.1
|
||||
- AVR32 Linux
|
||||
- ARM Android 1.5
|
||||
- ARM Android 1.5, 2.1
|
||||
- ARM INTEGRITY
|
||||
- ARM iPhone OS
|
||||
- Cell Linux
|
||||
|
@@ -356,7 +356,7 @@ multi interface/non-blocking
|
||||
|
||||
The FTP and the SFTP/SCP protocols are thus perfect examples of how we adapt
|
||||
and adjust the code to allow non-blocking operations even on multi-stage
|
||||
protocols. The DICT, TELNET and TFTP are crappy examples and they are subject
|
||||
protocols. The DICT, LDAP and TELNET are crappy examples and they are subject
|
||||
for rewrite in the future to better fit the libcurl protocol family.
|
||||
|
||||
SSL libraries
|
||||
|
@@ -3,6 +3,11 @@ join in and help us correct one or more of these! Also be sure to check the
|
||||
changelog of the current development status, as one or more of these problems
|
||||
may have been fixed since this was written!
|
||||
|
||||
76. The SOCKET type in Win64 is 64 bits large (and thus so is curl_socket_t on
|
||||
that platform), and long is only 32 bits. It makes it impossible for
|
||||
curl_easy_getinfo() to return a socket properly with the CURLINFO_LASTSOCKET
|
||||
option as for all other operating systems.
|
||||
|
||||
75. NTLM authentication involving unicode user name or password.
|
||||
http://curl.haxx.se/mail/lib-2009-10/0024.html
|
||||
http://curl.haxx.se/bug/view.cgi?id=2944325
|
||||
@@ -63,10 +68,6 @@ may have been fixed since this was written!
|
||||
is waiting for the the 100-continue response.
|
||||
http://curl.haxx.se/mail/lib-2008-08/0462.html
|
||||
|
||||
59. If the CURLOPT_PORT option is used on an FTP URL like
|
||||
"ftp://example.com/file;type=A" using a proxy, the ";type=A" is stripped off.
|
||||
See the comment in parse_remote_port()
|
||||
|
||||
58. It seems sensible to be able to use CURLOPT_NOBODY and
|
||||
CURLOPT_FAILONERROR with FTP to detect if a file exists or not, but it is
|
||||
not working: http://curl.haxx.se/mail/lib-2008-07/0295.html
|
||||
@@ -91,7 +92,7 @@ may have been fixed since this was written!
|
||||
|
||||
52. Gautam Kachroo's issue that identifies a problem with the multi interface
|
||||
where a connection can be re-used without actually being properly
|
||||
SSL-negoatiated:
|
||||
SSL-negotiated:
|
||||
http://curl.haxx.se/mail/lib-2008-01/0277.html
|
||||
|
||||
49. If using --retry and the transfer timeouts (possibly due to using -m or
|
||||
@@ -141,12 +142,13 @@ may have been fixed since this was written!
|
||||
30. You need to use -g to the command line tool in order to use RFC2732-style
|
||||
IPv6 numerical addresses in URLs.
|
||||
|
||||
29. IPv6 URLs with zone ID is not supported.
|
||||
29. IPv6 URLs with zone ID is not nicely supported.
|
||||
http://www.ietf.org/internet-drafts/draft-fenner-literal-zone-02.txt (expired)
|
||||
specifies the use of a plus sign instead of a percent when specifying zone
|
||||
IDs in URLs to get around the problem of percent signs being
|
||||
special. According to the reporter, Firefox deals with the URL _with_ a
|
||||
percent letter (which seems like a blatant URL spec violation).
|
||||
libcurl supports zone IDs where the percent sign is URL-escaped (i.e. %25).
|
||||
|
||||
See http://curl.haxx.se/bug/view.cgi?id=1371118
|
||||
|
||||
@@ -189,7 +191,7 @@ may have been fixed since this was written!
|
||||
would not meaningfully support NUL characters within RFC 959 <string>,
|
||||
anyway (e.g., UNIX pathnames may not contain NUL).
|
||||
|
||||
14. Test case 165 might fail on system which has libidn present, but with an
|
||||
14. Test case 165 might fail on a system which has libidn present, but with an
|
||||
old iconv version (2.1.3 is a known bad version), since it doesn't recognize
|
||||
the charset when named ISO8859-1. Changing the name to ISO-8859-1 makes the
|
||||
test pass, but instead makes it fail on Solaris hosts that use its native
|
||||
|
@@ -32,12 +32,16 @@ This document lists documents and standards used by curl.
|
||||
|
||||
RFC 2068 - HTTP 1.1 (obsoleted by RFC 2616)
|
||||
|
||||
RFC 2104 - Keyed-Hashing for Message Authentication
|
||||
|
||||
RFC 2109 - HTTP State Management Mechanism (cookie stuff)
|
||||
- Also, read Netscape's specification at
|
||||
http://curl.haxx.se/rfc/cookie_spec.html
|
||||
|
||||
RFC 2183 - The Content-Disposition Header Field
|
||||
|
||||
RFC 2195 - CRAM-MD5 authentication
|
||||
|
||||
RFC 2229 - A Dictionary Server Protocol
|
||||
|
||||
RFC 2255 - Newer LDAP URL syntax document.
|
||||
@@ -73,3 +77,7 @@ This document lists documents and standards used by curl.
|
||||
RFC 2965 - HTTP State Management Mechanism. Cookies. Obsoletes RFC2109
|
||||
|
||||
RFC 3207 - SMTP over TLS
|
||||
|
||||
RFC 4616 - PLAIN authentication
|
||||
|
||||
RFC 4954 - SMTP Authentication
|
||||
|
32
docs/THANKS
32
docs/THANKS
@@ -8,12 +8,14 @@ Aaron Oneal
|
||||
Adam D. Moss
|
||||
Adam Piggott
|
||||
Adrian Schuur
|
||||
Akos Pasztory
|
||||
Alan Pinstein
|
||||
Albert Chin-A-Young
|
||||
Albert Choy
|
||||
Ale Vesely
|
||||
Aleksandar Milivojevic
|
||||
Alessandro Vesely
|
||||
Alex Bligh
|
||||
Alex Fishman
|
||||
Alex Neblett
|
||||
Alex Suykov
|
||||
@@ -41,6 +43,7 @@ Andreas Olsson
|
||||
Andreas Rieke
|
||||
Andreas Schuldei
|
||||
Andreas Wurf
|
||||
Andrei Benea
|
||||
Andres Garcia
|
||||
Andrew Benham
|
||||
Andrew Biggs
|
||||
@@ -81,6 +84,7 @@ Bill Hoffman
|
||||
Bjorn Augustsson
|
||||
Bjorn Reese
|
||||
Bj<EFBFBD>rn Stenberg
|
||||
Bob Richmond
|
||||
Bob Schader
|
||||
Bogdan Nicula
|
||||
Brad Burdick
|
||||
@@ -118,6 +122,7 @@ Christian Schmitz
|
||||
Christian Vogt
|
||||
Christophe Demory
|
||||
Christophe Legry
|
||||
Christopher Conroy
|
||||
Christopher Palow
|
||||
Christopher R. Palmer
|
||||
Ciprian Badescu
|
||||
@@ -200,7 +205,9 @@ Dominick Meglio
|
||||
Doug Kaufman
|
||||
Doug Porter
|
||||
Douglas E. Wegscheid
|
||||
Douglas Kilpatrick
|
||||
Douglas R. Horner
|
||||
Douglas Steinwand
|
||||
Dov Murik
|
||||
Duane Cathey
|
||||
Duncan Mac-Vicar Prett
|
||||
@@ -222,6 +229,7 @@ Eric Cooper
|
||||
Eric Landes
|
||||
Eric Lavigne
|
||||
Eric Melville
|
||||
Eric Mertens
|
||||
Eric Rautman
|
||||
Eric Thelin
|
||||
Eric Vergnaud
|
||||
@@ -243,6 +251,7 @@ Forrest Cahoon
|
||||
Frank Hempel
|
||||
Frank Keeney
|
||||
Frank McGeough
|
||||
Frank Meier
|
||||
Frank Ticheler
|
||||
Fred Machado
|
||||
Fred New
|
||||
@@ -291,9 +300,12 @@ Hans Steegers
|
||||
Hans-Jurgen May
|
||||
Hardeep Singh
|
||||
Harshal Pradhan
|
||||
Hauke Duden
|
||||
Heikki Korpela
|
||||
Henrik Storner
|
||||
Hidemoto Nakada
|
||||
Hoi-Ho Chan
|
||||
Howard Chu
|
||||
Hzhijun
|
||||
Ian Ford
|
||||
Ian Gulliver
|
||||
@@ -310,8 +322,10 @@ Immanuel Gregoire
|
||||
Ingmar Runge
|
||||
Ingo Ralf Blum
|
||||
Ingo Wilken
|
||||
Jack Zhang
|
||||
Jacky Lam
|
||||
Jacob Meuser
|
||||
Jacob Moshenko
|
||||
Jad Chamcham
|
||||
James Bursa
|
||||
James Cheng
|
||||
@@ -327,6 +341,7 @@ Jamie Wilkinson
|
||||
Jan Kunder
|
||||
Jared Lundell
|
||||
Jari Sundell
|
||||
Jason McDonald
|
||||
Jason S. Priebe
|
||||
Jay Austin
|
||||
Jayesh A Shah
|
||||
@@ -345,6 +360,7 @@ Jeff Weber
|
||||
Jeffrey Pohlmeyer
|
||||
Jeremy Friesner
|
||||
Jerome Muffat-Meridol
|
||||
Jerome Vouillon
|
||||
Jes Badwal
|
||||
Jesper Jensen
|
||||
Jesse Noller
|
||||
@@ -369,6 +385,7 @@ John Lightsey
|
||||
John McGowan
|
||||
John P. McCaskey
|
||||
John Wilkinson
|
||||
John-Mark Bell
|
||||
Johnny Luong
|
||||
Jon Grubbs
|
||||
Jon Nelson
|
||||
@@ -396,6 +413,7 @@ J
|
||||
J<EFBFBD>rn Hartroth
|
||||
Kai Sommerfeld
|
||||
Kai-Uwe Rommel
|
||||
Kalle Vahlman
|
||||
Kamil Dudka
|
||||
Kang-Jin Lee
|
||||
Karl Moerder
|
||||
@@ -408,6 +426,7 @@ Keith McGuigan
|
||||
Keith Mok
|
||||
Ken Hirsch
|
||||
Ken Rastatter
|
||||
Kenny To
|
||||
Kent Boortz
|
||||
Keshav Krity
|
||||
Kevin Baughman
|
||||
@@ -471,24 +490,28 @@ Mark Eichin
|
||||
Mark Incley
|
||||
Mark Karpeles
|
||||
Mark Lentczner
|
||||
Markus Duft
|
||||
Markus Koetter
|
||||
Markus Moeller
|
||||
Markus Oberhumer
|
||||
Martijn Koster
|
||||
Martin C. Martin
|
||||
Martin Drasar
|
||||
Martin Hager
|
||||
Martin Hedenfalk
|
||||
Martin Skinner
|
||||
Martin Storsjo
|
||||
Marty Kuhrt
|
||||
Maruko
|
||||
Massimiliano Ziccardi
|
||||
Massimo Callegari
|
||||
Mateusz Loskot
|
||||
Mathias Axelsson
|
||||
Mats Lidell
|
||||
Matt Kraai
|
||||
Matt Veenstra
|
||||
Matt Witherspoon
|
||||
Matt Wixson
|
||||
Matthew Blain
|
||||
Matthew Clarke
|
||||
Maurice Barnum
|
||||
@@ -554,18 +577,21 @@ Olaf St
|
||||
Oren Tirosh
|
||||
P R Schaffner
|
||||
Pascal Terjan
|
||||
Pat Ray
|
||||
Patrick Bihan-Faou
|
||||
Patrick Monnerat
|
||||
Patrick Scott
|
||||
Patrick Smith
|
||||
Patrik Thunstrom
|
||||
Paul Harrington
|
||||
Paul Howarth
|
||||
Paul Marquis
|
||||
Paul Moore
|
||||
Paul Nolan
|
||||
Paul Querna
|
||||
Pavel Cenek
|
||||
Pavel Orehov
|
||||
Pavel Raiskup
|
||||
Pawel A. Gajda
|
||||
Pawel Kierski
|
||||
Pedro Neves
|
||||
@@ -601,6 +627,7 @@ Puneet Pawaia
|
||||
Quagmire
|
||||
Rafa Muyo
|
||||
Rafael Sagula
|
||||
Rainer Canavan
|
||||
Rainer Koenig
|
||||
Ralf S. Engelschall
|
||||
Ralph Beckmann
|
||||
@@ -651,6 +678,8 @@ Ron Zapp
|
||||
Rosimildo da Silva
|
||||
Roy Shan
|
||||
Rune Kleveland
|
||||
Ruslan Gazizov
|
||||
Ryan Chan
|
||||
Ryan Nelson
|
||||
S. Moonesamy
|
||||
Salvador D<>vila
|
||||
@@ -703,6 +732,7 @@ Steve Oliphant
|
||||
Steve Roskowski
|
||||
Steven Bazyl
|
||||
Steven G. Johnson
|
||||
Steven M. Schweda
|
||||
Stoned Elipot
|
||||
Sven Anders
|
||||
Sven Neuhaus
|
||||
@@ -714,6 +744,7 @@ Tanguy Fautre
|
||||
Temprimus
|
||||
Thomas J. Moore
|
||||
Thomas Klausner
|
||||
Thomas Lopatic
|
||||
Thomas Schwinge
|
||||
Thomas Tonino
|
||||
Tim Ansell
|
||||
@@ -727,6 +758,7 @@ Toby Peterson
|
||||
Todd Kulesza
|
||||
Todd Vierling
|
||||
Tom Benoist
|
||||
Tom Donovan
|
||||
Tom Lee
|
||||
Tom Mattison
|
||||
Tom Moers
|
||||
|
96
docs/TODO
96
docs/TODO
@@ -22,12 +22,13 @@
|
||||
2.2 Remove easy interface internally
|
||||
2.3 Avoid having to remove/readd handles
|
||||
2.4 Fix HTTP Pipelining for PUT
|
||||
2.5 Make curl_multi_info_read faster
|
||||
|
||||
3. Documentation
|
||||
3.1 More and better
|
||||
|
||||
4. FTP
|
||||
4.1 PRET
|
||||
4.1 HOST
|
||||
4.2 Alter passive/active on failure and retry
|
||||
4.3 Earlier bad letter detection
|
||||
4.4 REST for large files
|
||||
@@ -60,28 +61,23 @@
|
||||
8. GnuTLS
|
||||
8.1 SSL engine stuff
|
||||
8.2 SRP
|
||||
8.3 non-blocking
|
||||
8.4 check connection
|
||||
8.3 check connection
|
||||
|
||||
9. Other protocols
|
||||
9.1 ditch ldap-specific select
|
||||
|
||||
10. New protocols
|
||||
10.1 RTSP
|
||||
10.2 RSYNC
|
||||
10.3 RTMP
|
||||
10.1 RSYNC
|
||||
10.2 RTMP
|
||||
|
||||
11. Client
|
||||
11.1 Content-Disposition
|
||||
11.2 sync
|
||||
11.3 glob posts
|
||||
11.4 prevent file overwriting
|
||||
11.5 ftp wildcard download
|
||||
11.6 simultaneous parallel transfers
|
||||
11.7 provide formpost headers
|
||||
11.8 url-specific options
|
||||
11.9 metalink support
|
||||
11.10 warning when setting an option
|
||||
11.1 sync
|
||||
11.2 glob posts
|
||||
11.3 prevent file overwriting
|
||||
11.4 simultaneous parallel transfers
|
||||
11.5 provide formpost headers
|
||||
11.6 url-specific options
|
||||
11.7 metalink support
|
||||
11.8 warning when setting an option
|
||||
|
||||
12. Build
|
||||
12.1 roffit
|
||||
@@ -148,7 +144,6 @@
|
||||
EWOULDBLOCK or similar. Blocking cases include:
|
||||
|
||||
- Name resolves on non-windows unless c-ares is used
|
||||
- GnuTLS SSL connections
|
||||
- NSS SSL connections
|
||||
- Active FTP connections
|
||||
- HTTP proxy CONNECT operations
|
||||
@@ -190,6 +185,10 @@
|
||||
serial requests and currently libcurl only supports that for HEAD and GET
|
||||
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
|
||||
|
||||
@@ -199,12 +198,12 @@
|
||||
|
||||
4. FTP
|
||||
|
||||
4.1 PRET
|
||||
4.1 HOST
|
||||
|
||||
PRET is a command that primarily "drftpd" supports, which could be useful
|
||||
when using libcurl against such a server. It is a non-standard and a rather
|
||||
oddly designed command, but...
|
||||
http://curl.haxx.se/bug/feature.cgi?id=1729967
|
||||
HOST is a suggested command in the works for a client to tell which host name
|
||||
to use, to offer FTP servers named-based virtual hosting:
|
||||
|
||||
http://tools.ietf.org/html/draft-hethmon-mcmurray-ftp-hosts-11
|
||||
|
||||
4.2 Alter passive/active on failure and retry
|
||||
|
||||
@@ -362,39 +361,21 @@ to provide the data to send.
|
||||
Work out a common method with Peter Sylvester's OpenSSL-patch for SRP on the
|
||||
TLS to provide name and password. GnuTLS already supports it...
|
||||
|
||||
8.3 non-blocking
|
||||
|
||||
Fix the connection phase to be non-blocking when multi interface is used
|
||||
|
||||
8.4 check connection
|
||||
8.3 check connection
|
||||
|
||||
Add a way to check if the connection seems to be alive, to correspond to the
|
||||
SSL_peak() way we use with OpenSSL.
|
||||
|
||||
9. Other protocols
|
||||
|
||||
9.1 ditch ldap-specific select
|
||||
|
||||
* Look over the implementation. The looping will have to "go away" from the
|
||||
lib/ldap.c source file and get moved to the main network code so that the
|
||||
multi interface and friends will work for LDAP as well.
|
||||
|
||||
9.2 stop TFTP blocking
|
||||
|
||||
Stop TFTP from being blocking and doing its own read loop in tftp_do.
|
||||
|
||||
10. New protocols
|
||||
|
||||
10.1 RTSP
|
||||
|
||||
RFC2326 (protocol - very HTTP-like, also contains URL description)
|
||||
|
||||
10.2 RSYNC
|
||||
10.1 RSYNC
|
||||
|
||||
There's no RFC for protocol nor URI/URL format. An implementation should
|
||||
most probably use an existing rsync library, such as librsync.
|
||||
|
||||
10.3 RTMP
|
||||
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
|
||||
@@ -402,14 +383,7 @@ to provide the data to send.
|
||||
|
||||
11. Client
|
||||
|
||||
11.1 Content-Disposition
|
||||
|
||||
Add option that is similar to -O but that takes the output file name from the
|
||||
Content-Disposition: header, and/or uses the local file name used in
|
||||
redirections for the cases the server bounces the request further to a
|
||||
different file (name): http://curl.haxx.se/bug/feature.cgi?id=1364676
|
||||
|
||||
11.2 sync
|
||||
11.1 sync
|
||||
|
||||
"curl --sync http://example.com/feed[1-100].rss" or
|
||||
"curl --sync http://example.net/{index,calendar,history}.html"
|
||||
@@ -418,12 +392,12 @@ to provide the data to send.
|
||||
remote file is newer than the local file. A Last-Modified HTTP date header
|
||||
should also be used to set the mod date on the downloaded file.
|
||||
|
||||
11.3 glob posts
|
||||
11.2 glob posts
|
||||
|
||||
Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'.
|
||||
This is easily scripted though.
|
||||
|
||||
11.4 prevent file overwriting
|
||||
11.3 prevent file overwriting
|
||||
|
||||
Add an option that prevents cURL from overwriting existing local files. When
|
||||
used, and there already is an existing file with the target file name
|
||||
@@ -431,18 +405,14 @@ to provide the data to send.
|
||||
existing). So that index.html becomes first index.html.1 and then
|
||||
index.html.2 etc.
|
||||
|
||||
11.5 ftp wildcard download
|
||||
|
||||
"curl ftp://site.com/*.txt"
|
||||
|
||||
11.6 simultaneous parallel transfers
|
||||
11.4 simultaneous parallel transfers
|
||||
|
||||
The client could be told to use maximum N simultaneous parallel transfers and
|
||||
then just make sure that happens. It should of course not make more than one
|
||||
connection to the same remote host. This would require the client to use the
|
||||
multi interface. http://curl.haxx.se/bug/feature.cgi?id=1558595
|
||||
|
||||
11.7 provide formpost headers
|
||||
11.5 provide formpost headers
|
||||
|
||||
Extending the capabilities of the multipart formposting. How about leaving
|
||||
the ';type=foo' syntax as it is and adding an extra tag (headers) which
|
||||
@@ -456,7 +426,7 @@ to provide the data to send.
|
||||
which should overwrite the program reasonable defaults (plain/text,
|
||||
8bit...)
|
||||
|
||||
11.8 url-specific options
|
||||
11.6 url-specific options
|
||||
|
||||
Provide a way to make options bound to a specific URL among several on the
|
||||
command line. Possibly by letting ':' separate options between URLs,
|
||||
@@ -470,12 +440,12 @@ to provide the data to send.
|
||||
|
||||
The example would do a POST-GET-POST combination on a single command line.
|
||||
|
||||
11.9 metalink support
|
||||
11.7 metalink support
|
||||
|
||||
Add metalink support to curl (http://www.metalinker.org/). This is most useful
|
||||
with simultaneous parallel transfers (11.6) but not necessary.
|
||||
|
||||
11.10 warning when setting an option
|
||||
11.8 warning when setting an option
|
||||
|
||||
Display a warning when libcurl returns an error when setting an option.
|
||||
This can be useful to tell when support for a particular feature hasn't been
|
||||
|
46
docs/curl.1
46
docs/curl.1
@@ -927,6 +927,52 @@ in web browsers, so curl does the conversion by default to maintain
|
||||
consistency. However, a server may require a POST to remain a POST after such
|
||||
a redirection. This option is meaningful only when using \fI-L/--location\fP
|
||||
(Added in 7.19.1)
|
||||
.IP "--proto <protocols>"
|
||||
Tells curl to use the listed protocols for its initial retrieval. Protocols
|
||||
are evaluated left to right, are comma separated, and are each a protocol
|
||||
name or 'all', optionally prefixed by zero or more modifiers. Available
|
||||
modifiers are:
|
||||
.RS
|
||||
.TP 3
|
||||
.B +
|
||||
Permit this protocol in addition to protocols already permitted (this is
|
||||
the default if no modifier is used).
|
||||
.TP
|
||||
.B -
|
||||
Deny this protocol, removing it from the list of protocols already permitted.
|
||||
.TP
|
||||
.B =
|
||||
Permit only this protocol (ignoring the list already permitted), though
|
||||
subject to later modification by subsequent entries in the comma separated
|
||||
list.
|
||||
.RE
|
||||
.IP
|
||||
For example:
|
||||
.RS
|
||||
.TP 15
|
||||
.B --proto -ftps
|
||||
uses the default protocols, but disables ftps
|
||||
.TP
|
||||
.B --proto -all,https,+http
|
||||
only enables http and https
|
||||
.TP
|
||||
.B --proto =http,https
|
||||
also only enables http and https
|
||||
.RE
|
||||
.IP
|
||||
Unknown protocols produce a warning. This allows scripts to safely rely on
|
||||
being able to disable potentially dangerous protocols, without relying upon
|
||||
support for that protocol being built into curl to avoid an error.
|
||||
|
||||
This option can be used multiple times, in which case the effect is the same
|
||||
as concatenating the protocols into one instance of the option.
|
||||
|
||||
(Added in 7.20.2)
|
||||
.IP "--proto-redir <protocols>"
|
||||
Tells curl to use the listed protocols after a redirect. See --proto for
|
||||
how protocols are represented.
|
||||
|
||||
(Added in 7.20.2)
|
||||
.IP "--proxy-anyauth"
|
||||
Tells curl to pick a suitable authentication method when communicating with
|
||||
the given proxy. This might cause an extra request/response round-trip. (Added
|
||||
|
32
docs/examples/.gitignore
vendored
Normal file
32
docs/examples/.gitignore
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
10-at-a-time
|
||||
anyauthput
|
||||
certinfo
|
||||
chkspeed
|
||||
cookie_interface
|
||||
debug
|
||||
fileupload
|
||||
fopen
|
||||
ftp-wildcard
|
||||
ftpget
|
||||
ftpgetinfo
|
||||
ftpgetresp
|
||||
ftpupload
|
||||
getinfo
|
||||
getinmemory
|
||||
http-post
|
||||
httpcustomheader
|
||||
httpput
|
||||
https
|
||||
multi-app
|
||||
multi-debugcallback
|
||||
multi-double
|
||||
multi-post
|
||||
multi-single
|
||||
persistant
|
||||
post-callback
|
||||
postit2
|
||||
sendrecv
|
||||
sepheaders
|
||||
simple
|
||||
simplepost
|
||||
simplessl
|
@@ -1,16 +1,12 @@
|
||||
# These are all libcurl example programs to be test compiled
|
||||
check_PROGRAMS = 10-at-a-time anyauthput cookie_interface \
|
||||
debug fileupload fopen ftpget ftpgetresp ftpupload \
|
||||
getinfo getinmemory http-post httpput \
|
||||
https multi-app multi-debugcallback multi-double \
|
||||
multi-post multi-single persistant post-callback \
|
||||
postit2 sepheaders simple simplepost simplessl \
|
||||
sendrecv httpcustomheader certinfo chkspeed ftpgetinfo
|
||||
check_PROGRAMS = 10-at-a-time anyauthput cookie_interface debug fileupload \
|
||||
fopen ftpget ftpgetresp ftpupload getinfo getinmemory http-post httpput \
|
||||
https multi-app multi-debugcallback multi-double multi-post multi-single \
|
||||
persistant post-callback postit2 sepheaders simple simplepost simplessl \
|
||||
sendrecv httpcustomheader certinfo chkspeed ftpgetinfo ftp-wildcard
|
||||
|
||||
# These examples require external dependencies that may not be commonly
|
||||
# available on POSIX systems, so don't bother attempting to compile them here.
|
||||
COMPLICATED_EXAMPLES = \
|
||||
curlgtk.c curlx.c htmltitle.cc cacertinmem.c ftpuploadresume.c \
|
||||
ghiper.c hiperfifo.c htmltidy.c multithread.c \
|
||||
opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c evhiperfifo.c
|
||||
|
||||
COMPLICATED_EXAMPLES = curlgtk.c curlx.c htmltitle.cc cacertinmem.c \
|
||||
ftpuploadresume.c ghiper.c hiperfifo.c htmltidy.c multithread.c \
|
||||
opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c evhiperfifo.c
|
||||
|
@@ -40,6 +40,8 @@ static size_t WriteCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
/* we are not interested in the downloaded bytes itself,
|
||||
so we only return the size we would have saved ... */
|
||||
(void)ptr; /* unused */
|
||||
(void)data; /* unused */
|
||||
return (size_t)(size * nmemb);
|
||||
}
|
||||
|
||||
@@ -48,7 +50,7 @@ int main(int argc, char *argv[])
|
||||
CURL *curl_handle;
|
||||
CURLcode res;
|
||||
int prtsep = 0, prttime = 0;
|
||||
char *url = URL_1M;
|
||||
const char *url = URL_1M;
|
||||
char *appname = argv[0];
|
||||
|
||||
if (argc > 1) {
|
||||
@@ -135,17 +137,17 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* check for bytes downloaded */
|
||||
res = curl_easy_getinfo(curl_handle, CURLINFO_SIZE_DOWNLOAD, &val);
|
||||
if((CURLE_OK == res) && val)
|
||||
if((CURLE_OK == res) && (val>0))
|
||||
printf("Data downloaded: %0.0f bytes.\n", val);
|
||||
|
||||
/* check for total download time */
|
||||
res = curl_easy_getinfo(curl_handle, CURLINFO_TOTAL_TIME, &val);
|
||||
if((CURLE_OK == res) && val)
|
||||
if((CURLE_OK == res) && (val>0))
|
||||
printf("Total download time: %0.3f sec.\n", val);
|
||||
|
||||
/* check for average download speed */
|
||||
res = curl_easy_getinfo(curl_handle, CURLINFO_SPEED_DOWNLOAD, &val);
|
||||
if((CURLE_OK == res) && val)
|
||||
if((CURLE_OK == res) && (val>0))
|
||||
printf("Average download speed: %0.3f kbyte/sec.\n", val / 1024);
|
||||
|
||||
} else {
|
||||
|
@@ -131,7 +131,6 @@ fill_buffer(URL_FILE *file,int want,int waittime)
|
||||
fd_set fdread;
|
||||
fd_set fdwrite;
|
||||
fd_set fdexcep;
|
||||
int maxfd;
|
||||
struct timeval timeout;
|
||||
int rc;
|
||||
|
||||
@@ -144,6 +143,9 @@ fill_buffer(URL_FILE *file,int want,int waittime)
|
||||
/* attempt to fill buffer */
|
||||
do
|
||||
{
|
||||
int maxfd = -1;
|
||||
long curl_timeo = -1;
|
||||
|
||||
FD_ZERO(&fdread);
|
||||
FD_ZERO(&fdwrite);
|
||||
FD_ZERO(&fdexcep);
|
||||
@@ -152,12 +154,23 @@ fill_buffer(URL_FILE *file,int want,int waittime)
|
||||
timeout.tv_sec = 60; /* 1 minute */
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
curl_multi_timeout(multi_handle, &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(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
|
||||
/* In a real-world program you OF COURSE check the return code of the
|
||||
function calls, *and* you make sure that maxfd is bigger than -1
|
||||
so that the call to select() below makes sense! */
|
||||
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);
|
||||
|
||||
|
136
docs/examples/ftp-wildcard.c
Normal file
136
docs/examples/ftp-wildcard.c
Normal file
@@ -0,0 +1,136 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
*/
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
struct callback_data {
|
||||
FILE *output;
|
||||
};
|
||||
|
||||
static long file_is_comming(struct curl_fileinfo *finfo,
|
||||
struct callback_data *data,
|
||||
int remains);
|
||||
|
||||
static long file_is_downloaded(struct callback_data *data);
|
||||
|
||||
static size_t write_it(char *buff, size_t size, size_t nmemb,
|
||||
struct callback_data *data);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int rc = CURLE_OK;
|
||||
|
||||
/* curl easy handle */
|
||||
CURL *handle;
|
||||
|
||||
/* help data */
|
||||
struct callback_data data = { 0 };
|
||||
|
||||
/* global initialization */
|
||||
rc = curl_global_init(CURL_GLOBAL_ALL);
|
||||
if(rc)
|
||||
return rc;
|
||||
|
||||
/* initialization of easy handle */
|
||||
handle = curl_easy_init();
|
||||
if(!handle) {
|
||||
curl_global_cleanup();
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* turn on wildcard matching */
|
||||
curl_easy_setopt(handle, CURLOPT_WILDCARDMATCH, 1L);
|
||||
|
||||
/* callback is called before download of concrete file started */
|
||||
curl_easy_setopt(handle, CURLOPT_CHUNK_BGN_FUNCTION, file_is_comming);
|
||||
|
||||
/* callback is called after data from the file have been transferred */
|
||||
curl_easy_setopt(handle, CURLOPT_CHUNK_END_FUNCTION, file_is_downloaded);
|
||||
|
||||
/* this callback will write contents into files */
|
||||
curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, write_it);
|
||||
|
||||
/* put transfer data into callbacks */
|
||||
curl_easy_setopt(handle, CURLOPT_CHUNK_DATA, &data);
|
||||
curl_easy_setopt(handle, CURLOPT_WRITEDATA, &data);
|
||||
|
||||
/* curl_easy_setopt(handle, CURLOPT_VERBOSE, 1L); */
|
||||
|
||||
/* set an URL containing wildcard pattern (only in the last part) */
|
||||
if(argc == 2)
|
||||
curl_easy_setopt(handle, CURLOPT_URL, argv[1]);
|
||||
else
|
||||
curl_easy_setopt(handle, CURLOPT_URL,
|
||||
"ftp://curltest.howto.cz:123456@curltest.howto.cz/test/*");
|
||||
|
||||
/* and start transfer! */
|
||||
rc = curl_easy_perform(handle);
|
||||
|
||||
curl_easy_cleanup(handle);
|
||||
curl_global_cleanup();
|
||||
return rc;
|
||||
}
|
||||
|
||||
static long file_is_comming(struct curl_fileinfo *finfo,
|
||||
struct callback_data *data,
|
||||
int remains)
|
||||
{
|
||||
printf("%3d %40s %10luB ", remains, finfo->filename,
|
||||
(unsigned long)finfo->size);
|
||||
|
||||
switch(finfo->filetype) {
|
||||
case CURLFILETYPE_DIRECTORY:
|
||||
printf(" DIR\n");
|
||||
break;
|
||||
case CURLFILETYPE_FILE:
|
||||
printf("FILE ");
|
||||
break;
|
||||
default:
|
||||
printf("OTHER\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if(finfo->filetype == CURLFILETYPE_FILE) {
|
||||
/* do not transfer files >= 50B */
|
||||
if(finfo->size > 50) {
|
||||
printf("SKIPPED\n");
|
||||
return CURL_CHUNK_BGN_FUNC_SKIP;
|
||||
}
|
||||
|
||||
data->output = fopen(finfo->filename, "w");
|
||||
if(!data->output) {
|
||||
return CURL_CHUNK_BGN_FUNC_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return CURL_CHUNK_BGN_FUNC_OK;
|
||||
}
|
||||
|
||||
static long file_is_downloaded(struct callback_data *data)
|
||||
{
|
||||
if(data->output) {
|
||||
printf("DOWNLOADED\n");
|
||||
fclose(data->output);
|
||||
data->output = 0x0;
|
||||
}
|
||||
return CURL_CHUNK_END_FUNC_OK;
|
||||
}
|
||||
|
||||
static size_t write_it(char *buff, size_t size, size_t nmemb,
|
||||
struct callback_data *data)
|
||||
{
|
||||
size_t written = 0;
|
||||
if(data->output)
|
||||
written = fwrite(buff, size, nmemb, data->output);
|
||||
else
|
||||
/* listing output */
|
||||
written = fwrite(buff, size, nmemb, stdout);
|
||||
return written;
|
||||
}
|
@@ -66,7 +66,9 @@ int main(int argc, char **argv)
|
||||
fd_set fdread;
|
||||
fd_set fdwrite;
|
||||
fd_set fdexcep;
|
||||
int maxfd;
|
||||
int maxfd = -1;
|
||||
|
||||
long curl_timeo = -1;
|
||||
|
||||
FD_ZERO(&fdread);
|
||||
FD_ZERO(&fdwrite);
|
||||
@@ -76,12 +78,23 @@ int main(int argc, char **argv)
|
||||
timeout.tv_sec = 1;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
curl_multi_timeout(multi_handle, &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(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
|
||||
/* In a real-world program you OF COURSE check the return code of the
|
||||
function calls, *and* you make sure that maxfd is bigger than -1 so
|
||||
that the call to select() below makes sense! */
|
||||
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);
|
||||
|
||||
|
@@ -140,7 +140,9 @@ int main(int argc, char **argv)
|
||||
fd_set fdread;
|
||||
fd_set fdwrite;
|
||||
fd_set fdexcep;
|
||||
int maxfd;
|
||||
int maxfd = -1;
|
||||
|
||||
long curl_timeo = -1;
|
||||
|
||||
FD_ZERO(&fdread);
|
||||
FD_ZERO(&fdwrite);
|
||||
@@ -150,12 +152,23 @@ int main(int argc, char **argv)
|
||||
timeout.tv_sec = 1;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
curl_multi_timeout(multi_handle, &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(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
|
||||
/* In a real-world program you OF COURSE check the return code of the
|
||||
function calls, *and* you make sure that maxfd is bigger than -1
|
||||
so that the call to select() below makes sense! */
|
||||
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);
|
||||
|
||||
|
@@ -57,7 +57,9 @@ int main(int argc, char **argv)
|
||||
fd_set fdread;
|
||||
fd_set fdwrite;
|
||||
fd_set fdexcep;
|
||||
int maxfd;
|
||||
int maxfd = -1;
|
||||
|
||||
long curl_timeo = -1;
|
||||
|
||||
FD_ZERO(&fdread);
|
||||
FD_ZERO(&fdwrite);
|
||||
@@ -67,12 +69,23 @@ int main(int argc, char **argv)
|
||||
timeout.tv_sec = 1;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
curl_multi_timeout(multi_handle, &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(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
|
||||
/* In a real-world program you OF COURSE check the return code of the
|
||||
function calls, *and* you make sure that maxfd is bigger than -1 so
|
||||
that the call to select() below makes sense! */
|
||||
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);
|
||||
|
||||
|
@@ -77,7 +77,9 @@ int main(int argc, char *argv[])
|
||||
fd_set fdread;
|
||||
fd_set fdwrite;
|
||||
fd_set fdexcep;
|
||||
int maxfd;
|
||||
int maxfd = -1;
|
||||
|
||||
long curl_timeo = -1;
|
||||
|
||||
FD_ZERO(&fdread);
|
||||
FD_ZERO(&fdwrite);
|
||||
@@ -87,12 +89,23 @@ int main(int argc, char *argv[])
|
||||
timeout.tv_sec = 1;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
curl_multi_timeout(multi_handle, &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(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
|
||||
/* In a real-world program you OF COURSE check the return code of the
|
||||
function calls, *and* you make sure that maxfd is bigger than -1
|
||||
so that the call to select() below makes sense! */
|
||||
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);
|
||||
|
||||
|
@@ -51,7 +51,9 @@ int main(int argc, char **argv)
|
||||
fd_set fdread;
|
||||
fd_set fdwrite;
|
||||
fd_set fdexcep;
|
||||
int maxfd;
|
||||
int maxfd = -1;
|
||||
|
||||
long curl_timeo = -1;
|
||||
|
||||
FD_ZERO(&fdread);
|
||||
FD_ZERO(&fdwrite);
|
||||
@@ -61,12 +63,23 @@ int main(int argc, char **argv)
|
||||
timeout.tv_sec = 1;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
curl_multi_timeout(multi_handle, &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(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
|
||||
/* In a real-world program you OF COURSE check the return code of the
|
||||
function calls, *and* you make sure that maxfd is bigger than -1 so
|
||||
that the call to select() below makes sense! */
|
||||
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);
|
||||
|
||||
|
2
docs/libcurl/.gitignore
vendored
Normal file
2
docs/libcurl/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*.html
|
||||
*.pdf
|
@@ -173,6 +173,17 @@ string holding the IP address of the most recent connection done with this
|
||||
\fBcurl\fP handle. This string may be IPv6 if that's enabled. Note that you
|
||||
get a pointer to a memory area that will be re-used at next request so you
|
||||
need to copy the string if you want to keep the information. (Added in 7.19.0)
|
||||
.IP CURLINFO_PRIMARY_PORT
|
||||
Pass a pointer to a long to receive the destination port of the most recent
|
||||
connection done with this \fBcurl\fP handle. (Added in 7.21.0)
|
||||
.IP CURLINFO_LOCAL_IP
|
||||
Pass a pointer to a char pointer to receive the pointer to a zero-terminated
|
||||
string holding the local (source) IP address of the most recent connection done
|
||||
with this \fBcurl\fP handle. This string may be IPv6 if that's enabled. The
|
||||
same restrictions apply as to \fICURLINFO_PRIMARY_IP\fP. (Added in 7.21.0)
|
||||
.IP CURLINFO_LOCAL_PORT
|
||||
Pass a pointer to a long to receive the local (source) port of the most recent
|
||||
connection done with this \fBcurl\fP handle. (Added in 7.21.0)
|
||||
.IP CURLINFO_COOKIELIST
|
||||
Pass a pointer to a 'struct curl_slist *' to receive a linked-list of all
|
||||
cookies cURL knows (expired ones, too). Don't forget to
|
||||
@@ -187,6 +198,9 @@ working with the socket, you must call curl_easy_cleanup() as usual and let
|
||||
libcurl close the socket and cleanup other resources associated with the
|
||||
handle. This is typically used in combination with \fICURLOPT_CONNECT_ONLY\fP.
|
||||
(Added in 7.15.2)
|
||||
|
||||
NOTE: this API is not really working on win64, since the SOCKET type on win64
|
||||
is 64 bit large while its 'long' is only 32 bits.
|
||||
.IP CURLINFO_FTP_ENTRY_PATH
|
||||
Pass a pointer to a char pointer to receive a pointer to a string holding the
|
||||
path of the entry path. That is the initial path libcurl ended up in when
|
||||
|
@@ -84,11 +84,61 @@ 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.
|
||||
Consider building libcurl with c-ares support to enable asynchronous DNS
|
||||
lookups, which enables nice timeouts for name resolves without signals.
|
||||
.IP CURLOPT_WILDCARDMATCH
|
||||
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
|
||||
\fICURLOPT_URL\fP option, using an fnmatch-like pattern (Shell Pattern
|
||||
Matching) in the last part of URL (file name).
|
||||
|
||||
By default, libcurl uses its internal wildcard matching implementation. You
|
||||
can provide your own matching function by the \fICURLOPT_FNMATCH_FUNCTION\fP
|
||||
option.
|
||||
|
||||
This feature is only supported by the FTP download for now.
|
||||
|
||||
A brief introduction of its syntax follows:
|
||||
.RS
|
||||
.IP "\fB*\fP - ASTERISK"
|
||||
\&ftp://example.com/some/path/\fB*.txt\fP (for all txt's from the root
|
||||
directory)
|
||||
.RE
|
||||
.RS
|
||||
.IP "\fB?\fP - QUESTION MARK"
|
||||
Question mark matches any (exactly one) character.
|
||||
|
||||
\&ftp://example.com/some/path/\fBphoto?.jpeg\fP
|
||||
.RE
|
||||
.RS
|
||||
.IP "\fB[\fP - BRACKET EXPRESSION"
|
||||
The left bracket opens a bracket expression. The question mark and asterisk have
|
||||
no special meaning in a bracket expression. Each bracket expression ends by the
|
||||
right bracket and matches exactly one character. Some examples follow:
|
||||
|
||||
\fB[a-zA-Z0\-9]\fP or \fB[f\-gF\-G]\fP \- character interval
|
||||
|
||||
\fB[abc]\fP - character enumeration
|
||||
|
||||
\fB[^abc]\fP or \fB[!abc]\fP - negation
|
||||
|
||||
\fB[[:\fP\fIname\fP\fB:]]\fP class expression. Supported classes are
|
||||
\fBalnum\fP,\fBlower\fP, \fBspace\fP, \fBalpha\fP, \fBdigit\fP, \fBprint\fP,
|
||||
\fBupper\fP, \fBblank\fP, \fBgraph\fP, \fBxdigit\fP.
|
||||
|
||||
\fB[][-!^]\fP - special case \- matches only '\-', ']', '[', '!' or '^'. These
|
||||
characters have no special purpose.
|
||||
|
||||
\fB[\\[\\]\\\\]\fP - escape syntax. Matches '[', ']' or '\\'.
|
||||
|
||||
Using the rules above, a file name pattern can be constructed:
|
||||
|
||||
\&ftp://example.com/some/path/\fB[a-z[:upper:]\\\\].jpeg\fP
|
||||
.RE
|
||||
.PP
|
||||
(This was added in 7.21.0)
|
||||
.SH CALLBACK OPTIONS
|
||||
.IP CURLOPT_WRITEFUNCTION
|
||||
Function pointer that should match the following prototype: \fBsize_t
|
||||
function( void *ptr, size_t size, size_t nmemb, void *stream);\fP This
|
||||
function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP This
|
||||
function gets called by libcurl as soon as there is data received that needs
|
||||
to be saved. The size of the data pointed to by \fIptr\fP is \fIsize\fP
|
||||
multiplied with \fInmemb\fP, it will not be zero terminated. Return the number
|
||||
@@ -107,7 +157,7 @@ Set this option to NULL to get the internal default function. The internal
|
||||
default function will write the data to the FILE * given with
|
||||
\fICURLOPT_WRITEDATA\fP.
|
||||
|
||||
Set the \fIstream\fP argument with the \fICURLOPT_WRITEDATA\fP option.
|
||||
Set the \fIuserdata\fP argument with the \fICURLOPT_WRITEDATA\fP option.
|
||||
|
||||
The callback function will be passed as much data as possible in all invokes,
|
||||
but you cannot possibly make any assumptions. It may be one byte, it may be
|
||||
@@ -130,7 +180,7 @@ This option is also known with the older name \fICURLOPT_FILE\fP, the name
|
||||
\fICURLOPT_WRITEDATA\fP was introduced in 7.9.7.
|
||||
.IP CURLOPT_READFUNCTION
|
||||
Function pointer that should match the following prototype: \fBsize_t
|
||||
function( void *ptr, size_t size, size_t nmemb, void *stream);\fP This
|
||||
function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP This
|
||||
function gets called by libcurl as soon as it needs to read data in order to
|
||||
send it to the peer. The data area pointed at by the pointer \fIptr\fP may be
|
||||
filled with at most \fIsize\fP multiplied with \fInmemb\fP number of
|
||||
@@ -151,9 +201,9 @@ From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause
|
||||
reading from this connection to become paused. See \fIcurl_easy_pause(3)\fP
|
||||
for further details.
|
||||
|
||||
If you set the callback pointer to NULL, or don't set it at all, the default
|
||||
internal read function will be used. It is simply doing an fread() on the FILE
|
||||
* stream set with \fICURLOPT_READDATA\fP.
|
||||
If you set this callback pointer to NULL, or don't set it at all, the default
|
||||
internal read function will be used. It is doing an fread() on the FILE *
|
||||
userdata set with \fICURLOPT_READDATA\fP.
|
||||
.IP CURLOPT_READDATA
|
||||
Data pointer to pass to the file read function. If you use the
|
||||
\fICURLOPT_READFUNCTION\fP option, this is the pointer you'll get as input. If
|
||||
@@ -246,11 +296,11 @@ argument in the opensocket callback set with \fICURLOPT_OPENSOCKETFUNCTION\fP.
|
||||
Function pointer that should match the \fIcurl_progress_callback\fP prototype
|
||||
found in \fI<curl/curl.h>\fP. This function gets called by libcurl instead of
|
||||
its internal equivalent with a frequent interval during operation (roughly
|
||||
once per second) no matter if data is being transfered or not. Unknown/unused
|
||||
argument values passed to the callback will be set to zero (like if you only
|
||||
download data, the upload size will remain 0). Returning a non-zero value from
|
||||
this callback will cause libcurl to abort the transfer and return
|
||||
\fICURLE_ABORTED_BY_CALLBACK\fP.
|
||||
once per second or sooner) no matter if data is being transfered or not.
|
||||
Unknown/unused argument values passed to the callback will be set to zero
|
||||
(like if you only download data, the upload size will remain 0). Returning a
|
||||
non-zero value from this callback will cause libcurl to abort the transfer and
|
||||
return \fICURLE_ABORTED_BY_CALLBACK\fP.
|
||||
|
||||
If you transfer data with the multi interface, this function will not be
|
||||
called during periods of idleness unless you call the appropriate libcurl
|
||||
@@ -263,13 +313,13 @@ Pass a pointer that will be untouched by libcurl and passed as the first
|
||||
argument in the progress callback set with \fICURLOPT_PROGRESSFUNCTION\fP.
|
||||
.IP CURLOPT_HEADERFUNCTION
|
||||
Function pointer that should match the following prototype: \fIsize_t
|
||||
function( void *ptr, size_t size, size_t nmemb, void *stream);\fP. This
|
||||
function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP. This
|
||||
function gets called by libcurl as soon as it has received header data. The
|
||||
header callback will be called once for each header and only complete header
|
||||
lines are passed on to the callback. Parsing headers should be easy enough
|
||||
using this. The size of the data pointed to by \fIptr\fP is \fIsize\fP
|
||||
multiplied with \fInmemb\fP. Do not assume that the header line is zero
|
||||
terminated! The pointer named \fIstream\fP is the one you set with the
|
||||
terminated! The pointer named \fIuserdata\fP is the one you set with the
|
||||
\fICURLOPT_WRITEHEADER\fP option. The callback function must return the number
|
||||
of bytes actually taken care of. If that amount differs from the amount passed
|
||||
to your function, it'll signal an error to the library. This will abort the
|
||||
@@ -402,7 +452,7 @@ You will need to override these definitions if they are different on your
|
||||
system.
|
||||
.IP CURLOPT_INTERLEAVEFUNCTION
|
||||
Function pointer that should match the following prototype: \fIsize_t
|
||||
function( void *ptr, size_t size, size_t nmemb, void *stream)\fP. This
|
||||
function( void *ptr, size_t size, size_t nmemb, void *userdata)\fP. This
|
||||
function gets called by libcurl as soon as it has received interleaved RTP
|
||||
data. This function gets called for each $ block and therefore contains
|
||||
exactly one upper-layer protocol unit (e.g. one RTP packet). Curl writes the
|
||||
@@ -422,8 +472,52 @@ request, (e.g. \fICURL_RTSPREQ_PAUSE\fP) then the response handler will
|
||||
process any pending RTP data before marking the request as finished. (Added
|
||||
in 7.20.0)
|
||||
.IP CURLOPT_INTERLEAVEDATA
|
||||
This is the stream that will be passed to \fICURLOPT_INTERLEAVEFUNCTION\fP when
|
||||
interleaved RTP data is received. (Added in 7.20.0)
|
||||
This is the userdata pointer that will be passed to
|
||||
\fICURLOPT_INTERLEAVEFUNCTION\fP when interleaved RTP data is received. (Added
|
||||
in 7.20.0)
|
||||
.IP CURLOPT_CHUNK_BGN_FUNCTION
|
||||
Function pointer that should match the following prototype: \fBlong function
|
||||
(const void *transfer_info, void *ptr, int remains)\fP. This function gets
|
||||
called by libcurl before a part of the stream is going to be transferred (if
|
||||
the transfer supports chunks).
|
||||
|
||||
This callback makes sense only when using the \fICURLOPT_WILDCARDMATCH\fP
|
||||
option for now.
|
||||
|
||||
The target of transfer_info parameter is a "feature depended" structure. For
|
||||
the FTP wildcard download, the target is curl_fileinfo structure (see
|
||||
\fIcurl/curl.h\fP). The parameter ptr is a pointer given by
|
||||
\fICURLOPT_CHUNK_DATA\fP. The parameter remains contains number of chunks
|
||||
remaining per the transfer. If the feature is not available, the parameter has
|
||||
zero value.
|
||||
|
||||
Return \fICURL_CHUNK_BGN_FUNC_OK\fP if everything is fine,
|
||||
\fICURL_CHUNK_BGN_FUNC_SKIP\fP if you want to skip the concrete chunk or
|
||||
\fICURL_CHUNK_BGN_FUNC_FAIL\fP to tell libcurl to stop if some error occurred.
|
||||
(This was added in 7.21.0)
|
||||
.IP CURLOPT_CHUNK_END_FUNCTION
|
||||
Function pointer that should match the following prototype: \fBlong
|
||||
function(void *ptr)\fP. This function gets called by libcurl as soon as a part
|
||||
of the stream has been transferred (or skipped).
|
||||
|
||||
Return \fICURL_CHUNK_END_FUNC_OK\fP if everything is fine or
|
||||
\fBCURL_CHUNK_END_FUNC_FAIL\fP to tell the lib to stop if some error occurred.
|
||||
(This was added in 7.21.0)
|
||||
.IP CURLOPT_CHUNK_DATA
|
||||
Pass a pointer that will be untouched by libcurl and passed as the ptr
|
||||
argument to the \fICURL_CHUNK_BGN_FUNTION\fP and \fICURL_CHUNK_END_FUNTION\fP.
|
||||
(This was added in 7.21.0)
|
||||
.IP CURLOPT_FNMATCH_FUNCTION
|
||||
Function pointer that should match \fBint function(void *ptr, const char
|
||||
*pattern, const char *string)\fP prototype (see \fIcurl/curl.h\fP). It is used
|
||||
internally for the wildcard matching feature.
|
||||
|
||||
Return \fICURL_FNMATCHFUNC_MATCH\fP if pattern matches the string,
|
||||
\fICURL_FNMATCHFUNC_NOMATCH\fP if not or \fICURL_FNMATCHFUNC_FAIL\fP if an
|
||||
error occurred. (This was added in 7.21.0)
|
||||
.IP CURLOPT_FNMATCH_DATA
|
||||
Pass a pointer that will be untouched by libcurl and passed as the ptr argument
|
||||
to the \fICURL_FNMATCH_FUNCTION\fP. (This was added in 7.21.0)
|
||||
.SH ERROR OPTIONS
|
||||
.IP CURLOPT_ERRORBUFFER
|
||||
Pass a char * to a buffer that the libcurl may store human readable error
|
||||
|
@@ -112,14 +112,15 @@ timeout value to use when waiting for socket activities.
|
||||
them for activity. This can be done through your application code, or by way
|
||||
of an external library such as libevent or glib.
|
||||
|
||||
6. Wait for activity on any of libcurl's sockets, use the timeout value your
|
||||
6. Call curl_multi_socket_action() to kickstart everything. To get one or more
|
||||
callbacks called.
|
||||
|
||||
7. Wait for activity on any of libcurl's sockets, use the timeout value your
|
||||
callback has been told
|
||||
|
||||
7, When activity is detected, call curl_multi_socket_action() for the
|
||||
8, When activity is detected, call curl_multi_socket_action() for the
|
||||
socket(s) that got action. If no activity is detected and the timeout expires,
|
||||
call \fIcurl_multi_socket_action(3)\fP with \fICURL_SOCKET_TIMEOUT\fP
|
||||
|
||||
8. Go back to step 6.
|
||||
.SH AVAILABILITY
|
||||
This function was added in libcurl 7.15.4, and is deemed stable since 7.16.0.
|
||||
.SH "SEE ALSO"
|
||||
|
@@ -218,6 +218,16 @@ return code is only returned from \fIcurl_easy_recv(3)\fP and
|
||||
Failed to load CRL file (Added in 7.19.0)
|
||||
.IP "CURLE_SSL_ISSUER_ERROR (83)"
|
||||
Issuer check failed (Added in 7.19.0)
|
||||
.IP "CURLE_FTP_PRET_FAILED (84)"
|
||||
PRET command failed
|
||||
.IP "CURLE_RTSP_CSEQ_ERROR (85)"
|
||||
Mismatch of RTSP CSeq numbers.
|
||||
.IP "CURLE_RTSP_SESSION_ERROR (86)"
|
||||
Mismatch of RTSP Session Identifiers.
|
||||
.IP "CURLE_FTP_BAD_FILE_LIST (87)"
|
||||
Unable to parse FTP file list (during FTP wildcard downloading).
|
||||
.IP "CURLE_CHUNK_FAILED (88)"
|
||||
Chunk callback reported error.
|
||||
.IP "CURLE_OBSOLETE*"
|
||||
These error codes will never be returned. They were used in an old libcurl
|
||||
version and are currently unused.
|
||||
|
@@ -151,11 +151,14 @@ CURLINFO_HTTPAUTH_AVAIL 7.10.8
|
||||
CURLINFO_HTTP_CODE 7.4.1 7.10.8
|
||||
CURLINFO_HTTP_CONNECTCODE 7.10.7
|
||||
CURLINFO_LASTSOCKET 7.15.2
|
||||
CURLINFO_LOCAL_IP 7.21.0
|
||||
CURLINFO_LOCAL_PORT 7.21.0
|
||||
CURLINFO_NAMELOOKUP_TIME 7.4.1
|
||||
CURLINFO_NUM_CONNECTS 7.12.3
|
||||
CURLINFO_OS_ERRNO 7.12.2
|
||||
CURLINFO_PRETRANSFER_TIME 7.4.1
|
||||
CURLINFO_PRIMARY_IP 7.19.0
|
||||
CURLINFO_PRIMARY_PORT 7.21.0
|
||||
CURLINFO_PRIVATE 7.10.3
|
||||
CURLINFO_PRIVATE 7.10.3
|
||||
CURLINFO_PROXYAUTH_AVAIL 7.10.8
|
||||
@@ -188,6 +191,9 @@ CURLOPT_BUFFERSIZE 7.10
|
||||
CURLOPT_CAINFO 7.4.2
|
||||
CURLOPT_CAPATH 7.9.8
|
||||
CURLOPT_CERTINFO 7.19.1
|
||||
CURLOPT_CHUNK_BGN_FUNCTION 7.21.0
|
||||
CURLOPT_CHUNK_DATA 7.21.0
|
||||
CURLOPT_CHUNK_END_FUNCTION 7.21.0
|
||||
CURLOPT_CLOSEFUNCTION 7.7 7.11.1 7.15.4
|
||||
CURLOPT_CLOSEPOLICY 7.7 7.16.1
|
||||
CURLOPT_CONNECTTIMEOUT 7.7
|
||||
@@ -217,6 +223,8 @@ CURLOPT_FAILONERROR 7.1
|
||||
CURLOPT_FILE 7.1 7.9.7
|
||||
CURLOPT_FILETIME 7.5
|
||||
CURLOPT_FLAGS 7.1 - 7.9.2
|
||||
CURLOPT_FNMATCH_DATA 7.21.0
|
||||
CURLOPT_FNMATCH_FUNCTION 7.21.0
|
||||
CURLOPT_FOLLOWLOCATION 7.1
|
||||
CURLOPT_FORBID_REUSE 7.7
|
||||
CURLOPT_FRESH_CONNECT 7.7
|
||||
@@ -236,14 +244,6 @@ CURLOPT_FTP_SSL_CCC 7.16.1
|
||||
CURLOPT_FTP_USE_EPRT 7.10.5
|
||||
CURLOPT_FTP_USE_EPSV 7.9.2
|
||||
CURLOPT_FTP_USE_PRET 7.20.0
|
||||
CURLOPT_RTSP_REQUEST 7.20.0
|
||||
CURLOPT_RTSP_SESSION_ID 7.20.0
|
||||
CURLOPT_RTSP_STREAM_URI 7.20.0
|
||||
CURLOPT_RTSP_TRANSPORT 7.20.0
|
||||
CURLOPT_RTSP_CLIENT_CSEQ 7.20.0
|
||||
CURLOPT_RTSP_SERVER_CSEQ 7.20.0
|
||||
CURLOPT_INTERLEAVEDATA 7.20.0
|
||||
CURLOPT_INTERLEAVEFUNCTION 7.20.0
|
||||
CURLOPT_HEADER 7.1
|
||||
CURLOPT_HEADERDATA 7.10
|
||||
CURLOPT_HEADERFUNCTION 7.7.2
|
||||
@@ -262,6 +262,8 @@ CURLOPT_INFILE 7.1 7.9.7
|
||||
CURLOPT_INFILESIZE 7.1
|
||||
CURLOPT_INFILESIZE_LARGE 7.11.0
|
||||
CURLOPT_INTERFACE 7.3
|
||||
CURLOPT_INTERLEAVEDATA 7.20.0
|
||||
CURLOPT_INTERLEAVEFUNCTION 7.20.0
|
||||
CURLOPT_IOCTLDATA 7.12.3
|
||||
CURLOPT_IOCTLFUNCTION 7.12.3
|
||||
CURLOPT_IPRESOLVE 7.10.8
|
||||
@@ -328,6 +330,12 @@ CURLOPT_REDIR_PROTOCOLS 7.19.4
|
||||
CURLOPT_REFERER 7.1
|
||||
CURLOPT_RESUME_FROM 7.1
|
||||
CURLOPT_RESUME_FROM_LARGE 7.11.0
|
||||
CURLOPT_RTSP_CLIENT_CSEQ 7.20.0
|
||||
CURLOPT_RTSP_REQUEST 7.20.0
|
||||
CURLOPT_RTSP_SERVER_CSEQ 7.20.0
|
||||
CURLOPT_RTSP_SESSION_ID 7.20.0
|
||||
CURLOPT_RTSP_STREAM_URI 7.20.0
|
||||
CURLOPT_RTSP_TRANSPORT 7.20.0
|
||||
CURLOPT_SEEKDATA 7.18.1
|
||||
CURLOPT_SEEKFUNCTION 7.18.1
|
||||
CURLOPT_SHARE 7.10
|
||||
@@ -380,6 +388,7 @@ CURLOPT_USERNAME 7.19.1
|
||||
CURLOPT_USERPWD 7.1
|
||||
CURLOPT_USE_SSL 7.17.0
|
||||
CURLOPT_VERBOSE 7.1
|
||||
CURLOPT_WILDCARDMATCH 7.21.0
|
||||
CURLOPT_WRITEDATA 7.9.7
|
||||
CURLOPT_WRITEFUNCTION 7.1
|
||||
CURLOPT_WRITEHEADER 7.1
|
||||
@@ -396,6 +405,12 @@ CURLPROTO_LDAP 7.19.4
|
||||
CURLPROTO_LDAPS 7.19.4
|
||||
CURLPROTO_POP3 7.20.0
|
||||
CURLPROTO_POP3S 7.20.0
|
||||
CURLPROTO_RTMP 7.21.0
|
||||
CURLPROTO_RTMPE 7.21.0
|
||||
CURLPROTO_RTMPS 7.21.0
|
||||
CURLPROTO_RTMPT 7.21.0
|
||||
CURLPROTO_RTMPTE 7.21.0
|
||||
CURLPROTO_RTMPTS 7.21.0
|
||||
CURLPROTO_RTSP 7.20.0
|
||||
CURLPROTO_SCP 7.19.4
|
||||
CURLPROTO_SFTP 7.19.4
|
||||
@@ -427,6 +442,14 @@ CURLVERSION_FIRST 7.10
|
||||
CURLVERSION_NOW 7.10
|
||||
CURLVERSION_SECOND 7.11.1
|
||||
CURLVERSION_THIRD 7.12.0
|
||||
CURL_CHUNK_BGN_FUNC_FAIL 7.21.0
|
||||
CURL_CHUNK_BGN_FUNC_OK 7.21.0
|
||||
CURL_CHUNK_BGN_FUNC_SKIP 7.21.0
|
||||
CURL_CHUNK_END_FUNC_FAIL 7.21.0
|
||||
CURL_CHUNK_END_FUNC_OK 7.21.0
|
||||
CURL_FNMATCHFUNC_FAIL 7.21.0
|
||||
CURL_FNMATCHFUNC_MATCH 7.21.0
|
||||
CURL_FNMATCHFUNC_NOMATCH 7.21.0
|
||||
CURL_HTTP_VERSION_1_0 7.9.1
|
||||
CURL_HTTP_VERSION_1_1 7.9.1
|
||||
CURL_HTTP_VERSION_NONE 7.9.1
|
||||
|
2
include/curl/.gitignore
vendored
2
include/curl/.gitignore
vendored
@@ -1,3 +1,3 @@
|
||||
curlbuild.h
|
||||
stamp-h3
|
||||
|
||||
curlver.h.dist
|
||||
|
@@ -198,6 +198,97 @@ typedef size_t (*curl_write_callback)(char *buffer,
|
||||
size_t nitems,
|
||||
void *outstream);
|
||||
|
||||
|
||||
|
||||
/* enumeration of file types */
|
||||
typedef enum {
|
||||
CURLFILETYPE_FILE = 0,
|
||||
CURLFILETYPE_DIRECTORY,
|
||||
CURLFILETYPE_SYMLINK,
|
||||
CURLFILETYPE_DEVICE_BLOCK,
|
||||
CURLFILETYPE_DEVICE_CHAR,
|
||||
CURLFILETYPE_NAMEDPIPE,
|
||||
CURLFILETYPE_SOCKET,
|
||||
CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */
|
||||
|
||||
CURLFILETYPE_UNKNOWN /* should never occur */
|
||||
} curlfiletype;
|
||||
|
||||
#define CURLFINFOFLAG_KNOWN_FILENAME (1<<0)
|
||||
#define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1)
|
||||
#define CURLFINFOFLAG_KNOWN_TIME (1<<2)
|
||||
#define CURLFINFOFLAG_KNOWN_PERM (1<<3)
|
||||
#define CURLFINFOFLAG_KNOWN_UID (1<<4)
|
||||
#define CURLFINFOFLAG_KNOWN_GID (1<<5)
|
||||
#define CURLFINFOFLAG_KNOWN_SIZE (1<<6)
|
||||
#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7)
|
||||
|
||||
/* Content of this structure depends on information which is known and is
|
||||
achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man
|
||||
page for callbacks returning this structure -- some fields are mandatory,
|
||||
some others are optional. The FLAG field has special meaning. */
|
||||
struct curl_fileinfo {
|
||||
char *filename;
|
||||
curlfiletype filetype;
|
||||
time_t time;
|
||||
unsigned int perm;
|
||||
int uid;
|
||||
int gid;
|
||||
curl_off_t size;
|
||||
long int hardlinks;
|
||||
|
||||
struct {
|
||||
/* If some of these fields is not NULL, it is a pointer to b_data. */
|
||||
char *time;
|
||||
char *perm;
|
||||
char *user;
|
||||
char *group;
|
||||
char *target; /* pointer to the target filename of a symlink */
|
||||
} strings;
|
||||
|
||||
unsigned int flags;
|
||||
|
||||
/* used internally */
|
||||
char * b_data;
|
||||
size_t b_size;
|
||||
size_t b_used;
|
||||
};
|
||||
|
||||
/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */
|
||||
#define CURL_CHUNK_BGN_FUNC_OK 0
|
||||
#define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */
|
||||
#define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */
|
||||
|
||||
/* if splitting of data transfer is enabled, this callback is called before
|
||||
download of an individual chunk started. Note that parameter "remains" works
|
||||
only for FTP wildcard downloading (for now), otherwise is not used */
|
||||
typedef long (*curl_chunk_bgn_callback)(const void *transfer_info,
|
||||
void *ptr,
|
||||
int remains);
|
||||
|
||||
/* return codes for CURLOPT_CHUNK_END_FUNCTION */
|
||||
#define CURL_CHUNK_END_FUNC_OK 0
|
||||
#define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */
|
||||
|
||||
/* If splitting of data transfer is enabled this callback is called after
|
||||
download of an individual chunk finished.
|
||||
Note! After this callback was set then it have to be called FOR ALL chunks.
|
||||
Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.
|
||||
This is the reason why we don't need "transfer_info" parameter in this
|
||||
callback and we are not interested in "remains" parameter too. */
|
||||
typedef long (*curl_chunk_end_callback)(void *ptr);
|
||||
|
||||
/* return codes for FNMATCHFUNCTION */
|
||||
#define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */
|
||||
#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */
|
||||
#define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */
|
||||
|
||||
/* callback type for wildcard downloading pattern matching. If the
|
||||
string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */
|
||||
typedef int (*curl_fnmatch_callback)(void *ptr,
|
||||
const char *pattern,
|
||||
const char *string);
|
||||
|
||||
/* These are the return codes for the seek callbacks */
|
||||
#define CURL_SEEKFUNC_OK 0
|
||||
#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */
|
||||
@@ -409,6 +500,8 @@ typedef enum {
|
||||
CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */
|
||||
CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */
|
||||
CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Identifiers */
|
||||
CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */
|
||||
CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */
|
||||
|
||||
CURL_LAST /* never use! */
|
||||
} CURLcode;
|
||||
@@ -623,6 +716,12 @@ typedef enum {
|
||||
#define CURLPROTO_SMTP (1<<16)
|
||||
#define CURLPROTO_SMTPS (1<<17)
|
||||
#define CURLPROTO_RTSP (1<<18)
|
||||
#define CURLPROTO_RTMP (1<<19)
|
||||
#define CURLPROTO_RTMPT (1<<20)
|
||||
#define CURLPROTO_RTMPE (1<<21)
|
||||
#define CURLPROTO_RTMPTE (1<<22)
|
||||
#define CURLPROTO_RTMPS (1<<23)
|
||||
#define CURLPROTO_RTMPTS (1<<24)
|
||||
#define CURLPROTO_ALL (~0) /* enable everything */
|
||||
|
||||
/* long may be 32 or 64 bits, but we should never depend on anything else
|
||||
@@ -1316,6 +1415,26 @@ typedef enum {
|
||||
/* Let the application define a custom write method for RTP data */
|
||||
CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),
|
||||
|
||||
/* Turn on wildcard matching */
|
||||
CINIT(WILDCARDMATCH, LONG, 197),
|
||||
|
||||
/* Directory matching callback called before downloading of an
|
||||
individual file (chunk) started */
|
||||
CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),
|
||||
|
||||
/* Directory matching callback called after the file (chunk)
|
||||
was downloaded, or skipped */
|
||||
CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),
|
||||
|
||||
/* Change match (fnmatch-like) callback for wildcard matching */
|
||||
CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),
|
||||
|
||||
/* Let the application define custom chunk data pointer */
|
||||
CINIT(CHUNK_DATA, OBJECTPOINT, 201),
|
||||
|
||||
/* FNMATCH_FUNCTION user pointer */
|
||||
CINIT(FNMATCH_DATA, OBJECTPOINT, 202),
|
||||
|
||||
CURLOPT_LASTENTRY /* the last unused */
|
||||
} CURLoption;
|
||||
|
||||
@@ -1764,9 +1883,12 @@ typedef enum {
|
||||
CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37,
|
||||
CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38,
|
||||
CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39,
|
||||
CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,
|
||||
CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,
|
||||
CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
|
||||
/* Fill in new entries below here! */
|
||||
|
||||
CURLINFO_LASTONE = 39
|
||||
CURLINFO_LASTONE = 42
|
||||
} CURLINFO;
|
||||
|
||||
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
|
||||
|
@@ -30,12 +30,12 @@
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.20.1-DEV"
|
||||
#define LIBCURL_VERSION "7.21.1-DEV"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 20
|
||||
#define LIBCURL_VERSION_MINOR 21
|
||||
#define LIBCURL_VERSION_PATCH 1
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
@@ -53,7 +53,7 @@
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x071401
|
||||
#define LIBCURL_VERSION_NUM 0x071501
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
|
@@ -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
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -230,6 +230,12 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
|
||||
(option) == CURLOPT_CRLFILE || \
|
||||
(option) == CURLOPT_ISSUERCERT || \
|
||||
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
|
||||
(option) == CURLOPT_SSH_KNOWNHOSTS || \
|
||||
(option) == CURLOPT_MAIL_FROM || \
|
||||
(option) == CURLOPT_RTSP_SESSION_ID || \
|
||||
(option) == CURLOPT_RTSP_STREAM_URI || \
|
||||
(option) == CURLOPT_RTSP_TRANSPORT || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a curl_write_callback argument */
|
||||
@@ -256,6 +262,10 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
(option) == CURLOPT_SSL_CTX_DATA || \
|
||||
(option) == CURLOPT_SEEKDATA || \
|
||||
(option) == CURLOPT_PRIVATE || \
|
||||
(option) == CURLOPT_SSH_KEYDATA || \
|
||||
(option) == CURLOPT_INTERLEAVEDATA || \
|
||||
(option) == CURLOPT_CHUNK_DATA || \
|
||||
(option) == CURLOPT_FNMATCH_DATA || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a POST data argument (void* or char*) */
|
||||
@@ -272,6 +282,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
(option) == CURLOPT_POSTQUOTE || \
|
||||
(option) == CURLOPT_PREQUOTE || \
|
||||
(option) == CURLOPT_TELNETOPTIONS || \
|
||||
(option) == CURLOPT_MAIL_RCPT || \
|
||||
0)
|
||||
|
||||
/* groups of curl_easy_getinfo infos that take the same type of argument */
|
||||
|
5
lib/.gitignore
vendored
5
lib/.gitignore
vendored
@@ -4,3 +4,8 @@ stamp-h1
|
||||
*.orig
|
||||
*.rej
|
||||
TAGS
|
||||
Makefile.vc8.dist
|
||||
Makefile.vc9.dist
|
||||
libcurl.plist.dist
|
||||
libcurl.vcproj
|
||||
vc6libcurl.dsp
|
||||
|
@@ -3,56 +3,107 @@
|
||||
# G. Vanem <gvanem@broadpark.no>
|
||||
#
|
||||
|
||||
TARGETS = libcurl_wc.dll libcurl_wc_imp.lib libcurl_wc.lib
|
||||
!ifndef %watcom
|
||||
!error WATCOM environment variable not set!
|
||||
!else
|
||||
SYS_INCL = -I$(%watcom)\h\nt -I$(%watcom)\h
|
||||
SYS_LIBS = $(%watcom)\lib386\nt;$(%watcom)\lib386
|
||||
!endif
|
||||
|
||||
!ifdef %libname
|
||||
LIBNAME = $(%libname)
|
||||
!else
|
||||
LIBNAME = libcurl
|
||||
!endif
|
||||
TARGETS = $(LIBNAME).dll $(LIBNAME)_imp.lib $(LIBNAME).lib
|
||||
|
||||
CC = wcc386
|
||||
LD = wlink
|
||||
AR = wlib
|
||||
RC = wrc
|
||||
|
||||
CFLAGS = -3s -mf -d3 -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -bt=nt &
|
||||
-bd -d+ -dWIN32 -dCURL_CA_BUNDLE=getenv("CURL_CA_BUNDLE") &
|
||||
-dBUILDING_LIBCURL -dHAVE_SPNEGO=1 -dENABLE_IPV6 &
|
||||
-dDEBUG=1 -dDEBUGBUILD -d_WIN32_WINNT=0x0501 -dWINBERAPI=__declspec(cdecl) &
|
||||
-dWINLDAPAPI=__declspec(cdecl) -I. -I..\include
|
||||
!ifdef __LOADDLL__
|
||||
! loaddll wcc386 wccd386
|
||||
! loaddll wpp386 wppd386
|
||||
! loaddll wlib wlibd
|
||||
! if $(__VERSION__) > 1270
|
||||
! loaddll wlink wlinkd
|
||||
! else
|
||||
! loaddll wlink wlink
|
||||
! endif
|
||||
!endif
|
||||
|
||||
!if $(__VERSION__) < 1250
|
||||
RM = del /q /f >NUL 2>&1
|
||||
!else
|
||||
RM = rm -f
|
||||
!endif
|
||||
MD = mkdir
|
||||
RD = rmdir /q /s >NUL 2>&1
|
||||
CP = copy
|
||||
|
||||
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 &
|
||||
-dBUILDING_LIBCURL -dHAVE_SPNEGO=1 -I. -I..\include $(SYS_INCL)
|
||||
|
||||
!ifdef %debug
|
||||
DEBUG = -dDEBUG=1 -dDEBUGBUILD
|
||||
CFLAGS += -d3 $(DEBUG)
|
||||
!else
|
||||
CFLAGS += -d0
|
||||
!endif
|
||||
|
||||
!ifdef %use_ipv6
|
||||
CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6
|
||||
!endif
|
||||
|
||||
#
|
||||
# Change to suite.
|
||||
#
|
||||
ZLIB_ROOT = ..\..\..\zlib-1.2.3
|
||||
USE_ZLIB = 0
|
||||
USE_ARES = 0
|
||||
USE_WATT32 = 0
|
||||
!ifdef %zlib_root
|
||||
ZLIB_ROOT = $(%zlib_root)
|
||||
!else
|
||||
ZLIB_ROOT = ..\..\zlib-1.2.5
|
||||
!endif
|
||||
|
||||
!ifeq USE_ZLIB 1
|
||||
!ifdef %openssl_root
|
||||
OPENSSL_ROOT = $(%openssl_root)
|
||||
!else
|
||||
OPENSSL_ROOT = ..\..\openssl-0.9.8o
|
||||
!endif
|
||||
|
||||
!ifdef %ares_root
|
||||
ARES_ROOT = $(%ares_root)
|
||||
!else
|
||||
ARES_ROOT = ..\ares
|
||||
!endif
|
||||
|
||||
!ifdef %use_zlib
|
||||
CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I$(ZLIB_ROOT)
|
||||
!endif
|
||||
|
||||
!ifeq USE_ARES 1
|
||||
CFLAGS += -dUSE_ARES -I..\ares
|
||||
!ifdef %use_ssl
|
||||
CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_SSLEAY -I$(OPENSSL_ROOT)\inc32
|
||||
!endif
|
||||
|
||||
!ifeq USE_WATT32 1
|
||||
!ifdef %use_ares
|
||||
CFLAGS += -dUSE_ARES -I$(ARES_ROOT)
|
||||
!endif
|
||||
|
||||
!ifdef %use_watt32
|
||||
CFLAGS += -dUSE_WATT32 -I$(%watt_root)\inc
|
||||
!endif
|
||||
|
||||
OBJ_BASE = WC_Win32.obj
|
||||
C_ARG = $(OBJ_BASE)\wcc386.arg
|
||||
LINK_ARG = $(OBJ_BASE)\dyn\wlink.arg
|
||||
LIB_ARG = $(OBJ_BASE)\stat\wlib.arg
|
||||
|
||||
# Unfortunately, we can't include Makefile.inc here because wmake doesn't
|
||||
# use backslash as the line continuation character by default
|
||||
CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c &
|
||||
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c &
|
||||
ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c &
|
||||
netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c &
|
||||
krb5.c memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c &
|
||||
multi.c content_encoding.c share.c http_digest.c md5.c curl_rand.c &
|
||||
http_negotiate.c http_ntlm.c inet_pton.c strtoofft.c strerror.c &
|
||||
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c &
|
||||
inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.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 &
|
||||
curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c &
|
||||
warnless.c
|
||||
# In order to process Makefile.inc wmake must be called with -u switch!
|
||||
!ifndef %MAKEFLAGS
|
||||
!error You MUST call wmake with the -u switch!
|
||||
!else
|
||||
!include Makefile.inc
|
||||
!endif
|
||||
|
||||
OBJS = $(CSOURCES:.c=.obj)
|
||||
OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\)
|
||||
@@ -60,506 +111,82 @@ OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\)
|
||||
#
|
||||
# Use $(OBJS) as a template to generate $(OBJS_STAT) and $(OBJS_DYN).
|
||||
#
|
||||
OBJ_DIR = $(OBJ_BASE)\stat
|
||||
OBJS_STAT = $+ $(OBJS) $-
|
||||
OBJ_DIR = $(OBJ_BASE)\stat
|
||||
OBJS_STAT = $+ $(OBJS) $-
|
||||
|
||||
OBJ_DIR = $(OBJ_BASE)\dyn
|
||||
OBJS_DYN = $+ $(OBJS) $-
|
||||
OBJ_DIR = $(OBJ_BASE)\dyn
|
||||
OBJS_DYN = $+ $(OBJS) $-
|
||||
|
||||
RESOURCE = $(OBJ_BASE)\dyn\libcurl.res
|
||||
CURLBUILDH = ..\include\curl\curlbuild.h
|
||||
RESOURCE = $(OBJ_BASE)\dyn\libcurl.res
|
||||
|
||||
all: $(OBJ_BASE) $(C_ARG) $(TARGETS) .SYMBOLIC
|
||||
all: $(CURLBUILDH) $(OBJ_BASE) $(TARGETS) .SYMBOLIC
|
||||
@echo Welcome to libcurl
|
||||
|
||||
$(OBJ_BASE):
|
||||
- mkdir $(OBJ_BASE)
|
||||
- mkdir $(OBJ_BASE)\stat
|
||||
- mkdir $(OBJ_BASE)\dyn
|
||||
|
||||
libcurl_wc.dll libcurl_wc_imp.lib: $(OBJS_DYN) $(RESOURCE) $(LINK_ARG)
|
||||
wlink name libcurl_wc.dll @$(LINK_ARG)
|
||||
|
||||
libcurl_wc.lib: $(OBJS_STAT) $(LIB_ARG)
|
||||
wlib -q -b- c $@ @$(LIB_ARG)
|
||||
|
||||
clean: .SYMBOLIC
|
||||
- rm -f $(OBJS_STAT) $(OBJS_DYN) $(RESOURCE) $(C_ARG) $(LINK_ARG) $(LIB_ARG)
|
||||
-$(RM) $(OBJS_STAT)
|
||||
-$(RM) $(OBJS_DYN)
|
||||
-$(RM) $(RESOURCE) $(LINK_ARG) $(LIB_ARG)
|
||||
|
||||
vclean realclean: clean .SYMBOLIC
|
||||
- rm -f $(TARGETS) libcurl_wc.map
|
||||
- rmdir $(OBJ_BASE)\stat
|
||||
- rmdir $(OBJ_BASE)\dyn
|
||||
- rmdir $(OBJ_BASE)
|
||||
-$(RM) $(TARGETS) $(LIBNAME).map $(LIBNAME).sym
|
||||
-$(RD) $(OBJ_BASE)\stat
|
||||
-$(RD) $(OBJ_BASE)\dyn
|
||||
-$(RD) $(OBJ_BASE)
|
||||
|
||||
$(OBJ_BASE):
|
||||
-$(MD) $^@
|
||||
-$(MD) $^@\stat
|
||||
-$(MD) $^@\dyn
|
||||
|
||||
$(CURLBUILDH): .EXISTSONLY
|
||||
$(CP) $^@.dist $^@
|
||||
|
||||
$(LIBNAME).dll: $(OBJS_DYN) $(RESOURCE) $(LINK_ARG)
|
||||
$(LD) name $^@ @$]@
|
||||
|
||||
$(LIBNAME).lib: $(OBJS_STAT) $(LIB_ARG)
|
||||
$(AR) -q -b -c $^@ @$]@
|
||||
|
||||
.ERASE
|
||||
$(RESOURCE): libcurl.rc
|
||||
wrc -dDEBUGBUILD=1 -q -r -zm -I..\include -fo=$@ libcurl.rc
|
||||
$(RC) $(DEBUG) -q -r -zm -I..\include $(SYS_INCL) $[@ -fo=$^@
|
||||
|
||||
.ERASE
|
||||
.c{$(OBJ_BASE)\dyn}.obj:
|
||||
$(CC) $[@ @$(C_ARG) -fo=$@
|
||||
$(CC) $(CFLAGS) -bd -br $[@ -fo=$^@
|
||||
|
||||
.ERASE
|
||||
.c{$(OBJ_BASE)\stat}.obj:
|
||||
$(CC) $[@ @$(C_ARG) -DCURL_STATICLIB -fo=$@
|
||||
|
||||
$(C_ARG): $(__MAKEFILES__)
|
||||
%create $^@
|
||||
%append $^@ $(CFLAGS)
|
||||
$(CC) $(CFLAGS) -DCURL_STATICLIB $[@ -fo=$^@
|
||||
|
||||
$(LINK_ARG): $(__MAKEFILES__)
|
||||
%create $^@
|
||||
@%append $^@ system nt dll
|
||||
@%append $^@ file { $(OBJS_DYN) }
|
||||
@%append $^@ option quiet, map, caseexact, eliminate, implib=libcurl_wc_imp.lib,
|
||||
@%append $^@ res=$(RESOURCE) libpath $(%watcom)\lib386;$(%watcom)\lib386\nt
|
||||
@%append $^@ library clib3s.lib, wldap32.lib
|
||||
!ifeq USE_WATT32 1
|
||||
!ifdef %debug
|
||||
@%append $^@ debug all
|
||||
@%append $^@ option symfile
|
||||
!endif
|
||||
@%append $^@ option quiet, map, caseexact, eliminate, implib=$(LIBNAME)_imp.lib,
|
||||
@%append $^@ res=$(RESOURCE) libpath $(SYS_LIBS)
|
||||
@%append $^@ library wldap32.lib
|
||||
!ifdef %use_watt32
|
||||
@%append $^@ library $(%watt_root)\lib\wattcpw_imp.lib
|
||||
!else
|
||||
@%append $^@ library ws2_32.lib
|
||||
!endif
|
||||
!ifeq USE_ZLIB 1
|
||||
!ifdef %use_zlib
|
||||
@%append $^@ library $(ZLIB_ROOT)\zlib.lib
|
||||
!endif
|
||||
!ifeq USE_ARES 1
|
||||
@%append $^@ library ..\ares\cares.lib
|
||||
!ifdef %use_ssl
|
||||
@%append $^@ library $(OPENSSL_ROOT)\out32\libeay32.lib, $(OPENSSL_ROOT)\out32\ssleay32.lib
|
||||
!endif
|
||||
!ifdef %use_ares
|
||||
@%append $^@ library $(ARES_ROOT)\cares.lib
|
||||
!endif
|
||||
|
||||
$(LIB_ARG): $(__MAKEFILES__)
|
||||
%create $^@
|
||||
for %f in ($(OBJS_STAT)) do @%append $^@ +- %f
|
||||
@for %f in ($(OBJS_STAT)) do @%append $^@ +- %f
|
||||
|
||||
#
|
||||
# Dependencies based on "gcc -MM .."
|
||||
#
|
||||
$(OBJ_DIR)\file.obj: file.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h strtoofft.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
progress.h sendf.h escape.h file.h speedcheck.h getinfo.h transfer.h &
|
||||
url.h curl_memory.h parsedate.h ..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\timeval.obj: timeval.c timeval.h setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\base64.obj: base64.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\mprintf.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h urldata.h cookie.h ..\include\curl\curl.h &
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h easyif.h curl_base64.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\hostip.obj: hostip.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h inet_ntop.h ..\include\curl\mprintf.h curl_memory.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\progress.obj: progress.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
progress.h ..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\formdata.obj: formdata.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h curl_addrinfo.h splay.h easyif.h strequal.h curl_memory.h &
|
||||
curl_rand.h ..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\cookie.obj: cookie.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\mprintf.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h urldata.h cookie.h ..\include\curl\curl.h &
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h strequal.h strtok.h sendf.h curl_memory.h share.h &
|
||||
strtoofft.h rawstr.h memdebug.h curl_memrchr.h
|
||||
$(OBJ_DIR)\http.obj: http.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
transfer.h sendf.h easyif.h progress.h curl_base64.h strequal.h &
|
||||
sslgen.h http_digest.h http_ntlm.h http_negotiate.h url.h share.h &
|
||||
http.h curl_memory.h select.h parsedate.h strtoofft.h multiif.h rawstr.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\sendf.obj: sendf.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h curl_addrinfo.h splay.h sendf.h connect.h sslgen.h ssh.h &
|
||||
multiif.h ..\include\curl\mprintf.h curl_memory.h strerror.h easyif.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\ftp.obj: ftp.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h curl_addrinfo.h splay.h sendf.h easyif.h if2ip.h progress.h &
|
||||
transfer.h escape.h http.h socks.h ftp.h strtoofft.h strequal.h &
|
||||
sslgen.h connect.h strerror.h inet_ntop.h inet_pton.h select.h &
|
||||
parsedate.h sockaddr.h multiif.h url.h ..\include\curl\mprintf.h &
|
||||
curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\url.obj: url.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h netrc.h &
|
||||
sslgen.h transfer.h sendf.h progress.h strequal.h strerror.h escape.h &
|
||||
strtok.h share.h content_encoding.h http_digest.h http_negotiate.h &
|
||||
select.h multiif.h easyif.h speedcheck.h rawstr.h ftp.h dict.h telnet.h &
|
||||
tftp.h http.h file.h curl_ldap.h ssh.h url.h connect.h inet_ntop.h &
|
||||
http_ntlm.h socks.h ..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\dict.obj: dict.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
transfer.h sendf.h progress.h strequal.h dict.h rawstr.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\if2ip.obj: if2ip.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h inet_ntop.h strequal.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h if2ip.h &
|
||||
..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\speedcheck.obj: speedcheck.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h &
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h sendf.h multiif.h speedcheck.h
|
||||
$(OBJ_DIR)\ldap.obj: ldap.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\ssluse.obj: ssluse.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
url.h inet_pton.h ssluse.h connect.h strequal.h select.h sslgen.h &
|
||||
rawstr.h ..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\version.obj: version.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h curl_addrinfo.h splay.h sslgen.h ..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\getenv.obj: getenv.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\escape.obj: escape.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
curl_memory.h urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h &
|
||||
hash.h llist.h curl_addrinfo.h splay.h easyif.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\mprintf.obj: mprintf.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\mprintf.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h curl_memory.h ..\include\curl\curl.h memdebug.h
|
||||
$(OBJ_DIR)\telnet.obj: telnet.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
transfer.h sendf.h telnet.h connect.h ..\include\curl\mprintf.h &
|
||||
arpa_telnet.h curl_memory.h select.h strequal.h rawstr.h memdebug.h
|
||||
$(OBJ_DIR)\netrc.obj: netrc.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
netrc.h strequal.h strtok.h curl_memory.h rawstr.h ..\include\curl\mprintf.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\getinfo.obj: getinfo.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h curl_addrinfo.h splay.h getinfo.h curl_memory.h sslgen.h connect.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\transfer.obj: transfer.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h strtoofft.h strequal.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h rawstr.h urldata.h &
|
||||
cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h netrc.h content_encoding.h transfer.h sendf.h &
|
||||
speedcheck.h progress.h http.h url.h getinfo.h sslgen.h http_digest.h &
|
||||
http_ntlm.h http_negotiate.h share.h curl_memory.h select.h multiif.h &
|
||||
easyif.h ..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\strequal.obj: strequal.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h strequal.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h
|
||||
$(OBJ_DIR)\easy.obj: easy.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h strequal.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h &
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h transfer.h sslgen.h url.h getinfo.h share.h &
|
||||
strdup.h curl_memory.h progress.h easyif.h select.h sendf.h http_ntlm.h &
|
||||
curl_rand.h connect.h ..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\security.obj: security.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\krb4.obj: krb4.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\krb5.obj: krb5.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\memdebug.obj: memdebug.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
..\include\curl\mprintf.h urldata.h cookie.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h curl_memory.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\http_chunks.obj: http_chunks.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
urldata.h cookie.h ..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
content_encoding.h http.h curl_memory.h easyif.h ..\include\curl\mprintf.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\strtok.obj: strtok.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h strtok.h
|
||||
$(OBJ_DIR)\connect.obj: connect.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\mprintf.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h urldata.h cookie.h ..\include\curl\curl.h &
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h sendf.h if2ip.h strerror.h connect.h curl_memory.h &
|
||||
select.h url.h multiif.h sockaddr.h inet_ntop.h sslgen.h memdebug.h
|
||||
$(OBJ_DIR)\llist.obj: llist.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h llist.h curl_memory.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h memdebug.h
|
||||
$(OBJ_DIR)\hash.obj: hash.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h hash.h llist.h &
|
||||
..\include\curl\mprintf.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h curl_memory.h &
|
||||
..\include\curl\curl.h memdebug.h
|
||||
$(OBJ_DIR)\multi.obj: multi.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h curl_addrinfo.h splay.h transfer.h url.h connect.h progress.h &
|
||||
easyif.h multiif.h sendf.h http.h ..\include\curl\mprintf.h curl_memory.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\content_encoding.obj: content_encoding.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\share.obj: share.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h curl_addrinfo.h splay.h share.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\http_digest.obj: http_digest.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
urldata.h cookie.h ..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
rawstr.h curl_base64.h curl_md5.h http_digest.h strtok.h url.h curl_memory.h &
|
||||
easyif.h ..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\md5.obj: md5.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h curl_md5.h
|
||||
$(OBJ_DIR)\http_negotiate.obj: http_negotiate.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\http_ntlm.obj: http_ntlm.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
urldata.h cookie.h ..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h easyif.h &
|
||||
sendf.h rawstr.h curl_base64.h http_ntlm.h url.h curl_memory.h ssluse.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\inet_pton.obj: inet_pton.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
inet_pton.h
|
||||
$(OBJ_DIR)\strtoofft.obj: strtoofft.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
strtoofft.h
|
||||
$(OBJ_DIR)\strerror.obj: strerror.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
strerror.h urldata.h cookie.h formdata.h timeval.h http_chunks.h &
|
||||
hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\hostares.obj: hostares.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h multiif.h inet_pton.h connect.h select.h &
|
||||
..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\hostasyn.obj: hostasyn.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h ..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\hostip4.obj: hostip4.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h inet_pton.h ..\include\curl\mprintf.h curl_memory.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\hostip6.obj: hostip6.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h inet_pton.h connect.h &
|
||||
..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\hostsyn.obj: hostsyn.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h ..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\hostthre.obj: hostthre.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h multiif.h inet_pton.h &
|
||||
..\include\curl\mprintf.h inet_ntop.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\mprintf.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h inet_ntop.h
|
||||
$(OBJ_DIR)\parsedate.obj: parsedate.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h rawstr.h parsedate.h
|
||||
$(OBJ_DIR)\select.obj: select.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h curl_addrinfo.h splay.h connect.h select.h
|
||||
$(OBJ_DIR)\gtls.obj: gtls.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\sslgen.obj: sslgen.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sslgen.h &
|
||||
ssluse.h gtls.h nssg.h qssl.h sendf.h rawstr.h url.h curl_memory.h &
|
||||
progress.h memdebug.h
|
||||
$(OBJ_DIR)\tftp.obj: tftp.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
transfer.h sendf.h tftp.h progress.h connect.h strerror.h sockaddr.h &
|
||||
url.h ..\include\curl\mprintf.h curl_memory.h select.h memdebug.h
|
||||
$(OBJ_DIR)\splay.obj: splay.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h splay.h
|
||||
$(OBJ_DIR)\strdup.obj: strdup.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h strdup.h
|
||||
$(OBJ_DIR)\socks.obj: socks.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
strequal.h select.h connect.h socks.h memdebug.h
|
||||
$(OBJ_DIR)\ssh.obj: ssh.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\nss.obj: nss.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
url.h connect.h strequal.h select.h sslgen.h ..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\qssl.obj: qssl.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\nonblock.obj: nonblock.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h nonblock.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h
|
||||
$(OBJ_DIR)\rawstr.obj: rawstr.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h rawstr.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h
|
||||
$(OBJ_DIR)\curl_addrinfo.obj: curl_addrinfo.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h curl_addrinfo.h &
|
||||
..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\curl_rand.obj: curl_rand.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h curl_rand.h &
|
||||
..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\curl_memrchr.obj: curl_memrchr.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h curl_memrchr.h &
|
||||
..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\imap.obj: imap.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h imap.h &
|
||||
..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\pop3.obj: pop3.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h pop3.h &
|
||||
..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\smtp.obj: smtp.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h smtp.h &
|
||||
..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
$(OBJ_DIR)\pingpong.obj: pingpong.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h pingpong.h &
|
||||
..\include\curl\mprintf.h curl_memory.h memdebug.h
|
||||
|
@@ -44,6 +44,9 @@ CLEANFILES = $(DSP) $(VCPROJ)
|
||||
lib_LTLIBRARIES = libcurl.la
|
||||
LIBCURL_LIBS = @LIBCURL_LIBS@
|
||||
|
||||
# This might hold -Werror
|
||||
CFLAGS += @CURL_CFLAG_EXTRAS@
|
||||
|
||||
# Specify our include paths here, and do it relative to $(top_srcdir) and
|
||||
# $(top_builddir), to ensure that these paths which belong to the library
|
||||
# being currently built and tested are searched before the library which
|
||||
|
@@ -1,28 +1,38 @@
|
||||
# ./lib/Makefile.inc
|
||||
# Using the backslash as line continuation character might be problematic
|
||||
# with some make flavours, as Watcom's wmake showed us already. If we
|
||||
# ever want to change this in a portable manner then we should consider
|
||||
# this idea (posted to the libcurl list by Adam Kellas):
|
||||
# CSRC1 = file1.c file2.c file3.c
|
||||
# CSRC2 = file4.c file5.c file6.c
|
||||
# CSOURCES = $(CSRC1) $(CSRC2)
|
||||
|
||||
CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
|
||||
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \
|
||||
ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c \
|
||||
netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c \
|
||||
krb5.c memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c \
|
||||
multi.c content_encoding.c share.c http_digest.c md5.c curl_rand.c \
|
||||
curl_fnmatch.c fileinfo.c ftplistparser.c wildcard.c krb5.c \
|
||||
memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c multi.c \
|
||||
content_encoding.c share.c http_digest.c md4.c md5.c curl_rand.c \
|
||||
http_negotiate.c http_ntlm.c inet_pton.c strtoofft.c strerror.c \
|
||||
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c \
|
||||
inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.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 \
|
||||
curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c \
|
||||
warnless.c
|
||||
warnless.c hmac.c polarssl.c curl_rtmp.c openldap.c curl_gethostname.c
|
||||
|
||||
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
|
||||
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
|
||||
if2ip.h speedcheck.h urldata.h curl_ldap.h ssluse.h escape.h telnet.h \
|
||||
getinfo.h strequal.h krb4.h memdebug.h http_chunks.h curl_rand.h \
|
||||
strtok.h connect.h llist.h hash.h content_encoding.h share.h \
|
||||
curl_fnmatch.h wildcard.h fileinfo.h ftplistparser.h strtok.h \
|
||||
connect.h llist.h hash.h content_encoding.h share.h curl_md4.h \
|
||||
curl_md5.h http_digest.h http_negotiate.h http_ntlm.h inet_pton.h \
|
||||
strtoofft.h strerror.h inet_ntop.h curlx.h curl_memory.h setup.h \
|
||||
transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h gtls.h \
|
||||
tftp.h sockaddr.h splay.h strdup.h setup_once.h socks.h ssh.h nssg.h \
|
||||
curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h slist.h nonblock.h \
|
||||
curl_memrchr.h imap.h pop3.h smtp.h pingpong.h rtsp.h curl_threads.h \
|
||||
warnless.h
|
||||
warnless.h curl_hmac.h polarssl.h curl_rtmp.h curl_gethostname.h
|
||||
|
||||
|
@@ -1,13 +1,13 @@
|
||||
#########################################################################
|
||||
#
|
||||
## Makefile for building libcurl.a with MingW32 (GCC-3.2 or later)
|
||||
## and optionally OpenSSL (0.9.8), libssh2 (1.1), zlib (1.2.3)
|
||||
## and optionally OpenSSL (0.9.8), libssh2 (1.2), zlib (1.2.5)
|
||||
##
|
||||
## Usage:
|
||||
## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [IDN=1] [SSPI=1] [IPV6=1] [LDAPS=1] [DYN=1]
|
||||
##
|
||||
## Hint: you can also set environment vars to control the build, f.e.:
|
||||
## set ZLIB_PATH=c:/zlib-1.2.3
|
||||
## set ZLIB_PATH=c:/zlib-1.2.5
|
||||
## set ZLIB=1
|
||||
##
|
||||
## Comments to: Troy Engel <tengel@sonic.net> or
|
||||
@@ -16,15 +16,15 @@
|
||||
|
||||
# Edit the path below to point to the base of your Zlib sources.
|
||||
ifndef ZLIB_PATH
|
||||
ZLIB_PATH = ../../zlib-1.2.4
|
||||
ZLIB_PATH = ../../zlib-1.2.5
|
||||
endif
|
||||
# Edit the path below to point to the base of your OpenSSL package.
|
||||
ifndef OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../openssl-0.9.8n
|
||||
OPENSSL_PATH = ../../openssl-0.9.8o
|
||||
endif
|
||||
# Edit the path below to point to the base of your LibSSH2 package.
|
||||
ifndef LIBSSH2_PATH
|
||||
LIBSSH2_PATH = ../../libssh2-1.2.4
|
||||
LIBSSH2_PATH = ../../libssh2-1.2.6
|
||||
endif
|
||||
# Edit the path below to point to the base of your libidn package.
|
||||
ifndef LIBIDN_PATH
|
||||
|
@@ -14,17 +14,17 @@ endif
|
||||
|
||||
# Edit the path below to point to the base of your Zlib sources.
|
||||
ifndef ZLIB_PATH
|
||||
ZLIB_PATH = ../../zlib-1.2.4
|
||||
ZLIB_PATH = ../../zlib-1.2.5
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your OpenSSL package.
|
||||
ifndef OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../openssl-0.9.8n
|
||||
OPENSSL_PATH = ../../openssl-0.9.8o
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your LibSSH2 package.
|
||||
ifndef LIBSSH2_PATH
|
||||
LIBSSH2_PATH = ../../libssh2-1.2.4
|
||||
LIBSSH2_PATH = ../../libssh2-1.2.6
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your libidn package.
|
||||
@@ -616,6 +616,9 @@ $(CURL_INC)/curl/curlbuild.h: Makefile.netware FORCE
|
||||
@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
|
||||
@echo $(DL)** All your changes will be lost!!$(DL) >> $@
|
||||
@echo $(DL)*/$(DL) >> $@
|
||||
@echo $(DL)#ifndef NETWARE$(DL) >> $@
|
||||
@echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
|
||||
@echo $(DL)#endif$(DL) >> $@
|
||||
@echo $(DL)#ifndef __CURL_CURLBUILD_H$(DL) >> $@
|
||||
@echo $(DL)#define __CURL_CURLBUILD_H$(DL) >> $@
|
||||
ifeq ($(LIBARCH),LIBC)
|
||||
|
@@ -1,6 +1,4 @@
|
||||
# Makefile for project libcurl
|
||||
# Generated on Sun,13 Jan 2002.16:57:00 by EasyGCC (0.1.3 [beta 2] (3 Jan 2002))
|
||||
# Contact: easygcc@melotech.co.uk
|
||||
|
||||
# Project objects:
|
||||
objs = o.base64 o.connect o.cookie o.dict \
|
||||
@@ -9,13 +7,15 @@ objs = o.base64 o.connect o.cookie o.dict \
|
||||
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.curl_threads o.warnless o.hmac o.md5 o.curl_rtmp \
|
||||
o.openldap o.polarssl o.md4 o.curl_gethostname
|
||||
|
||||
|
||||
# Compile options:
|
||||
@@ -39,12 +39,18 @@ o.cookie: 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
|
||||
|
||||
@@ -78,6 +84,9 @@ o.getinfo: 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
|
||||
|
||||
@@ -111,6 +120,12 @@ o.krb4: 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
|
||||
|
||||
@@ -120,12 +135,18 @@ o.mprintf: 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
|
||||
|
||||
@@ -153,7 +174,7 @@ o.smtp: c.smtp
|
||||
o.speedcheck: c.speedcheck
|
||||
gcc $(compileropts) -c -o speedcheck.o c.speedcheck
|
||||
|
||||
o.gtls: c.gtls
|
||||
o.gtls: c.gtls
|
||||
gcc $(compileropts) -c -o gtls.o c.gtls
|
||||
|
||||
o.sslgen: c.sslgen
|
||||
@@ -186,7 +207,7 @@ o.timeval: c.timeval
|
||||
o.transfer: c.transfer
|
||||
gcc $(compileropts) -c -o transfer.o c.transfer
|
||||
|
||||
o.url: c.url
|
||||
o.url: c.url
|
||||
gcc $(compileropts) -c -o url.o c.url
|
||||
|
||||
o.version: c.version
|
||||
@@ -194,3 +215,15 @@ o.version: 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
|
||||
|
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1999 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1999 - 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
|
||||
@@ -18,7 +18,6 @@
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# $Id: Makefile.am,v 1.139 2008-11-03 08:50:58 bagder Exp $
|
||||
###########################################################################
|
||||
#
|
||||
# Makefile for building libcurl with MSVC6
|
||||
@@ -55,11 +54,11 @@ IMPLIB_NAME = libcurl_imp
|
||||
IMPLIB_NAME_DEBUG = libcurld_imp
|
||||
|
||||
!IFNDEF OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../openssl-0.9.8g
|
||||
OPENSSL_PATH = ../../openssl-0.9.8o
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF ZLIB_PATH
|
||||
ZLIB_PATH = ../../zlib-1.2.3
|
||||
ZLIB_PATH = ../../zlib-1.2.5
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF MACHINE
|
||||
@@ -101,7 +100,7 @@ LFLAGS = /nologo /machine:$(MACHINE)
|
||||
SSLLIBS = libeay32.lib ssleay32.lib
|
||||
ZLIBLIBSDLL= zdll.lib
|
||||
ZLIBLIBS = zlib.lib
|
||||
WINLIBS = wsock32.lib wldap32.lib
|
||||
WINLIBS = ws2_32.lib wldap32.lib
|
||||
CFLAGS = $(CFLAGS)
|
||||
|
||||
CFGSET = FALSE
|
||||
@@ -110,6 +109,10 @@ CFGSET = FALSE
|
||||
CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include
|
||||
!ENDIF
|
||||
|
||||
!IFDEF USE_IPV6
|
||||
CFLAGS = $(CFLAGS) /DUSE_IPV6
|
||||
!ENDIF
|
||||
|
||||
##############################################################
|
||||
# Runtime library configuration
|
||||
|
||||
@@ -450,46 +453,55 @@ X_OBJS= \
|
||||
$(DIROBJ)\content_encoding.obj \
|
||||
$(DIROBJ)\cookie.obj \
|
||||
$(DIROBJ)\curl_addrinfo.obj \
|
||||
$(DIROBJ)\curl_fnmatch.obj \
|
||||
$(DIROBJ)\curl_gethostname.obj \
|
||||
$(DIROBJ)\curl_memrchr.obj \
|
||||
$(DIROBJ)\curl_rand.obj \
|
||||
$(DIROBJ)\curl_rtmp.obj \
|
||||
$(DIROBJ)\curl_sspi.obj \
|
||||
$(DIROBJ)\curl_threads.obj \
|
||||
$(DIROBJ)\dict.obj \
|
||||
$(DIROBJ)\easy.obj \
|
||||
$(DIROBJ)\escape.obj \
|
||||
$(DIROBJ)\fileinfo.obj \
|
||||
$(DIROBJ)\file.obj \
|
||||
$(DIROBJ)\formdata.obj \
|
||||
$(DIROBJ)\ftplistparser.obj \
|
||||
$(DIROBJ)\ftp.obj \
|
||||
$(DIROBJ)\getenv.obj \
|
||||
$(DIROBJ)\getinfo.obj \
|
||||
$(DIROBJ)\gtls.obj \
|
||||
$(DIROBJ)\hash.obj \
|
||||
$(DIROBJ)\hmac.obj \
|
||||
$(DIROBJ)\hostares.obj \
|
||||
$(DIROBJ)\hostasyn.obj \
|
||||
$(DIROBJ)\hostip.obj \
|
||||
$(DIROBJ)\hostip4.obj \
|
||||
$(DIROBJ)\hostip6.obj \
|
||||
$(DIROBJ)\hostip.obj \
|
||||
$(DIROBJ)\hostsyn.obj \
|
||||
$(DIROBJ)\hostthre.obj \
|
||||
$(DIROBJ)\http.obj \
|
||||
$(DIROBJ)\http_chunks.obj \
|
||||
$(DIROBJ)\http_digest.obj \
|
||||
$(DIROBJ)\http_negotiate.obj \
|
||||
$(DIROBJ)\http_ntlm.obj \
|
||||
$(DIROBJ)\http.obj \
|
||||
$(DIROBJ)\if2ip.obj \
|
||||
$(DIROBJ)\imap.obj \
|
||||
$(DIROBJ)\inet_ntop.obj \
|
||||
$(DIROBJ)\inet_pton.obj \
|
||||
$(DIROBJ)\ldap.obj \
|
||||
$(DIROBJ)\llist.obj \
|
||||
$(DIROBJ)\md4.obj \
|
||||
$(DIROBJ)\md5.obj \
|
||||
$(DIROBJ)\memdebug.obj \
|
||||
$(DIROBJ)\mprintf.obj \
|
||||
$(DIROBJ)\multi.obj \
|
||||
$(DIROBJ)\netrc.obj \
|
||||
$(DIROBJ)\nonblock.obj \
|
||||
$(DIROBJ)\openldap.obj \
|
||||
$(DIROBJ)\parsedate.obj \
|
||||
$(DIROBJ)\pingpong.obj \
|
||||
$(DIROBJ)\polarssl.obj \
|
||||
$(DIROBJ)\pop3.obj \
|
||||
$(DIROBJ)\progress.obj \
|
||||
$(DIROBJ)\rawstr.obj \
|
||||
@@ -499,8 +511,8 @@ X_OBJS= \
|
||||
$(DIROBJ)\share.obj \
|
||||
$(DIROBJ)\slist.obj \
|
||||
$(DIROBJ)\smtp.obj \
|
||||
$(DIROBJ)\socks.obj \
|
||||
$(DIROBJ)\socks_gssapi.obj \
|
||||
$(DIROBJ)\socks.obj \
|
||||
$(DIROBJ)\socks_sspi.obj \
|
||||
$(DIROBJ)\speedcheck.obj \
|
||||
$(DIROBJ)\splay.obj \
|
||||
@@ -518,6 +530,7 @@ X_OBJS= \
|
||||
$(DIROBJ)\url.obj \
|
||||
$(DIROBJ)\version.obj \
|
||||
$(DIROBJ)\warnless.obj \
|
||||
$(DIROBJ)\wildcard.obj \
|
||||
$(RESOURCE)
|
||||
|
||||
all : $(TARGET)
|
||||
|
@@ -48,10 +48,7 @@
|
||||
/* to enable hidden symbols */
|
||||
/*#define CURL_HIDDEN_SYMBOLS 1*/
|
||||
|
||||
/* W$ LDAP with non-W$ compiler */
|
||||
/* #undef CURL_LDAP_HYBRID */
|
||||
|
||||
/* Use W$ LDAP implementation */
|
||||
/* Use Windows LDAP implementation */
|
||||
/* #undef CURL_LDAP_WIN */
|
||||
|
||||
/* when not building a shared library */
|
||||
|
@@ -59,10 +59,7 @@
|
||||
/* to enable hidden symbols */
|
||||
/* #undef CURL_HIDDEN_SYMBOLS */
|
||||
|
||||
/* W$ LDAP with non-W$ compiler */
|
||||
/* #undef CURL_LDAP_HYBRID */
|
||||
|
||||
/* Use W$ LDAP implementation */
|
||||
/* Use Windows LDAP implementation */
|
||||
/* #undef CURL_LDAP_WIN */
|
||||
|
||||
/* when not building a shared library */
|
||||
|
@@ -504,6 +504,10 @@
|
||||
# define USE_WIN32_LARGE_FILES
|
||||
#endif
|
||||
|
||||
#if defined(__WATCOMC__) && !defined(USE_WIN32_LARGE_FILES)
|
||||
# define USE_WIN32_LARGE_FILES
|
||||
#endif
|
||||
|
||||
#if defined(__POCC__)
|
||||
# undef USE_WIN32_LARGE_FILES
|
||||
#endif
|
||||
@@ -535,20 +539,24 @@
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#if defined(CURL_HAS_NOVELL_LDAPSDK) || defined(CURL_HAS_MOZILLA_LDAPSDK)
|
||||
#undef CURL_LDAP_HYBRID
|
||||
#undef CURL_LDAP_WIN
|
||||
#define HAVE_LDAP_SSL_H 1
|
||||
#define HAVE_LDAP_URL_PARSE 1
|
||||
#elif defined(CURL_HAS_OPENLDAP_LDAPSDK)
|
||||
#undef CURL_LDAP_HYBRID
|
||||
#undef CURL_LDAP_WIN
|
||||
#define HAVE_LDAP_URL_PARSE 1
|
||||
#else
|
||||
#undef CURL_LDAP_HYBRID
|
||||
#undef HAVE_LDAP_URL_PARSE
|
||||
#define CURL_LDAP_WIN 1
|
||||
#endif
|
||||
|
||||
#if defined(__WATCOMC__) && defined(CURL_LDAP_WIN)
|
||||
#if __WATCOMC__ < 1280
|
||||
#define WINBERAPI __declspec(cdecl)
|
||||
#define WINLDAPAPI __declspec(cdecl)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__POCC__) && defined(CURL_LDAP_WIN)
|
||||
# define CURL_DISABLE_LDAP 1
|
||||
#endif
|
||||
@@ -572,7 +580,7 @@
|
||||
/* Name of package */
|
||||
#define PACKAGE "curl"
|
||||
|
||||
#if defined(__POCC__)
|
||||
#if defined(__POCC__) || (USE_IPV6)
|
||||
# define ENABLE_IPV6 1
|
||||
#endif
|
||||
|
||||
|
@@ -379,7 +379,6 @@
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#define CURL_LDAP_WIN 1
|
||||
#undef CURL_LDAP_HYBRID
|
||||
#undef HAVE_LDAP_URL_PARSE
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
179
lib/connect.c
179
lib/connect.c
@@ -112,10 +112,11 @@ struct Curl_sockaddr_ex {
|
||||
|
||||
static bool verifyconnect(curl_socket_t sockfd, int *error);
|
||||
|
||||
static curl_socket_t
|
||||
static CURLcode
|
||||
singleipconnect(struct connectdata *conn,
|
||||
const Curl_addrinfo *ai, /* start connecting to this */
|
||||
long timeout_ms,
|
||||
curl_socket_t *sock,
|
||||
bool *connected);
|
||||
|
||||
/*
|
||||
@@ -180,16 +181,13 @@ long Curl_timeleft(struct connectdata *conn,
|
||||
/*
|
||||
* waitconnect() waits for a TCP connect on the given socket for the specified
|
||||
* number if milliseconds. It returns:
|
||||
* 0 fine connect
|
||||
* -1 select() error
|
||||
* 1 select() timeout
|
||||
* 2 select() returned with an error condition fd_set
|
||||
*/
|
||||
|
||||
#define WAITCONN_CONNECTED 0
|
||||
#define WAITCONN_SELECT_ERROR -1
|
||||
#define WAITCONN_TIMEOUT 1
|
||||
#define WAITCONN_FDSET_ERROR 2
|
||||
#define WAITCONN_ABORTED 3
|
||||
|
||||
static
|
||||
int waitconnect(struct connectdata *conn,
|
||||
@@ -209,9 +207,8 @@ int waitconnect(struct connectdata *conn,
|
||||
/* now select() until we get connect or timeout */
|
||||
rc = Curl_socket_ready(CURL_SOCKET_BAD, sockfd, (int)(timeout_msec>1000?
|
||||
1000:timeout_msec));
|
||||
|
||||
if(Curl_pgrsUpdate(conn))
|
||||
return CURLE_ABORTED_BY_CALLBACK;
|
||||
return WAITCONN_ABORTED;
|
||||
|
||||
if(-1 == rc)
|
||||
/* error, no connect here, try next */
|
||||
@@ -492,37 +489,130 @@ static bool verifyconnect(curl_socket_t sockfd, int *error)
|
||||
|
||||
/* Used within the multi interface. Try next IP address, return TRUE if no
|
||||
more address exists or error */
|
||||
static bool trynextip(struct connectdata *conn,
|
||||
int sockindex,
|
||||
bool *connected)
|
||||
static CURLcode trynextip(struct connectdata *conn,
|
||||
int sockindex,
|
||||
bool *connected)
|
||||
{
|
||||
curl_socket_t sockfd;
|
||||
Curl_addrinfo *ai;
|
||||
|
||||
/* first close the failed socket */
|
||||
sclose(conn->sock[sockindex]);
|
||||
/* First clean up after the failed socket.
|
||||
Don't close it yet to ensure that the next IP's socket gets a different
|
||||
file descriptor, which can prevent bugs when the curl_multi_socket_action
|
||||
interface is used with certain select() replacements such as kqueue. */
|
||||
curl_socket_t fd_to_close = conn->sock[sockindex];
|
||||
conn->sock[sockindex] = CURL_SOCKET_BAD;
|
||||
*connected = FALSE;
|
||||
|
||||
if(sockindex != FIRSTSOCKET)
|
||||
return TRUE; /* no next */
|
||||
if(sockindex != FIRSTSOCKET) {
|
||||
sclose(fd_to_close);
|
||||
return CURLE_COULDNT_CONNECT; /* no next */
|
||||
}
|
||||
|
||||
/* try the next address */
|
||||
ai = conn->ip_addr->ai_next;
|
||||
|
||||
while(ai) {
|
||||
sockfd = singleipconnect(conn, ai, 0L, connected);
|
||||
CURLcode res = singleipconnect(conn, ai, 0L, &sockfd, connected);
|
||||
if(res)
|
||||
return res;
|
||||
if(sockfd != CURL_SOCKET_BAD) {
|
||||
/* store the new socket descriptor */
|
||||
conn->sock[sockindex] = sockfd;
|
||||
conn->ip_addr = ai;
|
||||
return FALSE;
|
||||
sclose(fd_to_close);
|
||||
return CURLE_OK;
|
||||
}
|
||||
ai = ai->ai_next;
|
||||
}
|
||||
sclose(fd_to_close);
|
||||
return CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
|
||||
/* retrieves ip address and port from a sockaddr structure */
|
||||
static bool getaddressinfo(struct sockaddr* sa, char* addr,
|
||||
long* port)
|
||||
{
|
||||
unsigned short us_port;
|
||||
struct sockaddr_in* si = NULL;
|
||||
#ifdef ENABLE_IPV6
|
||||
struct sockaddr_in6* si6 = NULL;
|
||||
#endif
|
||||
|
||||
switch (sa->sa_family) {
|
||||
case AF_INET:
|
||||
si = (struct sockaddr_in*) sa;
|
||||
if(Curl_inet_ntop(sa->sa_family, &si->sin_addr,
|
||||
addr, MAX_IPADR_LEN) == NULL)
|
||||
return FALSE;
|
||||
us_port = ntohs(si->sin_port);
|
||||
*port = us_port;
|
||||
break;
|
||||
#ifdef ENABLE_IPV6
|
||||
case AF_INET6:
|
||||
si6 = (struct sockaddr_in6*)sa;
|
||||
if(Curl_inet_ntop(sa->sa_family, &si6->sin6_addr,
|
||||
addr, MAX_IPADR_LEN) == NULL)
|
||||
return FALSE;
|
||||
us_port = ntohs(si6->sin6_port);
|
||||
*port = us_port;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
addr[0] = '\0';
|
||||
*port = 0;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* retrieves the start/end point information of a socket of an established
|
||||
connection */
|
||||
void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
|
||||
{
|
||||
int error;
|
||||
curl_socklen_t len;
|
||||
struct Curl_sockaddr_storage ssrem;
|
||||
struct Curl_sockaddr_storage ssloc;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct PureInfo *info = &conn->data->info;
|
||||
|
||||
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,
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_is_connected() is used from the multi interface to check if the
|
||||
* firstsocket has connected.
|
||||
@@ -575,16 +665,19 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
/* we are connected, awesome! */
|
||||
conn->bits.tcpconnect = TRUE;
|
||||
*connected = TRUE;
|
||||
Curl_pgrsTime(data, TIMER_CONNECT); /* connect done */
|
||||
Curl_verboseconnect(conn);
|
||||
Curl_updateconninfo(conn, sockfd);
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
/* nope, not connected for real */
|
||||
data->state.os_errno = error;
|
||||
infof(data, "Connection failed\n");
|
||||
if(trynextip(conn, sockindex, connected)) {
|
||||
code = trynextip(conn, sockindex, connected);
|
||||
if(code)
|
||||
failf(data, "Failed connect to %s:%ld; %s",
|
||||
conn->host.name, conn->port, Curl_strerror(conn, error));
|
||||
code = CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
}
|
||||
else if(WAITCONN_TIMEOUT != rc) {
|
||||
int error = 0;
|
||||
@@ -598,12 +691,13 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
else
|
||||
infof(data, "Connection failed\n");
|
||||
|
||||
if(trynextip(conn, sockindex, connected)) {
|
||||
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));
|
||||
code = CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
}
|
||||
/*
|
||||
@@ -691,12 +785,20 @@ void Curl_sndbufset(curl_socket_t sockfd)
|
||||
#endif
|
||||
|
||||
|
||||
/* singleipconnect() connects to the given IP only, and it may return without
|
||||
having connected if used from the multi interface. */
|
||||
static curl_socket_t
|
||||
/*
|
||||
* singleipconnect()
|
||||
*
|
||||
* Note that even on connect fail it returns CURLE_OK, but with 'sock' set to
|
||||
* CURL_SOCKET_BAD. Other errors will however return proper errors.
|
||||
*
|
||||
* singleipconnect() connects to the given IP only, and it may return without
|
||||
* having connected if used from the multi interface.
|
||||
*/
|
||||
static CURLcode
|
||||
singleipconnect(struct connectdata *conn,
|
||||
const Curl_addrinfo *ai,
|
||||
long timeout_ms,
|
||||
curl_socket_t *sockp,
|
||||
bool *connected)
|
||||
{
|
||||
struct Curl_sockaddr_ex addr;
|
||||
@@ -706,13 +808,15 @@ singleipconnect(struct connectdata *conn,
|
||||
bool isconnected;
|
||||
struct SessionHandle *data = conn->data;
|
||||
curl_socket_t sockfd;
|
||||
CURLcode res;
|
||||
CURLcode res = CURLE_OK;
|
||||
const void *iptoprint;
|
||||
struct sockaddr_in * const sa4 = (void *)&addr.sa_addr;
|
||||
#ifdef ENABLE_IPV6
|
||||
struct sockaddr_in6 * const sa6 = (void *)&addr.sa_addr;
|
||||
#endif
|
||||
|
||||
*sockp = CURL_SOCKET_BAD;
|
||||
|
||||
/*
|
||||
* The Curl_sockaddr_ex structure is basically libcurl's external API
|
||||
* curl_sockaddr structure with enough space available to directly hold
|
||||
@@ -751,7 +855,7 @@ singleipconnect(struct connectdata *conn,
|
||||
|
||||
if(sockfd == CURL_SOCKET_BAD)
|
||||
/* no socket, no connection */
|
||||
return CURL_SOCKET_BAD;
|
||||
return CURLE_OK;
|
||||
|
||||
#if defined(ENABLE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
|
||||
if (conn->scope && (addr.family == AF_INET6))
|
||||
@@ -804,7 +908,7 @@ singleipconnect(struct connectdata *conn,
|
||||
CURLSOCKTYPE_IPCXN);
|
||||
if(error) {
|
||||
sclose(sockfd); /* close the socket and bail out */
|
||||
return CURL_SOCKET_BAD;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -812,7 +916,7 @@ singleipconnect(struct connectdata *conn,
|
||||
res = bindlocal(conn, sockfd, addr.family);
|
||||
if(res) {
|
||||
sclose(sockfd); /* close socket and bail out */
|
||||
return CURL_SOCKET_BAD;
|
||||
return res;
|
||||
}
|
||||
|
||||
/* set socket non-blocking */
|
||||
@@ -840,6 +944,10 @@ singleipconnect(struct connectdata *conn,
|
||||
#endif
|
||||
#endif
|
||||
rc = waitconnect(conn, sockfd, timeout_ms);
|
||||
if(WAITCONN_ABORTED == rc) {
|
||||
sclose(sockfd);
|
||||
return CURLE_ABORTED_BY_CALLBACK;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* unknown error, fallthrough and try another address! */
|
||||
@@ -855,7 +963,8 @@ singleipconnect(struct connectdata *conn,
|
||||
if((WAITCONN_TIMEOUT == rc) &&
|
||||
(data->state.used_interface == Curl_if_multi)) {
|
||||
/* Timeout when running the multi interface */
|
||||
return sockfd;
|
||||
*sockp = sockfd;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
isconnected = verifyconnect(sockfd, &error);
|
||||
@@ -864,7 +973,9 @@ singleipconnect(struct connectdata *conn,
|
||||
/* we are connected, awesome! */
|
||||
*connected = TRUE; /* this is a true connect */
|
||||
infof(data, "connected\n");
|
||||
return sockfd;
|
||||
Curl_updateconninfo(conn, sockfd);
|
||||
*sockp = sockfd;
|
||||
return CURLE_OK;
|
||||
}
|
||||
else if(WAITCONN_TIMEOUT == rc)
|
||||
infof(data, "Timeout\n");
|
||||
@@ -876,7 +987,7 @@ singleipconnect(struct connectdata *conn,
|
||||
/* connect failed or timed out */
|
||||
sclose(sockfd);
|
||||
|
||||
return CURL_SOCKET_BAD;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -941,7 +1052,11 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
curr_addr = curr_addr->ai_next, aliasindex++) {
|
||||
|
||||
/* start connecting to the IP curr_addr points to */
|
||||
sockfd = singleipconnect(conn, curr_addr, timeout_per_addr, connected);
|
||||
CURLcode res =
|
||||
singleipconnect(conn, curr_addr, timeout_per_addr, &sockfd, connected);
|
||||
|
||||
if(res)
|
||||
return res;
|
||||
|
||||
if(sockfd != CURL_SOCKET_BAD)
|
||||
break;
|
||||
|
@@ -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
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -68,4 +68,6 @@ void Curl_sndbufset(curl_socket_t sockfd);
|
||||
#define Curl_sndbufset(y)
|
||||
#endif
|
||||
|
||||
void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd);
|
||||
|
||||
#endif
|
||||
|
@@ -103,7 +103,7 @@ inflate_stream(struct connectdata *conn,
|
||||
status = inflate(z, Z_SYNC_FLUSH);
|
||||
if(status == Z_OK || status == Z_STREAM_END) {
|
||||
allow_restart = 0;
|
||||
if(DSIZ - z->avail_out) {
|
||||
if((DSIZ - z->avail_out) && (!k->ignorebody)) {
|
||||
result = Curl_client_write(conn, CLIENTWRITE_BODY, decomp,
|
||||
DSIZ - z->avail_out);
|
||||
/* if !CURLE_OK, clean up, return */
|
||||
@@ -247,7 +247,6 @@ static enum {
|
||||
|
||||
/* Skip over the NUL */
|
||||
--len;
|
||||
++data;
|
||||
}
|
||||
|
||||
if(flags & HEAD_CRC) {
|
||||
@@ -255,7 +254,6 @@ static enum {
|
||||
return GZIP_UNDERFLOW;
|
||||
|
||||
len -= 2;
|
||||
data += 2;
|
||||
}
|
||||
|
||||
*headerlen = totallen - len;
|
||||
|
@@ -151,7 +151,10 @@ Curl_getaddrinfo_ex(const char *nodename,
|
||||
ca->ai_next = NULL;
|
||||
|
||||
if((ai->ai_addrlen > 0) && (ai->ai_addr != NULL)) {
|
||||
ca->ai_addrlen = ai->ai_addrlen;
|
||||
/* typecast below avoid warning on at least win64:
|
||||
conversion from 'size_t' to 'curl_socklen_t', possible loss of data
|
||||
*/
|
||||
ca->ai_addrlen = (curl_socklen_t)ai->ai_addrlen;
|
||||
if((ca->ai_addr = malloc(ca->ai_addrlen)) == NULL) {
|
||||
error = EAI_MEMORY;
|
||||
free(ca);
|
||||
|
@@ -58,10 +58,7 @@
|
||||
/* to enable hidden symbols */
|
||||
#cmakedefine CURL_HIDDEN_SYMBOLS ${CURL_HIDDEN_SYMBOLS}
|
||||
|
||||
/* W$ LDAP with non-W$ compiler */
|
||||
#cmakedefine CURL_LDAP_HYBRID ${CURL_LDAP_HYBRID}
|
||||
|
||||
/* Use W$ LDAP implementation */
|
||||
/* Use Windows LDAP implementation */
|
||||
#cmakedefine CURL_LDAP_WIN ${CURL_LDAP_WIN}
|
||||
|
||||
/* when not building a shared library */
|
||||
@@ -889,6 +886,9 @@
|
||||
/* if GnuTLS is enabled */
|
||||
#cmakedefine USE_GNUTLS ${USE_GNUTLS}
|
||||
|
||||
/* if PolarSSL is enabled */
|
||||
#cmakedefine USE_POLARSSL ${USE_POLARSSL}
|
||||
|
||||
/* if libSSH2 is in use */
|
||||
#cmakedefine USE_LIBSSH2 ${USE_LIBSSH2}
|
||||
|
||||
|
424
lib/curl_fnmatch.c
Normal file
424
lib/curl_fnmatch.c
Normal file
@@ -0,0 +1,424 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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"
|
||||
|
||||
#include "curl_fnmatch.h"
|
||||
|
||||
#define _MPRINTF_REPLACE /* use our functions only */
|
||||
#include <curl/mprintf.h>
|
||||
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
#define CURLFNM_CHARSET_LEN (sizeof(char) * 256)
|
||||
#define CURLFNM_CHSET_SIZE (CURLFNM_CHARSET_LEN + 15)
|
||||
|
||||
#define CURLFNM_NEGATE CURLFNM_CHARSET_LEN
|
||||
|
||||
#define CURLFNM_ALNUM (CURLFNM_CHARSET_LEN + 1)
|
||||
#define CURLFNM_DIGIT (CURLFNM_CHARSET_LEN + 2)
|
||||
#define CURLFNM_XDIGIT (CURLFNM_CHARSET_LEN + 3)
|
||||
#define CURLFNM_ALPHA (CURLFNM_CHARSET_LEN + 4)
|
||||
#define CURLFNM_PRINT (CURLFNM_CHARSET_LEN + 5)
|
||||
#define CURLFNM_BLANK (CURLFNM_CHARSET_LEN + 6)
|
||||
#define CURLFNM_LOWER (CURLFNM_CHARSET_LEN + 7)
|
||||
#define CURLFNM_GRAPH (CURLFNM_CHARSET_LEN + 8)
|
||||
#define CURLFNM_SPACE (CURLFNM_CHARSET_LEN + 9)
|
||||
#define CURLFNM_UPPER (CURLFNM_CHARSET_LEN + 10)
|
||||
|
||||
typedef enum {
|
||||
CURLFNM_LOOP_DEFAULT = 0,
|
||||
CURLFNM_LOOP_BACKSLASH
|
||||
} loop_state;
|
||||
|
||||
typedef enum {
|
||||
CURLFNM_SCHS_DEFAULT = 0,
|
||||
CURLFNM_SCHS_MAYRANGE,
|
||||
CURLFNM_SCHS_MAYRANGE2,
|
||||
CURLFNM_SCHS_RIGHTBR,
|
||||
CURLFNM_SCHS_RIGHTBRLEFTBR
|
||||
} setcharset_state;
|
||||
|
||||
typedef enum {
|
||||
CURLFNM_PKW_INIT = 0,
|
||||
CURLFNM_PKW_DDOT
|
||||
} parsekey_state;
|
||||
|
||||
#define SETCHARSET_OK 1
|
||||
#define SETCHARSET_FAIL 0
|
||||
|
||||
static int parsekeyword(unsigned char **pattern, unsigned char *charset)
|
||||
{
|
||||
parsekey_state state = CURLFNM_PKW_INIT;
|
||||
#define KEYLEN 10
|
||||
char keyword[KEYLEN] = { 0 };
|
||||
int found = FALSE;
|
||||
int i;
|
||||
unsigned char *p = *pattern;
|
||||
for(i = 0; !found; i++) {
|
||||
char c = *p++;
|
||||
if(i >= KEYLEN)
|
||||
return SETCHARSET_FAIL;
|
||||
switch(state) {
|
||||
case CURLFNM_PKW_INIT:
|
||||
if(ISALPHA(c) && ISLOWER(c))
|
||||
keyword[i] = c;
|
||||
else if(c == ':')
|
||||
state = CURLFNM_PKW_DDOT;
|
||||
else
|
||||
return 0;
|
||||
break;
|
||||
case CURLFNM_PKW_DDOT:
|
||||
if(c == ']')
|
||||
found = TRUE;
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
}
|
||||
#undef KEYLEN
|
||||
|
||||
*pattern = p; /* move caller's pattern pointer */
|
||||
if(strcmp(keyword, "digit") == 0)
|
||||
charset[CURLFNM_DIGIT] = 1;
|
||||
else if(strcmp(keyword, "alnum") == 0)
|
||||
charset[CURLFNM_ALNUM] = 1;
|
||||
else if(strcmp(keyword, "alpha") == 0)
|
||||
charset[CURLFNM_ALPHA] = 1;
|
||||
else if(strcmp(keyword, "xdigit") == 0)
|
||||
charset[CURLFNM_XDIGIT] = 1;
|
||||
else if(strcmp(keyword, "print") == 0)
|
||||
charset[CURLFNM_PRINT] = 1;
|
||||
else if(strcmp(keyword, "graph") == 0)
|
||||
charset[CURLFNM_GRAPH] = 1;
|
||||
else if(strcmp(keyword, "space") == 0)
|
||||
charset[CURLFNM_SPACE] = 1;
|
||||
else if(strcmp(keyword, "blank") == 0)
|
||||
charset[CURLFNM_BLANK] = 1;
|
||||
else if(strcmp(keyword, "upper") == 0)
|
||||
charset[CURLFNM_UPPER] = 1;
|
||||
else if(strcmp(keyword, "lower") == 0)
|
||||
charset[CURLFNM_LOWER] = 1;
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
return SETCHARSET_OK;
|
||||
}
|
||||
|
||||
/* returns 1 (true) if pattern is OK, 0 if is bad ("p" is pattern pointer) */
|
||||
static int setcharset(unsigned char **p, unsigned char *charset)
|
||||
{
|
||||
setcharset_state state = CURLFNM_SCHS_DEFAULT;
|
||||
unsigned char rangestart = 0;
|
||||
unsigned char lastchar = 0;
|
||||
bool something_found = FALSE;
|
||||
unsigned char c;
|
||||
for(;;) {
|
||||
c = **p;
|
||||
switch(state) {
|
||||
case CURLFNM_SCHS_DEFAULT:
|
||||
if(ISALNUM(c)) { /* ASCII value */
|
||||
rangestart = c;
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
state = CURLFNM_SCHS_MAYRANGE;
|
||||
something_found = TRUE;
|
||||
}
|
||||
else if(c == ']') {
|
||||
if(something_found)
|
||||
return SETCHARSET_OK;
|
||||
else
|
||||
something_found = TRUE;
|
||||
state = CURLFNM_SCHS_RIGHTBR;
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else if(c == '[') {
|
||||
char c2 = *((*p)+1);
|
||||
if(c2 == ':') { /* there has to be a keyword */
|
||||
(*p) += 2;
|
||||
if(parsekeyword(p, charset)) {
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
else {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
something_found = TRUE;
|
||||
}
|
||||
else if(c == '?' || c == '*') {
|
||||
something_found = TRUE;
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else if(c == '^' || c == '!') {
|
||||
if(!something_found) {
|
||||
if(charset[CURLFNM_NEGATE]) {
|
||||
charset[c] = 1;
|
||||
something_found = TRUE;
|
||||
}
|
||||
else
|
||||
charset[CURLFNM_NEGATE] = 1; /* negate charset */
|
||||
}
|
||||
else
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else if(c == '\\') {
|
||||
c = *(++(*p));
|
||||
if(ISPRINT((c))) {
|
||||
something_found = TRUE;
|
||||
state = CURLFNM_SCHS_MAYRANGE;
|
||||
charset[c] = 1;
|
||||
rangestart = c;
|
||||
(*p)++;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
else if(c == '\0') {
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
else {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
something_found = TRUE;
|
||||
}
|
||||
break;
|
||||
case CURLFNM_SCHS_MAYRANGE:
|
||||
if(c == '-') {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
lastchar = '-';
|
||||
state = CURLFNM_SCHS_MAYRANGE2;
|
||||
}
|
||||
else if(c == '[') {
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
}
|
||||
else if(ISALNUM(c)) {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else if(c == '\\') {
|
||||
c = *(++(*p));
|
||||
if(ISPRINT(c)) {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
else if(c == ']') {
|
||||
return SETCHARSET_OK;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
break;
|
||||
case CURLFNM_SCHS_MAYRANGE2:
|
||||
if(c == '\\') {
|
||||
c = *(++(*p));
|
||||
if(!ISPRINT(c))
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
if(c == ']') {
|
||||
return SETCHARSET_OK;
|
||||
}
|
||||
else if(c == '\\') {
|
||||
c = *(++(*p));
|
||||
if(ISPRINT(c)) {
|
||||
charset[c] = 1;
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
(*p)++;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
if(c >= rangestart) {
|
||||
if((ISLOWER(c) && ISLOWER(rangestart)) ||
|
||||
(ISDIGIT(c) && ISDIGIT(rangestart)) ||
|
||||
(ISUPPER(c) && ISUPPER(rangestart))) {
|
||||
charset[lastchar] = 0;
|
||||
rangestart++;
|
||||
while(rangestart++ <= c)
|
||||
charset[rangestart-1] = 1;
|
||||
(*p)++;
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
}
|
||||
else
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
break;
|
||||
case CURLFNM_SCHS_RIGHTBR:
|
||||
if(c == '[') {
|
||||
state = CURLFNM_SCHS_RIGHTBRLEFTBR;
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
else if(c == ']') {
|
||||
return SETCHARSET_OK;
|
||||
}
|
||||
else if(c == '\0') {
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
else if(ISPRINT(c)) {
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
}
|
||||
else
|
||||
/* used 'goto fail' instead of 'return SETCHARSET_FAIL' to avoid a
|
||||
* nonsense warning 'statement not reached' at end of the fnc when
|
||||
* compiling on Solaris */
|
||||
goto fail;
|
||||
break;
|
||||
case CURLFNM_SCHS_RIGHTBRLEFTBR:
|
||||
if(c == ']') {
|
||||
return SETCHARSET_OK;
|
||||
}
|
||||
else {
|
||||
state = CURLFNM_SCHS_DEFAULT;
|
||||
charset[c] = 1;
|
||||
(*p)++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
fail:
|
||||
return SETCHARSET_FAIL;
|
||||
}
|
||||
|
||||
static int loop(const unsigned char *pattern, const unsigned char *string)
|
||||
{
|
||||
loop_state state = CURLFNM_LOOP_DEFAULT;
|
||||
unsigned char *p = (unsigned char *)pattern;
|
||||
unsigned char *s = (unsigned char *)string;
|
||||
unsigned char charset[CURLFNM_CHSET_SIZE] = { 0 };
|
||||
int rc = 0;
|
||||
|
||||
for (;;) {
|
||||
switch(state) {
|
||||
case CURLFNM_LOOP_DEFAULT:
|
||||
if(*p == '*') {
|
||||
while(*(p+1) == '*') /* eliminate multiple stars */
|
||||
p++;
|
||||
if(*s == '\0' && *(p+1) == '\0')
|
||||
return CURL_FNMATCH_MATCH;
|
||||
rc = loop(p + 1, s); /* *.txt matches .txt <=> .txt matches .txt */
|
||||
if(rc == CURL_FNMATCH_MATCH)
|
||||
return CURL_FNMATCH_MATCH;
|
||||
if(*s) /* let the star eat up one character */
|
||||
s++;
|
||||
else
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
}
|
||||
else if(*p == '?') {
|
||||
if(ISPRINT(*s)) {
|
||||
s++;
|
||||
p++;
|
||||
}
|
||||
else if(*s == '\0')
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
else
|
||||
return CURL_FNMATCH_FAIL; /* cannot deal with other character */
|
||||
}
|
||||
else if(*p == '\0') {
|
||||
if(*s == '\0')
|
||||
return CURL_FNMATCH_MATCH;
|
||||
else
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
}
|
||||
else if(*p == '\\') {
|
||||
state = CURLFNM_LOOP_BACKSLASH;
|
||||
p++;
|
||||
}
|
||||
else if(*p == '[') {
|
||||
unsigned char *pp = p+1; /* cannot handle with pointer to register */
|
||||
if(setcharset(&pp, charset)) {
|
||||
int found = FALSE;
|
||||
if(charset[(unsigned int)*s])
|
||||
found = TRUE;
|
||||
else if(charset[CURLFNM_ALNUM])
|
||||
found = ISALNUM(*s);
|
||||
else if(charset[CURLFNM_ALPHA])
|
||||
found = ISALPHA(*s);
|
||||
else if(charset[CURLFNM_DIGIT])
|
||||
found = ISDIGIT(*s);
|
||||
else if(charset[CURLFNM_XDIGIT])
|
||||
found = ISXDIGIT(*s);
|
||||
else if(charset[CURLFNM_PRINT])
|
||||
found = ISPRINT(*s);
|
||||
else if(charset[CURLFNM_SPACE])
|
||||
found = ISSPACE(*s);
|
||||
else if(charset[CURLFNM_UPPER])
|
||||
found = ISUPPER(*s);
|
||||
else if(charset[CURLFNM_LOWER])
|
||||
found = ISLOWER(*s);
|
||||
else if(charset[CURLFNM_BLANK])
|
||||
found = ISBLANK(*s);
|
||||
else if(charset[CURLFNM_GRAPH])
|
||||
found = ISGRAPH(*s);
|
||||
|
||||
if(charset[CURLFNM_NEGATE])
|
||||
found = !found;
|
||||
|
||||
if(found) {
|
||||
p = pp+1;
|
||||
s++;
|
||||
memset(charset, 0, CURLFNM_CHSET_SIZE);
|
||||
}
|
||||
else
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
}
|
||||
else
|
||||
return CURL_FNMATCH_FAIL;
|
||||
}
|
||||
else {
|
||||
if(*p++ != *s++)
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
}
|
||||
break;
|
||||
case CURLFNM_LOOP_BACKSLASH:
|
||||
if(ISPRINT(*p)) {
|
||||
if(*p++ == *s++)
|
||||
state = CURLFNM_LOOP_DEFAULT;
|
||||
else
|
||||
return CURL_FNMATCH_NOMATCH;
|
||||
}
|
||||
else
|
||||
return CURL_FNMATCH_FAIL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int Curl_fnmatch(void *ptr, const char *pattern, const char *string)
|
||||
{
|
||||
(void)ptr; /* the argument is specified by the curl_fnmatch_callback
|
||||
prototype, but not used by Curl_fnmatch() */
|
||||
if(!pattern || !string) {
|
||||
return CURL_FNMATCH_FAIL;
|
||||
}
|
||||
return loop((unsigned char *)pattern, (unsigned char *)string);
|
||||
}
|
44
lib/curl_fnmatch.h
Normal file
44
lib/curl_fnmatch.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef HEADER_CURL_FNMATCH_H
|
||||
#define HEADER_CURL_FNMATCH_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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#define CURL_FNMATCH_MATCH 0
|
||||
#define CURL_FNMATCH_NOMATCH 1
|
||||
#define CURL_FNMATCH_FAIL 2
|
||||
|
||||
/* default pattern matching function
|
||||
* =================================
|
||||
* Implemented with recursive backtracking, if you want to use Curl_fnmatch,
|
||||
* please note that there is not implemented UTF/UNICODE support.
|
||||
*
|
||||
* Implemented features:
|
||||
* '?' notation, does not match UTF characters
|
||||
* '*' can also work with UTF string
|
||||
* [a-zA-Z0-9] enumeration support
|
||||
*
|
||||
* keywords: alnum, digit, xdigit, alpha, print, blank, lower, graph, space
|
||||
* and upper (use as "[[:alnum:]]")
|
||||
*/
|
||||
int Curl_fnmatch(void *ptr, const char *pattern, const char *string);
|
||||
|
||||
#endif /* HEADER_CURL_FNMATCH_H */
|
81
lib/curl_gethostname.c
Normal file
81
lib/curl_gethostname.c
Normal file
@@ -0,0 +1,81 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "curl_gethostname.h"
|
||||
|
||||
/*
|
||||
* Curl_gethostname() is a wrapper around gethostname() which allows
|
||||
* overriding the host name that the function would normally return.
|
||||
* This capability is used by the test suite to verify exact matching
|
||||
* of NTLM authentication, which exercises libcurl's MD4 and DES code.
|
||||
*
|
||||
* For libcurl debug enabled builds host name overriding takes place
|
||||
* when environment variable CURL_GETHOSTNAME is set, using the value
|
||||
* held by the variable to override returned host name.
|
||||
*
|
||||
* For libcurl shared library release builds the test suite preloads
|
||||
* another shared library named libhostname using the LD_PRELOAD
|
||||
* mechanism which intercepts, and might override, the gethostname()
|
||||
* function call. In this case a given platform must support the
|
||||
* LD_PRELOAD mechanism and additionally have environment variable
|
||||
* CURL_GETHOSTNAME set in order to override the returned host name.
|
||||
*
|
||||
* For libcurl static library release builds no overriding takes place.
|
||||
*/
|
||||
|
||||
int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) {
|
||||
|
||||
#ifndef HAVE_GETHOSTNAME
|
||||
|
||||
/* Allow compilation and return failure when unavailable */
|
||||
(void) name;
|
||||
(void) namelen;
|
||||
return -1;
|
||||
|
||||
#else
|
||||
|
||||
#ifdef DEBUGBUILD
|
||||
|
||||
/* Override host name when environment variable CURL_GETHOSTNAME is set */
|
||||
const char *force_hostname = getenv("CURL_GETHOSTNAME");
|
||||
if(force_hostname) {
|
||||
strncpy(name, force_hostname, namelen);
|
||||
name[namelen-1] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* DEBUGBUILD */
|
||||
|
||||
/* The call to system's gethostname() might get intercepted by the
|
||||
libhostname library when libcurl is built as a non-debug shared
|
||||
library when running the test suite. */
|
||||
return gethostname(name, namelen);
|
||||
|
||||
#endif
|
||||
|
||||
}
|
27
lib/curl_gethostname.h
Normal file
27
lib/curl_gethostname.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef HEADER_CURL_GETHOSTNAME_H
|
||||
#define HEADER_CURL_GETHOSTNAME_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen);
|
||||
|
||||
#endif /* HEADER_CURL_GETHOSTNAME_H */
|
67
lib/curl_hmac.h
Normal file
67
lib/curl_hmac.h
Normal file
@@ -0,0 +1,67 @@
|
||||
#ifndef HEADER_CURL_HMAC_H
|
||||
#define HEADER_CURL_HMAC_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||
|
||||
typedef void (* HMAC_hinit_func)(void * context);
|
||||
typedef void (* HMAC_hupdate_func)(void * context,
|
||||
const unsigned char * data,
|
||||
unsigned int len);
|
||||
typedef void (* HMAC_hfinal_func)(unsigned char * result, void * context);
|
||||
|
||||
|
||||
/* Per-hash function HMAC parameters. */
|
||||
|
||||
typedef struct {
|
||||
HMAC_hinit_func hmac_hinit; /* Initialize context procedure. */
|
||||
HMAC_hupdate_func hmac_hupdate; /* Update context with data. */
|
||||
HMAC_hfinal_func hmac_hfinal; /* Get final result procedure. */
|
||||
unsigned int hmac_ctxtsize; /* Context structure size. */
|
||||
unsigned int hmac_maxkeylen; /* Maximum key length (bytes). */
|
||||
unsigned int hmac_resultlen; /* Result length (bytes). */
|
||||
} HMAC_params;
|
||||
|
||||
|
||||
/* HMAC computation context. */
|
||||
|
||||
typedef struct {
|
||||
const HMAC_params * hmac_hash; /* Hash function definition. */
|
||||
void * hmac_hashctxt1; /* Hash function context 1. */
|
||||
void * hmac_hashctxt2; /* Hash function context 2. */
|
||||
} HMAC_context;
|
||||
|
||||
|
||||
/* Prototypes. */
|
||||
|
||||
HMAC_context * Curl_HMAC_init(const HMAC_params * hashparams,
|
||||
const unsigned char * key,
|
||||
unsigned int keylen);
|
||||
int Curl_HMAC_update(HMAC_context * context,
|
||||
const unsigned char * data,
|
||||
unsigned int len);
|
||||
int Curl_HMAC_final(HMAC_context * context, unsigned char * result);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_HMAC_H */
|
@@ -8,7 +8,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2007, 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
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -25,7 +25,8 @@
|
||||
#ifndef CURL_DISABLE_LDAP
|
||||
extern const struct Curl_handler Curl_handler_ldap;
|
||||
|
||||
#ifdef HAVE_LDAP_SSL
|
||||
#if (defined(USE_OPENLDAP) && defined(USE_SSL)) || \
|
||||
(!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))
|
||||
extern const struct Curl_handler Curl_handler_ldaps;
|
||||
#endif
|
||||
|
||||
|
33
lib/curl_md4.h
Normal file
33
lib/curl_md4.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef HEADER_CURL_MD4_H
|
||||
#define HEADER_CURL_MD4_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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"
|
||||
|
||||
/* NSS crypto library does not provide the MD4 hash algorithm, so that we have
|
||||
* a local implementation of it */
|
||||
#ifdef USE_NSS
|
||||
void Curl_md4it(unsigned char *output, const unsigned char *input, size_t len);
|
||||
#endif /* USE_NSS */
|
||||
|
||||
#endif /* HEADER_CURL_MD4_H */
|
@@ -22,7 +22,13 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||
#include "curl_hmac.h"
|
||||
|
||||
extern const HMAC_params Curl_HMAC_MD5[1];
|
||||
|
||||
void Curl_md5it(unsigned char *output,
|
||||
const unsigned char *input);
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_MD5_H */
|
||||
|
284
lib/curl_rtmp.c
Normal file
284
lib/curl_rtmp.c
Normal file
@@ -0,0 +1,284 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2010, Howard Chu, <hyc@highlandsun.com>
|
||||
*
|
||||
* 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"
|
||||
|
||||
#ifdef USE_LIBRTMP
|
||||
|
||||
#include "urldata.h"
|
||||
#include "nonblock.h" /* for curlx_nonblock */
|
||||
#include "progress.h" /* for Curl_pgrsSetUploadSize */
|
||||
#include "transfer.h"
|
||||
#include <curl/curl.h>
|
||||
#include <librtmp/rtmp.h>
|
||||
|
||||
#define _MPRINTF_REPLACE /* use our functions only */
|
||||
#include <curl/mprintf.h>
|
||||
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e)
|
||||
#define SET_RCVTIMEO(tv,s) int tv = s*1000
|
||||
#else
|
||||
#define SET_RCVTIMEO(tv,s) struct timeval tv = {s,0}
|
||||
#endif
|
||||
|
||||
#define DEF_BUFTIME (2*60*60*1000) /* 2 hours */
|
||||
|
||||
static CURLcode rtmp_setup(struct connectdata *conn);
|
||||
static CURLcode rtmp_do(struct connectdata *conn, bool *done);
|
||||
static CURLcode rtmp_done(struct connectdata *conn, CURLcode, bool premature);
|
||||
static CURLcode rtmp_connect(struct connectdata *conn, bool *done);
|
||||
static CURLcode rtmp_disconnect(struct connectdata *conn);
|
||||
|
||||
static Curl_recv rtmp_recv;
|
||||
static Curl_send rtmp_send;
|
||||
|
||||
/*
|
||||
* RTMP protocol handler.h, based on http://rtmpdump.mplayerhq.hu
|
||||
*/
|
||||
|
||||
const struct Curl_handler Curl_handler_rtmp = {
|
||||
"RTMP", /* scheme */
|
||||
rtmp_setup, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
PORT_RTMP, /* defport */
|
||||
PROT_RTMP /* protocol */
|
||||
};
|
||||
|
||||
const struct Curl_handler Curl_handler_rtmpt = {
|
||||
"RTMPT", /* scheme */
|
||||
rtmp_setup, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
PORT_RTMPT, /* defport */
|
||||
PROT_RTMPT /* protocol */
|
||||
};
|
||||
|
||||
const struct Curl_handler Curl_handler_rtmpe = {
|
||||
"RTMPE", /* scheme */
|
||||
rtmp_setup, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
PORT_RTMP, /* defport */
|
||||
PROT_RTMPE /* protocol */
|
||||
};
|
||||
|
||||
const struct Curl_handler Curl_handler_rtmpte = {
|
||||
"RTMPTE", /* scheme */
|
||||
rtmp_setup, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
PORT_RTMPT, /* defport */
|
||||
PROT_RTMPTE /* protocol */
|
||||
};
|
||||
|
||||
const struct Curl_handler Curl_handler_rtmps = {
|
||||
"RTMPS", /* scheme */
|
||||
rtmp_setup, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
PORT_RTMPS, /* defport */
|
||||
PROT_RTMPS /* protocol */
|
||||
};
|
||||
const struct Curl_handler Curl_handler_rtmpts = {
|
||||
"RTMPTS", /* scheme */
|
||||
rtmp_setup, /* setup_connection */
|
||||
rtmp_do, /* do_it */
|
||||
rtmp_done, /* done */
|
||||
ZERO_NULL, /* do_more */
|
||||
rtmp_connect, /* connect_it */
|
||||
ZERO_NULL, /* connecting */
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
rtmp_disconnect, /* disconnect */
|
||||
PORT_RTMPS, /* defport */
|
||||
PROT_RTMPTS /* protocol */
|
||||
};
|
||||
|
||||
static CURLcode rtmp_setup(struct connectdata *conn)
|
||||
{
|
||||
RTMP *r = RTMP_Alloc();
|
||||
|
||||
if (!r)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
RTMP_Init(r);
|
||||
RTMP_SetBufferMS(r, DEF_BUFTIME);
|
||||
if (!RTMP_SetupURL(r, conn->data->change.url)) {
|
||||
RTMP_Free(r);
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
conn->proto.generic = r;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode rtmp_connect(struct connectdata *conn, bool *done)
|
||||
{
|
||||
RTMP *r = conn->proto.generic;
|
||||
SET_RCVTIMEO(tv,10);
|
||||
|
||||
r->m_sb.sb_socket = conn->sock[FIRSTSOCKET];
|
||||
|
||||
/* We have to know if it's a write before we send the
|
||||
* connect request packet
|
||||
*/
|
||||
if (conn->data->set.upload)
|
||||
r->Link.protocol |= RTMP_FEATURE_WRITE;
|
||||
|
||||
/* For plain streams, use the buffer toggle trick to keep data flowing */
|
||||
if (!(r->Link.lFlags & RTMP_LF_LIVE) && !(r->Link.protocol & RTMP_FEATURE_HTTP))
|
||||
r->Link.lFlags |= RTMP_LF_BUFX;
|
||||
|
||||
curlx_nonblock(r->m_sb.sb_socket, FALSE);
|
||||
setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv));
|
||||
|
||||
if (!RTMP_Connect1(r, NULL))
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
/* Clients must send a periodic BytesReceived report to the server */
|
||||
r->m_bSendCounter = true;
|
||||
|
||||
*done = TRUE;
|
||||
conn->recv[FIRSTSOCKET] = rtmp_recv;
|
||||
conn->send[FIRSTSOCKET] = rtmp_send;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode rtmp_do(struct connectdata *conn, bool *done)
|
||||
{
|
||||
RTMP *r = conn->proto.generic;
|
||||
|
||||
if (!RTMP_ConnectStream(r, 0))
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
if (conn->data->set.upload) {
|
||||
Curl_pgrsSetUploadSize(conn->data, conn->data->set.infilesize);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL);
|
||||
} else
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, NULL, -1, NULL);
|
||||
*done = TRUE;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode rtmp_done(struct connectdata *conn, CURLcode status,
|
||||
bool premature)
|
||||
{
|
||||
(void)conn; /* unused */
|
||||
(void)status; /* unused */
|
||||
(void)premature; /* unused */
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode rtmp_disconnect(struct connectdata *conn)
|
||||
{
|
||||
RTMP *r = conn->proto.generic;
|
||||
if (r) {
|
||||
conn->proto.generic = NULL;
|
||||
RTMP_Close(r);
|
||||
RTMP_Free(r);
|
||||
}
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static ssize_t rtmp_recv(struct connectdata *conn, int sockindex, char *buf,
|
||||
size_t len, CURLcode *err)
|
||||
{
|
||||
RTMP *r = conn->proto.generic;
|
||||
ssize_t nread;
|
||||
|
||||
(void)sockindex; /* unused */
|
||||
|
||||
nread = RTMP_Read(r, buf, len);
|
||||
if (nread < 0) {
|
||||
if (r->m_read.status == RTMP_READ_COMPLETE ||
|
||||
r->m_read.status == RTMP_READ_EOF) {
|
||||
conn->data->req.size = conn->data->req.bytecount;
|
||||
nread = 0;
|
||||
} else
|
||||
*err = CURLE_RECV_ERROR;
|
||||
}
|
||||
return nread;
|
||||
}
|
||||
|
||||
static ssize_t rtmp_send(struct connectdata *conn, int sockindex,
|
||||
const void *buf, size_t len, CURLcode *err)
|
||||
{
|
||||
RTMP *r = conn->proto.generic;
|
||||
ssize_t num;
|
||||
|
||||
(void)sockindex; /* unused */
|
||||
|
||||
num = RTMP_Write(r, (char *)buf, len);
|
||||
if (num < 0) {
|
||||
*err = CURLE_SEND_ERROR;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
#endif /* USE_LIBRTMP */
|
33
lib/curl_rtmp.h
Normal file
33
lib/curl_rtmp.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef HEADER_CURL_RTMP_H
|
||||
#define HEADER_CURL_RTMP_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 2010, Howard Chu, <hyc@highlandsun.com>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
#ifdef USE_LIBRTMP
|
||||
extern const struct Curl_handler Curl_handler_rtmp;
|
||||
extern const struct Curl_handler Curl_handler_rtmpt;
|
||||
extern const struct Curl_handler Curl_handler_rtmpe;
|
||||
extern const struct Curl_handler Curl_handler_rtmpte;
|
||||
extern const struct Curl_handler Curl_handler_rtmps;
|
||||
extern const struct Curl_handler Curl_handler_rtmpts;
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CURL_RTMP_H */
|
31
lib/dict.c
31
lib/dict.c
@@ -5,7 +5,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
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -217,13 +217,12 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
|
||||
|
||||
free(eword);
|
||||
|
||||
if(result)
|
||||
if(result) {
|
||||
failf(data, "Failed sending DICT request");
|
||||
else
|
||||
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
|
||||
-1, NULL); /* no upload */
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
|
||||
-1, NULL); /* no upload */
|
||||
}
|
||||
else if(Curl_raw_nequal(path, DICT_DEFINE, sizeof(DICT_DEFINE)-1) ||
|
||||
Curl_raw_nequal(path, DICT_DEFINE2, sizeof(DICT_DEFINE2)-1) ||
|
||||
@@ -265,15 +264,12 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
|
||||
|
||||
free(eword);
|
||||
|
||||
if(result)
|
||||
if(result) {
|
||||
failf(data, "Failed sending DICT request");
|
||||
else
|
||||
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
|
||||
-1, NULL); /* no upload */
|
||||
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
}
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
|
||||
-1, NULL); /* no upload */
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -290,13 +286,12 @@ static CURLcode dict_do(struct connectdata *conn, bool *done)
|
||||
"CLIENT " LIBCURL_NAME " " LIBCURL_VERSION "\r\n"
|
||||
"%s\r\n"
|
||||
"QUIT\r\n", ppath);
|
||||
if(result)
|
||||
if(result) {
|
||||
failf(data, "Failed sending DICT request");
|
||||
else
|
||||
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount,
|
||||
-1, NULL);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, bytecount, -1, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
21
lib/easy.c
21
lib/easy.c
@@ -287,6 +287,13 @@ CURLcode curl_global_init(long flags)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_INIT)
|
||||
if(libssh2_init(0)) {
|
||||
DEBUGF(fprintf(stderr, "Error: libssh2_init failed\n"));
|
||||
return CURLE_FAILED_INIT;
|
||||
}
|
||||
#endif
|
||||
|
||||
init_flags = flags;
|
||||
|
||||
/* Preset pseudo-random number sequence. */
|
||||
@@ -355,6 +362,10 @@ void curl_global_cleanup(void)
|
||||
amiga_cleanup();
|
||||
#endif
|
||||
|
||||
#if defined(USE_LIBSSH2) && defined(HAVE_LIBSSH2_EXIT)
|
||||
(void)libssh2_exit();
|
||||
#endif
|
||||
|
||||
init_flags = 0;
|
||||
}
|
||||
|
||||
@@ -1097,7 +1108,6 @@ CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n)
|
||||
{
|
||||
curl_socket_t sfd;
|
||||
CURLcode ret;
|
||||
int ret1;
|
||||
ssize_t n1;
|
||||
struct connectdata *c;
|
||||
struct SessionHandle *data = (struct SessionHandle *)curl;
|
||||
@@ -1107,13 +1117,10 @@ CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n)
|
||||
return ret;
|
||||
|
||||
*n = 0;
|
||||
ret1 = Curl_read(c, sfd, buffer, buflen, &n1);
|
||||
ret = Curl_read(c, sfd, buffer, buflen, &n1);
|
||||
|
||||
if(ret1 == -1)
|
||||
return CURLE_AGAIN;
|
||||
|
||||
if(ret1 != CURLE_OK)
|
||||
return (CURLcode)ret1;
|
||||
if(ret != CURLE_OK)
|
||||
return ret;
|
||||
|
||||
*n = (size_t)n1;
|
||||
|
||||
|
@@ -5,7 +5,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
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -146,7 +146,7 @@ static CURLcode file_range(struct connectdata *conn)
|
||||
|
||||
if(data->state.use_range && data->state.range) {
|
||||
from=curlx_strtoofft(data->state.range, &ptr, 0);
|
||||
while(ptr && *ptr && (isspace((int)*ptr) || (*ptr=='-')))
|
||||
while(*ptr && (isspace((int)*ptr) || (*ptr=='-')))
|
||||
ptr++;
|
||||
to=curlx_strtoofft(ptr, &ptr2, 0);
|
||||
if(ptr == ptr2) {
|
||||
@@ -161,11 +161,10 @@ static CURLcode file_range(struct connectdata *conn)
|
||||
}
|
||||
else if(from < 0) {
|
||||
/* -Y */
|
||||
totalsize = -from;
|
||||
data->req.maxdownload = -from;
|
||||
data->state.resume_from = from;
|
||||
DEBUGF(infof(data, "RANGE the last %" FORMAT_OFF_T " bytes\n",
|
||||
totalsize));
|
||||
-from));
|
||||
}
|
||||
else {
|
||||
/* X-Y */
|
||||
|
75
lib/fileinfo.c
Normal file
75
lib/fileinfo.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "strdup.h"
|
||||
#include "fileinfo.h"
|
||||
|
||||
#define _MPRINTF_REPLACE /* use our functions only */
|
||||
#include <curl/mprintf.h>
|
||||
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
struct curl_fileinfo *Curl_fileinfo_alloc(void)
|
||||
{
|
||||
struct curl_fileinfo *tmp = malloc(sizeof(struct curl_fileinfo));
|
||||
if(!tmp)
|
||||
return NULL;
|
||||
memset(tmp, 0, sizeof(struct curl_fileinfo));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
void Curl_fileinfo_dtor(void *user, void *element)
|
||||
{
|
||||
struct curl_fileinfo *finfo = element;
|
||||
(void) user;
|
||||
if(!finfo)
|
||||
return;
|
||||
|
||||
if(finfo->b_data){
|
||||
free(finfo->b_data);
|
||||
}
|
||||
|
||||
free(finfo);
|
||||
}
|
||||
|
||||
struct curl_fileinfo *Curl_fileinfo_dup(const struct curl_fileinfo *src)
|
||||
{
|
||||
struct curl_fileinfo *ptr = malloc(sizeof(struct curl_fileinfo));
|
||||
if(!ptr)
|
||||
return NULL;
|
||||
*ptr = *src;
|
||||
|
||||
ptr->b_data = malloc(src->b_size);
|
||||
if(!ptr->b_data) {
|
||||
free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
memcpy(ptr->b_data, src->b_data, src->b_size);
|
||||
return ptr;
|
||||
}
|
||||
}
|
33
lib/fileinfo.h
Normal file
33
lib/fileinfo.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef HEADER_CURL_FILEINFO_H
|
||||
#define HEADER_CURL_FILEINFO_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 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 <curl/curl.h>
|
||||
|
||||
struct curl_fileinfo *Curl_fileinfo_alloc(void);
|
||||
|
||||
void Curl_fileinfo_dtor(void *, void *);
|
||||
|
||||
struct curl_fileinfo *Curl_fileinfo_dup(const struct curl_fileinfo *src);
|
||||
|
||||
#endif /* HEADER_CURL_FILEINFO_H */
|
305
lib/ftp.c
305
lib/ftp.c
@@ -71,6 +71,8 @@
|
||||
#include "http.h" /* for HTTP proxy tunnel stuff */
|
||||
#include "socks.h"
|
||||
#include "ftp.h"
|
||||
#include "fileinfo.h"
|
||||
#include "ftplistparser.h"
|
||||
|
||||
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||
#include "krb4.h"
|
||||
@@ -144,6 +146,14 @@ static CURLcode ftp_doing(struct connectdata *conn,
|
||||
bool *dophase_done);
|
||||
static CURLcode ftp_setup_connection(struct connectdata * conn);
|
||||
|
||||
static CURLcode init_wc_data(struct connectdata *conn);
|
||||
static CURLcode wc_statemach(struct connectdata *conn);
|
||||
|
||||
static void wc_data_dtor(void *ptr);
|
||||
|
||||
static CURLcode ftp_state_post_retr_size(struct connectdata *conn,
|
||||
curl_off_t filesize);
|
||||
|
||||
/* easy-to-use macro: */
|
||||
#define FTPSENDF(x,y,z) if((result = Curl_ftpsendf(x,y,z)) != CURLE_OK) \
|
||||
return result
|
||||
@@ -820,7 +830,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
||||
/* resolv ip/host to ip */
|
||||
rc = Curl_resolv(conn, host, 0, &h);
|
||||
if(rc == CURLRESOLV_PENDING)
|
||||
rc = Curl_wait_for_resolv(conn, &h);
|
||||
(void)Curl_wait_for_resolv(conn, &h);
|
||||
if(h) {
|
||||
res = h->addr;
|
||||
/* when we return from this function, we can forget about this entry
|
||||
@@ -1378,7 +1388,7 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn,
|
||||
infof(data, "File already completely uploaded\n");
|
||||
|
||||
/* no data to transfer */
|
||||
result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
|
||||
/* Set ->transfer so that we won't get any error in
|
||||
* ftp_done() because we didn't transfer anything! */
|
||||
@@ -1469,8 +1479,14 @@ static CURLcode ftp_state_quote(struct connectdata *conn,
|
||||
if(ftp->transfer != FTPTRANSFER_BODY)
|
||||
state(conn, FTP_STOP);
|
||||
else {
|
||||
PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file);
|
||||
state(conn, FTP_RETR_SIZE);
|
||||
if(ftpc->known_filesize != -1) {
|
||||
Curl_pgrsSetDownloadSize(data, ftpc->known_filesize);
|
||||
result = ftp_state_post_retr_size(conn, ftpc->known_filesize);
|
||||
}
|
||||
else {
|
||||
PPSENDF(&ftpc->pp, "SIZE %s", ftpc->file);
|
||||
state(conn, FTP_RETR_SIZE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FTP_STOR_PREQUOTE:
|
||||
@@ -1630,8 +1646,9 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
|
||||
*/
|
||||
rc = Curl_resolv(conn, conn->proxy.name, (int)conn->port, &addr);
|
||||
if(rc == CURLRESOLV_PENDING)
|
||||
/* BLOCKING */
|
||||
rc = Curl_wait_for_resolv(conn, &addr);
|
||||
/* BLOCKING, ignores the return code but 'addr' will be NULL in
|
||||
case of failure */
|
||||
(void)Curl_wait_for_resolv(conn, &addr);
|
||||
|
||||
connectport =
|
||||
(unsigned short)conn->port; /* we connect to the proxy's port */
|
||||
@@ -1647,7 +1664,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
|
||||
rc = Curl_resolv(conn, newhost, newport, &addr);
|
||||
if(rc == CURLRESOLV_PENDING)
|
||||
/* BLOCKING */
|
||||
rc = Curl_wait_for_resolv(conn, &addr);
|
||||
(void)Curl_wait_for_resolv(conn, &addr);
|
||||
|
||||
connectport = newport; /* we connect to the remote port */
|
||||
|
||||
@@ -1973,7 +1990,7 @@ static CURLcode ftp_state_post_retr_size(struct connectdata *conn,
|
||||
|
||||
if(ftp->downloadsize == 0) {
|
||||
/* no data to transfer */
|
||||
result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
infof(data, "File already completely downloaded\n");
|
||||
|
||||
/* Set ->transfer so that we won't get any error in ftp_done()
|
||||
@@ -2115,8 +2132,8 @@ static CURLcode ftp_state_stor_resp(struct connectdata *conn,
|
||||
/* set the SO_SNDBUF for the secondary socket for those who need it */
|
||||
Curl_sndbufset(conn->sock[SECONDARYSOCKET]);
|
||||
|
||||
result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */
|
||||
SECONDARYSOCKET, ftp->bytecountp);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */
|
||||
SECONDARYSOCKET, ftp->bytecountp);
|
||||
state(conn, FTP_STOP);
|
||||
|
||||
conn->proto.ftpc.pp.pending_resp = TRUE; /* expect a server response */
|
||||
@@ -2229,11 +2246,8 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
|
||||
infof(data, "Getting file with size: %" FORMAT_OFF_T "\n", size);
|
||||
|
||||
/* FTP download: */
|
||||
result=Curl_setup_transfer(conn, SECONDARYSOCKET, size, FALSE,
|
||||
ftp->bytecountp,
|
||||
-1, NULL); /* no upload here */
|
||||
if(result)
|
||||
return result;
|
||||
Curl_setup_transfer(conn, SECONDARYSOCKET, size, FALSE,
|
||||
ftp->bytecountp, -1, NULL); /* no upload here */
|
||||
|
||||
conn->proto.ftpc.pp.pending_resp = TRUE; /* expect server response */
|
||||
state(conn, FTP_STOP);
|
||||
@@ -2857,6 +2871,8 @@ static CURLcode ftp_init(struct connectdata *conn)
|
||||
if(TRUE == isBadFtpString(ftp->passwd))
|
||||
return CURLE_URL_MALFORMAT;
|
||||
|
||||
conn->proto.ftpc.known_filesize = -1; /* unknown size for now */
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
@@ -3020,6 +3036,13 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
|
||||
if(ftpc->prevpath)
|
||||
free(ftpc->prevpath);
|
||||
|
||||
if(data->set.wildcardmatch) {
|
||||
if(data->set.chunk_end && ftpc->file) {
|
||||
data->set.chunk_end(data->wildcard.customptr);
|
||||
}
|
||||
ftpc->known_filesize = -1;
|
||||
}
|
||||
|
||||
/* get the "raw" path */
|
||||
path = curl_easy_unescape(data, path_to_use, 0, NULL);
|
||||
if(!path) {
|
||||
@@ -3180,6 +3203,8 @@ CURLcode ftp_sendquote(struct connectdata *conn, struct curl_slist *quote)
|
||||
ssize_t nread;
|
||||
int ftpcode;
|
||||
CURLcode result;
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
struct pingpong *pp = &ftpc->pp;
|
||||
|
||||
item = quote;
|
||||
while(item) {
|
||||
@@ -3199,6 +3224,8 @@ CURLcode ftp_sendquote(struct connectdata *conn, struct curl_slist *quote)
|
||||
|
||||
FTPSENDF(conn, "%s", cmd);
|
||||
|
||||
pp->response = Curl_tvnow(); /* timeout relative now */
|
||||
|
||||
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
|
||||
if(result)
|
||||
return result;
|
||||
@@ -3285,7 +3312,6 @@ ftp_pasv_verbose(struct connectdata *conn,
|
||||
static CURLcode ftp_range(struct connectdata *conn)
|
||||
{
|
||||
curl_off_t from, to;
|
||||
curl_off_t totalsize=-1;
|
||||
char *ptr;
|
||||
char *ptr2;
|
||||
struct SessionHandle *data = conn->data;
|
||||
@@ -3293,7 +3319,7 @@ static CURLcode ftp_range(struct connectdata *conn)
|
||||
|
||||
if(data->state.use_range && data->state.range) {
|
||||
from=curlx_strtoofft(data->state.range, &ptr, 0);
|
||||
while(ptr && *ptr && (ISSPACE(*ptr) || (*ptr=='-')))
|
||||
while(*ptr && (ISSPACE(*ptr) || (*ptr=='-')))
|
||||
ptr++;
|
||||
to=curlx_strtoofft(ptr, &ptr2, 0);
|
||||
if(ptr == ptr2) {
|
||||
@@ -3308,16 +3334,14 @@ static CURLcode ftp_range(struct connectdata *conn)
|
||||
}
|
||||
else if(from < 0) {
|
||||
/* -Y */
|
||||
totalsize = -from;
|
||||
data->req.maxdownload = -from;
|
||||
data->state.resume_from = from;
|
||||
DEBUGF(infof(conn->data, "FTP RANGE the last %" FORMAT_OFF_T " bytes\n",
|
||||
totalsize));
|
||||
-from));
|
||||
}
|
||||
else {
|
||||
/* X-Y */
|
||||
totalsize = to-from;
|
||||
data->req.maxdownload = totalsize+1; /* include last byte */
|
||||
data->req.maxdownload = (to-from)+1; /* include last byte */
|
||||
data->state.resume_from = from;
|
||||
DEBUGF(infof(conn->data, "FTP RANGE from %" FORMAT_OFF_T
|
||||
" getting %" FORMAT_OFF_T " bytes\n",
|
||||
@@ -3393,7 +3417,7 @@ static CURLcode ftp_nextconnect(struct connectdata *conn)
|
||||
if((result == CURLE_OK) && (ftp->transfer != FTPTRANSFER_BODY))
|
||||
/* no data to transfer. FIX: it feels like a kludge to have this here
|
||||
too! */
|
||||
result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
|
||||
/* end of transfer */
|
||||
DEBUGF(infof(data, "DO-MORE phase ends with %d\n", (int)result));
|
||||
@@ -3450,6 +3474,221 @@ CURLcode ftp_perform(struct connectdata *conn,
|
||||
return result;
|
||||
}
|
||||
|
||||
static void wc_data_dtor(void *ptr)
|
||||
{
|
||||
struct ftp_wc_tmpdata *tmp = ptr;
|
||||
if(tmp)
|
||||
Curl_ftp_parselist_data_free(&tmp->parser);
|
||||
Curl_safefree(tmp);
|
||||
}
|
||||
|
||||
static CURLcode init_wc_data(struct connectdata *conn)
|
||||
{
|
||||
char *last_slash;
|
||||
char *path = conn->data->state.path;
|
||||
struct WildcardData *wildcard = &(conn->data->wildcard);
|
||||
CURLcode ret = CURLE_OK;
|
||||
struct ftp_wc_tmpdata *ftp_tmp;
|
||||
|
||||
last_slash = strrchr(conn->data->state.path, '/');
|
||||
if(last_slash) {
|
||||
last_slash++;
|
||||
if(last_slash[0] == '\0') {
|
||||
wildcard->state = CURLWC_CLEAN;
|
||||
ret = ftp_parse_url_path(conn);
|
||||
return ret;
|
||||
}
|
||||
else {
|
||||
wildcard->pattern = strdup(last_slash);
|
||||
if (!wildcard->pattern)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
last_slash[0] = '\0'; /* cut file from path */
|
||||
}
|
||||
}
|
||||
else { /* there is only 'wildcard pattern' or nothing */
|
||||
if(path[0]) {
|
||||
wildcard->pattern = strdup(path);
|
||||
if (!wildcard->pattern)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
path[0] = '\0';
|
||||
}
|
||||
else { /* only list */
|
||||
wildcard->state = CURLWC_CLEAN;
|
||||
ret = ftp_parse_url_path(conn);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* program continues only if URL is not ending with slash, allocate needed
|
||||
resources for wildcard transfer */
|
||||
|
||||
/* allocate ftp protocol specific temporary wildcard data */
|
||||
ftp_tmp = malloc(sizeof(struct ftp_wc_tmpdata));
|
||||
if(!ftp_tmp) {
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* INITIALIZE parselist structure */
|
||||
ftp_tmp->parser = Curl_ftp_parselist_data_alloc();
|
||||
if(!ftp_tmp->parser) {
|
||||
free(ftp_tmp);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
wildcard->tmp = ftp_tmp; /* put it to the WildcardData tmp pointer */
|
||||
wildcard->tmp_dtor = wc_data_dtor;
|
||||
|
||||
/* wildcard does not support NOCWD option (assert it?) */
|
||||
if(conn->data->set.ftp_filemethod == FTPFILE_NOCWD)
|
||||
conn->data->set.ftp_filemethod = FTPFILE_MULTICWD;
|
||||
|
||||
/* try to parse ftp url */
|
||||
ret = ftp_parse_url_path(conn);
|
||||
if(ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* backup old write_function */
|
||||
ftp_tmp->backup.write_function = conn->data->set.fwrite_func;
|
||||
/* parsing write function (callback included directly from ftplistparser.c) */
|
||||
conn->data->set.fwrite_func = Curl_ftp_parselist;
|
||||
/* backup old file descriptor */
|
||||
ftp_tmp->backup.file_descriptor = conn->data->set.out;
|
||||
/* let the writefunc callback know what curl pointer is working with */
|
||||
conn->data->set.out = conn;
|
||||
|
||||
wildcard->path = strdup(conn->data->state.path);
|
||||
if(!wildcard->path) {
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
infof(conn->data, "Wildcard - Parsing started\n");
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode wc_statemach(struct connectdata *conn)
|
||||
{
|
||||
struct ftp_conn *ftpc = &conn->proto.ftpc;
|
||||
struct WildcardData *wildcard = &(conn->data->wildcard);
|
||||
struct ftp_wc_tmpdata *ftp_tmp = wildcard->tmp;
|
||||
char *tmp_path;
|
||||
CURLcode ret = CURLE_OK;
|
||||
long userresponse = 0;
|
||||
switch (wildcard->state) {
|
||||
case CURLWC_INIT:
|
||||
ret = init_wc_data(conn);
|
||||
if(wildcard->state == CURLWC_CLEAN)
|
||||
/* only listing! */
|
||||
break;
|
||||
else
|
||||
wildcard->state = ret ? CURLWC_ERROR : CURLWC_MATCHING;
|
||||
break;
|
||||
|
||||
case CURLWC_MATCHING:
|
||||
/* In this state is LIST response successfully parsed, so lets restore
|
||||
previous WRITEFUNCTION callback and WRITEDATA pointer */
|
||||
ftp_tmp = wildcard->tmp;
|
||||
conn->data->set.fwrite_func = ftp_tmp->backup.write_function;
|
||||
conn->data->set.out = ftp_tmp->backup.file_descriptor;
|
||||
wildcard->state = CURLWC_DOWNLOADING;
|
||||
|
||||
if(Curl_ftp_parselist_geterror(ftp_tmp->parser)) {
|
||||
/* error found in LIST parsing */
|
||||
wildcard->state = CURLWC_CLEAN;
|
||||
return wc_statemach(conn);
|
||||
}
|
||||
else if(wildcard->filelist->size == 0) {
|
||||
/* no corresponding file */
|
||||
wildcard->state = CURLWC_CLEAN;
|
||||
return CURLE_REMOTE_FILE_NOT_FOUND;
|
||||
}
|
||||
ret = wc_statemach(conn);
|
||||
break;
|
||||
|
||||
case CURLWC_DOWNLOADING: {
|
||||
/* filelist has at least one file, lets get first one */
|
||||
struct curl_fileinfo *finfo = wildcard->filelist->head->ptr;
|
||||
tmp_path = malloc(strlen(conn->data->state.path) +
|
||||
strlen(finfo->filename) + 1);
|
||||
if(!tmp_path) {
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
tmp_path[0] = 0;
|
||||
/* make full path to matched file */
|
||||
strcat(tmp_path, wildcard->path);
|
||||
strcat(tmp_path, finfo->filename);
|
||||
/* switch default "state.pathbuffer" and tmp_path, good to see
|
||||
ftp_parse_url_path function to understand this trick */
|
||||
if(conn->data->state.pathbuffer)
|
||||
free(conn->data->state.pathbuffer);
|
||||
conn->data->state.pathbuffer = tmp_path;
|
||||
conn->data->state.path = tmp_path;
|
||||
|
||||
infof(conn->data, "Wildcard - START of \"%s\"\n", finfo->filename);
|
||||
if(conn->data->set.chunk_bgn) {
|
||||
userresponse = conn->data->set.chunk_bgn(
|
||||
finfo, wildcard->customptr, (int)wildcard->filelist->size);
|
||||
switch(userresponse) {
|
||||
case CURL_CHUNK_BGN_FUNC_SKIP:
|
||||
infof(conn->data, "Wildcard - \"%s\" skipped by user\n",
|
||||
finfo->filename);
|
||||
wildcard->state = CURLWC_SKIP;
|
||||
return wc_statemach(conn);
|
||||
case CURL_CHUNK_BGN_FUNC_FAIL:
|
||||
return CURLE_CHUNK_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
if(finfo->filetype != CURLFILETYPE_FILE) {
|
||||
wildcard->state = CURLWC_SKIP;
|
||||
return wc_statemach(conn);
|
||||
}
|
||||
|
||||
if(finfo->flags & CURLFINFOFLAG_KNOWN_SIZE)
|
||||
ftpc->known_filesize = finfo->size;
|
||||
|
||||
ret = ftp_parse_url_path(conn);
|
||||
if(ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* we don't need the Curl_fileinfo of first file anymore */
|
||||
Curl_llist_remove(wildcard->filelist, wildcard->filelist->head, NULL);
|
||||
|
||||
if(wildcard->filelist->size == 0) { /* remains only one file to down. */
|
||||
wildcard->state = CURLWC_CLEAN;
|
||||
/* after that will be ftp_do called once again and no transfer
|
||||
will be done because of CURLWC_CLEAN state */
|
||||
return CURLE_OK;
|
||||
}
|
||||
} break;
|
||||
|
||||
case CURLWC_SKIP: {
|
||||
if(conn->data->set.chunk_end)
|
||||
conn->data->set.chunk_end(conn->data->wildcard.customptr);
|
||||
Curl_llist_remove(wildcard->filelist, wildcard->filelist->head, NULL);
|
||||
wildcard->state = (wildcard->filelist->size == 0) ?
|
||||
CURLWC_CLEAN : CURLWC_DOWNLOADING;
|
||||
ret = wc_statemach(conn);
|
||||
} break;
|
||||
|
||||
case CURLWC_CLEAN:
|
||||
ret = CURLE_OK;
|
||||
if(ftp_tmp) {
|
||||
ret = Curl_ftp_parselist_geterror(ftp_tmp->parser);
|
||||
}
|
||||
wildcard->state = ret ? CURLWC_ERROR : CURLWC_DONE;
|
||||
break;
|
||||
|
||||
case CURLWC_DONE:
|
||||
case CURLWC_ERROR:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* ftp_do()
|
||||
@@ -3476,9 +3715,21 @@ static CURLcode ftp_do(struct connectdata *conn, bool *done)
|
||||
if(retcode)
|
||||
return retcode;
|
||||
|
||||
retcode = ftp_parse_url_path(conn);
|
||||
if(retcode)
|
||||
return retcode;
|
||||
if(conn->data->set.wildcardmatch) {
|
||||
retcode = wc_statemach(conn);
|
||||
if(conn->data->wildcard.state == CURLWC_SKIP ||
|
||||
conn->data->wildcard.state == CURLWC_DONE) {
|
||||
/* do not call ftp_regular_transfer */
|
||||
return CURLE_OK;
|
||||
}
|
||||
if(retcode) /* error, loop or skipping the file */
|
||||
return retcode;
|
||||
}
|
||||
else { /* no wildcard FSM needed */
|
||||
retcode = ftp_parse_url_path(conn);
|
||||
if(retcode)
|
||||
return retcode;
|
||||
}
|
||||
|
||||
retcode = ftp_regular_transfer(conn, done);
|
||||
|
||||
@@ -3820,7 +4071,7 @@ static CURLcode ftp_dophase_done(struct connectdata *conn,
|
||||
|
||||
if(ftp->transfer != FTPTRANSFER_BODY)
|
||||
/* no data to transfer */
|
||||
result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
else if(!connected)
|
||||
/* since we didn't connect now, we want do_more to get called */
|
||||
conn->bits.do_more = TRUE;
|
||||
@@ -3927,6 +4178,7 @@ static CURLcode ftp_setup_connection(struct connectdata * conn)
|
||||
}
|
||||
|
||||
data->state.path++; /* don't include the initial slash */
|
||||
data->state.slash_removed = TRUE; /* we've skipped the slash */
|
||||
|
||||
/* FTP URLs support an extension like ";type=<typecode>" that
|
||||
* we'll try to get now! */
|
||||
@@ -3938,6 +4190,7 @@ static CURLcode ftp_setup_connection(struct connectdata * conn)
|
||||
if(type) {
|
||||
*type = 0; /* it was in the middle of the hostname */
|
||||
command = Curl_raw_toupper(type[6]);
|
||||
conn->bits.type_set = TRUE;
|
||||
|
||||
switch (command) {
|
||||
case 'A': /* ASCII mode */
|
||||
|
13
lib/ftp.h
13
lib/ftp.h
@@ -79,6 +79,17 @@ typedef enum {
|
||||
FTP_LAST /* never used */
|
||||
} ftpstate;
|
||||
|
||||
struct ftp_parselist_data; /* defined later in ftplistparser.c */
|
||||
|
||||
struct ftp_wc_tmpdata {
|
||||
struct ftp_parselist_data *parser;
|
||||
|
||||
struct {
|
||||
curl_write_callback write_function;
|
||||
FILE *file_descriptor;
|
||||
} backup;
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
FTPFILE_MULTICWD = 1, /* as defined by RFC1738 */
|
||||
FTPFILE_NOCWD = 2, /* use SIZE / RETR / STOR on the full path */
|
||||
@@ -135,6 +146,8 @@ struct ftp_conn {
|
||||
int count3; /* general purpose counter for the state machine */
|
||||
ftpstate state; /* always use ftp.c:state() to change state! */
|
||||
char * server_os; /* The target server operating system. */
|
||||
curl_off_t known_filesize; /* file size is different from -1, if wildcard
|
||||
LIST parsing was done and wc_statemach set it */
|
||||
};
|
||||
|
||||
#endif /* HEADER_CURL_FTP_H */
|
||||
|
1045
lib/ftplistparser.c
Normal file
1045
lib/ftplistparser.c
Normal file
File diff suppressed because it is too large
Load Diff
39
lib/ftplistparser.h
Normal file
39
lib/ftplistparser.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef HEADER_CURL_FTPLISTPARSER_H
|
||||
#define HEADER_CURL_FTPLISTPARSER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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 <curl/curl.h>
|
||||
|
||||
/* WRITEFUNCTION callback for parsing LIST responses */
|
||||
size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
|
||||
void *connptr);
|
||||
|
||||
struct ftp_parselist_data; /* defined inside ftplibparser.c */
|
||||
|
||||
CURLcode Curl_ftp_parselist_geterror(struct ftp_parselist_data *pl_data);
|
||||
|
||||
struct ftp_parselist_data *Curl_ftp_parselist_data_alloc(void);
|
||||
|
||||
void Curl_ftp_parselist_data_free(struct ftp_parselist_data **pl_data);
|
||||
|
||||
#endif /* HEADER_CURL_FTPLISTPARSER_H */
|
@@ -66,6 +66,12 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
|
||||
info->header_size = 0;
|
||||
info->request_size = 0;
|
||||
info->numconnects = 0;
|
||||
|
||||
info->ip[0] = 0;
|
||||
info->port = 0;
|
||||
info->localip[0] = 0;
|
||||
info->localport = 0;
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
@@ -224,6 +230,19 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
|
||||
/* Return the ip address of the most recent (primary) connection */
|
||||
*param_charp = data->info.ip;
|
||||
break;
|
||||
case CURLINFO_PRIMARY_PORT:
|
||||
/* Return the (remote) port of the most recent (primary) connection */
|
||||
*param_longp = data->info.port;
|
||||
break;
|
||||
case CURLINFO_LOCAL_IP:
|
||||
/* Return the source/local ip address of the most recent (primary)
|
||||
connection */
|
||||
*param_charp = data->info.localip;
|
||||
break;
|
||||
case CURLINFO_LOCAL_PORT:
|
||||
/* Return the local port of the most recent (primary) connection */
|
||||
*param_longp = data->info.localport;
|
||||
break;
|
||||
case CURLINFO_CERTINFO:
|
||||
/* Return the a pointer to the certinfo struct. Not really an slist
|
||||
pointer but we can pretend it is here */
|
||||
|
253
lib/gtls.c
253
lib/gtls.c
@@ -182,54 +182,76 @@ static void unload_file(gnutls_datum data) {
|
||||
}
|
||||
|
||||
|
||||
/* this function does a BLOCKING SSL/TLS (re-)handshake */
|
||||
/* this function does a SSL/TLS (re-)handshake */
|
||||
static CURLcode handshake(struct connectdata *conn,
|
||||
gnutls_session session,
|
||||
int sockindex,
|
||||
bool duringconnect)
|
||||
bool duringconnect,
|
||||
bool nonblocking)
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
|
||||
gnutls_session session = conn->ssl[sockindex].session;
|
||||
curl_socket_t sockfd = conn->sock[sockindex];
|
||||
long timeout_ms;
|
||||
int rc;
|
||||
if(!gtls_inited)
|
||||
Curl_gtls_init();
|
||||
do {
|
||||
rc = gnutls_handshake(session);
|
||||
int what;
|
||||
|
||||
if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) {
|
||||
long timeout_ms = Curl_timeleft(conn, NULL, duringconnect);
|
||||
while(1) {
|
||||
/* check allowed time left */
|
||||
timeout_ms = Curl_timeleft(conn, NULL, duringconnect);
|
||||
|
||||
if(timeout_ms < 0) {
|
||||
/* a precaution, no need to continue if time already is up */
|
||||
failf(data, "SSL connection timeout");
|
||||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
if(timeout_ms < 0) {
|
||||
/* no need to continue if time already is up */
|
||||
failf(data, "SSL connection timeout");
|
||||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
|
||||
rc = Curl_socket_ready(conn->sock[sockindex],
|
||||
conn->sock[sockindex], (int)timeout_ms);
|
||||
if(rc > 0)
|
||||
/* reabable or writable, go loop*/
|
||||
continue;
|
||||
else if(0 == rc) {
|
||||
/* timeout */
|
||||
failf(data, "SSL connection timeout");
|
||||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
else {
|
||||
/* anything that gets here is fatally bad */
|
||||
/* if ssl is expecting something, check if it's available. */
|
||||
if(connssl->connecting_state == ssl_connect_2_reading
|
||||
|| connssl->connecting_state == ssl_connect_2_writing) {
|
||||
|
||||
curl_socket_t writefd = ssl_connect_2_writing==
|
||||
connssl->connecting_state?sockfd:CURL_SOCKET_BAD;
|
||||
curl_socket_t readfd = ssl_connect_2_reading==
|
||||
connssl->connecting_state?sockfd:CURL_SOCKET_BAD;
|
||||
|
||||
what = Curl_socket_ready(readfd, writefd,
|
||||
nonblocking?0:(int)timeout_ms);
|
||||
if(what < 0) {
|
||||
/* fatal error */
|
||||
failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO);
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
else if(0 == what) {
|
||||
if(nonblocking) {
|
||||
return CURLE_OK;
|
||||
}
|
||||
else {
|
||||
/* timeout */
|
||||
failf(data, "SSL connection timeout");
|
||||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
}
|
||||
/* socket is readable or writable */
|
||||
}
|
||||
else
|
||||
break;
|
||||
} while(1);
|
||||
|
||||
if(rc < 0) {
|
||||
failf(data, "gnutls_handshake() failed: %s", gnutls_strerror(rc));
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
rc = gnutls_handshake(session);
|
||||
|
||||
if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) {
|
||||
connssl->connecting_state =
|
||||
gnutls_record_get_direction(session)?
|
||||
ssl_connect_2_writing:ssl_connect_2_reading;
|
||||
if(nonblocking) {
|
||||
return CURLE_OK;
|
||||
}
|
||||
} else if (rc < 0) {
|
||||
failf(data, "gnutls_handshake() failed: %s", gnutls_strerror(rc));
|
||||
} else {
|
||||
/* Reset our connect state machine */
|
||||
connssl->connecting_state = ssl_connect_1;
|
||||
return CURLE_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static gnutls_x509_crt_fmt do_file_type(const char *type)
|
||||
@@ -243,31 +265,14 @@ static gnutls_x509_crt_fmt do_file_type(const char *type)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This function is called after the TCP connect has completed. Setup the TLS
|
||||
* layer and do all necessary magic.
|
||||
*/
|
||||
CURLcode
|
||||
Curl_gtls_connect(struct connectdata *conn,
|
||||
int sockindex)
|
||||
|
||||
static CURLcode
|
||||
gtls_connect_step1(struct connectdata *conn,
|
||||
int sockindex)
|
||||
{
|
||||
static const int cert_type_priority[] = { GNUTLS_CRT_X509, 0 };
|
||||
struct SessionHandle *data = conn->data;
|
||||
gnutls_session session;
|
||||
int rc;
|
||||
unsigned int cert_list_size;
|
||||
const gnutls_datum *chainp;
|
||||
unsigned int verify_status;
|
||||
gnutls_x509_crt x509_cert,x509_issuer;
|
||||
gnutls_datum issuerp;
|
||||
char certbuf[256]; /* big enough? */
|
||||
size_t size;
|
||||
unsigned int algo;
|
||||
unsigned int bits;
|
||||
time_t certclock;
|
||||
const char *ptr;
|
||||
void *ssl_sessionid;
|
||||
size_t ssl_idsize;
|
||||
bool sni = TRUE; /* default is SNI enabled */
|
||||
@@ -411,10 +416,32 @@ Curl_gtls_connect(struct connectdata *conn,
|
||||
infof (data, "SSL re-using session ID\n");
|
||||
}
|
||||
|
||||
rc = handshake(conn, session, sockindex, TRUE);
|
||||
if(rc)
|
||||
/* handshake() sets its own error message with failf() */
|
||||
return rc;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static Curl_recv gtls_recv;
|
||||
static Curl_send gtls_send;
|
||||
|
||||
static CURLcode
|
||||
gtls_connect_step3(struct connectdata *conn,
|
||||
int sockindex)
|
||||
{
|
||||
unsigned int cert_list_size;
|
||||
const gnutls_datum *chainp;
|
||||
unsigned int verify_status;
|
||||
gnutls_x509_crt x509_cert,x509_issuer;
|
||||
gnutls_datum issuerp;
|
||||
char certbuf[256]; /* big enough? */
|
||||
size_t size;
|
||||
unsigned int algo;
|
||||
unsigned int bits;
|
||||
time_t certclock;
|
||||
const char *ptr;
|
||||
struct SessionHandle *data = conn->data;
|
||||
gnutls_session session = conn->ssl[sockindex].session;
|
||||
int rc;
|
||||
int incache;
|
||||
void *ssl_sessionid;
|
||||
|
||||
/* This function will return the peer's raw certificate (chain) as sent by
|
||||
the peer. These certificates are in raw format (DER encoded for
|
||||
@@ -606,6 +633,8 @@ Curl_gtls_connect(struct connectdata *conn,
|
||||
infof(data, "\t MAC: %s\n", ptr);
|
||||
|
||||
conn->ssl[sockindex].state = ssl_connection_complete;
|
||||
conn->recv[sockindex] = gtls_recv;
|
||||
conn->send[sockindex] = gtls_send;
|
||||
|
||||
{
|
||||
/* we always unconditionally get the session id here, as even if we
|
||||
@@ -623,33 +652,100 @@ Curl_gtls_connect(struct connectdata *conn,
|
||||
/* extract session ID to the allocated buffer */
|
||||
gnutls_session_get_data(session, connect_sessionid, &connect_idsize);
|
||||
|
||||
if(ssl_sessionid)
|
||||
incache = !(Curl_ssl_getsessionid(conn, &ssl_sessionid, NULL));
|
||||
if (incache) {
|
||||
/* there was one before in the cache, so instead of risking that the
|
||||
previous one was rejected, we just kill that and store the new */
|
||||
Curl_ssl_delsessionid(conn, ssl_sessionid);
|
||||
}
|
||||
|
||||
/* store this session id */
|
||||
return Curl_ssl_addsessionid(conn, connect_sessionid, connect_idsize);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
|
||||
/* for documentation see Curl_ssl_send() in sslgen.h */
|
||||
ssize_t Curl_gtls_send(struct connectdata *conn,
|
||||
int sockindex,
|
||||
const void *mem,
|
||||
size_t len,
|
||||
int *curlcode)
|
||||
/*
|
||||
* This function is called after the TCP connect has completed. Setup the TLS
|
||||
* layer and do all necessary magic.
|
||||
*/
|
||||
/* We use connssl->connecting_state to keep track of the connection status;
|
||||
there are three states: 'ssl_connect_1' (not started yet or complete),
|
||||
'ssl_connect_2_reading' (waiting for data from server), and
|
||||
'ssl_connect_2_writing' (waiting to be able to write).
|
||||
*/
|
||||
static CURLcode
|
||||
gtls_connect_common(struct connectdata *conn,
|
||||
int sockindex,
|
||||
bool nonblocking,
|
||||
bool *done)
|
||||
{
|
||||
int rc;
|
||||
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
|
||||
|
||||
/* Initiate the connection, if not already done */
|
||||
if(ssl_connect_1==connssl->connecting_state) {
|
||||
rc = gtls_connect_step1 (conn, sockindex);
|
||||
if(rc)
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = handshake(conn, sockindex, TRUE, nonblocking);
|
||||
if(rc)
|
||||
/* handshake() sets its own error message with failf() */
|
||||
return rc;
|
||||
|
||||
/* Finish connecting once the handshake is done */
|
||||
if(ssl_connect_1==connssl->connecting_state) {
|
||||
rc = gtls_connect_step3(conn, sockindex);
|
||||
if(rc)
|
||||
return rc;
|
||||
}
|
||||
|
||||
*done = ssl_connect_1==connssl->connecting_state;
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
CURLcode
|
||||
Curl_gtls_connect_nonblocking(struct connectdata *conn,
|
||||
int sockindex,
|
||||
bool *done)
|
||||
{
|
||||
return gtls_connect_common(conn, sockindex, TRUE, done);
|
||||
}
|
||||
|
||||
CURLcode
|
||||
Curl_gtls_connect(struct connectdata *conn,
|
||||
int sockindex)
|
||||
|
||||
{
|
||||
CURLcode retcode;
|
||||
bool done = FALSE;
|
||||
|
||||
retcode = gtls_connect_common(conn, sockindex, FALSE, &done);
|
||||
if(retcode)
|
||||
return retcode;
|
||||
|
||||
DEBUGASSERT(done);
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static ssize_t gtls_send(struct connectdata *conn,
|
||||
int sockindex,
|
||||
const void *mem,
|
||||
size_t len,
|
||||
CURLcode *curlcode)
|
||||
{
|
||||
ssize_t rc = gnutls_record_send(conn->ssl[sockindex].session, mem, len);
|
||||
|
||||
if(rc < 0 ) {
|
||||
*curlcode = (rc == GNUTLS_E_AGAIN)
|
||||
? /* EWOULDBLOCK */ -1
|
||||
? CURLE_AGAIN
|
||||
: CURLE_SEND_ERROR;
|
||||
|
||||
rc = -1;
|
||||
@@ -751,36 +847,29 @@ int Curl_gtls_shutdown(struct connectdata *conn, int sockindex)
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* for documentation see Curl_ssl_recv() in sslgen.h */
|
||||
ssize_t Curl_gtls_recv(struct connectdata *conn, /* connection data */
|
||||
int num, /* socketindex */
|
||||
char *buf, /* store read data here */
|
||||
size_t buffersize, /* max amount to read */
|
||||
int *curlcode)
|
||||
static ssize_t gtls_recv(struct connectdata *conn, /* connection data */
|
||||
int num, /* socketindex */
|
||||
char *buf, /* store read data here */
|
||||
size_t buffersize, /* max amount to read */
|
||||
CURLcode *curlcode)
|
||||
{
|
||||
ssize_t ret;
|
||||
|
||||
ret = gnutls_record_recv(conn->ssl[num].session, buf, buffersize);
|
||||
if((ret == GNUTLS_E_AGAIN) || (ret == GNUTLS_E_INTERRUPTED)) {
|
||||
*curlcode = -1;
|
||||
*curlcode = CURLE_AGAIN;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(ret == GNUTLS_E_REHANDSHAKE) {
|
||||
/* BLOCKING call, this is bad but a work-around for now. Fixing this "the
|
||||
proper way" takes a whole lot of work. */
|
||||
CURLcode rc = handshake(conn, conn->ssl[num].session, num, FALSE);
|
||||
CURLcode rc = handshake(conn, num, FALSE, FALSE);
|
||||
if(rc)
|
||||
/* handshake() writes error message on its own */
|
||||
*curlcode = rc;
|
||||
else
|
||||
*curlcode = -1; /* then return as if this was a wouldblock */
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!ret) {
|
||||
failf(conn->data, "Peer closed the TLS connection");
|
||||
*curlcode = CURLE_RECV_ERROR;
|
||||
*curlcode = CURLE_AGAIN; /* then return as if this was a wouldblock */
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
14
lib/gtls.h
14
lib/gtls.h
@@ -27,6 +27,9 @@
|
||||
int Curl_gtls_init(void);
|
||||
int Curl_gtls_cleanup(void);
|
||||
CURLcode Curl_gtls_connect(struct connectdata *conn, int sockindex);
|
||||
CURLcode Curl_gtls_connect_nonblocking(struct connectdata *conn,
|
||||
int sockindex,
|
||||
bool *done);
|
||||
|
||||
/* tell GnuTLS to close down all open information regarding connections (and
|
||||
thus session ID caching etc) */
|
||||
@@ -35,14 +38,6 @@ void Curl_gtls_close_all(struct SessionHandle *data);
|
||||
/* close a SSL connection */
|
||||
void Curl_gtls_close(struct connectdata *conn, int sockindex);
|
||||
|
||||
/* for documentation see Curl_ssl_send() in sslgen.h */
|
||||
ssize_t Curl_gtls_send(struct connectdata *conn, int sockindex,
|
||||
const void *mem, size_t len, int *curlcode);
|
||||
|
||||
/* for documentation see Curl_ssl_recv() in sslgen.h */
|
||||
ssize_t Curl_gtls_recv(struct connectdata *conn, int num, char *buf,
|
||||
size_t buffersize, int *curlcode);
|
||||
|
||||
void Curl_gtls_session_free(void *ptr);
|
||||
size_t Curl_gtls_version(char *buffer, size_t size);
|
||||
int Curl_gtls_shutdown(struct connectdata *conn, int sockindex);
|
||||
@@ -52,6 +47,7 @@ int Curl_gtls_seed(struct SessionHandle *data);
|
||||
#define curlssl_init Curl_gtls_init
|
||||
#define curlssl_cleanup Curl_gtls_cleanup
|
||||
#define curlssl_connect Curl_gtls_connect
|
||||
#define curlssl_connect_nonblocking Curl_gtls_connect_nonblocking
|
||||
#define curlssl_session_free(x) Curl_gtls_session_free(x)
|
||||
#define curlssl_close_all Curl_gtls_close_all
|
||||
#define curlssl_close Curl_gtls_close
|
||||
@@ -59,8 +55,6 @@ int Curl_gtls_seed(struct SessionHandle *data);
|
||||
#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_FAILED_INIT)
|
||||
#define curlssl_set_engine_default(x) (x=x, CURLE_FAILED_INIT)
|
||||
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
|
||||
#define curlssl_send Curl_gtls_send
|
||||
#define curlssl_recv Curl_gtls_recv
|
||||
#define curlssl_version Curl_gtls_version
|
||||
#define curlssl_check_cxn(x) (x=x, -1)
|
||||
#define curlssl_data_pending(x,y) (x=x, y=y, 0)
|
||||
|
131
lib/hmac.c
Normal file
131
lib/hmac.c
Normal file
@@ -0,0 +1,131 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* 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.
|
||||
*
|
||||
* RFC2104 Keyed-Hashing for Message Authentication
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||
|
||||
#include "curl_hmac.h"
|
||||
|
||||
#define _MPRINTF_REPLACE /* use our functions only */
|
||||
#include <curl/mprintf.h>
|
||||
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
/*
|
||||
* Generic HMAC algorithm.
|
||||
*
|
||||
* This module computes HMAC digests based on any hash function. Parameters
|
||||
* and computing procedures are set-up dynamically at HMAC computation
|
||||
* context initialisation.
|
||||
*/
|
||||
|
||||
static const unsigned char hmac_ipad = 0x36;
|
||||
static const unsigned char hmac_opad = 0x5C;
|
||||
|
||||
|
||||
|
||||
HMAC_context *
|
||||
Curl_HMAC_init(const HMAC_params * hashparams,
|
||||
const unsigned char * key,
|
||||
unsigned int keylen)
|
||||
{
|
||||
size_t i;
|
||||
HMAC_context * ctxt;
|
||||
unsigned char * hkey;
|
||||
unsigned char b;
|
||||
|
||||
/* Create HMAC context. */
|
||||
i = sizeof *ctxt + 2 * hashparams->hmac_ctxtsize + hashparams->hmac_resultlen;
|
||||
ctxt = (HMAC_context *) malloc(i);
|
||||
|
||||
if(!ctxt)
|
||||
return ctxt;
|
||||
|
||||
ctxt->hmac_hash = hashparams;
|
||||
ctxt->hmac_hashctxt1 = (void *) (ctxt + 1);
|
||||
ctxt->hmac_hashctxt2 = (void *) ((char *) ctxt->hmac_hashctxt1 +
|
||||
hashparams->hmac_ctxtsize);
|
||||
|
||||
/* If the key is too long, replace it by its hash digest. */
|
||||
if(keylen > hashparams->hmac_maxkeylen) {
|
||||
(*hashparams->hmac_hinit)(ctxt->hmac_hashctxt1);
|
||||
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, key, keylen);
|
||||
hkey = (unsigned char *) ctxt->hmac_hashctxt2 + hashparams->hmac_ctxtsize;
|
||||
(*hashparams->hmac_hfinal)(hkey, ctxt->hmac_hashctxt1);
|
||||
key = hkey;
|
||||
keylen = hashparams->hmac_resultlen;
|
||||
}
|
||||
|
||||
/* Prime the two hash contexts with the modified key. */
|
||||
(*hashparams->hmac_hinit)(ctxt->hmac_hashctxt1);
|
||||
(*hashparams->hmac_hinit)(ctxt->hmac_hashctxt2);
|
||||
|
||||
for (i = 0; i < keylen; i++) {
|
||||
b = *key ^ hmac_ipad;
|
||||
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &b, 1);
|
||||
b = *key++ ^ hmac_opad;
|
||||
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &b, 1);
|
||||
}
|
||||
|
||||
for (; i < hashparams->hmac_maxkeylen; i++) {
|
||||
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt1, &hmac_ipad, 1);
|
||||
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2, &hmac_opad, 1);
|
||||
}
|
||||
|
||||
/* Done, return pointer to HMAC context. */
|
||||
return ctxt;
|
||||
}
|
||||
|
||||
int Curl_HMAC_update(HMAC_context * ctxt,
|
||||
const unsigned char * data,
|
||||
unsigned int len)
|
||||
{
|
||||
/* Update first hash calculation. */
|
||||
(*ctxt->hmac_hash->hmac_hupdate)(ctxt->hmac_hashctxt1, data, len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int Curl_HMAC_final(HMAC_context * ctxt, unsigned char * result)
|
||||
{
|
||||
const HMAC_params * hashparams = ctxt->hmac_hash;
|
||||
|
||||
/* Do not get result if called with a null parameter: only release storage. */
|
||||
|
||||
if(!result)
|
||||
result = (unsigned char *) ctxt->hmac_hashctxt2 +
|
||||
ctxt->hmac_hash->hmac_ctxtsize;
|
||||
|
||||
(*hashparams->hmac_hfinal)(result, ctxt->hmac_hashctxt1);
|
||||
(*hashparams->hmac_hupdate)(ctxt->hmac_hashctxt2,
|
||||
result, hashparams->hmac_resultlen);
|
||||
(*hashparams->hmac_hfinal)(result, ctxt->hmac_hashctxt2);
|
||||
free((char *) ctxt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CURL_DISABLE_CRYPTO_AUTH */
|
@@ -251,7 +251,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
|
||||
second is left, otherwise just use 1000ms to make sure the progress
|
||||
callback gets called frequent enough */
|
||||
if(!tvp->tv_sec)
|
||||
timeout_ms = tvp->tv_usec/1000;
|
||||
timeout_ms = (int)(tvp->tv_usec/1000);
|
||||
else
|
||||
timeout_ms = 1000;
|
||||
|
||||
|
@@ -160,7 +160,7 @@ Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname,
|
||||
snprintf(sbuf, sizeof(sbuf), "%d", port);
|
||||
sbufptr = sbuf;
|
||||
}
|
||||
hints.ai_flags = AI_CANONNAME;
|
||||
|
||||
(void)Curl_getaddrinfo_ex(hostname, sbufptr, &hints, &ai);
|
||||
|
||||
#elif defined(HAVE_GETHOSTBYNAME_R)
|
||||
|
@@ -213,11 +213,6 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
||||
/* the given address is numerical only, prevent a reverse lookup */
|
||||
hints.ai_flags = AI_NUMERICHOST;
|
||||
}
|
||||
#ifdef HAVE_GSSAPI
|
||||
if(conn->data->set.krb)
|
||||
/* if krb is used, we (might) need the canonical host name */
|
||||
hints.ai_flags |= AI_CANONNAME;
|
||||
#endif
|
||||
|
||||
if(port) {
|
||||
snprintf(sbuf, sizeof(sbuf), "%d", port);
|
||||
|
@@ -451,6 +451,9 @@ CURLcode Curl_is_resolved(struct connectdata *conn,
|
||||
|
||||
td->interval_end = elapsed + td->poll_interval;
|
||||
|
||||
/* Reset old timer so we can set a new one further in the future */
|
||||
Curl_expire(conn->data, 0);
|
||||
|
||||
Curl_expire(conn->data, td->poll_interval);
|
||||
}
|
||||
|
||||
@@ -484,8 +487,6 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
||||
int port,
|
||||
int *waitp)
|
||||
{
|
||||
struct hostent *h = NULL;
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct in_addr in;
|
||||
|
||||
*waitp = 0; /* default to synchronous response */
|
||||
@@ -561,9 +562,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = pf;
|
||||
hints.ai_socktype = conn->socktype;
|
||||
#if 0 /* removed nov 8 2005 before 7.15.1 */
|
||||
hints.ai_flags = AI_CANONNAME;
|
||||
#endif
|
||||
|
||||
snprintf(sbuf, sizeof(sbuf), "%d", port);
|
||||
|
||||
/* fire up a new resolver thread! */
|
||||
|
110
lib/http.c
110
lib/http.c
@@ -977,12 +977,15 @@ Curl_send_buffer *Curl_add_buffer_init(void)
|
||||
* Returns CURLcode
|
||||
*/
|
||||
CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
|
||||
struct connectdata *conn,
|
||||
long *bytes_written, /* add the number of sent bytes
|
||||
to this counter */
|
||||
size_t included_body_bytes, /* how much of the buffer
|
||||
contains body data */
|
||||
int socketindex)
|
||||
struct connectdata *conn,
|
||||
|
||||
/* add the number of sent bytes to this
|
||||
counter */
|
||||
long *bytes_written,
|
||||
|
||||
/* how much of the buffer contains body data */
|
||||
size_t included_body_bytes,
|
||||
int socketindex)
|
||||
|
||||
{
|
||||
ssize_t amount;
|
||||
@@ -1069,7 +1072,10 @@ CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
|
||||
accordingly */
|
||||
http->writebytecount += bodylen;
|
||||
|
||||
*bytes_written += amount;
|
||||
/* 'amount' can never be a very large value here so typecasting it so a
|
||||
signed 31 bit value should not cause problems even if ssize_t is
|
||||
64bit */
|
||||
*bytes_written += (long)amount;
|
||||
|
||||
if(http) {
|
||||
if((size_t)amount != size) {
|
||||
@@ -1283,7 +1289,6 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
||||
struct SessionHandle *data=conn->data;
|
||||
struct SingleRequest *k = &data->req;
|
||||
CURLcode result;
|
||||
int res;
|
||||
long timeout =
|
||||
data->set.timeout?data->set.timeout:PROXY_TIMEOUT; /* in milliseconds */
|
||||
curl_socket_t tunnelsocket = conn->sock[sockindex];
|
||||
@@ -1381,7 +1386,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
||||
if(CURLE_OK == result) {
|
||||
/* Now send off the request */
|
||||
result = Curl_add_buffer_send(req_buffer, conn,
|
||||
&data->info.request_size, 0, sockindex);
|
||||
&data->info.request_size, 0, sockindex);
|
||||
}
|
||||
req_buffer = NULL;
|
||||
if(result)
|
||||
@@ -1467,11 +1472,10 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
|
||||
break;
|
||||
default:
|
||||
DEBUGASSERT(ptr+BUFSIZE-nread <= data->state.buffer+BUFSIZE+1);
|
||||
res = Curl_read(conn, tunnelsocket, ptr, BUFSIZE-nread, &gotbytes);
|
||||
if(res< 0)
|
||||
/* EWOULDBLOCK */
|
||||
result = Curl_read(conn, tunnelsocket, ptr, BUFSIZE-nread, &gotbytes);
|
||||
if(result==CURLE_AGAIN)
|
||||
continue; /* go loop yourself */
|
||||
else if(res)
|
||||
else if(result)
|
||||
keepon = FALSE;
|
||||
else if(gotbytes <= 0) {
|
||||
keepon = FALSE;
|
||||
@@ -1817,9 +1821,9 @@ static CURLcode https_connecting(struct connectdata *conn, bool *done)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_SSLEAY
|
||||
/* This function is OpenSSL-specific. It should be made to query the generic
|
||||
SSL layer instead. */
|
||||
#if defined(USE_SSLEAY) || defined(USE_GNUTLS)
|
||||
/* This function is for OpenSSL and GnuTLS only. It should be made to query
|
||||
the generic SSL layer instead. */
|
||||
static int https_getsock(struct connectdata *conn,
|
||||
curl_socket_t *socks,
|
||||
int numsocks)
|
||||
@@ -1844,17 +1848,6 @@ static int https_getsock(struct connectdata *conn,
|
||||
return CURLE_OK;
|
||||
}
|
||||
#else
|
||||
#ifdef USE_GNUTLS
|
||||
static int https_getsock(struct connectdata *conn,
|
||||
curl_socket_t *socks,
|
||||
int numsocks)
|
||||
{
|
||||
(void)conn;
|
||||
(void)socks;
|
||||
(void)numsocks;
|
||||
return GETSOCK_BLANK;
|
||||
}
|
||||
#else
|
||||
#ifdef USE_NSS
|
||||
static int https_getsock(struct connectdata *conn,
|
||||
curl_socket_t *socks,
|
||||
@@ -1876,6 +1869,17 @@ static int https_getsock(struct connectdata *conn,
|
||||
(void)numsocks;
|
||||
return GETSOCK_BLANK;
|
||||
}
|
||||
#else
|
||||
#ifdef USE_POLARSSL
|
||||
static int https_getsock(struct connectdata *conn,
|
||||
curl_socket_t *socks,
|
||||
int numsocks)
|
||||
{
|
||||
(void)conn;
|
||||
(void)socks;
|
||||
(void)numsocks;
|
||||
return GETSOCK_BLANK;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
@@ -2224,7 +2228,10 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
if((conn->protocol&PROT_HTTP) &&
|
||||
data->set.upload &&
|
||||
(data->set.infilesize == -1)) {
|
||||
if (use_http_1_1(data, conn)) {
|
||||
if(conn->bits.authneg)
|
||||
/* don't enable chunked during auth neg */
|
||||
;
|
||||
else if(use_http_1_1(data, conn)) {
|
||||
/* HTTP, upload, unknown file size and not HTTP 1.0 */
|
||||
data->req.upload_chunky = TRUE;
|
||||
}
|
||||
@@ -2529,7 +2536,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
/* url */
|
||||
if (paste_ftp_userpwd)
|
||||
result = Curl_add_bufferf(req_buffer, "ftp://%s:%s@%s",
|
||||
conn->user, conn->passwd, ppath + sizeof("ftp://") - 1);
|
||||
conn->user, conn->passwd,
|
||||
ppath + sizeof("ftp://") - 1);
|
||||
else
|
||||
result = Curl_add_buffer(req_buffer, ppath, strlen(ppath));
|
||||
if (result)
|
||||
@@ -2665,14 +2673,13 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
return result;
|
||||
|
||||
result = Curl_add_buffer_send(req_buffer, conn,
|
||||
&data->info.request_size, 0, FIRSTSOCKET);
|
||||
&data->info.request_size, 0, FIRSTSOCKET);
|
||||
if(result)
|
||||
failf(data, "Failed sending POST request");
|
||||
else
|
||||
/* setup variables for the upcoming transfer */
|
||||
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount,
|
||||
-1, NULL);
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount,
|
||||
-1, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2735,15 +2742,14 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
|
||||
/* fire away the whole request to the server */
|
||||
result = Curl_add_buffer_send(req_buffer, conn,
|
||||
&data->info.request_size, 0, FIRSTSOCKET);
|
||||
&data->info.request_size, 0, FIRSTSOCKET);
|
||||
if(result)
|
||||
failf(data, "Failed sending POST request");
|
||||
else
|
||||
/* setup variables for the upcoming transfer */
|
||||
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount,
|
||||
FIRSTSOCKET,
|
||||
&http->writebytecount);
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount, FIRSTSOCKET,
|
||||
&http->writebytecount);
|
||||
|
||||
if(result) {
|
||||
Curl_formclean(&http->sendit); /* free that whole lot */
|
||||
@@ -2788,15 +2794,14 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
|
||||
/* this sends the buffer and frees all the buffer resources */
|
||||
result = Curl_add_buffer_send(req_buffer, conn,
|
||||
&data->info.request_size, 0, FIRSTSOCKET);
|
||||
&data->info.request_size, 0, FIRSTSOCKET);
|
||||
if(result)
|
||||
failf(data, "Failed sending PUT request");
|
||||
else
|
||||
/* prepare for transfer */
|
||||
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount,
|
||||
postsize?FIRSTSOCKET:-1,
|
||||
postsize?&http->writebytecount:NULL);
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount, postsize?FIRSTSOCKET:-1,
|
||||
postsize?&http->writebytecount:NULL);
|
||||
if(result)
|
||||
return result;
|
||||
break;
|
||||
@@ -2938,16 +2943,14 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
}
|
||||
/* issue the request */
|
||||
result = Curl_add_buffer_send(req_buffer, conn, &data->info.request_size,
|
||||
(size_t)included_body, FIRSTSOCKET);
|
||||
(size_t)included_body, FIRSTSOCKET);
|
||||
|
||||
if(result)
|
||||
failf(data, "Failed sending HTTP POST request");
|
||||
else
|
||||
result =
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount,
|
||||
http->postdata?FIRSTSOCKET:-1,
|
||||
http->postdata?&http->writebytecount:NULL);
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount, http->postdata?FIRSTSOCKET:-1,
|
||||
http->postdata?&http->writebytecount:NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -2957,16 +2960,15 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
|
||||
/* issue the request */
|
||||
result = Curl_add_buffer_send(req_buffer, conn,
|
||||
&data->info.request_size, 0, FIRSTSOCKET);
|
||||
&data->info.request_size, 0, FIRSTSOCKET);
|
||||
|
||||
if(result)
|
||||
failf(data, "Failed sending HTTP request");
|
||||
else
|
||||
/* HTTP GET/HEAD download: */
|
||||
result = Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE,
|
||||
&http->readbytecount,
|
||||
http->postdata?FIRSTSOCKET:-1,
|
||||
http->postdata?&http->writebytecount:NULL);
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, -1, TRUE, &http->readbytecount,
|
||||
http->postdata?FIRSTSOCKET:-1,
|
||||
http->postdata?&http->writebytecount:NULL);
|
||||
}
|
||||
if(result)
|
||||
return result;
|
||||
|
@@ -56,11 +56,10 @@ Curl_send_buffer *Curl_add_buffer_init(void);
|
||||
CURLcode Curl_add_bufferf(Curl_send_buffer *in, const char *fmt, ...);
|
||||
CURLcode Curl_add_buffer(Curl_send_buffer *in, const void *inptr, size_t size);
|
||||
CURLcode Curl_add_buffer_send(Curl_send_buffer *in,
|
||||
struct connectdata *conn,
|
||||
long *bytes_written,
|
||||
size_t included_body_bytes,
|
||||
int socketindex);
|
||||
|
||||
struct connectdata *conn,
|
||||
long *bytes_written,
|
||||
size_t included_body_bytes,
|
||||
int socketindex);
|
||||
|
||||
CURLcode Curl_add_timecondition(struct SessionHandle *data,
|
||||
Curl_send_buffer *buf);
|
||||
|
@@ -305,9 +305,15 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
|
||||
infof(conn->data, "Make SPNEGO Initial Token failed\n");
|
||||
}
|
||||
else {
|
||||
free(neg_ctx->output_token.value);
|
||||
free(responseToken);
|
||||
responseToken = NULL;
|
||||
free(neg_ctx->output_token.value);
|
||||
neg_ctx->output_token.value = malloc(spnegoTokenLength);
|
||||
if(neg_ctx->output_token.value == NULL) {
|
||||
free(spnegoToken);
|
||||
spnegoToken = NULL;
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
memcpy(neg_ctx->output_token.value, spnegoToken,spnegoTokenLength);
|
||||
neg_ctx->output_token.length = spnegoTokenLength;
|
||||
free(spnegoToken);
|
||||
|
129
lib/http_ntlm.c
129
lib/http_ntlm.c
@@ -58,6 +58,7 @@
|
||||
#include "curl_base64.h"
|
||||
#include "http_ntlm.h"
|
||||
#include "url.h"
|
||||
#include "curl_gethostname.h"
|
||||
#include "curl_memory.h"
|
||||
|
||||
#define _MPRINTF_REPLACE /* use our functions only */
|
||||
@@ -116,6 +117,15 @@
|
||||
#define MD5_DIGEST_LENGTH 16
|
||||
#define MD4_DIGEST_LENGTH 16
|
||||
|
||||
#elif defined(USE_NSS)
|
||||
|
||||
#include "curl_md4.h"
|
||||
#include "nssg.h"
|
||||
#include <nss.h>
|
||||
#include <pk11pub.h>
|
||||
#include <hasht.h>
|
||||
#define MD5_DIGEST_LENGTH MD5_LENGTH
|
||||
|
||||
#elif defined(USE_WINDOWS_SSPI)
|
||||
|
||||
#include "curl_sspi.h"
|
||||
@@ -250,6 +260,11 @@ CURLntlm Curl_input_ntlm(struct connectdata *conn,
|
||||
static const char type2_marker[] = { 0x02, 0x00, 0x00, 0x00 };
|
||||
#endif
|
||||
|
||||
#ifdef USE_NSS
|
||||
if(CURLE_OK != Curl_nss_force_init(conn->data))
|
||||
return CURLNTLM_BAD;
|
||||
#endif
|
||||
|
||||
ntlm = proxy?&conn->proxyntlm:&conn->ntlm;
|
||||
|
||||
/* skip initial whitespaces */
|
||||
@@ -351,16 +366,14 @@ static void setup_des_key(const unsigned char *key_56,
|
||||
DES_set_odd_parity(&key);
|
||||
DES_set_key(&key, ks);
|
||||
}
|
||||
#elif defined(USE_GNUTLS)
|
||||
|
||||
#else /* defined(USE_SSLEAY) */
|
||||
|
||||
/*
|
||||
* Turns a 56 bit key into the 64 bit, odd parity key and sets the key.
|
||||
* Turns a 56 bit key into the 64 bit, odd parity key. Used by GnuTLS and NSS.
|
||||
*/
|
||||
static void setup_des_key(const unsigned char *key_56,
|
||||
gcry_cipher_hd_t *des)
|
||||
static void extend_key_56_to_64(const unsigned char *key_56, char *key)
|
||||
{
|
||||
char key[8];
|
||||
|
||||
key[0] = key_56[0];
|
||||
key[1] = (unsigned char)(((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1));
|
||||
key[2] = (unsigned char)(((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2));
|
||||
@@ -369,10 +382,84 @@ static void setup_des_key(const unsigned char *key_56,
|
||||
key[5] = (unsigned char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5));
|
||||
key[6] = (unsigned char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6));
|
||||
key[7] = (unsigned char) ((key_56[6] << 1) & 0xFF);
|
||||
}
|
||||
|
||||
#if defined(USE_GNUTLS)
|
||||
|
||||
/*
|
||||
* Turns a 56 bit key into the 64 bit, odd parity key and sets the key.
|
||||
*/
|
||||
static void setup_des_key(const unsigned char *key_56,
|
||||
gcry_cipher_hd_t *des)
|
||||
{
|
||||
char key[8];
|
||||
extend_key_56_to_64(key_56, key);
|
||||
gcry_cipher_setkey(*des, key, 8);
|
||||
}
|
||||
#endif
|
||||
|
||||
#elif defined(USE_NSS)
|
||||
|
||||
/*
|
||||
* Expands a 56 bit key KEY_56 to 64 bit and encrypts 64 bit of data, using
|
||||
* the expanded key. The caller is responsible for giving 64 bit of valid
|
||||
* data is IN and (at least) 64 bit large buffer as OUT.
|
||||
*/
|
||||
static bool encrypt_des(const unsigned char *in, unsigned char *out,
|
||||
const unsigned char *key_56)
|
||||
{
|
||||
const CK_MECHANISM_TYPE mech = CKM_DES_ECB; /* DES cipher in ECB mode */
|
||||
PK11SlotInfo *slot = NULL;
|
||||
char key[8]; /* expanded 64 bit key */
|
||||
SECItem key_item;
|
||||
PK11SymKey *symkey = NULL;
|
||||
SECItem *param = NULL;
|
||||
PK11Context *ctx = NULL;
|
||||
int out_len; /* not used, required by NSS */
|
||||
bool rv = FALSE;
|
||||
|
||||
/* use internal slot for DES encryption (requires NSS to be initialized) */
|
||||
slot = PK11_GetInternalKeySlot();
|
||||
if(!slot)
|
||||
return FALSE;
|
||||
|
||||
/* expand the 56 bit key to 64 bit and wrap by NSS */
|
||||
extend_key_56_to_64(key_56, key);
|
||||
key_item.data = (unsigned char *)key;
|
||||
key_item.len = /* hard-wired */ 8;
|
||||
symkey = PK11_ImportSymKey(slot, mech, PK11_OriginUnwrap, CKA_ENCRYPT,
|
||||
&key_item, NULL);
|
||||
if(!symkey)
|
||||
goto fail;
|
||||
|
||||
/* create DES encryption context */
|
||||
param = PK11_ParamFromIV(mech, /* no IV in ECB mode */ NULL);
|
||||
if(!param)
|
||||
goto fail;
|
||||
ctx = PK11_CreateContextBySymKey(mech, CKA_ENCRYPT, symkey, param);
|
||||
if(!ctx)
|
||||
goto fail;
|
||||
|
||||
/* perform the encryption */
|
||||
if(SECSuccess == PK11_CipherOp(ctx, out, &out_len, /* outbuflen */ 8,
|
||||
(unsigned char *)in, /* inbuflen */ 8)
|
||||
&& SECSuccess == PK11_Finalize(ctx))
|
||||
rv = /* all OK */ TRUE;
|
||||
|
||||
fail:
|
||||
/* cleanup */
|
||||
if(ctx)
|
||||
PK11_DestroyContext(ctx, PR_TRUE);
|
||||
if(symkey)
|
||||
PK11_FreeSymKey(symkey);
|
||||
if(param)
|
||||
SECITEM_FreeItem(param, PR_TRUE);
|
||||
PK11_FreeSlot(slot);
|
||||
return rv;
|
||||
}
|
||||
|
||||
#endif /* defined(USE_NSS) */
|
||||
|
||||
#endif /* defined(USE_SSLEAY) */
|
||||
|
||||
/*
|
||||
* takes a 21 byte array and treats it as 3 56-bit DES keys. The
|
||||
@@ -414,6 +501,10 @@ static void lm_resp(const unsigned char *keys,
|
||||
setup_des_key(keys+14, &des);
|
||||
gcry_cipher_encrypt(des, results+16, 8, plaintext, 8);
|
||||
gcry_cipher_close(des);
|
||||
#elif defined(USE_NSS)
|
||||
encrypt_des(plaintext, results, keys);
|
||||
encrypt_des(plaintext, results+8, keys+7);
|
||||
encrypt_des(plaintext, results+16, keys+14);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -470,11 +561,14 @@ static void mk_lm_hash(struct SessionHandle *data,
|
||||
setup_des_key(pw+7, &des);
|
||||
gcry_cipher_encrypt(des, lmbuffer+8, 8, magic, 8);
|
||||
gcry_cipher_close(des);
|
||||
#elif defined(USE_NSS)
|
||||
encrypt_des(magic, lmbuffer, pw);
|
||||
encrypt_des(magic, lmbuffer+8, pw+7);
|
||||
#endif
|
||||
|
||||
memset(lmbuffer + 16, 0, 21 - 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if USE_NTRESPONSES
|
||||
static void ascii_to_unicode_le(unsigned char *dest, const char *src,
|
||||
@@ -525,6 +619,8 @@ static CURLcode mk_nt_hash(struct SessionHandle *data,
|
||||
gcry_md_write(MD4pw, pw, 2*len);
|
||||
memcpy (ntbuffer, gcry_md_read (MD4pw, 0), MD4_DIGEST_LENGTH);
|
||||
gcry_md_close(MD4pw);
|
||||
#elif defined(USE_NSS)
|
||||
Curl_md4it(ntbuffer, pw, 2*len);
|
||||
#endif
|
||||
|
||||
memset(ntbuffer + 16, 0, 21 - 16);
|
||||
@@ -599,6 +695,11 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
|
||||
DEBUGASSERT(conn);
|
||||
DEBUGASSERT(conn->data);
|
||||
|
||||
#ifdef USE_NSS
|
||||
if(CURLE_OK != Curl_nss_force_init(conn->data))
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
#endif
|
||||
|
||||
if(proxy) {
|
||||
allocuserpwd = &conn->allocptr.proxyuserpwd;
|
||||
userp = conn->proxyuser;
|
||||
@@ -894,7 +995,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
|
||||
user = userp;
|
||||
userlen = strlen(user);
|
||||
|
||||
if(gethostname(host, HOSTNAME_MAX)) {
|
||||
if(Curl_gethostname(host, HOSTNAME_MAX)) {
|
||||
infof(conn->data, "gethostname() failed, continuing without!");
|
||||
hostlen = 0;
|
||||
}
|
||||
@@ -926,6 +1027,11 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
|
||||
gcry_md_hd_t MD5pw;
|
||||
Curl_gtls_seed(conn->data); /* Initiate the seed if not already done */
|
||||
gcry_randomize(entropy, 8, GCRY_STRONG_RANDOM);
|
||||
#elif defined(USE_NSS)
|
||||
PK11Context *MD5pw;
|
||||
unsigned int outlen;
|
||||
Curl_nss_seed(conn->data); /* Initiate the seed if not already done */
|
||||
PK11_GenerateRandom(entropy, 8);
|
||||
#endif
|
||||
|
||||
/* 8 bytes random data as challenge in lmresp */
|
||||
@@ -946,6 +1052,11 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
|
||||
gcry_md_write(MD5pw, tmp, MD5_DIGEST_LENGTH);
|
||||
memcpy(md5sum, gcry_md_read (MD5pw, 0), MD5_DIGEST_LENGTH);
|
||||
gcry_md_close(MD5pw);
|
||||
#elif defined(USE_NSS)
|
||||
MD5pw = PK11_CreateDigestContext(SEC_OID_MD5);
|
||||
PK11_DigestOp(MD5pw, tmp, 16);
|
||||
PK11_DigestFinal(MD5pw, md5sum, &outlen, MD5_DIGEST_LENGTH);
|
||||
PK11_DestroyContext(MD5pw, PR_TRUE);
|
||||
#endif
|
||||
|
||||
/* We shall only use the first 8 bytes of md5sum,
|
||||
|
12
lib/imap.c
12
lib/imap.c
@@ -436,12 +436,11 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn,
|
||||
|
||||
if(!filesize)
|
||||
/* the entire data is already transfered! */
|
||||
result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
else
|
||||
/* IMAP download */
|
||||
result=Curl_setup_transfer(conn, FIRSTSOCKET, filesize, FALSE,
|
||||
imap->bytecountp,
|
||||
-1, NULL); /* no upload here */
|
||||
Curl_setup_transfer(conn, FIRSTSOCKET, filesize, FALSE,
|
||||
imap->bytecountp, -1, NULL); /* no upload here */
|
||||
|
||||
data->req.maxdownload = filesize;
|
||||
}
|
||||
@@ -924,15 +923,14 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
|
||||
static CURLcode imap_dophase_done(struct connectdata *conn,
|
||||
bool connected)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
struct FTP *imap = conn->data->state.proto.imap;
|
||||
(void)connected;
|
||||
|
||||
if(imap->transfer != FTPTRANSFER_BODY)
|
||||
/* no data to transfer */
|
||||
result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
|
||||
|
||||
return result;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* called from multi.c while DOing */
|
||||
|
@@ -159,7 +159,7 @@ inet_pton6(const char *src, unsigned char *dst)
|
||||
unsigned char tmp[IN6ADDRSZ], *tp, *endp, *colonp;
|
||||
const char *xdigits, *curtok;
|
||||
int ch, saw_xdigit;
|
||||
unsigned int val;
|
||||
size_t val;
|
||||
|
||||
memset((tp = tmp), 0, IN6ADDRSZ);
|
||||
endp = tp + IN6ADDRSZ;
|
||||
@@ -218,8 +218,8 @@ inet_pton6(const char *src, unsigned char *dst)
|
||||
* Since some memmove()'s erroneously fail to handle
|
||||
* overlapping regions, we'll do the shift by hand.
|
||||
*/
|
||||
const long n = tp - colonp;
|
||||
long i;
|
||||
const size_t n = tp - colonp;
|
||||
size_t i;
|
||||
|
||||
if(tp == endp)
|
||||
return (0);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2006, 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
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -51,14 +51,11 @@ int Curl_sec_fflush_fd(struct connectdata *conn, int fd);
|
||||
int Curl_sec_fprintf (struct connectdata *, FILE *, const char *, ...);
|
||||
int Curl_sec_getc (struct connectdata *conn, FILE *);
|
||||
int Curl_sec_putc (struct connectdata *conn, int, FILE *);
|
||||
int Curl_sec_read (struct connectdata *conn, int, void *, int);
|
||||
int Curl_sec_read_msg (struct connectdata *conn, char *, int);
|
||||
|
||||
int Curl_sec_vfprintf(struct connectdata *, FILE *, const char *, va_list);
|
||||
int Curl_sec_fprintf2(struct connectdata *conn, FILE *f, const char *fmt, ...);
|
||||
int Curl_sec_vfprintf2(struct connectdata *conn, FILE *, const char *, va_list);
|
||||
ssize_t Curl_sec_send(struct connectdata *conn, int, const char *, int);
|
||||
int Curl_sec_write(struct connectdata *conn, int, const char *, int);
|
||||
|
||||
void Curl_sec_end (struct connectdata *);
|
||||
int Curl_sec_login (struct connectdata *);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* GSSAPI/krb5 support for FTP - loosely based on old krb4.c
|
||||
*
|
||||
* Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1995, 1996, 1997, 1998, 1999, 2010 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* Copyright (c) 2004 - 2009 Daniel Stenberg
|
||||
* All rights reserved.
|
||||
@@ -163,7 +163,7 @@ krb5_auth(void *app_data, struct connectdata *conn)
|
||||
{
|
||||
int ret;
|
||||
char *p;
|
||||
const char *host = conn->dns_entry->addr->ai_canonname;
|
||||
const char *host = conn->host.name;
|
||||
ssize_t nread;
|
||||
curl_socklen_t l = sizeof(conn->local_addr);
|
||||
struct SessionHandle *data = conn->data;
|
||||
|
42
lib/ldap.c
42
lib/ldap.c
@@ -5,7 +5,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
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -22,7 +22,19 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef CURL_DISABLE_LDAP
|
||||
#if !defined(CURL_DISABLE_LDAP) && !defined(USE_OPENLDAP)
|
||||
|
||||
/*
|
||||
* Notice that USE_OPENLDAP is only a source code selection switch. When
|
||||
* libcurl is built with USE_OPENLDAP defined the libcurl source code that
|
||||
* gets compiled is the code from openldap.c, otherwise the code that gets
|
||||
* compiled is the code from ldap.c.
|
||||
*
|
||||
* When USE_OPENLDAP is defined a recent version of the OpenLDAP library
|
||||
* might be required for compilation and runtime. In order to use ancient
|
||||
* OpenLDAP library versions, USE_OPENLDAP shall not be defined.
|
||||
*/
|
||||
|
||||
/* -- WIN32 approved -- */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -31,15 +43,7 @@
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef CURL_LDAP_HYBRID /* If W$ definitions are needed. */
|
||||
# include <windows.h>
|
||||
/* Remember we are NOT in a W$ compiler! */
|
||||
# undef WIN32
|
||||
# undef _WIN32
|
||||
# undef __WIN32__
|
||||
#endif
|
||||
|
||||
#ifdef CURL_LDAP_WIN /* Use W$ LDAP implementation. */
|
||||
#ifdef CURL_LDAP_WIN /* Use Windows LDAP implementation. */
|
||||
# include <winldap.h>
|
||||
# ifndef LDAP_VENDOR_NAME
|
||||
# error Your Platform SDK is NOT sufficient for LDAP support! Update your Platform SDK, or disable LDAP support!
|
||||
@@ -47,14 +51,14 @@
|
||||
# include <winber.h>
|
||||
# endif
|
||||
#else
|
||||
#define LDAP_DEPRECATED 1 /* Be sure ldap_init() is defined. */
|
||||
#ifdef HAVE_LBER_H
|
||||
# include <lber.h>
|
||||
#endif
|
||||
# define LDAP_DEPRECATED 1 /* Be sure ldap_init() is defined. */
|
||||
# ifdef HAVE_LBER_H
|
||||
# include <lber.h>
|
||||
# endif
|
||||
# include <ldap.h>
|
||||
#if (defined(HAVE_LDAP_SSL) && defined(HAVE_LDAP_SSL_H))
|
||||
# include <ldap_ssl.h>
|
||||
#endif /* HAVE_LDAP_SSL && HAVE_LDAP_SSL_H */
|
||||
# if (defined(HAVE_LDAP_SSL) && defined(HAVE_LDAP_SSL_H))
|
||||
# include <ldap_ssl.h>
|
||||
# endif /* HAVE_LDAP_SSL && HAVE_LDAP_SSL_H */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
@@ -715,4 +719,4 @@ static void _ldap_free_urldesc (LDAPURLDesc *ludp)
|
||||
free (ludp);
|
||||
}
|
||||
#endif /* !HAVE_LDAP_URL_PARSE */
|
||||
#endif /* CURL_DISABLE_LDAP */
|
||||
#endif /* !CURL_DISABLE_LDAP && !USE_OPENLDAP */
|
||||
|
@@ -5,7 +5,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
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -31,8 +31,8 @@
|
||||
/* this must be the last include file */
|
||||
#include "memdebug.h"
|
||||
|
||||
void
|
||||
Curl_llist_init(struct curl_llist *l, curl_llist_dtor dtor)
|
||||
static void
|
||||
llist_init(struct curl_llist *l, curl_llist_dtor dtor)
|
||||
{
|
||||
l->size = 0;
|
||||
l->dtor = dtor;
|
||||
@@ -49,7 +49,7 @@ Curl_llist_alloc(curl_llist_dtor dtor)
|
||||
if(NULL == list)
|
||||
return NULL;
|
||||
|
||||
Curl_llist_init(list, dtor);
|
||||
llist_init(list, dtor);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, 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
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -43,16 +43,11 @@ struct curl_llist {
|
||||
size_t size;
|
||||
};
|
||||
|
||||
void Curl_llist_init(struct curl_llist *, curl_llist_dtor);
|
||||
struct curl_llist *Curl_llist_alloc(curl_llist_dtor);
|
||||
int Curl_llist_insert_next(struct curl_llist *, struct curl_llist_element *,
|
||||
const void *);
|
||||
int Curl_llist_insert_prev(struct curl_llist *, struct curl_llist_element *,
|
||||
const void *);
|
||||
int Curl_llist_remove(struct curl_llist *, struct curl_llist_element *,
|
||||
void *);
|
||||
int Curl_llist_remove_next(struct curl_llist *, struct curl_llist_element *,
|
||||
void *);
|
||||
size_t Curl_llist_count(struct curl_llist *);
|
||||
void Curl_llist_destroy(struct curl_llist *, void *);
|
||||
int Curl_llist_move(struct curl_llist *, struct curl_llist_element *,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# $VER: LibcURL Makefile for AmigaOS ...
|
||||
# libcurl Makefile for AmigaOS ...
|
||||
#
|
||||
|
||||
# change the follow to where you have the AmiTCP SDK v4.3 includes:
|
||||
@@ -10,23 +10,12 @@ ATCPSDKI= /GG/netinclude
|
||||
CC = m68k-amigaos-gcc
|
||||
CFLAGS = -I$(ATCPSDKI) -m68020-60 -O2 -msoft-float -noixemul -g -I. -I../include -W -Wall
|
||||
|
||||
OBJS = amigaos.c \
|
||||
file.c timeval.c base64.c hostip.c progress.c formdata.c \
|
||||
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \
|
||||
ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c \
|
||||
netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c \
|
||||
krb5.c memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c \
|
||||
multi.c content_encoding.c share.c http_digest.c md5.c curl_rand.c \
|
||||
http_negotiate.c http_ntlm.c inet_pton.c strtoofft.c strerror.c \
|
||||
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c \
|
||||
inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.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 \
|
||||
curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c \
|
||||
warnless.c
|
||||
include Makefile.inc
|
||||
CSOURCES += amigaos.c
|
||||
OBJS = $(CSOURCES:.c=.o)
|
||||
|
||||
all: $(OBJS:.c=.o)
|
||||
ar cru libcurl.a $(OBJS:.c=.o)
|
||||
all: $(OBJS)
|
||||
ar cru libcurl.a $(OBJS)
|
||||
ranlib libcurl.a
|
||||
|
||||
install:
|
||||
|
281
lib/md4.c
Normal file
281
lib/md4.c
Normal file
@@ -0,0 +1,281 @@
|
||||
/*-
|
||||
Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved.
|
||||
|
||||
License to copy and use this software is granted provided that it
|
||||
is identified as the "RSA Data Security, Inc. MD4 Message-Digest
|
||||
Algorithm" in all material mentioning or referencing this software
|
||||
or this function.
|
||||
|
||||
License is also granted to make and use derivative works provided
|
||||
that such works are identified as "derived from the RSA Data
|
||||
Security, Inc. MD4 Message-Digest Algorithm" in all material
|
||||
mentioning or referencing the derived work.
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
/* NSS crypto library does not provide the MD4 hash algorithm, so that we have
|
||||
* a local implementation of it */
|
||||
#ifdef USE_NSS
|
||||
|
||||
#include "curl_md4.h"
|
||||
#include <string.h>
|
||||
|
||||
typedef unsigned int UINT4;
|
||||
|
||||
typedef struct MD4Context {
|
||||
UINT4 state[4]; /* state (ABCD) */
|
||||
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
||||
unsigned char buffer[64]; /* input buffer */
|
||||
} MD4_CTX;
|
||||
|
||||
/* Constants for MD4Transform routine.
|
||||
*/
|
||||
#define S11 3
|
||||
#define S12 7
|
||||
#define S13 11
|
||||
#define S14 19
|
||||
#define S21 3
|
||||
#define S22 5
|
||||
#define S23 9
|
||||
#define S24 13
|
||||
#define S31 3
|
||||
#define S32 9
|
||||
#define S33 11
|
||||
#define S34 15
|
||||
|
||||
static void MD4Transform(UINT4 [4], const unsigned char [64]);
|
||||
static void Encode(unsigned char *, UINT4 *, unsigned int);
|
||||
static void Decode(UINT4 *, const unsigned char *, unsigned int);
|
||||
|
||||
static unsigned char PADDING[64] = {
|
||||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
/* F, G and H are basic MD4 functions.
|
||||
*/
|
||||
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
|
||||
#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
|
||||
#define H(x, y, z) ((x) ^ (y) ^ (z))
|
||||
|
||||
/* ROTATE_LEFT rotates x left n bits.
|
||||
*/
|
||||
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
|
||||
|
||||
/* FF, GG and HH are transformations for rounds 1, 2 and 3 */
|
||||
/* Rotation is separate from addition to prevent recomputation */
|
||||
#define FF(a, b, c, d, x, s) { \
|
||||
(a) += F ((b), (c), (d)) + (x); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
}
|
||||
#define GG(a, b, c, d, x, s) { \
|
||||
(a) += G ((b), (c), (d)) + (x) + (UINT4)0x5a827999; \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
}
|
||||
#define HH(a, b, c, d, x, s) { \
|
||||
(a) += H ((b), (c), (d)) + (x) + (UINT4)0x6ed9eba1; \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
}
|
||||
|
||||
/* MD4 initialization. Begins an MD4 operation, writing a new context.
|
||||
*/
|
||||
static void MD4Init(MD4_CTX *context)
|
||||
{
|
||||
context->count[0] = context->count[1] = 0;
|
||||
|
||||
/* Load magic initialization constants.
|
||||
*/
|
||||
context->state[0] = 0x67452301;
|
||||
context->state[1] = 0xefcdab89;
|
||||
context->state[2] = 0x98badcfe;
|
||||
context->state[3] = 0x10325476;
|
||||
}
|
||||
|
||||
/* MD4 block update operation. Continues an MD4 message-digest
|
||||
operation, processing another message block, and updating the
|
||||
context.
|
||||
*/
|
||||
static void MD4Update(MD4_CTX *context, const unsigned char *input,
|
||||
unsigned int inputLen)
|
||||
{
|
||||
unsigned int i, bufindex, partLen;
|
||||
|
||||
/* Compute number of bytes mod 64 */
|
||||
bufindex = (unsigned int)((context->count[0] >> 3) & 0x3F);
|
||||
/* Update number of bits */
|
||||
if ((context->count[0] += ((UINT4)inputLen << 3))
|
||||
< ((UINT4)inputLen << 3))
|
||||
context->count[1]++;
|
||||
context->count[1] += ((UINT4)inputLen >> 29);
|
||||
|
||||
partLen = 64 - bufindex;
|
||||
/* Transform as many times as possible.
|
||||
*/
|
||||
if (inputLen >= partLen) {
|
||||
memcpy(&context->buffer[bufindex], input, partLen);
|
||||
MD4Transform (context->state, context->buffer);
|
||||
|
||||
for (i = partLen; i + 63 < inputLen; i += 64)
|
||||
MD4Transform (context->state, &input[i]);
|
||||
|
||||
bufindex = 0;
|
||||
}
|
||||
else
|
||||
i = 0;
|
||||
|
||||
/* Buffer remaining input */
|
||||
memcpy(&context->buffer[bufindex], &input[i], inputLen-i);
|
||||
}
|
||||
|
||||
/* MD4 padding. */
|
||||
static void MD4Pad(MD4_CTX *context)
|
||||
{
|
||||
unsigned char bits[8];
|
||||
unsigned int bufindex, padLen;
|
||||
|
||||
/* Save number of bits */
|
||||
Encode (bits, context->count, 8);
|
||||
|
||||
/* Pad out to 56 mod 64.
|
||||
*/
|
||||
bufindex = (unsigned int)((context->count[0] >> 3) & 0x3f);
|
||||
padLen = (bufindex < 56) ? (56 - bufindex) : (120 - bufindex);
|
||||
MD4Update (context, PADDING, padLen);
|
||||
|
||||
/* Append length (before padding) */
|
||||
MD4Update (context, bits, 8);
|
||||
}
|
||||
|
||||
/* MD4 finalization. Ends an MD4 message-digest operation, writing the
|
||||
the message digest and zeroizing the context.
|
||||
*/
|
||||
static void MD4Final (unsigned char digest[16], MD4_CTX *context)
|
||||
{
|
||||
/* Do padding */
|
||||
MD4Pad (context);
|
||||
|
||||
/* Store state in digest */
|
||||
Encode (digest, context->state, 16);
|
||||
|
||||
/* Zeroize sensitive information.
|
||||
*/
|
||||
memset(context, 0, sizeof(*context));
|
||||
}
|
||||
|
||||
/* MD4 basic transformation. Transforms state based on block.
|
||||
*/
|
||||
static void MD4Transform (UINT4 state[4], const unsigned char block[64])
|
||||
{
|
||||
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
|
||||
|
||||
Decode (x, block, 64);
|
||||
|
||||
/* Round 1 */
|
||||
FF (a, b, c, d, x[ 0], S11); /* 1 */
|
||||
FF (d, a, b, c, x[ 1], S12); /* 2 */
|
||||
FF (c, d, a, b, x[ 2], S13); /* 3 */
|
||||
FF (b, c, d, a, x[ 3], S14); /* 4 */
|
||||
FF (a, b, c, d, x[ 4], S11); /* 5 */
|
||||
FF (d, a, b, c, x[ 5], S12); /* 6 */
|
||||
FF (c, d, a, b, x[ 6], S13); /* 7 */
|
||||
FF (b, c, d, a, x[ 7], S14); /* 8 */
|
||||
FF (a, b, c, d, x[ 8], S11); /* 9 */
|
||||
FF (d, a, b, c, x[ 9], S12); /* 10 */
|
||||
FF (c, d, a, b, x[10], S13); /* 11 */
|
||||
FF (b, c, d, a, x[11], S14); /* 12 */
|
||||
FF (a, b, c, d, x[12], S11); /* 13 */
|
||||
FF (d, a, b, c, x[13], S12); /* 14 */
|
||||
FF (c, d, a, b, x[14], S13); /* 15 */
|
||||
FF (b, c, d, a, x[15], S14); /* 16 */
|
||||
|
||||
/* Round 2 */
|
||||
GG (a, b, c, d, x[ 0], S21); /* 17 */
|
||||
GG (d, a, b, c, x[ 4], S22); /* 18 */
|
||||
GG (c, d, a, b, x[ 8], S23); /* 19 */
|
||||
GG (b, c, d, a, x[12], S24); /* 20 */
|
||||
GG (a, b, c, d, x[ 1], S21); /* 21 */
|
||||
GG (d, a, b, c, x[ 5], S22); /* 22 */
|
||||
GG (c, d, a, b, x[ 9], S23); /* 23 */
|
||||
GG (b, c, d, a, x[13], S24); /* 24 */
|
||||
GG (a, b, c, d, x[ 2], S21); /* 25 */
|
||||
GG (d, a, b, c, x[ 6], S22); /* 26 */
|
||||
GG (c, d, a, b, x[10], S23); /* 27 */
|
||||
GG (b, c, d, a, x[14], S24); /* 28 */
|
||||
GG (a, b, c, d, x[ 3], S21); /* 29 */
|
||||
GG (d, a, b, c, x[ 7], S22); /* 30 */
|
||||
GG (c, d, a, b, x[11], S23); /* 31 */
|
||||
GG (b, c, d, a, x[15], S24); /* 32 */
|
||||
|
||||
/* Round 3 */
|
||||
HH (a, b, c, d, x[ 0], S31); /* 33 */
|
||||
HH (d, a, b, c, x[ 8], S32); /* 34 */
|
||||
HH (c, d, a, b, x[ 4], S33); /* 35 */
|
||||
HH (b, c, d, a, x[12], S34); /* 36 */
|
||||
HH (a, b, c, d, x[ 2], S31); /* 37 */
|
||||
HH (d, a, b, c, x[10], S32); /* 38 */
|
||||
HH (c, d, a, b, x[ 6], S33); /* 39 */
|
||||
HH (b, c, d, a, x[14], S34); /* 40 */
|
||||
HH (a, b, c, d, x[ 1], S31); /* 41 */
|
||||
HH (d, a, b, c, x[ 9], S32); /* 42 */
|
||||
HH (c, d, a, b, x[ 5], S33); /* 43 */
|
||||
HH (b, c, d, a, x[13], S34); /* 44 */
|
||||
HH (a, b, c, d, x[ 3], S31); /* 45 */
|
||||
HH (d, a, b, c, x[11], S32); /* 46 */
|
||||
HH (c, d, a, b, x[ 7], S33); /* 47 */
|
||||
HH (b, c, d, a, x[15], S34); /* 48 */
|
||||
|
||||
state[0] += a;
|
||||
state[1] += b;
|
||||
state[2] += c;
|
||||
state[3] += d;
|
||||
|
||||
/* Zeroize sensitive information.
|
||||
*/
|
||||
memset(x, 0, sizeof(x));
|
||||
}
|
||||
|
||||
/* Encodes input (UINT4) into output (unsigned char). Assumes len is
|
||||
a multiple of 4.
|
||||
*/
|
||||
static void Encode(unsigned char *output, UINT4 *input, unsigned int len)
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
for (i = 0, j = 0; j < len; i++, j += 4) {
|
||||
output[j] = (unsigned char)(input[i] & 0xff);
|
||||
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
|
||||
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
|
||||
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
/* Decodes input (unsigned char) into output (UINT4). Assumes len is
|
||||
a multiple of 4.
|
||||
*/
|
||||
static void Decode (UINT4 *output, const unsigned char *input, unsigned int len)
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
for (i = 0, j = 0; j < len; i++, j += 4)
|
||||
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
|
||||
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
|
||||
}
|
||||
|
||||
void Curl_md4it(unsigned char *output, const unsigned char *input, size_t len)
|
||||
{
|
||||
MD4_CTX ctx;
|
||||
MD4Init(&ctx);
|
||||
MD4Update(&ctx, input, (unsigned int)len);
|
||||
MD4Final(output, &ctx);
|
||||
}
|
||||
#endif /* USE_NSS */
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user