Compare commits
22 Commits
curl-7_1_1
...
curl-7_2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
61c4342736 | ||
![]() |
216b198494 | ||
![]() |
6e3a6e79e5 | ||
![]() |
2cf44fb374 | ||
![]() |
dab9658b3e | ||
![]() |
3f9b9dfdee | ||
![]() |
76229d3da1 | ||
![]() |
6562caf6a2 | ||
![]() |
d49eba2aed | ||
![]() |
bb7929ec50 | ||
![]() |
a1c0a5d0f2 | ||
![]() |
1be0bf56a6 | ||
![]() |
53c2798886 | ||
![]() |
7271ebf23e | ||
![]() |
b6e18f2f66 | ||
![]() |
400ca043c7 | ||
![]() |
d4ffc5ef32 | ||
![]() |
1b1f143cd6 | ||
![]() |
31b8eea041 | ||
![]() |
903f4c16cc | ||
![]() |
1998aee2a2 | ||
![]() |
d4731b7050 |
61
CHANGES
61
CHANGES
@@ -6,6 +6,67 @@
|
|||||||
|
|
||||||
History of Changes
|
History of Changes
|
||||||
|
|
||||||
|
Version 7.2
|
||||||
|
|
||||||
|
Daniel (30 August 2000)
|
||||||
|
- Understanding AIX is a hard task. I believe I'll never figure out why they
|
||||||
|
solve things so differently from the other unixes. Now, I'm left with the
|
||||||
|
AIX 4.3 run-time warnings about duplicate symbols that according to this
|
||||||
|
article (http://www.geocrawler.com/archives/3/405/1999/9/0/2593428/) is a
|
||||||
|
libtool flaw. I tried the mentioned patch, although that stops the linking
|
||||||
|
completely.
|
||||||
|
|
||||||
|
So, if I select to ignore the ld warnings there are compiler warnings that
|
||||||
|
fill the screen pretty bad when curl compiles. It turns out that if I want
|
||||||
|
to '#include <arpa/inet.h>', I can get tid of the warnings by include the
|
||||||
|
following three include files before that one:
|
||||||
|
|
||||||
|
#include <net/if_dl.h>
|
||||||
|
#include <sys/mbuf.h>
|
||||||
|
#include <netinet/if_ether.h>
|
||||||
|
|
||||||
|
Now, is it really sane to add those include files before arpa/inet.h in all
|
||||||
|
the source files that include it?
|
||||||
|
|
||||||
|
Thanks to Albert Chin-A-Young at thewrittenword.com who gave me the AIX
|
||||||
|
login to try everything on.
|
||||||
|
|
||||||
|
Daniel (24 August 2000)
|
||||||
|
- Jan Schmidt supplied us a new VC6 makefile for Windows as the previous one
|
||||||
|
was not up to date but lacked several object files.
|
||||||
|
|
||||||
|
- More work on the naming.
|
||||||
|
|
||||||
|
- Albert Chin-A-Young provided a configure-check for large file support, as
|
||||||
|
some systems seem to need that for them to work. Had to change the position
|
||||||
|
for the config.h include file in every .c file in the libcurl dir...
|
||||||
|
|
||||||
|
- As suggested on the mailing list (by Troy Engel), I did use a --data-binary
|
||||||
|
option instead of the messy way I've left described below. It seems to
|
||||||
|
work. The libcurl fix remained the same as yesterday.
|
||||||
|
|
||||||
|
Daniel (23 August 2000)
|
||||||
|
- Back on the -d stripping newlines thing. The 'plain post' thing was added
|
||||||
|
when I had no thought of that one could actually post binary data with
|
||||||
|
it. Now, I have to add this functionality in a graceful manner and I think
|
||||||
|
I've managed to come up with a way: '-d @file;binary' will thus post the
|
||||||
|
file binary, exactly as its contents are. It is implemented with a new
|
||||||
|
*setopt() option (CURLOPT_POSTFIELDSIZE) to set the postfield size, since
|
||||||
|
libcurl can't strlen() the data in these cases.
|
||||||
|
|
||||||
|
- Albert Chin-A-Young made some very serious efforts and all the name
|
||||||
|
resolving problems seem to have been sorted out now on all the platforms
|
||||||
|
that previously showed them. I'll make another release now anyday because of
|
||||||
|
this.
|
||||||
|
|
||||||
|
- The FAQ was much enhanced when it comes to the licensing issues thanks to
|
||||||
|
Bjorn Reese.
|
||||||
|
|
||||||
|
Daniel (21 August 2000)
|
||||||
|
- Rick Welykochy pointed out a problem when you use -d to post and you want to
|
||||||
|
keep the newlines, as curl strips them off as a bonus before posting...
|
||||||
|
This needs to be addressed.
|
||||||
|
|
||||||
Version 7.1.1
|
Version 7.1.1
|
||||||
|
|
||||||
Daniel (21 August 2000)
|
Daniel (21 August 2000)
|
||||||
|
1
FILES
1
FILES
@@ -25,6 +25,7 @@ maketgz
|
|||||||
Makefile.in
|
Makefile.in
|
||||||
Makefile.am
|
Makefile.am
|
||||||
acconfig.h
|
acconfig.h
|
||||||
|
acinclude.m4
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
config.guess
|
config.guess
|
||||||
config.h.in
|
config.h.in
|
||||||
|
10
README
10
README
@@ -30,14 +30,14 @@ README
|
|||||||
|
|
||||||
cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl login
|
cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl login
|
||||||
|
|
||||||
(just press enter when asked for password)
|
(just press enter when asked for password)
|
||||||
|
|
||||||
cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl co .
|
cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl co .
|
||||||
|
|
||||||
(now, you'll get all the latest sources downloaded into your current
|
(now, you'll get all the latest sources downloaded into your current
|
||||||
directory. Note that this does not create a directory named curl or
|
directory. Note that this does NOT create a directory named curl or
|
||||||
anything)
|
anything)
|
||||||
|
|
||||||
cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl logout
|
cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl logout
|
||||||
|
|
||||||
(you're off the hook!)
|
(you're off the hook!)
|
||||||
|
@@ -27,3 +27,9 @@
|
|||||||
|
|
||||||
/* Define if you have the gethostbyname_r() function with 6 arguments */
|
/* Define if you have the gethostbyname_r() function with 6 arguments */
|
||||||
#undef HAVE_GETHOSTBYNAME_R_6
|
#undef HAVE_GETHOSTBYNAME_R_6
|
||||||
|
|
||||||
|
/* Define if you have the inet_ntoa_r function declared. */
|
||||||
|
#undef HAVE_INET_NTOA_R_DECL
|
||||||
|
|
||||||
|
/* Define if you need the _REENTRANT define for some functions */
|
||||||
|
#undef NEED_REENTRANT
|
||||||
|
75
acinclude.m4
Normal file
75
acinclude.m4
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
#serial 12
|
||||||
|
|
||||||
|
dnl By default, many hosts won't let programs access large files;
|
||||||
|
dnl one must use special compiler options to get large-file access to work.
|
||||||
|
dnl For more details about this brain damage please see:
|
||||||
|
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
|
||||||
|
|
||||||
|
dnl Written by Paul Eggert <eggert@twinsun.com>.
|
||||||
|
|
||||||
|
dnl Internal subroutine of AC_SYS_LARGEFILE.
|
||||||
|
dnl AC_SYS_LARGEFILE_TEST_INCLUDES
|
||||||
|
AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES,
|
||||||
|
[[#include <sys/types.h>
|
||||||
|
int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
|
||||||
|
]])
|
||||||
|
|
||||||
|
dnl Internal subroutine of AC_SYS_LARGEFILE.
|
||||||
|
dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY)
|
||||||
|
AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
|
||||||
|
[AC_CACHE_CHECK([for $1 value needed for large files], $3,
|
||||||
|
[$3=no
|
||||||
|
AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES
|
||||||
|
$5
|
||||||
|
,
|
||||||
|
[$6],
|
||||||
|
,
|
||||||
|
[AC_TRY_COMPILE([#define $1 $2]
|
||||||
|
AC_SYS_LARGEFILE_TEST_INCLUDES
|
||||||
|
$5
|
||||||
|
,
|
||||||
|
[$6],
|
||||||
|
[$3=$2])])])
|
||||||
|
if test "[$]$3" != no; then
|
||||||
|
AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
|
||||||
|
fi])
|
||||||
|
|
||||||
|
AC_DEFUN(AC_SYS_LARGEFILE,
|
||||||
|
[AC_ARG_ENABLE(largefile,
|
||||||
|
[ --disable-largefile omit support for large files])
|
||||||
|
if test "$enable_largefile" != no; then
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([for special C compiler options needed for large files],
|
||||||
|
ac_cv_sys_largefile_CC,
|
||||||
|
[ac_cv_sys_largefile_CC=no
|
||||||
|
if test "$GCC" != yes; then
|
||||||
|
# IRIX 6.2 and later do not support large files by default,
|
||||||
|
# so use the C compiler's -n32 option if that helps.
|
||||||
|
AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
|
||||||
|
[ac_save_CC="$CC"
|
||||||
|
CC="$CC -n32"
|
||||||
|
AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, ,
|
||||||
|
ac_cv_sys_largefile_CC=' -n32')
|
||||||
|
CC="$ac_save_CC"])
|
||||||
|
fi])
|
||||||
|
if test "$ac_cv_sys_largefile_CC" != no; then
|
||||||
|
CC="$CC$ac_cv_sys_largefile_CC"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
|
||||||
|
ac_cv_sys_file_offset_bits,
|
||||||
|
[Number of bits in a file offset, on hosts where this is settable.])
|
||||||
|
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
|
||||||
|
ac_cv_sys_largefile_source,
|
||||||
|
[Define to make ftello visible on some hosts (e.g. HP-UX 10.20).],
|
||||||
|
[#include <stdio.h>], [return !ftello;])
|
||||||
|
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
|
||||||
|
ac_cv_sys_large_files,
|
||||||
|
[Define for large files, on AIX-style hosts.])
|
||||||
|
dnl lftp does not need ftello, and _XOPEN_SOURCE=500 makes resolv.h fail.
|
||||||
|
dnl AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE, 500,
|
||||||
|
dnl ac_cv_sys_xopen_source,
|
||||||
|
dnl [Define to make ftello visible on some hosts (e.g. glibc 2.1.3).],
|
||||||
|
dnl [#include <stdio.h>], [return !ftello;])
|
||||||
|
fi
|
||||||
|
])
|
76
aclocal.m4
vendored
76
aclocal.m4
vendored
@@ -10,6 +10,82 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|||||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
dnl PARTICULAR PURPOSE.
|
dnl PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
#serial 12
|
||||||
|
|
||||||
|
dnl By default, many hosts won't let programs access large files;
|
||||||
|
dnl one must use special compiler options to get large-file access to work.
|
||||||
|
dnl For more details about this brain damage please see:
|
||||||
|
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
|
||||||
|
|
||||||
|
dnl Written by Paul Eggert <eggert@twinsun.com>.
|
||||||
|
|
||||||
|
dnl Internal subroutine of AC_SYS_LARGEFILE.
|
||||||
|
dnl AC_SYS_LARGEFILE_TEST_INCLUDES
|
||||||
|
AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES,
|
||||||
|
[[#include <sys/types.h>
|
||||||
|
int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
|
||||||
|
]])
|
||||||
|
|
||||||
|
dnl Internal subroutine of AC_SYS_LARGEFILE.
|
||||||
|
dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY)
|
||||||
|
AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
|
||||||
|
[AC_CACHE_CHECK([for $1 value needed for large files], $3,
|
||||||
|
[$3=no
|
||||||
|
AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES
|
||||||
|
$5
|
||||||
|
,
|
||||||
|
[$6],
|
||||||
|
,
|
||||||
|
[AC_TRY_COMPILE([#define $1 $2]
|
||||||
|
AC_SYS_LARGEFILE_TEST_INCLUDES
|
||||||
|
$5
|
||||||
|
,
|
||||||
|
[$6],
|
||||||
|
[$3=$2])])])
|
||||||
|
if test "[$]$3" != no; then
|
||||||
|
AC_DEFINE_UNQUOTED([$1], [$]$3, [$4])
|
||||||
|
fi])
|
||||||
|
|
||||||
|
AC_DEFUN(AC_SYS_LARGEFILE,
|
||||||
|
[AC_ARG_ENABLE(largefile,
|
||||||
|
[ --disable-largefile omit support for large files])
|
||||||
|
if test "$enable_largefile" != no; then
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([for special C compiler options needed for large files],
|
||||||
|
ac_cv_sys_largefile_CC,
|
||||||
|
[ac_cv_sys_largefile_CC=no
|
||||||
|
if test "$GCC" != yes; then
|
||||||
|
# IRIX 6.2 and later do not support large files by default,
|
||||||
|
# so use the C compiler's -n32 option if that helps.
|
||||||
|
AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , ,
|
||||||
|
[ac_save_CC="$CC"
|
||||||
|
CC="$CC -n32"
|
||||||
|
AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, ,
|
||||||
|
ac_cv_sys_largefile_CC=' -n32')
|
||||||
|
CC="$ac_save_CC"])
|
||||||
|
fi])
|
||||||
|
if test "$ac_cv_sys_largefile_CC" != no; then
|
||||||
|
CC="$CC$ac_cv_sys_largefile_CC"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
|
||||||
|
ac_cv_sys_file_offset_bits,
|
||||||
|
[Number of bits in a file offset, on hosts where this is settable.])
|
||||||
|
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
|
||||||
|
ac_cv_sys_largefile_source,
|
||||||
|
[Define to make ftello visible on some hosts (e.g. HP-UX 10.20).],
|
||||||
|
[#include <stdio.h>], [return !ftello;])
|
||||||
|
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
|
||||||
|
ac_cv_sys_large_files,
|
||||||
|
[Define for large files, on AIX-style hosts.])
|
||||||
|
dnl lftp does not need ftello, and _XOPEN_SOURCE=500 makes resolv.h fail.
|
||||||
|
dnl AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE, 500,
|
||||||
|
dnl ac_cv_sys_xopen_source,
|
||||||
|
dnl [Define to make ftello visible on some hosts (e.g. glibc 2.1.3).],
|
||||||
|
dnl [#include <stdio.h>], [return !ftello;])
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
||||||
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||||
|
|
||||||
AC_DEFUN(AM_CONFIG_HEADER,
|
AC_DEFUN(AM_CONFIG_HEADER,
|
||||||
|
18
config.h.in
18
config.h.in
@@ -43,6 +43,12 @@
|
|||||||
/* Define if you have the gethostbyname_r() function with 6 arguments */
|
/* Define if you have the gethostbyname_r() function with 6 arguments */
|
||||||
#undef HAVE_GETHOSTBYNAME_R_6
|
#undef HAVE_GETHOSTBYNAME_R_6
|
||||||
|
|
||||||
|
/* Define if you have the inet_ntoa_r function declared. */
|
||||||
|
#undef HAVE_INET_NTOA_R_DECL
|
||||||
|
|
||||||
|
/* Define if you need the _REENTRANT define for some functions */
|
||||||
|
#undef NEED_REENTRANT
|
||||||
|
|
||||||
/* The number of bytes in a long double. */
|
/* The number of bytes in a long double. */
|
||||||
#undef SIZEOF_LONG_DOUBLE
|
#undef SIZEOF_LONG_DOUBLE
|
||||||
|
|
||||||
@@ -163,6 +169,9 @@
|
|||||||
/* Define if you have the <netdb.h> header file. */
|
/* Define if you have the <netdb.h> header file. */
|
||||||
#undef HAVE_NETDB_H
|
#undef HAVE_NETDB_H
|
||||||
|
|
||||||
|
/* Define if you have the <netinet/if_ether.h> header file. */
|
||||||
|
#undef HAVE_NETINET_IF_ETHER_H
|
||||||
|
|
||||||
/* Define if you have the <netinet/in.h> header file. */
|
/* Define if you have the <netinet/in.h> header file. */
|
||||||
#undef HAVE_NETINET_IN_H
|
#undef HAVE_NETINET_IN_H
|
||||||
|
|
||||||
@@ -265,6 +274,15 @@
|
|||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
#undef VERSION
|
#undef VERSION
|
||||||
|
|
||||||
|
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||||
|
#undef _FILE_OFFSET_BITS
|
||||||
|
|
||||||
|
/* Define to make ftello visible on some hosts (e.g. HP-UX 10.20). */
|
||||||
|
#undef _LARGEFILE_SOURCE
|
||||||
|
|
||||||
|
/* Define for large files, on AIX-style hosts. */
|
||||||
|
#undef _LARGE_FILES
|
||||||
|
|
||||||
/* Set to explicitly specify we don't want to use thread-safe functions */
|
/* Set to explicitly specify we don't want to use thread-safe functions */
|
||||||
#undef DISABLED_THREADSAFE
|
#undef DISABLED_THREADSAFE
|
||||||
|
|
||||||
|
331
configure.in
331
configure.in
@@ -2,7 +2,7 @@ dnl $Id$
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
AC_INIT(lib/urldata.h)
|
AC_INIT(lib/urldata.h)
|
||||||
AM_CONFIG_HEADER(config.h src/config.h)
|
AM_CONFIG_HEADER(config.h src/config.h)
|
||||||
AM_INIT_AUTOMAKE(curl,"7.1.1")
|
AM_INIT_AUTOMAKE(curl,"7.2")
|
||||||
AM_PROG_LIBTOOL
|
AM_PROG_LIBTOOL
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
@@ -13,12 +13,17 @@ AC_CANONICAL_TARGET
|
|||||||
|
|
||||||
dnl Checks for programs.
|
dnl Checks for programs.
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
|
||||||
|
dnl Check for AIX weirdos
|
||||||
|
AC_AIX
|
||||||
|
|
||||||
|
dnl check for how to do large files
|
||||||
|
AC_SYS_LARGEFILE
|
||||||
|
|
||||||
dnl The install stuff has already been taken care of by the automake stuff
|
dnl The install stuff has already been taken care of by the automake stuff
|
||||||
dnl AC_PROG_INSTALL
|
dnl AC_PROG_INSTALL
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
|
|
||||||
dnl Check for AIX weirdos
|
|
||||||
AC_AIX
|
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
dnl Checks for libraries.
|
dnl Checks for libraries.
|
||||||
@@ -161,164 +166,204 @@ then
|
|||||||
AC_DEFINE(DISABLED_THREADSAFE, 1, \
|
AC_DEFINE(DISABLED_THREADSAFE, 1, \
|
||||||
Set to explicitly specify we don't want to use thread-safe functions)
|
Set to explicitly specify we don't want to use thread-safe functions)
|
||||||
else
|
else
|
||||||
|
dnl check for number of arguments to gethostbyname_r. it might take
|
||||||
dnl check for a few thread-safe functions
|
dnl either 3, 5, or 6 arguments.
|
||||||
|
AC_CHECK_FUNCS(gethostbyname_r,[
|
||||||
AC_CHECK_FUNCS( gethostbyname_r \
|
AC_MSG_CHECKING(if gethostbyname_r takes 3 arguments)
|
||||||
gethostbyaddr_r \
|
AC_TRY_RUN([
|
||||||
localtime_r \
|
#include <string.h>
|
||||||
inet_ntoa_r
|
|
||||||
)
|
|
||||||
|
|
||||||
if test "$ac_cv_func_gethostbyname_r" = "yes"; then
|
|
||||||
|
|
||||||
dnl **********************************************************************
|
|
||||||
dnl Time to make a check for gethostbyname_r
|
|
||||||
dnl If it exists, it may use one of three different interfaces
|
|
||||||
dnl **********************************************************************
|
|
||||||
|
|
||||||
AC_MSG_CHECKING(for gethostbyname_r)
|
|
||||||
if test -z "$ac_cv_gethostbyname_args"; then
|
|
||||||
AC_TRY_COMPILE(
|
|
||||||
[
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netdb.h>],
|
#include <netdb.h>
|
||||||
[
|
|
||||||
|
int
|
||||||
|
main () {
|
||||||
struct hostent h;
|
struct hostent h;
|
||||||
struct hostent_data hdata;
|
struct hostent_data hdata;
|
||||||
char *name;
|
char *name = "localhost";
|
||||||
int rc;
|
int rc;
|
||||||
rc = gethostbyname_r(name, &h, &hdata);],
|
memset(&h, 0, sizeof(struct hostent));
|
||||||
ac_cv_gethostbyname_args=3)
|
memset(&hdata, 0, sizeof(struct hostent_data));
|
||||||
fi
|
rc = gethostbyname_r(name, &h, &hdata);
|
||||||
if test -z "$ac_cv_gethostbyname_args"; then
|
exit (rc != 0 ? 1 : 0); }],[
|
||||||
AC_TRY_COMPILE(
|
AC_MSG_RESULT(yes)
|
||||||
[
|
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
|
||||||
|
ac_cv_gethostbyname_args=3],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_CHECKING(if gethostbyname_r with -D_REENTRANT takes 3 arguments)
|
||||||
|
AC_TRY_RUN([
|
||||||
|
#define _REENTRANT
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netdb.h>],
|
#include <netdb.h>
|
||||||
[
|
|
||||||
|
int
|
||||||
|
main () {
|
||||||
|
struct hostent h;
|
||||||
|
struct hostent_data hdata;
|
||||||
|
char *name = "localhost";
|
||||||
|
int rc;
|
||||||
|
memset(&h, 0, sizeof(struct hostent));
|
||||||
|
memset(&hdata, 0, sizeof(struct hostent_data));
|
||||||
|
rc = gethostbyname_r(name, &h, &hdata);
|
||||||
|
exit (rc != 0 ? 1 : 0); }],[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
|
||||||
|
AC_DEFINE(NEED_REENTRANT)
|
||||||
|
ac_cv_gethostbyname_args=3],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_CHECKING(if gethostbyname_r takes 5 arguments)
|
||||||
|
AC_TRY_RUN([
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main () {
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
struct hostent h;
|
struct hostent h;
|
||||||
char *name;
|
char *name = "localhost";
|
||||||
char buffer[10];
|
char buffer[8192];
|
||||||
int h_errno;
|
int h_errno;
|
||||||
hp = gethostbyname_r(name, &h, buffer, 10, &h_errno);],
|
hp = gethostbyname_r(name, &h, buffer, 8192, &h_errno);
|
||||||
ac_cv_gethostbyname_args=5)
|
exit (hp == NULL ? 1 : 0); }],[
|
||||||
fi
|
AC_MSG_RESULT(yes)
|
||||||
if test -z "$ac_cv_gethostbyname_args"; then
|
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5)
|
||||||
AC_TRY_COMPILE(
|
ac_cv_gethostbyname_args=5],[
|
||||||
[
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_CHECKING(if gethostbyname_r takes 6 arguments)
|
||||||
|
AC_TRY_RUN([
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netdb.h>],
|
#include <netdb.h>
|
||||||
[
|
|
||||||
|
int
|
||||||
|
main () {
|
||||||
struct hostent h;
|
struct hostent h;
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
char *name;
|
char *name = "localhost";
|
||||||
char buf[10];
|
char buf[8192];
|
||||||
int rc;
|
int rc;
|
||||||
int h_errno;
|
int h_errno;
|
||||||
|
rc = gethostbyname_r(name, &h, buf, 8192, &hp, &h_errno);
|
||||||
|
exit (rc != 0 ? 1 : 0); }],[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6)
|
||||||
|
ac_cv_gethostbyname_args=6],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
have_missing_r_funcs="$have_missing_r_funcs gethostbyname_r"],
|
||||||
|
[ac_cv_gethostbyname_args=0])],
|
||||||
|
[ac_cv_gethostbyname_args=0])],
|
||||||
|
[ac_cv_gethostbyname_args=0])],
|
||||||
|
[ac_cv_gethostbyname_args=0])])
|
||||||
|
|
||||||
rc = gethostbyname_r(name, &h, buf, 10, &hp, &h_errno);
|
dnl check for number of arguments to gethostbyaddr_r. it might take
|
||||||
],
|
dnl either 5, 7, or 8 arguments.
|
||||||
ac_cv_gethostbyname_args=6)
|
AC_CHECK_FUNCS(gethostbyaddr_r,[
|
||||||
fi
|
AC_MSG_CHECKING(if gethostbyaddr_r takes 5 arguments)
|
||||||
if test -z "$ac_cv_gethostbyname_args"; then
|
AC_TRY_COMPILE([
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
have_missing_r_funcs="$have_missing_r_funcs gethostbyname_r"
|
|
||||||
else
|
|
||||||
if test "$ac_cv_gethostbyname_args" = 3; then
|
|
||||||
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
|
|
||||||
elif test "$ac_cv_gethostbyname_args" = 5; then
|
|
||||||
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5)
|
|
||||||
elif test "$ac_cv_gethostbyname_args" = 6; then
|
|
||||||
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6)
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT([yes, and it takes $ac_cv_gethostbyname_args arguments])
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl **********************************************************************
|
|
||||||
dnl Time to make a check for gethostbyaddr_r
|
|
||||||
dnl If it exists, it may use one of three different interfaces
|
|
||||||
dnl **********************************************************************
|
|
||||||
AC_MSG_CHECKING(for gethostbyaddr_r)
|
|
||||||
if test -z "$ac_cv_gethostbyaddr_args"; then
|
|
||||||
AC_TRY_COMPILE(
|
|
||||||
[
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netdb.h>],
|
#include <netdb.h>],[
|
||||||
[
|
char * address;
|
||||||
char * address;
|
int length;
|
||||||
int length;
|
int type;
|
||||||
int type;
|
struct hostent h;
|
||||||
struct hostent h;
|
struct hostent_data hdata;
|
||||||
struct hostent_data hdata;
|
int rc;
|
||||||
int rc;
|
rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[
|
||||||
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
|
AC_MSG_RESULT(yes)
|
||||||
],
|
AC_DEFINE(HAVE_GETHOSTBYADDR_R_5)
|
||||||
ac_cv_gethostbyaddr_args=5)
|
ac_cv_gethostbyaddr_args=5],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
fi
|
AC_MSG_CHECKING(if gethostbyaddr_r with -D_REENTRANT takes 5 arguments)
|
||||||
if test -z "$ac_cv_gethostbyaddr_args"; then
|
AC_TRY_COMPILE([
|
||||||
AC_TRY_COMPILE(
|
#define _REENTRANT
|
||||||
[
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netdb.h>],
|
#include <netdb.h>],[
|
||||||
[
|
char * address;
|
||||||
char * address;
|
int length;
|
||||||
int length;
|
int type;
|
||||||
int type;
|
struct hostent h;
|
||||||
struct hostent h;
|
struct hostent_data hdata;
|
||||||
char buffer[10];
|
int rc;
|
||||||
int buflen;
|
rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[
|
||||||
int h_errnop;
|
AC_MSG_RESULT(yes)
|
||||||
struct hostent * hp;
|
AC_DEFINE(HAVE_GETHOSTBYADDR_R_5)
|
||||||
|
AC_DEFINE(NEED_REENTRANT)
|
||||||
hp = gethostbyaddr_r(address, length, type, &h,
|
ac_cv_gethostbyaddr_args=5],[
|
||||||
buffer, buflen, &h_errnop);
|
AC_MSG_RESULT(no)
|
||||||
],
|
AC_MSG_CHECKING(if gethostbyaddr_r takes 7 arguments)
|
||||||
ac_cv_gethostbyaddr_args=7)
|
AC_TRY_COMPILE([
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "$ac_cv_gethostbyaddr_args"; then
|
|
||||||
AC_TRY_COMPILE(
|
|
||||||
[
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netdb.h>],
|
#include <netdb.h>],[
|
||||||
[
|
char * address;
|
||||||
char * address;
|
int length;
|
||||||
int length;
|
int type;
|
||||||
int type;
|
struct hostent h;
|
||||||
struct hostent h;
|
char buffer[10];
|
||||||
char buffer[10];
|
int buflen;
|
||||||
int buflen;
|
int h_errnop;
|
||||||
int h_errnop;
|
struct hostent * hp;
|
||||||
struct hostent * hp;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
rc = gethostbyaddr_r(address, length, type, &h,
|
hp = gethostbyaddr_r(address, length, type, &h,
|
||||||
buffer, buflen, &hp, &h_errnop);
|
buffer, buflen, &h_errnop);],[
|
||||||
],
|
AC_MSG_RESULT(yes)
|
||||||
ac_cv_gethostbyaddr_args=8)
|
AC_DEFINE(HAVE_GETHOSTBYADDR_R_7)
|
||||||
fi
|
ac_cv_gethostbyaddr_args=7],[
|
||||||
if test -z "$ac_cv_gethostbyaddr_args"; then
|
AC_MSG_RESULT(no)
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_CHECKING(if gethostbyaddr_r takes 8 arguments)
|
||||||
have_missing_r_funcs="$have_missing_r_funcs gethostbyaddr_r"
|
AC_TRY_COMPILE([
|
||||||
else
|
#include <sys/types.h>
|
||||||
if test "$ac_cv_gethostbyaddr_args" = 5; then
|
#include <netdb.h>],[
|
||||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_5)
|
char * address;
|
||||||
elif test "$ac_cv_gethostbyaddr_args" = 7; then
|
int length;
|
||||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_7)
|
int type;
|
||||||
elif test "$ac_cv_gethostbyaddr_args" = 8; then
|
struct hostent h;
|
||||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_8)
|
char buffer[10];
|
||||||
fi
|
int buflen;
|
||||||
AC_MSG_RESULT([yes, and it takes $ac_cv_gethostbyaddr_args arguments])
|
int h_errnop;
|
||||||
fi
|
struct hostent * hp;
|
||||||
|
int rc;
|
||||||
|
|
||||||
fi
|
rc = gethostbyaddr_r(address, length, type, &h,
|
||||||
|
buffer, buflen, &hp, &h_errnop);],[
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_GETHOSTBYADDR_R_8)
|
||||||
|
ac_cv_gethostbyaddr_args=8],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
have_missing_r_funcs="$have_missing_r_funcs gethostbyaddr_r"])])])])])
|
||||||
|
|
||||||
|
dnl determine if function definition for inet_ntoa_r exists.
|
||||||
|
AC_CHECK_FUNCS(inet_ntoa_r,[
|
||||||
|
AC_MSG_CHECKING(whether inet_ntoa_r is declared)
|
||||||
|
AC_EGREP_CPP(inet_ntoa_r,[
|
||||||
|
#include <arpa/inet.h>],[
|
||||||
|
AC_DEFINE(HAVE_INET_NTOA_R_DECL)
|
||||||
|
AC_MSG_RESULT(yes)],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_CHECKING(whether inet_ntoa_r with -D_REENTRANT is declared)
|
||||||
|
AC_EGREP_CPP(inet_ntoa_r,[
|
||||||
|
#define _REENTRANT
|
||||||
|
#include <arpa/inet.h>],[
|
||||||
|
AC_DEFINE(HAVE_INET_NTOA_R_DECL)
|
||||||
|
AC_DEFINE(NEED_REENTRANT)
|
||||||
|
AC_MSG_RESULT(yes)],
|
||||||
|
AC_MSG_RESULT(no))])])
|
||||||
|
|
||||||
|
dnl check for a few thread-safe functions
|
||||||
|
AC_CHECK_FUNCS(localtime_r,[
|
||||||
|
AC_MSG_CHECKING(whether localtime_r is declared)
|
||||||
|
AC_EGREP_CPP(localtime_r,[
|
||||||
|
#include <time.h>],[
|
||||||
|
AC_MSG_RESULT(yes)],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_MSG_CHECKING(whether localtime_r with -D_REENTRANT is declared)
|
||||||
|
AC_EGREP_CPP(localtime_r,[
|
||||||
|
#define _REENTRANT
|
||||||
|
#include <time.h>],[
|
||||||
|
AC_DEFINE(NEED_REENTRANT)
|
||||||
|
AC_MSG_RESULT(yes)],
|
||||||
|
AC_MSG_RESULT(no))])])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
dnl Back to "normal" configuring
|
dnl Back to "normal" configuring
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
@@ -332,6 +377,7 @@ AC_CHECK_HEADERS( \
|
|||||||
arpa/inet.h \
|
arpa/inet.h \
|
||||||
net/if.h \
|
net/if.h \
|
||||||
netinet/in.h \
|
netinet/in.h \
|
||||||
|
netinet/if_ether.h \
|
||||||
netdb.h \
|
netdb.h \
|
||||||
sys/select.h \
|
sys/select.h \
|
||||||
sys/socket.h \
|
sys/socket.h \
|
||||||
@@ -430,6 +476,3 @@ dnl perl/checklinks.pl \
|
|||||||
dnl perl/getlinks.pl \
|
dnl perl/getlinks.pl \
|
||||||
dnl perl/formfind.pl \
|
dnl perl/formfind.pl \
|
||||||
dnl perl/recursiveftpget.pl )
|
dnl perl/recursiveftpget.pl )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
69
docs/FAQ
69
docs/FAQ
@@ -1,4 +1,4 @@
|
|||||||
Updated: August 17, 2000 (http://curl.haxx.se/docs/faq.shtml)
|
Updated: August 22, 2000 (http://curl.haxx.se/docs/faq.shtml)
|
||||||
_ _ ____ _
|
_ _ ____ _
|
||||||
___| | | | _ \| |
|
___| | | | _ \| |
|
||||||
/ __| | | | |_) | |
|
/ __| | | | |_) | |
|
||||||
@@ -50,9 +50,10 @@ FAQ
|
|||||||
6. License Issues
|
6. License Issues
|
||||||
6.1 I have a GPL program, can I use the libcurl library?
|
6.1 I have a GPL program, can I use the libcurl library?
|
||||||
6.2 I have a closed-source program, can I use the libcurl library?
|
6.2 I have a closed-source program, can I use the libcurl library?
|
||||||
6.3 I have a program that uses LGPL libraries, can I use libcurl?
|
6.3 I have a BSD licensed program, can I use the libcurl library?
|
||||||
6.4 Can I modify curl/libcurl for my program and keep the changes secret?
|
6.4 I have a program that uses LGPL libraries, can I use libcurl?
|
||||||
6.5 Can you please change the curl/libcurl license to XXXX?
|
6.5 Can I modify curl/libcurl for my program and keep the changes secret?
|
||||||
|
6.6 Can you please change the curl/libcurl license to XXXX?
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
@@ -95,6 +96,10 @@ FAQ
|
|||||||
Curl is not a PHP tool, even though it works perfectly well when used from
|
Curl is not a PHP tool, even though it works perfectly well when used from
|
||||||
or with PHP.
|
or with PHP.
|
||||||
|
|
||||||
|
Curl is not a single-OS program. Curl exists, compiles, builds and runs
|
||||||
|
under a long range of operating systems, including all modern Unixes,
|
||||||
|
Windows, Amiga, BeOS, OS/2, OS X, QNX etc.
|
||||||
|
|
||||||
1.4 When will you make curl do XXXX ?
|
1.4 When will you make curl do XXXX ?
|
||||||
|
|
||||||
I love suggestions of what to change in order to make curl and libcurl
|
I love suggestions of what to change in order to make curl and libcurl
|
||||||
@@ -384,20 +389,40 @@ FAQ
|
|||||||
Curl and libcurl are released under the MPL, the Mozilla Public License. To
|
Curl and libcurl are released under the MPL, the Mozilla Public License. To
|
||||||
get a really good answer to this or other licensing questions, you should
|
get a really good answer to this or other licensing questions, you should
|
||||||
study the MPL license and the license you are about to use and check for
|
study the MPL license and the license you are about to use and check for
|
||||||
clashes yourself. This is a brief summary for a few cases for which we get
|
clashes yourself. This is a brief summary for the cases we get the most
|
||||||
questions:
|
questions. (Parts of this section was enhanced by Bjorn Reese.)
|
||||||
|
|
||||||
6.1. I have a GPL program, can I use the libcurl library?
|
6.1. I have a GPL program, can I use the libcurl library?
|
||||||
|
|
||||||
No, you can't distribute your program as a binary and you cannot
|
No, unfortunately you cannot distribute the (lib)curl code with your code.
|
||||||
distribute the (lib)curl code with your code. GPL'd software requires all
|
According to both the Free Software Foundation and the Mozilla
|
||||||
parts of the final executable to be licensed under GPL or a license that
|
Organization, MPL and GPL are not compatible, because GPL requires of
|
||||||
"does impose further restrictions". (One could argue about which license
|
other licenses that they do "not impose any further restrictions on the
|
||||||
that acutally imposes the restrictions, but that'll be left for you to
|
recipients' exercise of the rights granted herein" [GPL paragraph 6] (One
|
||||||
ponder about.) MPL is not compatible with GPL.
|
could argue about which license that actually imposes restrictions, but
|
||||||
|
that'll be left for you to ponder about.)
|
||||||
|
|
||||||
However, nothing prevents you from distributing your program separately
|
However, you have two alternative options:
|
||||||
from curl and libcurl and request that the user gets it separately.
|
|
||||||
|
1) Nothing prevents you from distributing your program separately from
|
||||||
|
curl and libcurl, and request that the user receives it separately.
|
||||||
|
The incompability issues between MPL and GPL only applies to the
|
||||||
|
distribution.
|
||||||
|
|
||||||
|
2) Add the following exception to your distribution (you must have the
|
||||||
|
consent of all the copyright holders of the source code in your
|
||||||
|
project in order to do this)
|
||||||
|
|
||||||
|
As a special exception, you have permission to link this program
|
||||||
|
with the curl library and distribute executables, as long as you
|
||||||
|
follow the requirements of the GNU GPL in regard to all of the
|
||||||
|
software in the executable aside from curl.
|
||||||
|
|
||||||
|
This exception must be added to your GPL covered source code files
|
||||||
|
immediately after the notification mentioned in the appendix of GPL.
|
||||||
|
The wording was originally suggested by the Free Software Foundation
|
||||||
|
in relationship with the Qt library. We have changed the wording to
|
||||||
|
apply to curl.
|
||||||
|
|
||||||
6.2. I have a closed-source program, can I use the libcurl library?
|
6.2. I have a closed-source program, can I use the libcurl library?
|
||||||
|
|
||||||
@@ -405,21 +430,27 @@ FAQ
|
|||||||
library. If you end up doing changes to the library, only those changes
|
library. If you end up doing changes to the library, only those changes
|
||||||
must be made available, not the ones to your program.
|
must be made available, not the ones to your program.
|
||||||
|
|
||||||
6.3. I have a program that uses LGPL libraries, can I use libcurl?
|
6.3. I have a BSD licensed program, can I use the libcurl library?
|
||||||
|
|
||||||
|
Yes, libcurl does not put any restrictions on the program that uses the
|
||||||
|
library. If you end up doing changes to the library, only those changes
|
||||||
|
must be made available, not the ones to your program.
|
||||||
|
|
||||||
|
6.4. I have a program that uses LGPL libraries, can I use libcurl?
|
||||||
|
|
||||||
Yes you can. LGPL libraries don't spread to other libraries the same way
|
Yes you can. LGPL libraries don't spread to other libraries the same way
|
||||||
GPL ones do.
|
GPL ones do.
|
||||||
|
|
||||||
However, when you read paragraph (3) of the LGPL license, you'll see that
|
However, when you read paragraph (3) of the LGPL license, you'll see that
|
||||||
anyone - at will - may at any time convert that LGPL program into GPL. And
|
anyone - at will - may at any time convert that LGPL program into GPL. And
|
||||||
GPL programs can't be distributed together, neither with (lib)curl source
|
GPL programs can't be distributed together with MPL programs, neither with
|
||||||
code and not as a binary.
|
(lib)curl source code and not as a binary.
|
||||||
|
|
||||||
6.4. Can I modify curl/libcurl for my program and keep the changes secret?
|
6.5. Can I modify curl/libcurl for my program and keep the changes secret?
|
||||||
|
|
||||||
No, you're not allowed to do that.
|
No, you're not allowed to do that.
|
||||||
|
|
||||||
6.5. Can you please change the curl/libcurl license to XXXX?
|
6.6. Can you please change the curl/libcurl license to XXXX?
|
||||||
|
|
||||||
No. We carefully picked this license years ago and a large amount of
|
No. We carefully picked this license years ago and a large amount of
|
||||||
people have contributed with source code knowing that this is the license
|
people have contributed with source code knowing that this is the license
|
||||||
|
@@ -68,7 +68,7 @@ Standards
|
|||||||
|
|
||||||
Compilers
|
Compilers
|
||||||
---------
|
---------
|
||||||
MingW32 - http://www.xraylith.wisc.edu/~khan/software/gnu-win32/index.html
|
MingW32 - http://www.mingw.org
|
||||||
|
|
||||||
gcc - http://www.gnu.org/software/gcc/gcc.html
|
gcc - http://www.gnu.org/software/gcc/gcc.html
|
||||||
|
|
||||||
|
23
docs/curl.1
23
docs/curl.1
@@ -2,7 +2,7 @@
|
|||||||
.\" nroff -man curl.1
|
.\" nroff -man curl.1
|
||||||
.\" Written by Daniel Stenberg
|
.\" Written by Daniel Stenberg
|
||||||
.\"
|
.\"
|
||||||
.TH curl 1 "1 August 2000" "Curl 7.0" "Curl Manual"
|
.TH curl 1 "24 August 2000" "Curl 7.2" "Curl Manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
curl \- get a URL with FTP, TELNET, LDAP, GOPHER, DICT, FILE, HTTP or
|
curl \- get a URL with FTP, TELNET, LDAP, GOPHER, DICT, FILE, HTTP or
|
||||||
HTTPS syntax.
|
HTTPS syntax.
|
||||||
@@ -88,16 +88,26 @@ If used with uploads, the ftp server command SIZE will not be used by
|
|||||||
curl. Upload resume is for FTP only.
|
curl. Upload resume is for FTP only.
|
||||||
HTTP resume is only possible with HTTP/1.1 or later servers.
|
HTTP resume is only possible with HTTP/1.1 or later servers.
|
||||||
.IP "-d/--data <data>"
|
.IP "-d/--data <data>"
|
||||||
(HTTP)
|
(HTTP) Sends the specified data in a POST request to the HTTP server. Note
|
||||||
Sends the specified data in a POST request to the HTTP server. Note
|
that the data is sent exactly as specified with no extra processing (with all
|
||||||
that the data is sent exactly as specified with no extra processing.
|
newlines cut off). The data is expected to be "url-encoded". This will cause
|
||||||
The data is expected to be "url-encoded". This will cause curl to
|
curl to pass the data to the server using the content-type
|
||||||
pass the data to the server using the content-type
|
|
||||||
application/x-www-form-urlencoded. Compare to -F.
|
application/x-www-form-urlencoded. Compare to -F.
|
||||||
|
|
||||||
If you start the data with the letter @, the rest should be a file name to
|
If you start the data with the letter @, the rest should be a file name to
|
||||||
read the data from, or - if you want curl to read the data from stdin.
|
read the data from, or - if you want curl to read the data from stdin.
|
||||||
The contents of the file must already be url-encoded.
|
The contents of the file must already be url-encoded.
|
||||||
|
|
||||||
|
To post data purely binary, you should instead use the --data-binary option.
|
||||||
|
|
||||||
|
-d/--data is the same as --data-ascii.
|
||||||
|
.IP "--data-ascii <data>"
|
||||||
|
(HTTP) This is an alias for the -d/--data option.
|
||||||
|
.IP "--data-binary <data>"
|
||||||
|
(HTTP) This posts data in a similar manner as --data-ascii does, although when
|
||||||
|
using this option the entire context of the posted data is kept as-is. If you
|
||||||
|
want to post a binary file without the strip-newlines feature of the
|
||||||
|
--data-ascii option, this is for you.
|
||||||
.IP "-D/--dump-header <file>"
|
.IP "-D/--dump-header <file>"
|
||||||
(HTTP/FTP)
|
(HTTP/FTP)
|
||||||
Write the HTTP headers to this file. Write the FTP file info to this
|
Write the HTTP headers to this file. Write the FTP file info to this
|
||||||
@@ -605,6 +615,7 @@ If you do find any (or have other suggestions), mail Daniel Stenberg
|
|||||||
- Kristian K<>hntopp <kris@koehntopp.de>
|
- Kristian K<>hntopp <kris@koehntopp.de>
|
||||||
- Fred Noz <FNoz@siac.com>
|
- Fred Noz <FNoz@siac.com>
|
||||||
- Caolan McNamara <caolan@csn.ul.ie>
|
- Caolan McNamara <caolan@csn.ul.ie>
|
||||||
|
- Albert Chin-A-Young <china@thewrittenword.com>
|
||||||
|
|
||||||
.SH WWW
|
.SH WWW
|
||||||
http://curl.haxx.se
|
http://curl.haxx.se
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
.\" nroff -man [file]
|
.\" nroff -man [file]
|
||||||
.\" Written by daniel@haxx.se
|
.\" Written by daniel@haxx.se
|
||||||
.\"
|
.\"
|
||||||
.TH curl_easy_setopt 3 "16 June 2000" "Curl 7.0" "libcurl Manual"
|
.TH curl_easy_setopt 3 "24 August 2000" "Curl 7.2" "libcurl Manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
curl_easy_setopt - Set curl easy-session options
|
curl_easy_setopt - Set curl easy-session options
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -19,6 +19,8 @@ options are set with the
|
|||||||
followed by a parameter. That parameter can be a long, a function pointer or
|
followed by a parameter. That parameter can be a long, a function pointer or
|
||||||
an object pointer, all depending on what the option in question expects. Read
|
an object pointer, all depending on what the option in question expects. Read
|
||||||
this manual carefully as bad input values may cause libcurl to behave badly!
|
this manual carefully as bad input values may cause libcurl to behave badly!
|
||||||
|
You can only set one option in each function call. A typical application uses
|
||||||
|
many calls in the setup phase.
|
||||||
|
|
||||||
The
|
The
|
||||||
.I "handle"
|
.I "handle"
|
||||||
@@ -117,7 +119,7 @@ CURLOPT_INFILE and CURLOPT_INFILESIZE are also interesting for uploads.
|
|||||||
A non-zero parameter tells the library to do a regular HTTP post. This is a
|
A non-zero parameter tells the library to do a regular HTTP post. This is a
|
||||||
normal application/x-www-form-urlencoded kind, which is the most commonly used
|
normal application/x-www-form-urlencoded kind, which is the most commonly used
|
||||||
one by HTML forms. See the CURLOPT_POSTFIELDS option for how to specify the
|
one by HTML forms. See the CURLOPT_POSTFIELDS option for how to specify the
|
||||||
data to post.
|
data to post and CURLOPT_POSTFIELDSIZE in how to set the data size.
|
||||||
.TP
|
.TP
|
||||||
.B CURLOPT_FTPLISTONLY
|
.B CURLOPT_FTPLISTONLY
|
||||||
A non-zero parameter tells the library to just list the names of an ftp
|
A non-zero parameter tells the library to just list the names of an ftp
|
||||||
@@ -188,6 +190,12 @@ few minutes risk aborting perfectly normal operations.
|
|||||||
Pass a char * as parameter, which should be the full data to post in a HTTP
|
Pass a char * as parameter, which should be the full data to post in a HTTP
|
||||||
post operation. See also the CURLOPT_POST.
|
post operation. See also the CURLOPT_POST.
|
||||||
.TP
|
.TP
|
||||||
|
.B CURLOPT_POSTFIELDSIZE
|
||||||
|
If you want to post data to the server without letting libcurl do a strlen()
|
||||||
|
to measure the data size, this option must be used. Also, when this option is
|
||||||
|
used, you can post fully binary data which otherwise is likely to fail. If
|
||||||
|
this size is set to zero, the library will use strlen() to get the data size.
|
||||||
|
.TP
|
||||||
.B CURLOPT_REFERER
|
.B CURLOPT_REFERER
|
||||||
Pass a pointer to a zero terminated string as parameter. It will be used to
|
Pass a pointer to a zero terminated string as parameter. It will be used to
|
||||||
set the referer: header in the http request sent to the remote server. This
|
set the referer: header in the http request sent to the remote server. This
|
||||||
|
@@ -371,6 +371,9 @@ typedef enum {
|
|||||||
"[host]:[port]" */
|
"[host]:[port]" */
|
||||||
T(PROXYPORT, LONG, 59),
|
T(PROXYPORT, LONG, 59),
|
||||||
|
|
||||||
|
/* size of the POST input data, if strlen() is not good to use */
|
||||||
|
T(POSTFIELDSIZE, LONG, 60),
|
||||||
|
|
||||||
CURLOPT_LASTENTRY /* the last unusued */
|
CURLOPT_LASTENTRY /* the last unusued */
|
||||||
} CURLoption;
|
} CURLoption;
|
||||||
|
|
||||||
@@ -419,8 +422,8 @@ char *curl_getenv(char *variable);
|
|||||||
char *curl_version(void);
|
char *curl_version(void);
|
||||||
|
|
||||||
/* This is the version number */
|
/* This is the version number */
|
||||||
#define LIBCURL_VERSION "7.1.1"
|
#define LIBCURL_VERSION "7.2"
|
||||||
#define LIBCURL_VERSION_NUM 0x070101
|
#define LIBCURL_VERSION_NUM 0x070200
|
||||||
|
|
||||||
/* linked-list structure for the CURLOPT_QUOTE option */
|
/* linked-list structure for the CURLOPT_QUOTE option */
|
||||||
struct curl_slist {
|
struct curl_slist {
|
||||||
|
@@ -53,11 +53,11 @@ RELEASE_OBJS= \
|
|||||||
timevalr.obj \
|
timevalr.obj \
|
||||||
urlr.obj \
|
urlr.obj \
|
||||||
filer.obj \
|
filer.obj \
|
||||||
writeoutr.obj \
|
writeoutr.obj \
|
||||||
versionr.obj \
|
versionr.obj \
|
||||||
easyr.obj \
|
easyr.obj \
|
||||||
highlevelr.obj \
|
highlevelr.obj \
|
||||||
strequalr.obj
|
strequalr.obj
|
||||||
|
|
||||||
DEBUG_OBJS= \
|
DEBUG_OBJS= \
|
||||||
base64d.obj \
|
base64d.obj \
|
||||||
@@ -67,7 +67,7 @@ DEBUG_OBJS= \
|
|||||||
formdatad.obj \
|
formdatad.obj \
|
||||||
ftpd.obj \
|
ftpd.obj \
|
||||||
httpd.obj \
|
httpd.obj \
|
||||||
ldapd.obj \
|
ldapd.obj \
|
||||||
dictd.obj \
|
dictd.obj \
|
||||||
telnetd.obj \
|
telnetd.obj \
|
||||||
getdated.obj \
|
getdated.obj \
|
||||||
@@ -84,11 +84,11 @@ DEBUG_OBJS= \
|
|||||||
timevald.obj \
|
timevald.obj \
|
||||||
urld.obj \
|
urld.obj \
|
||||||
filed.obj \
|
filed.obj \
|
||||||
writeoutd.obj \
|
writeoutd.obj \
|
||||||
versiond.obj \
|
versiond.obj \
|
||||||
easyd.obj \
|
easyd.obj \
|
||||||
highleveld.obj \
|
highleveld.obj \
|
||||||
strequald.obj
|
strequald.obj
|
||||||
|
|
||||||
RELEASE_SSL_OBJS= \
|
RELEASE_SSL_OBJS= \
|
||||||
base64rs.obj \
|
base64rs.obj \
|
||||||
@@ -98,7 +98,7 @@ RELEASE_SSL_OBJS= \
|
|||||||
formdatars.obj \
|
formdatars.obj \
|
||||||
ftprs.obj \
|
ftprs.obj \
|
||||||
httprs.obj \
|
httprs.obj \
|
||||||
ldaprs.obj \
|
ldaprs.obj \
|
||||||
dictrs.obj \
|
dictrs.obj \
|
||||||
telnetrs.obj \
|
telnetrs.obj \
|
||||||
getdaters.obj \
|
getdaters.obj \
|
||||||
@@ -115,11 +115,11 @@ RELEASE_SSL_OBJS= \
|
|||||||
timevalrs.obj \
|
timevalrs.obj \
|
||||||
urlrs.obj \
|
urlrs.obj \
|
||||||
filers.obj \
|
filers.obj \
|
||||||
writeouts.obj \
|
writeouts.obj \
|
||||||
versionrs.obj \
|
versionrs.obj \
|
||||||
easyrs.obj \
|
easyrs.obj \
|
||||||
highlevelrs.obj \
|
highlevelrs.obj \
|
||||||
strequalrs.obj
|
strequalrs.obj
|
||||||
|
|
||||||
LINK_OBJS= \
|
LINK_OBJS= \
|
||||||
base64.obj \
|
base64.obj \
|
||||||
@@ -129,7 +129,7 @@ LINK_OBJS= \
|
|||||||
formdata.obj \
|
formdata.obj \
|
||||||
ftp.obj \
|
ftp.obj \
|
||||||
http.obj \
|
http.obj \
|
||||||
ldap.obj \
|
ldap.obj \
|
||||||
dict.obj \
|
dict.obj \
|
||||||
telnet.obj \
|
telnet.obj \
|
||||||
getdate.obj \
|
getdate.obj \
|
||||||
@@ -146,11 +146,11 @@ LINK_OBJS= \
|
|||||||
timeval.obj \
|
timeval.obj \
|
||||||
url.obj \
|
url.obj \
|
||||||
file.obj \
|
file.obj \
|
||||||
writeout.obj \
|
writeout.obj \
|
||||||
version.obj \
|
version.obj \
|
||||||
easy.obj \
|
easy.obj \
|
||||||
highlevel.obj \
|
highlevel.obj \
|
||||||
strequal.obj
|
strequal.obj
|
||||||
|
|
||||||
all : release
|
all : release
|
||||||
|
|
||||||
@@ -217,6 +217,12 @@ writeoutr.obj: writeout.c
|
|||||||
$(CCR) $(CFLAGS) writeout.c
|
$(CCR) $(CFLAGS) writeout.c
|
||||||
versionr.obj: version.c
|
versionr.obj: version.c
|
||||||
$(CCR) $(CFLAGS) version.c
|
$(CCR) $(CFLAGS) version.c
|
||||||
|
easyr.obj: easy.c
|
||||||
|
$(CCR) $(CFLAGS) easy.c
|
||||||
|
highlevelr.obj: highlevel.c
|
||||||
|
$(CCR) $(CFLAGS) highlevel.c
|
||||||
|
strequalr.obj: strequal.c
|
||||||
|
$(CCR) $(CFLAGS) strequal.c
|
||||||
|
|
||||||
## Debug
|
## Debug
|
||||||
base64d.obj: base64.c
|
base64d.obj: base64.c
|
||||||
@@ -271,6 +277,12 @@ writeoutd.obj: writeout.c
|
|||||||
$(CCR) $(CFLAGS) writeout.c
|
$(CCR) $(CFLAGS) writeout.c
|
||||||
versiond.obj: version.c
|
versiond.obj: version.c
|
||||||
$(CCD) $(CFLAGS) version.c
|
$(CCD) $(CFLAGS) version.c
|
||||||
|
easyd.obj: easy.c
|
||||||
|
$(CCR) $(CFLAGS) easy.c
|
||||||
|
highleveld.obj: highlevel.c
|
||||||
|
$(CCR) $(CFLAGS) highlevel.c
|
||||||
|
strequald.obj: strequal.c
|
||||||
|
$(CCR) $(CFLAGS) strequal.c
|
||||||
|
|
||||||
|
|
||||||
## Release SSL
|
## Release SSL
|
||||||
@@ -326,6 +338,12 @@ writeoutrs.obj: writeout.c
|
|||||||
$(CCR) $(CFLAGS) writeout.c
|
$(CCR) $(CFLAGS) writeout.c
|
||||||
versionrs.obj: version.c
|
versionrs.obj: version.c
|
||||||
$(CCRS) $(CFLAGS) version.c
|
$(CCRS) $(CFLAGS) version.c
|
||||||
|
easyrs.obj: easy.c
|
||||||
|
$(CCR) $(CFLAGS) easy.c
|
||||||
|
highlevelrs.obj: highlevel.c
|
||||||
|
$(CCR) $(CFLAGS) highlevel.c
|
||||||
|
strequalrs.obj: strequal.c
|
||||||
|
$(CCR) $(CFLAGS) strequal.c
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-@erase *.obj
|
-@erase *.obj
|
||||||
|
@@ -55,12 +55,13 @@ Example set of cookies:
|
|||||||
13-Jun-1988 03:04:55 GMT; domain=.fidelity.com; path=/; secure
|
13-Jun-1988 03:04:55 GMT; domain=.fidelity.com; path=/; secure
|
||||||
****/
|
****/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "cookie.h"
|
#include "cookie.h"
|
||||||
#include "setup.h"
|
|
||||||
#include "getdate.h"
|
#include "getdate.h"
|
||||||
#include "strequal.h"
|
#include "strequal.h"
|
||||||
|
|
||||||
|
@@ -38,6 +38,8 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
/* -- WIN32 approved -- */
|
/* -- WIN32 approved -- */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -49,8 +51,6 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@@ -38,12 +38,12 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
|
@@ -38,6 +38,8 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
/* -- WIN32 approved -- */
|
/* -- WIN32 approved -- */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -49,7 +51,6 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
#include "strequal.h"
|
#include "strequal.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
|
@@ -38,6 +38,8 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
/* -- WIN32 approved -- */
|
/* -- WIN32 approved -- */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -49,8 +51,6 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -60,13 +60,17 @@
|
|||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_ARPA_INET_H
|
#ifdef HAVE_ARPA_INET_H
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
@@ -49,6 +49,8 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -56,7 +58,6 @@
|
|||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include "formdata.h"
|
#include "formdata.h"
|
||||||
|
|
||||||
|
19
lib/ftp.c
19
lib/ftp.c
@@ -38,14 +38,14 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -60,22 +60,22 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_ARPA_INET_H
|
#ifdef HAVE_ARPA_INET_H
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(WIN32) && defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && defined(__GNUC__) || defined(__MINGW32__)
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_INET_NTOA_R
|
|
||||||
#include "inet_ntoa_r.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
@@ -680,7 +680,10 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
unsigned short ip[5];
|
unsigned short ip[5];
|
||||||
(void) memcpy(&in.s_addr, *h->h_addr_list, sizeof (in.s_addr));
|
(void) memcpy(&in.s_addr, *h->h_addr_list, sizeof (in.s_addr));
|
||||||
#if defined (HAVE_INET_NTOA_R)
|
#if defined (HAVE_INET_NTOA_R)
|
||||||
sscanf( inet_ntoa_r(in, ntoa_buf, sizeof(ntoa_buf)), "%hu.%hu.%hu.%hu",
|
/* ignore the return code from inet_ntoa_r() as it is int or
|
||||||
|
char * depending on system */
|
||||||
|
inet_ntoa_r(in, ntoa_buf, sizeof(ntoa_buf));
|
||||||
|
sscanf( ntoa_buf, "%hu.%hu.%hu.%hu",
|
||||||
&ip[0], &ip[1], &ip[2], &ip[3]);
|
&ip[0], &ip[1], &ip[2], &ip[3]);
|
||||||
#else
|
#else
|
||||||
sscanf( inet_ntoa(in), "%hu.%hu.%hu.%hu",
|
sscanf( inet_ntoa(in), "%hu.%hu.%hu.%hu",
|
||||||
@@ -815,7 +818,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
infof(data, "Connecting to %s (%s) port %u\n",
|
infof(data, "Connecting to %s (%s) port %u\n",
|
||||||
answer?answer->h_name:newhost,
|
answer?answer->h_name:newhost,
|
||||||
#if defined(HAVE_INET_NTOA_R)
|
#if defined(HAVE_INET_NTOA_R)
|
||||||
ip_addr = inet_ntoa_r(in, ntoa_buf, sizeof(ntoa_buf)),
|
inet_ntoa_r(in, ip_addr=ntoa_buf, sizeof(ntoa_buf)),
|
||||||
#else
|
#else
|
||||||
ip_addr = inet_ntoa(in),
|
ip_addr = inet_ntoa(in),
|
||||||
#endif
|
#endif
|
||||||
|
171
lib/getdate.c
171
lib/getdate.c
@@ -32,15 +32,18 @@
|
|||||||
** This code is in the public domain and has no copyright.
|
** This code is in the public domain and has no copyright.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _REENTRANT /* Necessary to use in Solaris, since the silly guys at Sun
|
|
||||||
made the localtime_r() prototype dependent on it (or
|
|
||||||
_POSIX_C_SOURCE or _POSIX_PTHREAD_SEMANTICS). */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
# ifdef HAVE_ALLOCA_H
|
# ifdef HAVE_ALLOCA_H
|
||||||
# include <alloca.h>
|
# include <alloca.h>
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef NEED_REENTRANT
|
||||||
|
# define _REENTRANT /* Necessary to use in Solaris, since the silly guys at
|
||||||
|
Sun made the localtime_r() prototype dependent on it
|
||||||
|
(or _POSIX_C_SOURCE or _POSIX_PTHREAD_SEMANTICS) */
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef HAVE_TIME_H
|
# ifdef HAVE_TIME_H
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
# endif
|
# endif
|
||||||
@@ -219,7 +222,7 @@ static int yyRelSeconds;
|
|||||||
static int yyRelYear;
|
static int yyRelYear;
|
||||||
|
|
||||||
|
|
||||||
#line 202 "getdate.y"
|
#line 205 "getdate.y"
|
||||||
typedef union {
|
typedef union {
|
||||||
int Number;
|
int Number;
|
||||||
enum _MERIDIAN Meridian;
|
enum _MERIDIAN Meridian;
|
||||||
@@ -302,11 +305,11 @@ static const short yyrhs[] = { -1,
|
|||||||
|
|
||||||
#if YYDEBUG != 0
|
#if YYDEBUG != 0
|
||||||
static const short yyrline[] = { 0,
|
static const short yyrline[] = { 0,
|
||||||
218, 219, 222, 225, 228, 231, 234, 237, 240, 246,
|
221, 222, 225, 228, 231, 234, 237, 240, 243, 249,
|
||||||
252, 261, 267, 279, 282, 285, 291, 295, 299, 305,
|
255, 264, 270, 282, 285, 288, 294, 298, 302, 308,
|
||||||
309, 327, 333, 339, 343, 348, 352, 359, 367, 370,
|
312, 330, 336, 342, 346, 351, 355, 362, 370, 373,
|
||||||
373, 376, 379, 382, 385, 388, 391, 394, 397, 400,
|
376, 379, 382, 385, 388, 391, 394, 397, 400, 403,
|
||||||
403, 406, 409, 412, 415, 418, 421, 426, 459, 463
|
406, 409, 412, 415, 418, 421, 424, 429, 462, 466
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -387,7 +390,7 @@ static const short yycheck[] = { 0,
|
|||||||
56
|
56
|
||||||
};
|
};
|
||||||
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
|
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
|
||||||
#line 3 "/usr/local/share/bison.simple"
|
#line 3 "/opt/TWWfsw/bison/share/bison.simple"
|
||||||
/* This file comes from bison-1.28. */
|
/* This file comes from bison-1.28. */
|
||||||
|
|
||||||
/* Skeleton output parser for bison,
|
/* Skeleton output parser for bison,
|
||||||
@@ -601,7 +604,7 @@ __yy_memcpy (char *to, char *from, unsigned int count)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#line 217 "/usr/local/share/bison.simple"
|
#line 217 "/opt/TWWfsw/bison/share/bison.simple"
|
||||||
|
|
||||||
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
|
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
|
||||||
into yyparse. The argument should have type void *.
|
into yyparse. The argument should have type void *.
|
||||||
@@ -930,37 +933,37 @@ yyreduce:
|
|||||||
switch (yyn) {
|
switch (yyn) {
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
#line 222 "getdate.y"
|
#line 225 "getdate.y"
|
||||||
{
|
{
|
||||||
yyHaveTime++;
|
yyHaveTime++;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 4:
|
case 4:
|
||||||
#line 225 "getdate.y"
|
#line 228 "getdate.y"
|
||||||
{
|
{
|
||||||
yyHaveZone++;
|
yyHaveZone++;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 5:
|
case 5:
|
||||||
#line 228 "getdate.y"
|
#line 231 "getdate.y"
|
||||||
{
|
{
|
||||||
yyHaveDate++;
|
yyHaveDate++;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 6:
|
case 6:
|
||||||
#line 231 "getdate.y"
|
#line 234 "getdate.y"
|
||||||
{
|
{
|
||||||
yyHaveDay++;
|
yyHaveDay++;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 7:
|
case 7:
|
||||||
#line 234 "getdate.y"
|
#line 237 "getdate.y"
|
||||||
{
|
{
|
||||||
yyHaveRel++;
|
yyHaveRel++;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 9:
|
case 9:
|
||||||
#line 240 "getdate.y"
|
#line 243 "getdate.y"
|
||||||
{
|
{
|
||||||
yyHour = yyvsp[-1].Number;
|
yyHour = yyvsp[-1].Number;
|
||||||
yyMinutes = 0;
|
yyMinutes = 0;
|
||||||
@@ -969,7 +972,7 @@ case 9:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 10:
|
case 10:
|
||||||
#line 246 "getdate.y"
|
#line 249 "getdate.y"
|
||||||
{
|
{
|
||||||
yyHour = yyvsp[-3].Number;
|
yyHour = yyvsp[-3].Number;
|
||||||
yyMinutes = yyvsp[-1].Number;
|
yyMinutes = yyvsp[-1].Number;
|
||||||
@@ -978,7 +981,7 @@ case 10:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 11:
|
case 11:
|
||||||
#line 252 "getdate.y"
|
#line 255 "getdate.y"
|
||||||
{
|
{
|
||||||
yyHour = yyvsp[-3].Number;
|
yyHour = yyvsp[-3].Number;
|
||||||
yyMinutes = yyvsp[-1].Number;
|
yyMinutes = yyvsp[-1].Number;
|
||||||
@@ -990,7 +993,7 @@ case 11:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 12:
|
case 12:
|
||||||
#line 261 "getdate.y"
|
#line 264 "getdate.y"
|
||||||
{
|
{
|
||||||
yyHour = yyvsp[-5].Number;
|
yyHour = yyvsp[-5].Number;
|
||||||
yyMinutes = yyvsp[-3].Number;
|
yyMinutes = yyvsp[-3].Number;
|
||||||
@@ -999,7 +1002,7 @@ case 12:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 13:
|
case 13:
|
||||||
#line 267 "getdate.y"
|
#line 270 "getdate.y"
|
||||||
{
|
{
|
||||||
yyHour = yyvsp[-5].Number;
|
yyHour = yyvsp[-5].Number;
|
||||||
yyMinutes = yyvsp[-3].Number;
|
yyMinutes = yyvsp[-3].Number;
|
||||||
@@ -1012,53 +1015,53 @@ case 13:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 14:
|
case 14:
|
||||||
#line 279 "getdate.y"
|
#line 282 "getdate.y"
|
||||||
{
|
{
|
||||||
yyTimezone = yyvsp[0].Number;
|
yyTimezone = yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 15:
|
case 15:
|
||||||
#line 282 "getdate.y"
|
#line 285 "getdate.y"
|
||||||
{
|
{
|
||||||
yyTimezone = yyvsp[0].Number - 60;
|
yyTimezone = yyvsp[0].Number - 60;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 16:
|
case 16:
|
||||||
#line 286 "getdate.y"
|
#line 289 "getdate.y"
|
||||||
{
|
{
|
||||||
yyTimezone = yyvsp[-1].Number - 60;
|
yyTimezone = yyvsp[-1].Number - 60;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 17:
|
case 17:
|
||||||
#line 291 "getdate.y"
|
#line 294 "getdate.y"
|
||||||
{
|
{
|
||||||
yyDayOrdinal = 1;
|
yyDayOrdinal = 1;
|
||||||
yyDayNumber = yyvsp[0].Number;
|
yyDayNumber = yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 18:
|
case 18:
|
||||||
#line 295 "getdate.y"
|
#line 298 "getdate.y"
|
||||||
{
|
{
|
||||||
yyDayOrdinal = 1;
|
yyDayOrdinal = 1;
|
||||||
yyDayNumber = yyvsp[-1].Number;
|
yyDayNumber = yyvsp[-1].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 19:
|
case 19:
|
||||||
#line 299 "getdate.y"
|
#line 302 "getdate.y"
|
||||||
{
|
{
|
||||||
yyDayOrdinal = yyvsp[-1].Number;
|
yyDayOrdinal = yyvsp[-1].Number;
|
||||||
yyDayNumber = yyvsp[0].Number;
|
yyDayNumber = yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 20:
|
case 20:
|
||||||
#line 305 "getdate.y"
|
#line 308 "getdate.y"
|
||||||
{
|
{
|
||||||
yyMonth = yyvsp[-2].Number;
|
yyMonth = yyvsp[-2].Number;
|
||||||
yyDay = yyvsp[0].Number;
|
yyDay = yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 21:
|
case 21:
|
||||||
#line 309 "getdate.y"
|
#line 312 "getdate.y"
|
||||||
{
|
{
|
||||||
/* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY.
|
/* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY.
|
||||||
The goal in recognizing YYYY/MM/DD is solely to support legacy
|
The goal in recognizing YYYY/MM/DD is solely to support legacy
|
||||||
@@ -1079,7 +1082,7 @@ case 21:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 22:
|
case 22:
|
||||||
#line 327 "getdate.y"
|
#line 330 "getdate.y"
|
||||||
{
|
{
|
||||||
/* ISO 8601 format. yyyy-mm-dd. */
|
/* ISO 8601 format. yyyy-mm-dd. */
|
||||||
yyYear = yyvsp[-2].Number;
|
yyYear = yyvsp[-2].Number;
|
||||||
@@ -1088,7 +1091,7 @@ case 22:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 23:
|
case 23:
|
||||||
#line 333 "getdate.y"
|
#line 336 "getdate.y"
|
||||||
{
|
{
|
||||||
/* e.g. 17-JUN-1992. */
|
/* e.g. 17-JUN-1992. */
|
||||||
yyDay = yyvsp[-2].Number;
|
yyDay = yyvsp[-2].Number;
|
||||||
@@ -1097,14 +1100,14 @@ case 23:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 24:
|
case 24:
|
||||||
#line 339 "getdate.y"
|
#line 342 "getdate.y"
|
||||||
{
|
{
|
||||||
yyMonth = yyvsp[-1].Number;
|
yyMonth = yyvsp[-1].Number;
|
||||||
yyDay = yyvsp[0].Number;
|
yyDay = yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 25:
|
case 25:
|
||||||
#line 343 "getdate.y"
|
#line 346 "getdate.y"
|
||||||
{
|
{
|
||||||
yyMonth = yyvsp[-3].Number;
|
yyMonth = yyvsp[-3].Number;
|
||||||
yyDay = yyvsp[-2].Number;
|
yyDay = yyvsp[-2].Number;
|
||||||
@@ -1112,14 +1115,14 @@ case 25:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 26:
|
case 26:
|
||||||
#line 348 "getdate.y"
|
#line 351 "getdate.y"
|
||||||
{
|
{
|
||||||
yyMonth = yyvsp[0].Number;
|
yyMonth = yyvsp[0].Number;
|
||||||
yyDay = yyvsp[-1].Number;
|
yyDay = yyvsp[-1].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 27:
|
case 27:
|
||||||
#line 352 "getdate.y"
|
#line 355 "getdate.y"
|
||||||
{
|
{
|
||||||
yyMonth = yyvsp[-1].Number;
|
yyMonth = yyvsp[-1].Number;
|
||||||
yyDay = yyvsp[-2].Number;
|
yyDay = yyvsp[-2].Number;
|
||||||
@@ -1127,7 +1130,7 @@ case 27:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 28:
|
case 28:
|
||||||
#line 359 "getdate.y"
|
#line 362 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelSeconds = -yyRelSeconds;
|
yyRelSeconds = -yyRelSeconds;
|
||||||
yyRelMinutes = -yyRelMinutes;
|
yyRelMinutes = -yyRelMinutes;
|
||||||
@@ -1138,115 +1141,115 @@ case 28:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 30:
|
case 30:
|
||||||
#line 370 "getdate.y"
|
|
||||||
{
|
|
||||||
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
|
|
||||||
;
|
|
||||||
break;}
|
|
||||||
case 31:
|
|
||||||
#line 373 "getdate.y"
|
#line 373 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
|
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 32:
|
case 31:
|
||||||
#line 376 "getdate.y"
|
#line 376 "getdate.y"
|
||||||
|
{
|
||||||
|
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
|
;
|
||||||
|
break;}
|
||||||
|
case 32:
|
||||||
|
#line 379 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelYear += yyvsp[0].Number;
|
yyRelYear += yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 33:
|
case 33:
|
||||||
#line 379 "getdate.y"
|
|
||||||
{
|
|
||||||
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
|
|
||||||
;
|
|
||||||
break;}
|
|
||||||
case 34:
|
|
||||||
#line 382 "getdate.y"
|
#line 382 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
|
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 35:
|
case 34:
|
||||||
#line 385 "getdate.y"
|
#line 385 "getdate.y"
|
||||||
|
{
|
||||||
|
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
|
;
|
||||||
|
break;}
|
||||||
|
case 35:
|
||||||
|
#line 388 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelMonth += yyvsp[0].Number;
|
yyRelMonth += yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 36:
|
case 36:
|
||||||
#line 388 "getdate.y"
|
|
||||||
{
|
|
||||||
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
|
|
||||||
;
|
|
||||||
break;}
|
|
||||||
case 37:
|
|
||||||
#line 391 "getdate.y"
|
#line 391 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
|
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 38:
|
case 37:
|
||||||
#line 394 "getdate.y"
|
#line 394 "getdate.y"
|
||||||
|
{
|
||||||
|
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
|
;
|
||||||
|
break;}
|
||||||
|
case 38:
|
||||||
|
#line 397 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelDay += yyvsp[0].Number;
|
yyRelDay += yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 39:
|
case 39:
|
||||||
#line 397 "getdate.y"
|
|
||||||
{
|
|
||||||
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
|
|
||||||
;
|
|
||||||
break;}
|
|
||||||
case 40:
|
|
||||||
#line 400 "getdate.y"
|
#line 400 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
|
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 41:
|
case 40:
|
||||||
#line 403 "getdate.y"
|
#line 403 "getdate.y"
|
||||||
|
{
|
||||||
|
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
|
;
|
||||||
|
break;}
|
||||||
|
case 41:
|
||||||
|
#line 406 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelHour += yyvsp[0].Number;
|
yyRelHour += yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 42:
|
case 42:
|
||||||
#line 406 "getdate.y"
|
|
||||||
{
|
|
||||||
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
|
|
||||||
;
|
|
||||||
break;}
|
|
||||||
case 43:
|
|
||||||
#line 409 "getdate.y"
|
#line 409 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
|
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 44:
|
case 43:
|
||||||
#line 412 "getdate.y"
|
#line 412 "getdate.y"
|
||||||
|
{
|
||||||
|
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
|
;
|
||||||
|
break;}
|
||||||
|
case 44:
|
||||||
|
#line 415 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelMinutes += yyvsp[0].Number;
|
yyRelMinutes += yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 45:
|
case 45:
|
||||||
#line 415 "getdate.y"
|
|
||||||
{
|
|
||||||
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
|
|
||||||
;
|
|
||||||
break;}
|
|
||||||
case 46:
|
|
||||||
#line 418 "getdate.y"
|
#line 418 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
|
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 47:
|
case 46:
|
||||||
#line 421 "getdate.y"
|
#line 421 "getdate.y"
|
||||||
|
{
|
||||||
|
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
|
||||||
|
;
|
||||||
|
break;}
|
||||||
|
case 47:
|
||||||
|
#line 424 "getdate.y"
|
||||||
{
|
{
|
||||||
yyRelSeconds += yyvsp[0].Number;
|
yyRelSeconds += yyvsp[0].Number;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 48:
|
case 48:
|
||||||
#line 427 "getdate.y"
|
#line 430 "getdate.y"
|
||||||
{
|
{
|
||||||
if (yyHaveTime && yyHaveDate && !yyHaveRel)
|
if (yyHaveTime && yyHaveDate && !yyHaveRel)
|
||||||
yyYear = yyvsp[0].Number;
|
yyYear = yyvsp[0].Number;
|
||||||
@@ -1279,20 +1282,20 @@ case 48:
|
|||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 49:
|
case 49:
|
||||||
#line 460 "getdate.y"
|
#line 463 "getdate.y"
|
||||||
{
|
{
|
||||||
yyval.Meridian = MER24;
|
yyval.Meridian = MER24;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
case 50:
|
case 50:
|
||||||
#line 464 "getdate.y"
|
#line 467 "getdate.y"
|
||||||
{
|
{
|
||||||
yyval.Meridian = yyvsp[0].Meridian;
|
yyval.Meridian = yyvsp[0].Meridian;
|
||||||
;
|
;
|
||||||
break;}
|
break;}
|
||||||
}
|
}
|
||||||
/* the action file gets copied in in place of this dollarsign */
|
/* the action file gets copied in in place of this dollarsign */
|
||||||
#line 543 "/usr/local/share/bison.simple"
|
#line 543 "/opt/TWWfsw/bison/share/bison.simple"
|
||||||
|
|
||||||
yyvsp -= yylen;
|
yyvsp -= yylen;
|
||||||
yyssp -= yylen;
|
yyssp -= yylen;
|
||||||
@@ -1512,7 +1515,7 @@ yyerrhandle:
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#line 469 "getdate.y"
|
#line 472 "getdate.y"
|
||||||
|
|
||||||
|
|
||||||
/* Include this file down here because bison inserts code above which
|
/* Include this file down here because bison inserts code above which
|
||||||
|
@@ -8,15 +8,18 @@
|
|||||||
** This code is in the public domain and has no copyright.
|
** This code is in the public domain and has no copyright.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _REENTRANT /* Necessary to use in Solaris, since the silly guys at Sun
|
|
||||||
made the localtime_r() prototype dependent on it (or
|
|
||||||
_POSIX_C_SOURCE or _POSIX_PTHREAD_SEMANTICS). */
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
# ifdef HAVE_ALLOCA_H
|
# ifdef HAVE_ALLOCA_H
|
||||||
# include <alloca.h>
|
# include <alloca.h>
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef NEED_REENTRANT
|
||||||
|
# define _REENTRANT /* Necessary to use in Solaris, since the silly guys at
|
||||||
|
Sun made the localtime_r() prototype dependent on it
|
||||||
|
(or _POSIX_C_SOURCE or _POSIX_PTHREAD_SEMANTICS) */
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef HAVE_TIME_H
|
# ifdef HAVE_TIME_H
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
# endif
|
# endif
|
||||||
|
@@ -38,6 +38,8 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
/* -- WIN32 approved -- */
|
/* -- WIN32 approved -- */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -49,7 +51,6 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
#include "strequal.h"
|
#include "strequal.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
|
24
lib/hostip.c
24
lib/hostip.c
@@ -38,10 +38,13 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include "setup.h"
|
#define _REENTRANT
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
@@ -52,8 +55,12 @@
|
|||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_ARPA_INET_H
|
#ifdef HAVE_ARPA_INET_H
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -62,9 +69,7 @@
|
|||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
|
|
||||||
#define _REENTRANT
|
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
|
||||||
|
|
||||||
#ifdef HAVE_INET_NTOA_R
|
|
||||||
#include "inet_ntoa_r.h"
|
#include "inet_ntoa_r.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -103,6 +108,7 @@ struct hostent *GetHost(struct UrlData *data,
|
|||||||
{
|
{
|
||||||
struct hostent *h = NULL;
|
struct hostent *h = NULL;
|
||||||
unsigned long in;
|
unsigned long in;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if ( (in=inet_addr(hostname)) != INADDR_NONE ) {
|
if ( (in=inet_addr(hostname)) != INADDR_NONE ) {
|
||||||
struct in_addr *addrentry;
|
struct in_addr *addrentry;
|
||||||
@@ -145,13 +151,17 @@ struct hostent *GetHost(struct UrlData *data,
|
|||||||
|
|
||||||
/* August 4th, 2000. I don't have any such system around so I write this
|
/* August 4th, 2000. I don't have any such system around so I write this
|
||||||
blindly in hope it might work or that someone else will help me fix
|
blindly in hope it might work or that someone else will help me fix
|
||||||
this. */
|
this. August 22nd, 2000: Albert Chin-A-Young brought an updated version
|
||||||
|
that should work! */
|
||||||
|
|
||||||
h = gethostbyname_r(hostname,
|
ret = gethostbyname_r(hostname,
|
||||||
(struct hostent *)buf,
|
(struct hostent *)buf,
|
||||||
(struct hostent_data *)(buf + sizeof(struct hostent)));
|
(struct hostent_data *)(buf + sizeof(struct hostent)));
|
||||||
|
|
||||||
|
/* result expected in h */
|
||||||
|
h = (struct hostent*)buf;
|
||||||
h_errnop= errno; /* we don't deal with this, but set it anyway */
|
h_errnop= errno; /* we don't deal with this, but set it anyway */
|
||||||
if(NULL == h)
|
if(ret)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
infof(data, "gethostbyname_r(2) failed for %s\n", hostname);
|
infof(data, "gethostbyname_r(2) failed for %s\n", hostname);
|
||||||
|
23
lib/http.c
23
lib/http.c
@@ -38,9 +38,7 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define _REENTRANT /* Necessary to use in Solaris, since the silly guys at Sun
|
#include "setup.h"
|
||||||
made the localtime_r() prototype dependent on it (or
|
|
||||||
_POSIX_C_SOURCE or _POSIX_PTHREAD_SEMANTICS). */
|
|
||||||
|
|
||||||
/* -- WIN32 approved -- */
|
/* -- WIN32 approved -- */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -53,7 +51,12 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
#ifdef NEED_REENTRANT
|
||||||
|
#define _REENTRANT /* Necessary to use in Solaris, since the silly guys at Sun
|
||||||
|
made the localtime_r() prototype dependent on it (or
|
||||||
|
_POSIX_C_SOURCE or _POSIX_PTHREAD_SEMANTICS). */
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
@@ -63,7 +66,9 @@
|
|||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#ifdef HAVE_TIME_H
|
#ifdef HAVE_TIME_H
|
||||||
@@ -374,7 +379,7 @@ CURLcode http(struct connectdata *conn)
|
|||||||
#ifdef HAVE_LOCALTIME_R
|
#ifdef HAVE_LOCALTIME_R
|
||||||
/* thread-safe version */
|
/* thread-safe version */
|
||||||
struct tm keeptime;
|
struct tm keeptime;
|
||||||
thistime = localtime_r(&data->timevalue, &keeptime);
|
thistime = (struct tm *)localtime_r(&data->timevalue, &keeptime);
|
||||||
#else
|
#else
|
||||||
thistime = localtime(&data->timevalue);
|
thistime = localtime(&data->timevalue);
|
||||||
#endif
|
#endif
|
||||||
@@ -488,13 +493,19 @@ CURLcode http(struct connectdata *conn)
|
|||||||
actually set your own */
|
actually set your own */
|
||||||
sendf(data->firstsocket, data,
|
sendf(data->firstsocket, data,
|
||||||
"Content-Length: %d\r\n",
|
"Content-Length: %d\r\n",
|
||||||
strlen(data->postfields));
|
(data->postfieldsize?data->postfieldsize:
|
||||||
|
strlen(data->postfields)) );
|
||||||
|
|
||||||
if(!checkheaders(data, "Content-Type:"))
|
if(!checkheaders(data, "Content-Type:"))
|
||||||
sendf(data->firstsocket, data,
|
sendf(data->firstsocket, data,
|
||||||
"Content-Type: application/x-www-form-urlencoded\r\n");
|
"Content-Type: application/x-www-form-urlencoded\r\n");
|
||||||
|
|
||||||
/* and here comes the actual data */
|
/* and here comes the actual data */
|
||||||
|
if(data->postfieldsize) {
|
||||||
|
ssend(data->firstsocket, data, "\r\n", 2);
|
||||||
|
ssend(data->firstsocket, data, data->postfields, data->postfieldsize);
|
||||||
|
ssend(data->firstsocket, data, "\r\n", 2);
|
||||||
|
}
|
||||||
sendf(data->firstsocket, data,
|
sendf(data->firstsocket, data,
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"%s\r\n",
|
"%s\r\n",
|
||||||
|
14
lib/if2ip.c
14
lib/if2ip.c
@@ -38,11 +38,12 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -50,12 +51,19 @@
|
|||||||
|
|
||||||
#if ! defined(WIN32) && ! defined(__BEOS__)
|
#if ! defined(WIN32) && ! defined(__BEOS__)
|
||||||
|
|
||||||
|
#ifdef NEED_REENTRANT
|
||||||
|
#define _REENTRANT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_ARPA_INET_H
|
#ifdef HAVE_ARPA_INET_H
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
#include <netinet/in.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
/* This must be before net/if.h for AIX 3.2 to enjoy life */
|
/* This must be before net/if.h for AIX 3.2 to enjoy life */
|
||||||
@@ -75,7 +83,7 @@
|
|||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_INET_NTOA_R
|
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
|
||||||
#include "inet_ntoa_r.h"
|
#include "inet_ntoa_r.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -38,6 +38,8 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
/* -- WIN32 approved -- */
|
/* -- WIN32 approved -- */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -48,8 +50,6 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__)
|
#if defined(WIN32) && !defined(__GNUC__)
|
||||||
#else
|
#else
|
||||||
# ifdef HAVE_UNISTD_H
|
# ifdef HAVE_UNISTD_H
|
||||||
|
@@ -50,11 +50,12 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
#include "getenv.h"
|
#include "getenv.h"
|
||||||
#include "strequal.h"
|
#include "strequal.h"
|
||||||
|
|
||||||
|
@@ -38,9 +38,10 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
#if defined(__MINGW32__)
|
#if defined(__MINGW32__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
|
24
lib/sendf.c
24
lib/sendf.c
@@ -38,12 +38,12 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -84,7 +84,6 @@ void failf(struct UrlData *data, char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* sendf() sends the formated data to the server */
|
/* sendf() sends the formated data to the server */
|
||||||
|
|
||||||
int sendf(int fd, struct UrlData *data, char *fmt, ...)
|
int sendf(int fd, struct UrlData *data, char *fmt, ...)
|
||||||
{
|
{
|
||||||
size_t bytes_written;
|
size_t bytes_written;
|
||||||
@@ -110,6 +109,25 @@ int sendf(int fd, struct UrlData *data, char *fmt, ...)
|
|||||||
return(bytes_written);
|
return(bytes_written);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ssend() sends plain (binary) data to the server */
|
||||||
|
size_t ssend(int fd, struct UrlData *data, void *mem, size_t len)
|
||||||
|
{
|
||||||
|
size_t bytes_written;
|
||||||
|
|
||||||
|
if(data->bits.verbose)
|
||||||
|
fprintf(data->err, "> [binary output]\n");
|
||||||
|
#ifndef USE_SSLEAY
|
||||||
|
bytes_written = swrite(fd, mem, len);
|
||||||
|
#else
|
||||||
|
if (data->use_ssl) {
|
||||||
|
bytes_written = SSL_write(data->ssl, mem, len);
|
||||||
|
} else {
|
||||||
|
bytes_written = swrite(fd, mem, len);
|
||||||
|
}
|
||||||
|
#endif /* USE_SSLEAY */
|
||||||
|
return bytes_written;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -40,7 +40,8 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int sendf(int fd, struct UrlData *, char *fmt, ...);
|
size_t sendf(int fd, struct UrlData *, char *fmt, ...);
|
||||||
|
size_t ssend(int fd, struct UrlData *, void *fmt, size_t len);
|
||||||
void infof(struct UrlData *, char *fmt, ...);
|
void infof(struct UrlData *, char *fmt, ...);
|
||||||
void failf(struct UrlData *, char *fmt, ...);
|
void failf(struct UrlData *, char *fmt, ...);
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#if !defined(WIN32) && defined(_WIN32)
|
#if !defined(WIN32) && defined(_WIN32)
|
||||||
/* This _might_ be a good Borland fix. Please report whether this works or
|
/* This _might_ be a good Borland fix. Please report whether this works or
|
||||||
@@ -57,6 +57,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#ifndef OS
|
#ifndef OS
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define OS "win32"
|
#define OS "win32"
|
||||||
|
@@ -38,6 +38,8 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#if defined(__MINGW32__)
|
#if defined(__MINGW32__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
* Linas Vepstas <linas@linas.org> and Sampo Kellomaki <sampo@iki.fi>
|
* Linas Vepstas <linas@linas.org> and Sampo Kellomaki <sampo@iki.fi>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
@@ -38,10 +38,10 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int strequal(const char *first, const char *second)
|
int strequal(const char *first, const char *second)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_STRCASECMP)
|
#if defined(HAVE_STRCASECMP)
|
||||||
|
@@ -46,6 +46,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
/* -- WIN32 approved -- */
|
/* -- WIN32 approved -- */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -57,8 +59,6 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@@ -40,6 +40,8 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
@@ -47,7 +49,6 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#ifndef HAVE_GETTIMEOFDAY
|
#ifndef HAVE_GETTIMEOFDAY
|
||||||
#if !defined(_WINSOCKAPI_) && !defined(__MINGW32__)
|
#if !defined(_WINSOCKAPI_) && !defined(__MINGW32__)
|
||||||
|
@@ -39,6 +39,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* -- WIN32 approved -- */
|
/* -- WIN32 approved -- */
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@@ -49,7 +52,6 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
@@ -421,6 +423,9 @@ CURLcode curl_setopt(CURL *curl, CURLoption option, ...)
|
|||||||
case CURLOPT_POSTFIELDS:
|
case CURLOPT_POSTFIELDS:
|
||||||
data->postfields = va_arg(param, char *);
|
data->postfields = va_arg(param, char *);
|
||||||
break;
|
break;
|
||||||
|
case CURLOPT_POSTFIELDSIZE:
|
||||||
|
data->postfieldsize = va_arg(param, long);
|
||||||
|
break;
|
||||||
case CURLOPT_REFERER:
|
case CURLOPT_REFERER:
|
||||||
data->referer = va_arg(param, char *);
|
data->referer = va_arg(param, char *);
|
||||||
data->bits.http_set_referer = (data->referer && *data->referer)?1:0;
|
data->bits.http_set_referer = (data->referer && *data->referer)?1:0;
|
||||||
|
@@ -345,6 +345,9 @@ struct UrlData {
|
|||||||
char *range; /* range, if used. See README for detailed specification on
|
char *range; /* range, if used. See README for detailed specification on
|
||||||
this syntax. */
|
this syntax. */
|
||||||
char *postfields; /* if POST, set the fields' values here */
|
char *postfields; /* if POST, set the fields' values here */
|
||||||
|
long postfieldsize; /* if POST, this might have a size to use instead of
|
||||||
|
strlen(), and then the data *may* be binary (contain
|
||||||
|
zero bytes) */
|
||||||
|
|
||||||
bool free_referer; /* set TRUE if 'referer' points to a string we
|
bool free_referer; /* set TRUE if 'referer' points to a string we
|
||||||
allocated */
|
allocated */
|
||||||
|
@@ -38,10 +38,11 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
|
|
||||||
|
@@ -38,6 +38,8 @@
|
|||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
9
reconf
9
reconf
@@ -9,8 +9,7 @@ die(){
|
|||||||
echo "$@" ; exit
|
echo "$@" ; exit
|
||||||
}
|
}
|
||||||
|
|
||||||
aclocal || die "ahhhhh"
|
aclocal -I . || die "ahhhhh"
|
||||||
autoheader || die "ahhhhh"
|
autoheader || die "ahhhhh"
|
||||||
automake || die "ahhhhh"
|
automake || die "ahhhhh"
|
||||||
autoconf || die "ahhhhh"
|
autoconf || die "ahhhhh"
|
||||||
|
|
||||||
|
@@ -110,16 +110,32 @@ puts (
|
|||||||
" -d/--data <data>\n"
|
" -d/--data <data>\n"
|
||||||
" (HTTP) Sends the specified data in a POST request to\n"
|
" (HTTP) Sends the specified data in a POST request to\n"
|
||||||
" the HTTP server. Note that the data is sent exactly as\n"
|
" the HTTP server. Note that the data is sent exactly as\n"
|
||||||
" specified with no extra processing. The data is\n"
|
" specified with no extra processing (with all newlines\n"
|
||||||
" expected to be \"url-encoded\". This will cause curl to\n"
|
" cut off). The data is expected to be \"url-encoded\".\n"
|
||||||
" pass the data to the server using the content-type\n"
|
" This will cause curl to pass the data to the server\n"
|
||||||
" application/x-www-form-urlencoded. Compare to -F.\n"
|
" using the content-type application/x-www-form-urlen<EFBFBD>\n"
|
||||||
|
" coded. Compare to -F.\n"
|
||||||
"\n"
|
"\n"
|
||||||
" If you start the data with the letter @, the rest\n"
|
" If you start the data with the letter @, the rest\n"
|
||||||
" should be a file name to read the data from, or - if\n"
|
" should be a file name to read the data from, or - if\n"
|
||||||
" you want curl to read the data from stdin. The con<EFBFBD>\n"
|
" you want curl to read the data from stdin. The con<6F>\n"
|
||||||
" tents of the file must already be url-encoded.\n"
|
" tents of the file must already be url-encoded.\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
" To post data purely binary, you should instead use the\n"
|
||||||
|
" --data-binary option.\n"
|
||||||
|
"\n"
|
||||||
|
" -d/--data is the same as --data-ascii.\n"
|
||||||
|
"\n"
|
||||||
|
" --data-ascii <data>\n"
|
||||||
|
" (HTTP) This is an alias for the -d/--data option.\n"
|
||||||
|
"\n"
|
||||||
|
" --data-binary <data>\n"
|
||||||
|
" (HTTP) This posts data in a similar manner as --data-\n"
|
||||||
|
" ascii does, although when using this option the entire\n"
|
||||||
|
" context of the posted data is kept as-is. If you want\n"
|
||||||
|
" to post a binary file without the strip-newlines fea<65>\n"
|
||||||
|
" ture of the --data-ascii option, this is for you.\n"
|
||||||
|
"\n"
|
||||||
" -D/--dump-header <file>\n"
|
" -D/--dump-header <file>\n"
|
||||||
" (HTTP/FTP) Write the HTTP headers to this file. Write\n"
|
" (HTTP/FTP) Write the HTTP headers to this file. Write\n"
|
||||||
" the FTP file info to this file if -I/--head is used.\n"
|
" the FTP file info to this file if -I/--head is used.\n"
|
||||||
@@ -198,7 +214,6 @@ puts (
|
|||||||
" (HTTP) Include the HTTP-header in the output. The HTTP-\n"
|
" (HTTP) Include the HTTP-header in the output. The HTTP-\n"
|
||||||
" header includes things like server-name, date of the\n"
|
" header includes things like server-name, date of the\n"
|
||||||
" document, HTTP-version and more...\n"
|
" document, HTTP-version and more...\n"
|
||||||
"\n"
|
|
||||||
" -I/--head\n"
|
" -I/--head\n"
|
||||||
" (HTTP/FTP) Fetch the HTTP-header only! HTTP-servers\n"
|
" (HTTP/FTP) Fetch the HTTP-header only! HTTP-servers\n"
|
||||||
" feature the command HEAD which this uses to get nothing\n"
|
" feature the command HEAD which this uses to get nothing\n"
|
||||||
@@ -211,10 +226,13 @@ puts (
|
|||||||
" arguments can be written which then will be used as if\n"
|
" arguments can be written which then will be used as if\n"
|
||||||
" they were written on the actual command line. If the\n"
|
" they were written on the actual command line. If the\n"
|
||||||
" first column of a config line is a '#' character, the\n"
|
" first column of a config line is a '#' character, the\n"
|
||||||
|
);
|
||||||
|
puts(
|
||||||
" rest of the line will be treated as a comment.\n"
|
" rest of the line will be treated as a comment.\n"
|
||||||
"\n"
|
"\n"
|
||||||
" Specify the filename as '-' to make curl read the file\n"
|
" Specify the filename as '-' to make curl read the file\n"
|
||||||
" from stdin.\n"
|
" from stdin.\n"
|
||||||
|
"\n"
|
||||||
" -l/--list-only\n"
|
" -l/--list-only\n"
|
||||||
" (FTP) When listing an FTP directory, this switch forces\n"
|
" (FTP) When listing an FTP directory, this switch forces\n"
|
||||||
" a name-only view. Especially useful if you want to\n"
|
" a name-only view. Especially useful if you want to\n"
|
||||||
@@ -226,8 +244,6 @@ puts (
|
|||||||
" (HTTP/HTTPS) If the server reports that the requested\n"
|
" (HTTP/HTTPS) If the server reports that the requested\n"
|
||||||
" page has a different location (indicated with the\n"
|
" page has a different location (indicated with the\n"
|
||||||
" header line Location:) this flag will let curl attempt\n"
|
" header line Location:) this flag will let curl attempt\n"
|
||||||
);
|
|
||||||
puts(
|
|
||||||
" to reattempt the get on the new place. If used together\n"
|
" to reattempt the get on the new place. If used together\n"
|
||||||
" with -i or -I, headers from all requested pages will be\n"
|
" with -i or -I, headers from all requested pages will be\n"
|
||||||
" shown. If this flag is used when making a HTTP POST,\n"
|
" shown. If this flag is used when making a HTTP POST,\n"
|
||||||
@@ -304,7 +320,6 @@ puts (
|
|||||||
"\n"
|
"\n"
|
||||||
" - (any single-letter string) to make it pick\n"
|
" - (any single-letter string) to make it pick\n"
|
||||||
" the machine's default\n"
|
" the machine's default\n"
|
||||||
"\n"
|
|
||||||
" -q If used as the first parameter on the command line, the\n"
|
" -q If used as the first parameter on the command line, the\n"
|
||||||
" $HOME/.curlrc file will not be read and used as a con<6F>\n"
|
" $HOME/.curlrc file will not be read and used as a con<6F>\n"
|
||||||
" fig file.\n"
|
" fig file.\n"
|
||||||
@@ -320,6 +335,7 @@ puts (
|
|||||||
" to be run before and after the transfer. If the server\n"
|
" to be run before and after the transfer. If the server\n"
|
||||||
" returns failure for one of the commands, the entire\n"
|
" returns failure for one of the commands, the entire\n"
|
||||||
" operation will be aborted.\n"
|
" operation will be aborted.\n"
|
||||||
|
"\n"
|
||||||
" -r/--range <range>\n"
|
" -r/--range <range>\n"
|
||||||
" (HTTP/FTP) Retrieve a byte range (i.e a partial docu<63>\n"
|
" (HTTP/FTP) Retrieve a byte range (i.e a partial docu<63>\n"
|
||||||
" ment) from a HTTP/1.1 or FTP server. Ranges can be\n"
|
" ment) from a HTTP/1.1 or FTP server. Ranges can be\n"
|
||||||
@@ -356,7 +372,6 @@ puts (
|
|||||||
" -s/--silent\n"
|
" -s/--silent\n"
|
||||||
" Silent mode. Don't show progress meter or error mes<65>\n"
|
" Silent mode. Don't show progress meter or error mes<65>\n"
|
||||||
" sages. Makes Curl mute.\n"
|
" sages. Makes Curl mute.\n"
|
||||||
"\n"
|
|
||||||
" -S/--show-error\n"
|
" -S/--show-error\n"
|
||||||
" When used with -s it makes curl show error message if\n"
|
" When used with -s it makes curl show error message if\n"
|
||||||
" it fails.\n"
|
" it fails.\n"
|
||||||
@@ -408,9 +423,9 @@ puts (
|
|||||||
" particular file you specify it \"@filename\" and to tell\n"
|
" particular file you specify it \"@filename\" and to tell\n"
|
||||||
" curl to read the format from stdin you write \"@-\".\n"
|
" curl to read the format from stdin you write \"@-\".\n"
|
||||||
"\n"
|
"\n"
|
||||||
" The variables present in the output format will be sub<75>\n"
|
" The variables present in the output format will be\n"
|
||||||
" stituted by the value or text that curl thinks fit, as\n"
|
" substituted by the value or text that curl thinks fit,\n"
|
||||||
" described below. All variables are specified like\n"
|
" as described below. All variables are specified like\n"
|
||||||
" %{variable_name} and to output a normal % you just\n"
|
" %{variable_name} and to output a normal % you just\n"
|
||||||
" write them like %%. You can output a newline by using\n"
|
" write them like %%. You can output a newline by using\n"
|
||||||
" \\n, a carrige return with \\r and a tab space with \\t.\n"
|
" \\n, a carrige return with \\r and a tab space with \\t.\n"
|
||||||
@@ -424,6 +439,7 @@ puts (
|
|||||||
" url_effective The URL that was fetched last. This is\n"
|
" url_effective The URL that was fetched last. This is\n"
|
||||||
" mostly meaningful if you've told curl to\n"
|
" mostly meaningful if you've told curl to\n"
|
||||||
" follow location: headers.\n"
|
" follow location: headers.\n"
|
||||||
|
"\n"
|
||||||
" http_code The numerical code that was found in the\n"
|
" http_code The numerical code that was found in the\n"
|
||||||
" last retrieved HTTP(S) page.\n"
|
" last retrieved HTTP(S) page.\n"
|
||||||
"\n"
|
"\n"
|
||||||
@@ -447,6 +463,8 @@ puts (
|
|||||||
" transfer commands and negotiations that\n"
|
" transfer commands and negotiations that\n"
|
||||||
" are specific to the particular proto<74>\n"
|
" are specific to the particular proto<74>\n"
|
||||||
" col(s) involved.\n"
|
" col(s) involved.\n"
|
||||||
|
);
|
||||||
|
puts(
|
||||||
"\n"
|
"\n"
|
||||||
" size_download The total amount of bytes that were\n"
|
" size_download The total amount of bytes that were\n"
|
||||||
" downloaded.\n"
|
" downloaded.\n"
|
||||||
@@ -459,15 +477,12 @@ puts (
|
|||||||
"\n"
|
"\n"
|
||||||
" speed_upload The average upload speed that curl mea<65>\n"
|
" speed_upload The average upload speed that curl mea<65>\n"
|
||||||
" sured for the complete download.\n"
|
" sured for the complete download.\n"
|
||||||
"\n"
|
|
||||||
" -x/--proxy <proxyhost[:port]>\n"
|
" -x/--proxy <proxyhost[:port]>\n"
|
||||||
" Use specified proxy. If the port number is not speci<63>\n"
|
" Use specified proxy. If the port number is not speci<63>\n"
|
||||||
" fied, it is assumed at port 1080.\n"
|
" fied, it is assumed at port 1080.\n"
|
||||||
"\n"
|
"\n"
|
||||||
" -X/--request <command>\n"
|
" -X/--request <command>\n"
|
||||||
" (HTTP) Specifies a custom request to use when communi<6E>\n"
|
" (HTTP) Specifies a custom request to use when communi<6E>\n"
|
||||||
);
|
|
||||||
puts(
|
|
||||||
" cating with the HTTP server. The specified request\n"
|
" cating with the HTTP server. The specified request\n"
|
||||||
" will be used instead of the standard GET. Read the HTTP\n"
|
" will be used instead of the standard GET. Read the HTTP\n"
|
||||||
" 1.1 specification for details and explanations.\n"
|
" 1.1 specification for details and explanations.\n"
|
||||||
@@ -529,6 +544,7 @@ puts (
|
|||||||
"ENVIRONMENT\n"
|
"ENVIRONMENT\n"
|
||||||
" HTTP_PROXY [protocol://]<host>[:port]\n"
|
" HTTP_PROXY [protocol://]<host>[:port]\n"
|
||||||
" Sets proxy server to use for HTTP.\n"
|
" Sets proxy server to use for HTTP.\n"
|
||||||
|
"\n"
|
||||||
" HTTPS_PROXY [protocol://]<host>[:port]\n"
|
" HTTPS_PROXY [protocol://]<host>[:port]\n"
|
||||||
" Sets proxy server to use for HTTPS.\n"
|
" Sets proxy server to use for HTTPS.\n"
|
||||||
"\n"
|
"\n"
|
||||||
@@ -564,7 +580,6 @@ puts (
|
|||||||
"\n"
|
"\n"
|
||||||
" 4 URL user malformatted. The user-part of the URL syntax\n"
|
" 4 URL user malformatted. The user-part of the URL syntax\n"
|
||||||
" was not correct.\n"
|
" was not correct.\n"
|
||||||
"\n"
|
|
||||||
" 5 Couldn't resolve proxy. The given proxy host could not\n"
|
" 5 Couldn't resolve proxy. The given proxy host could not\n"
|
||||||
" be resolved.\n"
|
" be resolved.\n"
|
||||||
"\n"
|
"\n"
|
||||||
@@ -580,6 +595,7 @@ puts (
|
|||||||
"\n"
|
"\n"
|
||||||
" 10 FTP user/password incorrect. Either one or both were\n"
|
" 10 FTP user/password incorrect. Either one or both were\n"
|
||||||
" not accepted by the server.\n"
|
" not accepted by the server.\n"
|
||||||
|
"\n"
|
||||||
" 11 FTP weird PASS reply. Curl couldn't parse the reply\n"
|
" 11 FTP weird PASS reply. Curl couldn't parse the reply\n"
|
||||||
" sent to the PASS request.\n"
|
" sent to the PASS request.\n"
|
||||||
"\n"
|
"\n"
|
||||||
@@ -616,7 +632,6 @@ puts (
|
|||||||
"\n"
|
"\n"
|
||||||
" 23 Write error. Curl couldn't write data to a local\n"
|
" 23 Write error. Curl couldn't write data to a local\n"
|
||||||
" filesystem or similar.\n"
|
" filesystem or similar.\n"
|
||||||
"\n"
|
|
||||||
" 24 Malformat user. User name badly specified.\n"
|
" 24 Malformat user. User name badly specified.\n"
|
||||||
"\n"
|
"\n"
|
||||||
" 25 FTP couldn't STOR file. The server denied the STOR\n"
|
" 25 FTP couldn't STOR file. The server denied the STOR\n"
|
||||||
@@ -631,6 +646,7 @@ puts (
|
|||||||
"\n"
|
"\n"
|
||||||
" 29 FTP couldn't set ASCII. The server returned an unknown\n"
|
" 29 FTP couldn't set ASCII. The server returned an unknown\n"
|
||||||
" reply.\n"
|
" reply.\n"
|
||||||
|
"\n"
|
||||||
" 30 FTP PORT failed. The PORT command failed.\n"
|
" 30 FTP PORT failed. The PORT command failed.\n"
|
||||||
"\n"
|
"\n"
|
||||||
" 31 FTP couldn't use REST. The REST command failed.\n"
|
" 31 FTP couldn't use REST. The REST command failed.\n"
|
||||||
@@ -667,7 +683,6 @@ puts (
|
|||||||
"BUGS\n"
|
"BUGS\n"
|
||||||
" If you do find any (or have other suggestions), mail Daniel\n"
|
" If you do find any (or have other suggestions), mail Daniel\n"
|
||||||
" Stenberg <Daniel.Stenberg@haxx.se>.\n"
|
" Stenberg <Daniel.Stenberg@haxx.se>.\n"
|
||||||
"\n"
|
|
||||||
"AUTHORS / CONTRIBUTORS\n"
|
"AUTHORS / CONTRIBUTORS\n"
|
||||||
" - Daniel Stenberg <Daniel.Stenberg@haxx.se>\n"
|
" - Daniel Stenberg <Daniel.Stenberg@haxx.se>\n"
|
||||||
" - Rafael Sagula <sagula@inf.ufrgs.br>\n"
|
" - Rafael Sagula <sagula@inf.ufrgs.br>\n"
|
||||||
@@ -717,7 +732,7 @@ puts (
|
|||||||
" - Kristian K<>hntopp <kris@koehntopp.de>\n"
|
" - Kristian K<>hntopp <kris@koehntopp.de>\n"
|
||||||
" - Fred Noz <FNoz@siac.com>\n"
|
" - Fred Noz <FNoz@siac.com>\n"
|
||||||
" - Caolan McNamara <caolan@csn.ul.ie>\n"
|
" - Caolan McNamara <caolan@csn.ul.ie>\n"
|
||||||
"\n"
|
" - Albert Chin-A-Young <china@thewrittenword.com>\n"
|
||||||
"WWW\n"
|
"WWW\n"
|
||||||
" http://curl.haxx.se\n"
|
" http://curl.haxx.se\n"
|
||||||
"\n"
|
"\n"
|
||||||
@@ -747,6 +762,8 @@ puts (
|
|||||||
" Get a gopher document from funet's gopher server:\n"
|
" Get a gopher document from funet's gopher server:\n"
|
||||||
"\n"
|
"\n"
|
||||||
" curl gopher://gopher.funet.fi\n"
|
" curl gopher://gopher.funet.fi\n"
|
||||||
|
);
|
||||||
|
puts(
|
||||||
"\n"
|
"\n"
|
||||||
" Get a web page from a server using port 8000:\n"
|
" Get a web page from a server using port 8000:\n"
|
||||||
"\n"
|
"\n"
|
||||||
@@ -779,8 +796,6 @@ puts (
|
|||||||
" To ftp files using name+passwd, include them in the URL like:\n"
|
" To ftp files using name+passwd, include them in the URL like:\n"
|
||||||
"\n"
|
"\n"
|
||||||
" curl ftp://name:passwd@machine.domain:port/full/path/to/file\n"
|
" curl ftp://name:passwd@machine.domain:port/full/path/to/file\n"
|
||||||
);
|
|
||||||
puts(
|
|
||||||
"\n"
|
"\n"
|
||||||
" or specify them with the -u flag like\n"
|
" or specify them with the -u flag like\n"
|
||||||
"\n"
|
"\n"
|
||||||
@@ -1043,6 +1058,8 @@ puts (
|
|||||||
" headers that looks like 'Set-Cookie: <data>' where the data part then\n"
|
" headers that looks like 'Set-Cookie: <data>' where the data part then\n"
|
||||||
" typically contains a set of NAME=VALUE pairs (separated by semicolons ';'\n"
|
" typically contains a set of NAME=VALUE pairs (separated by semicolons ';'\n"
|
||||||
" like \"NAME1=VALUE1; NAME2=VALUE2;\"). The server can also specify for what\n"
|
" like \"NAME1=VALUE1; NAME2=VALUE2;\"). The server can also specify for what\n"
|
||||||
|
);
|
||||||
|
puts(
|
||||||
" path the \"cookie\" should be used for (by specifying \"path=value\"), when the\n"
|
" path the \"cookie\" should be used for (by specifying \"path=value\"), when the\n"
|
||||||
" cookie should expire (\"expire=DATE\"), for what domain to use it\n"
|
" cookie should expire (\"expire=DATE\"), for what domain to use it\n"
|
||||||
" (\"domain=NAME\") and if it should be used on secure connections only\n"
|
" (\"domain=NAME\") and if it should be used on secure connections only\n"
|
||||||
@@ -1061,8 +1078,6 @@ puts (
|
|||||||
" Curl also has the ability to use previously received cookies in following\n"
|
" Curl also has the ability to use previously received cookies in following\n"
|
||||||
" sessions. If you get cookies from a server and store them in a file in a\n"
|
" sessions. If you get cookies from a server and store them in a file in a\n"
|
||||||
" manner similar to:\n"
|
" manner similar to:\n"
|
||||||
);
|
|
||||||
puts(
|
|
||||||
"\n"
|
"\n"
|
||||||
" curl --dump-header headers www.example.com\n"
|
" curl --dump-header headers www.example.com\n"
|
||||||
"\n"
|
"\n"
|
||||||
@@ -1313,6 +1328,8 @@ puts (
|
|||||||
"TIME CONDITIONS\n"
|
"TIME CONDITIONS\n"
|
||||||
"\n"
|
"\n"
|
||||||
" HTTP allows a client to specify a time condition for the document it\n"
|
" HTTP allows a client to specify a time condition for the document it\n"
|
||||||
|
);
|
||||||
|
puts(
|
||||||
" requests. It is If-Modified-Since or If-Unmodified-Since. Curl allow you to\n"
|
" requests. It is If-Modified-Since or If-Unmodified-Since. Curl allow you to\n"
|
||||||
" specify them with the -z/--time-cond flag.\n"
|
" specify them with the -z/--time-cond flag.\n"
|
||||||
"\n"
|
"\n"
|
||||||
@@ -1332,8 +1349,6 @@ puts (
|
|||||||
" curl -z yesterday http://remote.server.com/remote.html\n"
|
" curl -z yesterday http://remote.server.com/remote.html\n"
|
||||||
"\n"
|
"\n"
|
||||||
" Curl will then accept a wide range of date formats. You always make the date\n"
|
" Curl will then accept a wide range of date formats. You always make the date\n"
|
||||||
);
|
|
||||||
puts(
|
|
||||||
" check the other way around by prepending it with a dash '-'.\n"
|
" check the other way around by prepending it with a dash '-'.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"DICT\n"
|
"DICT\n"
|
||||||
|
63
src/main.c
63
src/main.c
@@ -230,7 +230,9 @@ static void help(void)
|
|||||||
" -B/--use-ascii Use ASCII/text transfer\n"
|
" -B/--use-ascii Use ASCII/text transfer\n"
|
||||||
" -c/--continue Resume a previous transfer where we left it\n"
|
" -c/--continue Resume a previous transfer where we left it\n"
|
||||||
" -C/--continue-at <offset> Specify absolute resume offset\n"
|
" -C/--continue-at <offset> Specify absolute resume offset\n"
|
||||||
" -d/--data POST data (H)\n"
|
" -d/--data <data> HTTP POST data (H)\n"
|
||||||
|
" --data-ascii <data> HTTP POST ASCII data (H)\n"
|
||||||
|
" --data-binary <data> HTTP POST binary data (H)\n"
|
||||||
" -D/--dump-header <file> Write the headers to this file\n"
|
" -D/--dump-header <file> Write the headers to this file\n"
|
||||||
" -e/--referer Referer page (H)\n"
|
" -e/--referer Referer page (H)\n"
|
||||||
" -E/--cert <cert:passwd> Specifies your certificate file and password (HTTPS)\n"
|
" -E/--cert <cert:passwd> Specifies your certificate file and password (HTTPS)\n"
|
||||||
@@ -292,6 +294,7 @@ struct Configurable {
|
|||||||
bool use_resume;
|
bool use_resume;
|
||||||
int resume_from;
|
int resume_from;
|
||||||
char *postfields;
|
char *postfields;
|
||||||
|
long postfieldsize;
|
||||||
char *referer;
|
char *referer;
|
||||||
long timeout;
|
long timeout;
|
||||||
char *outfile;
|
char *outfile;
|
||||||
@@ -385,6 +388,36 @@ static char *file2string(FILE *file)
|
|||||||
return NULL; /* no string */
|
return NULL; /* no string */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *file2memory(FILE *file, long *size)
|
||||||
|
{
|
||||||
|
char buffer[1024];
|
||||||
|
char *ptr;
|
||||||
|
char *string=NULL;
|
||||||
|
char *newstring=NULL;
|
||||||
|
long len=0;
|
||||||
|
long stringlen=0;
|
||||||
|
|
||||||
|
if(file) {
|
||||||
|
while(len = fread(buffer, 1, sizeof(buffer), file)) {
|
||||||
|
if(string) {
|
||||||
|
newstring = realloc(string, len+stringlen);
|
||||||
|
if(newstring)
|
||||||
|
string = newstring;
|
||||||
|
else
|
||||||
|
break; /* no more strings attached! :-) */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
string = malloc(len);
|
||||||
|
memcpy(&string[stringlen], buffer, len);
|
||||||
|
stringlen+=len;
|
||||||
|
}
|
||||||
|
*size = stringlen;
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return NULL; /* no string */
|
||||||
|
}
|
||||||
|
|
||||||
static int getparameter(char *flag, /* f or -long-flag */
|
static int getparameter(char *flag, /* f or -long-flag */
|
||||||
char *nextarg, /* NULL if unset */
|
char *nextarg, /* NULL if unset */
|
||||||
bool *usedarg, /* set to TRUE if the arg has been
|
bool *usedarg, /* set to TRUE if the arg has been
|
||||||
@@ -392,11 +425,14 @@ static int getparameter(char *flag, /* f or -long-flag */
|
|||||||
struct Configurable *config)
|
struct Configurable *config)
|
||||||
{
|
{
|
||||||
char letter;
|
char letter;
|
||||||
|
char subletter=0; /* subletters can only occur on long options */
|
||||||
|
|
||||||
char *parse=NULL;
|
char *parse=NULL;
|
||||||
int res;
|
int res;
|
||||||
int j;
|
int j;
|
||||||
time_t now;
|
time_t now;
|
||||||
int hit=-1;
|
int hit=-1;
|
||||||
|
bool longopt=FALSE;
|
||||||
|
|
||||||
/* single-letter,
|
/* single-letter,
|
||||||
long-name,
|
long-name,
|
||||||
@@ -416,6 +452,8 @@ static int getparameter(char *flag, /* f or -long-flag */
|
|||||||
{"c", "continue", FALSE},
|
{"c", "continue", FALSE},
|
||||||
{"C", "continue-at", TRUE},
|
{"C", "continue-at", TRUE},
|
||||||
{"d", "data", TRUE},
|
{"d", "data", TRUE},
|
||||||
|
{"da", "data-ascii", TRUE},
|
||||||
|
{"db", "data-binary", TRUE},
|
||||||
{"D", "dump-header", TRUE},
|
{"D", "dump-header", TRUE},
|
||||||
{"e", "referer", TRUE},
|
{"e", "referer", TRUE},
|
||||||
{"E", "cert", TRUE},
|
{"E", "cert", TRUE},
|
||||||
@@ -465,6 +503,7 @@ static int getparameter(char *flag, /* f or -long-flag */
|
|||||||
int fnam=strlen(&flag[1]);
|
int fnam=strlen(&flag[1]);
|
||||||
for(j=0; j< sizeof(aliases)/sizeof(aliases[0]); j++) {
|
for(j=0; j< sizeof(aliases)/sizeof(aliases[0]); j++) {
|
||||||
if(strnequal(aliases[j].lname, &flag[1], fnam)) {
|
if(strnequal(aliases[j].lname, &flag[1], fnam)) {
|
||||||
|
longopt = TRUE;
|
||||||
if(strequal(aliases[j].lname, &flag[1])) {
|
if(strequal(aliases[j].lname, &flag[1])) {
|
||||||
parse = aliases[j].letter;
|
parse = aliases[j].letter;
|
||||||
hit = j;
|
hit = j;
|
||||||
@@ -492,7 +531,12 @@ static int getparameter(char *flag, /* f or -long-flag */
|
|||||||
do {
|
do {
|
||||||
/* we can loop here if we have multiple single-letters */
|
/* we can loop here if we have multiple single-letters */
|
||||||
|
|
||||||
letter = parse?*parse:'\0';
|
if(!longopt)
|
||||||
|
letter = parse?*parse:'\0';
|
||||||
|
else {
|
||||||
|
letter = parse[0];
|
||||||
|
subletter = parse[1];
|
||||||
|
}
|
||||||
*usedarg = FALSE; /* default is that we don't use the arg */
|
*usedarg = FALSE; /* default is that we don't use the arg */
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -500,7 +544,7 @@ static int getparameter(char *flag, /* f or -long-flag */
|
|||||||
#endif
|
#endif
|
||||||
if(hit < 0) {
|
if(hit < 0) {
|
||||||
for(j=0; j< sizeof(aliases)/sizeof(aliases[0]); j++) {
|
for(j=0; j< sizeof(aliases)/sizeof(aliases[0]); j++) {
|
||||||
if(letter == *aliases[j].letter) {
|
if(letter == aliases[j].letter[0]) {
|
||||||
hit = j;
|
hit = j;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -618,12 +662,19 @@ static int getparameter(char *flag, /* f or -long-flag */
|
|||||||
/* the data begins with a '@' letter, it means that a file name
|
/* the data begins with a '@' letter, it means that a file name
|
||||||
or - (stdin) follows */
|
or - (stdin) follows */
|
||||||
FILE *file;
|
FILE *file;
|
||||||
|
char *ptr;
|
||||||
|
|
||||||
nextarg++; /* pass the @ */
|
nextarg++; /* pass the @ */
|
||||||
|
|
||||||
if(strequal("-", nextarg))
|
if(strequal("-", nextarg))
|
||||||
file = stdin;
|
file = stdin;
|
||||||
else
|
else
|
||||||
file = fopen(nextarg, "r");
|
file = fopen(nextarg, "r");
|
||||||
config->postfields = file2string(file);
|
|
||||||
|
if(subletter == 'b') /* forced binary */
|
||||||
|
config->postfields = file2memory(file, &config->postfieldsize);
|
||||||
|
else
|
||||||
|
config->postfields = file2string(file);
|
||||||
if(file && (file != stdin))
|
if(file && (file != stdin))
|
||||||
fclose(stdin);
|
fclose(stdin);
|
||||||
}
|
}
|
||||||
@@ -1422,6 +1473,10 @@ int main(int argc, char *argv[])
|
|||||||
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorbuffer);
|
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorbuffer);
|
||||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, config.timeout);
|
curl_easy_setopt(curl, CURLOPT_TIMEOUT, config.timeout);
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, config.postfields);
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, config.postfields);
|
||||||
|
|
||||||
|
/* new in libcurl 7.2: */
|
||||||
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, config.postfieldsize);
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_REFERER, config.referer);
|
curl_easy_setopt(curl, CURLOPT_REFERER, config.referer);
|
||||||
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, config.conf&CONF_AUTO_REFERER);
|
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, config.conf&CONF_AUTO_REFERER);
|
||||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, config.useragent);
|
curl_easy_setopt(curl, CURLOPT_USERAGENT, config.useragent);
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
#define CURL_NAME "curl"
|
#define CURL_NAME "curl"
|
||||||
#define CURL_VERSION "7.1"
|
#define CURL_VERSION "7.2"
|
||||||
#define CURL_ID CURL_NAME " " CURL_VERSION " (" OS ") "
|
#define CURL_ID CURL_NAME " " CURL_VERSION " (" OS ") "
|
||||||
|
Reference in New Issue
Block a user