Compare commits

..

22 Commits

Author SHA1 Message Date
Daniel Stenberg
61c4342736 7.2 cleanup commit 2000-08-30 11:54:57 +00:00
Daniel Stenberg
216b198494 7.2 2000-08-30 11:53:39 +00:00
Daniel Stenberg
6e3a6e79e5 7.2 commit 2000-08-30 11:50:16 +00:00
Daniel Stenberg
2cf44fb374 renamed to acinclude.m4 to get included by aclocal automatically 2000-08-30 06:09:06 +00:00
Daniel Stenberg
dab9658b3e Added Albert to the list contributors. The question is why I hadn't done
that a long time ago...!
2000-08-24 19:19:38 +00:00
Daniel Stenberg
3f9b9dfdee added acinclude.m4 2000-08-24 19:17:30 +00:00
Daniel Stenberg
76229d3da1 largefile.m4 was turned into acinclude.m4 2000-08-24 19:16:26 +00:00
Daniel Stenberg
6562caf6a2 --data-binary and family ;-) 2000-08-24 17:56:20 +00:00
Daniel Stenberg
d49eba2aed Jan Schmidt supplied an update 2000-08-24 17:55:48 +00:00
Daniel Stenberg
bb7929ec50 Inreased buffer size for the Linux gethostbyname_r() test 2000-08-24 17:12:46 +00:00
Daniel Stenberg
a1c0a5d0f2 Added CURLOPT_POSTFIELDSIZE 2000-08-24 16:27:04 +00:00
Daniel Stenberg
1be0bf56a6 new binary post details 2000-08-24 14:28:48 +00:00
Daniel Stenberg
53c2798886 moved include setup.h 2000-08-24 14:28:11 +00:00
Daniel Stenberg
7271ebf23e include config.h first 2000-08-24 14:27:51 +00:00
Daniel Stenberg
b6e18f2f66 #include "setup.h" moved first of all includes 2000-08-24 14:26:33 +00:00
Daniel Stenberg
400ca043c7 inet_ntoa_r() usage made more portable 2000-08-24 14:26:06 +00:00
Daniel Stenberg
d4ffc5ef32 removed the AC_TRY_RUN complaints 2000-08-24 13:05:24 +00:00
Daniel Stenberg
1b1f143cd6 hostname and large file support added 2000-08-24 12:33:16 +00:00
Daniel Stenberg
31b8eea041 Bjorn Reese helped me update the license section 2000-08-23 07:27:00 +00:00
Daniel Stenberg
903f4c16cc Fixed name problems, updated FAQ, -d post problem found 2000-08-23 07:25:50 +00:00
Daniel Stenberg
1998aee2a2 Albert's fixes 2000-08-23 07:25:21 +00:00
Daniel Stenberg
d4731b7050 Albert Chin-A-Young's fixes 2000-08-23 07:23:42 +00:00
46 changed files with 878 additions and 376 deletions

61
CHANGES
View File

@@ -6,6 +6,67 @@
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
Daniel (21 August 2000)

1
FILES
View File

@@ -25,6 +25,7 @@ maketgz
Makefile.in
Makefile.am
acconfig.h
acinclude.m4
aclocal.m4
config.guess
config.h.in

10
README
View File

@@ -30,14 +30,14 @@ README
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 .
(now, you'll get all the latest sources downloaded into your current
directory. Note that this does not create a directory named curl or
anything)
(now, you'll get all the latest sources downloaded into your current
directory. Note that this does NOT create a directory named curl or
anything)
cvs -d :pserver:anonymous@cvs.curl.sourceforge.net:/cvsroot/curl logout
(you're off the hook!)
(you're off the hook!)

View File

@@ -27,3 +27,9 @@
/* Define if you have the gethostbyname_r() function with 6 arguments */
#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
View 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
View File

@@ -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 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.
AC_DEFUN(AM_CONFIG_HEADER,

View File

@@ -43,6 +43,12 @@
/* Define if you have the gethostbyname_r() function with 6 arguments */
#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. */
#undef SIZEOF_LONG_DOUBLE
@@ -163,6 +169,9 @@
/* Define if you have the <netdb.h> header file. */
#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. */
#undef HAVE_NETINET_IN_H
@@ -265,6 +274,15 @@
/* Version number of package */
#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 */
#undef DISABLED_THREADSAFE

View File

@@ -2,7 +2,7 @@ dnl $Id$
dnl Process this file with autoconf to produce a configure script.
AC_INIT(lib/urldata.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
dnl
@@ -13,12 +13,17 @@ AC_CANONICAL_TARGET
dnl Checks for programs.
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 AC_PROG_INSTALL
AC_PROG_MAKE_SET
dnl Check for AIX weirdos
AC_AIX
dnl **********************************************************************
dnl Checks for libraries.
@@ -161,164 +166,204 @@ then
AC_DEFINE(DISABLED_THREADSAFE, 1, \
Set to explicitly specify we don't want to use thread-safe functions)
else
dnl check for a few thread-safe functions
AC_CHECK_FUNCS( gethostbyname_r \
gethostbyaddr_r \
localtime_r \
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(
[
dnl check for number of arguments to gethostbyname_r. it might take
dnl either 3, 5, or 6 arguments.
AC_CHECK_FUNCS(gethostbyname_r,[
AC_MSG_CHECKING(if gethostbyname_r takes 3 arguments)
AC_TRY_RUN([
#include <string.h>
#include <sys/types.h>
#include <netdb.h>],
[
#include <netdb.h>
int
main () {
struct hostent h;
struct hostent_data hdata;
char *name;
int rc;
rc = gethostbyname_r(name, &h, &hdata);],
ac_cv_gethostbyname_args=3)
fi
if test -z "$ac_cv_gethostbyname_args"; then
AC_TRY_COMPILE(
[
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_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 <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 h;
char *name;
char buffer[10];
int h_errno;
hp = gethostbyname_r(name, &h, buffer, 10, &h_errno);],
ac_cv_gethostbyname_args=5)
fi
if test -z "$ac_cv_gethostbyname_args"; then
AC_TRY_COMPILE(
[
char *name = "localhost";
char buffer[8192];
int h_errno;
hp = gethostbyname_r(name, &h, buffer, 8192, &h_errno);
exit (hp == NULL ? 1 : 0); }],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5)
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 <netdb.h>],
[
#include <netdb.h>
int
main () {
struct hostent h;
struct hostent *hp;
char *name;
char buf[10];
char *name = "localhost";
char buf[8192];
int rc;
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);
],
ac_cv_gethostbyname_args=6)
fi
if test -z "$ac_cv_gethostbyname_args"; then
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(
[
dnl check for number of arguments to gethostbyaddr_r. it might take
dnl either 5, 7, or 8 arguments.
AC_CHECK_FUNCS(gethostbyaddr_r,[
AC_MSG_CHECKING(if gethostbyaddr_r takes 5 arguments)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <netdb.h>],
[
char * address;
int length;
int type;
struct hostent h;
struct hostent_data hdata;
int rc;
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
],
ac_cv_gethostbyaddr_args=5)
fi
if test -z "$ac_cv_gethostbyaddr_args"; then
AC_TRY_COMPILE(
[
#include <netdb.h>],[
char * address;
int length;
int type;
struct hostent h;
struct hostent_data hdata;
int rc;
rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GETHOSTBYADDR_R_5)
ac_cv_gethostbyaddr_args=5],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if gethostbyaddr_r with -D_REENTRANT takes 5 arguments)
AC_TRY_COMPILE([
#define _REENTRANT
#include <sys/types.h>
#include <netdb.h>],
[
char * address;
int length;
int type;
struct hostent h;
char buffer[10];
int buflen;
int h_errnop;
struct hostent * hp;
hp = gethostbyaddr_r(address, length, type, &h,
buffer, buflen, &h_errnop);
],
ac_cv_gethostbyaddr_args=7)
fi
if test -z "$ac_cv_gethostbyaddr_args"; then
AC_TRY_COMPILE(
[
#include <netdb.h>],[
char * address;
int length;
int type;
struct hostent h;
struct hostent_data hdata;
int rc;
rc = gethostbyaddr_r(address, length, type, &h, &hdata);],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GETHOSTBYADDR_R_5)
AC_DEFINE(NEED_REENTRANT)
ac_cv_gethostbyaddr_args=5],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if gethostbyaddr_r takes 7 arguments)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <netdb.h>],
[
char * address;
int length;
int type;
struct hostent h;
char buffer[10];
int buflen;
int h_errnop;
struct hostent * hp;
int rc;
#include <netdb.h>],[
char * address;
int length;
int type;
struct hostent h;
char buffer[10];
int buflen;
int h_errnop;
struct hostent * hp;
rc = gethostbyaddr_r(address, length, type, &h,
buffer, buflen, &hp, &h_errnop);
],
ac_cv_gethostbyaddr_args=8)
fi
if test -z "$ac_cv_gethostbyaddr_args"; then
AC_MSG_RESULT(no)
have_missing_r_funcs="$have_missing_r_funcs gethostbyaddr_r"
else
if test "$ac_cv_gethostbyaddr_args" = 5; then
AC_DEFINE(HAVE_GETHOSTBYADDR_R_5)
elif test "$ac_cv_gethostbyaddr_args" = 7; then
AC_DEFINE(HAVE_GETHOSTBYADDR_R_7)
elif test "$ac_cv_gethostbyaddr_args" = 8; then
AC_DEFINE(HAVE_GETHOSTBYADDR_R_8)
fi
AC_MSG_RESULT([yes, and it takes $ac_cv_gethostbyaddr_args arguments])
fi
hp = gethostbyaddr_r(address, length, type, &h,
buffer, buflen, &h_errnop);],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GETHOSTBYADDR_R_7)
ac_cv_gethostbyaddr_args=7],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING(if gethostbyaddr_r takes 8 arguments)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <netdb.h>],[
char * address;
int length;
int type;
struct hostent h;
char buffer[10];
int buflen;
int h_errnop;
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
dnl **********************************************************************
dnl Back to "normal" configuring
dnl **********************************************************************
@@ -332,6 +377,7 @@ AC_CHECK_HEADERS( \
arpa/inet.h \
net/if.h \
netinet/in.h \
netinet/if_ether.h \
netdb.h \
sys/select.h \
sys/socket.h \
@@ -430,6 +476,3 @@ dnl perl/checklinks.pl \
dnl perl/getlinks.pl \
dnl perl/formfind.pl \
dnl perl/recursiveftpget.pl )

View File

@@ -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.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.3 I have a program that uses LGPL libraries, can I use libcurl?
6.4 Can I modify curl/libcurl for my program and keep the changes secret?
6.5 Can you please change the curl/libcurl license to XXXX?
6.3 I have a BSD licensed program, can I use the libcurl library?
6.4 I have a program that uses LGPL libraries, can I use libcurl?
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
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 ?
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
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
clashes yourself. This is a brief summary for a few cases for which we get
questions:
clashes yourself. This is a brief summary for the cases we get the most
questions. (Parts of this section was enhanced by Bjorn Reese.)
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
distribute the (lib)curl code with your code. GPL'd software requires all
parts of the final executable to be licensed under GPL or a license that
"does impose further restrictions". (One could argue about which license
that acutally imposes the restrictions, but that'll be left for you to
ponder about.) MPL is not compatible with GPL.
No, unfortunately you cannot distribute the (lib)curl code with your code.
According to both the Free Software Foundation and the Mozilla
Organization, MPL and GPL are not compatible, because GPL requires of
other licenses that they do "not impose any further restrictions on the
recipients' exercise of the rights granted herein" [GPL paragraph 6] (One
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
from curl and libcurl and request that the user gets it separately.
However, you have two alternative options:
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?
@@ -405,21 +430,27 @@ FAQ
library. If you end up doing changes to the library, only those changes
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
GPL ones do.
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
GPL programs can't be distributed together, neither with (lib)curl source
code and not as a binary.
GPL programs can't be distributed together with MPL programs, neither with
(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.
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
people have contributed with source code knowing that this is the license

View File

@@ -68,7 +68,7 @@ Standards
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

View File

@@ -2,7 +2,7 @@
.\" nroff -man curl.1
.\" 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
curl \- get a URL with FTP, TELNET, LDAP, GOPHER, DICT, FILE, HTTP or
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.
HTTP resume is only possible with HTTP/1.1 or later servers.
.IP "-d/--data <data>"
(HTTP)
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.
The data is expected to be "url-encoded". This will cause curl to
pass the data to the server using the content-type
(HTTP) 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
newlines cut off). The data is expected to be "url-encoded". This will cause
curl to pass the data to the server using the content-type
application/x-www-form-urlencoded. Compare to -F.
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.
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>"
(HTTP/FTP)
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>
- Fred Noz <FNoz@siac.com>
- Caolan McNamara <caolan@csn.ul.ie>
- Albert Chin-A-Young <china@thewrittenword.com>
.SH WWW
http://curl.haxx.se

View File

@@ -2,7 +2,7 @@
.\" nroff -man [file]
.\" 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
curl_easy_setopt - Set curl easy-session options
.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
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!
You can only set one option in each function call. A typical application uses
many calls in the setup phase.
The
.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
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
data to post.
data to post and CURLOPT_POSTFIELDSIZE in how to set the data size.
.TP
.B CURLOPT_FTPLISTONLY
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
post operation. See also the CURLOPT_POST.
.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
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

View File

@@ -371,6 +371,9 @@ typedef enum {
"[host]:[port]" */
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 */
} CURLoption;
@@ -419,8 +422,8 @@ char *curl_getenv(char *variable);
char *curl_version(void);
/* This is the version number */
#define LIBCURL_VERSION "7.1.1"
#define LIBCURL_VERSION_NUM 0x070101
#define LIBCURL_VERSION "7.2"
#define LIBCURL_VERSION_NUM 0x070200
/* linked-list structure for the CURLOPT_QUOTE option */
struct curl_slist {

View File

@@ -53,11 +53,11 @@ RELEASE_OBJS= \
timevalr.obj \
urlr.obj \
filer.obj \
writeoutr.obj \
writeoutr.obj \
versionr.obj \
easyr.obj \
highlevelr.obj \
strequalr.obj
easyr.obj \
highlevelr.obj \
strequalr.obj
DEBUG_OBJS= \
base64d.obj \
@@ -67,7 +67,7 @@ DEBUG_OBJS= \
formdatad.obj \
ftpd.obj \
httpd.obj \
ldapd.obj \
ldapd.obj \
dictd.obj \
telnetd.obj \
getdated.obj \
@@ -84,11 +84,11 @@ DEBUG_OBJS= \
timevald.obj \
urld.obj \
filed.obj \
writeoutd.obj \
versiond.obj \
easyd.obj \
highleveld.obj \
strequald.obj
writeoutd.obj \
versiond.obj \
easyd.obj \
highleveld.obj \
strequald.obj
RELEASE_SSL_OBJS= \
base64rs.obj \
@@ -98,7 +98,7 @@ RELEASE_SSL_OBJS= \
formdatars.obj \
ftprs.obj \
httprs.obj \
ldaprs.obj \
ldaprs.obj \
dictrs.obj \
telnetrs.obj \
getdaters.obj \
@@ -115,11 +115,11 @@ RELEASE_SSL_OBJS= \
timevalrs.obj \
urlrs.obj \
filers.obj \
writeouts.obj \
writeouts.obj \
versionrs.obj \
easyrs.obj \
highlevelrs.obj \
strequalrs.obj
easyrs.obj \
highlevelrs.obj \
strequalrs.obj
LINK_OBJS= \
base64.obj \
@@ -129,7 +129,7 @@ LINK_OBJS= \
formdata.obj \
ftp.obj \
http.obj \
ldap.obj \
ldap.obj \
dict.obj \
telnet.obj \
getdate.obj \
@@ -146,11 +146,11 @@ LINK_OBJS= \
timeval.obj \
url.obj \
file.obj \
writeout.obj \
writeout.obj \
version.obj \
easy.obj \
highlevel.obj \
strequal.obj
easy.obj \
highlevel.obj \
strequal.obj
all : release
@@ -217,6 +217,12 @@ writeoutr.obj: writeout.c
$(CCR) $(CFLAGS) writeout.c
versionr.obj: 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
base64d.obj: base64.c
@@ -271,6 +277,12 @@ writeoutd.obj: writeout.c
$(CCR) $(CFLAGS) writeout.c
versiond.obj: 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
@@ -326,6 +338,12 @@ writeoutrs.obj: writeout.c
$(CCR) $(CFLAGS) writeout.c
versionrs.obj: 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:
-@erase *.obj

View File

@@ -55,12 +55,13 @@ Example set of cookies:
13-Jun-1988 03:04:55 GMT; domain=.fidelity.com; path=/; secure
****/
#include "setup.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "cookie.h"
#include "setup.h"
#include "getdate.h"
#include "strequal.h"

View File

@@ -38,6 +38,8 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
/* -- WIN32 approved -- */
#include <stdio.h>
#include <string.h>
@@ -49,8 +51,6 @@
#include <errno.h>
#include "setup.h"
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
#include <winsock.h>
#include <time.h>

View File

@@ -38,12 +38,12 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "setup.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

View File

@@ -38,6 +38,8 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
/* -- WIN32 approved -- */
#include <stdio.h>
#include <string.h>
@@ -49,7 +51,6 @@
#include <errno.h>
#include "setup.h"
#include "strequal.h"
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)

View File

@@ -38,6 +38,8 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
/* -- WIN32 approved -- */
#include <stdio.h>
#include <string.h>
@@ -49,8 +51,6 @@
#include <errno.h>
#include "setup.h"
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
#include <winsock.h>
#include <time.h>
@@ -60,13 +60,17 @@
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <sys/time.h>
#include <sys/resource.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

View File

@@ -49,6 +49,8 @@
*/
#include "setup.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -56,7 +58,6 @@
#include <time.h>
#include "setup.h"
#include <curl/curl.h>
#include "formdata.h"

View File

@@ -38,14 +38,14 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include "setup.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -60,22 +60,22 @@
#include <sys/socket.h>
#endif
#include <sys/types.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#include <sys/utsname.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#endif
#if defined(WIN32) && defined(__GNUC__) || defined(__MINGW32__)
#include <errno.h>
#endif
#ifdef HAVE_INET_NTOA_R
#include "inet_ntoa_r.h"
#endif
#include <curl/curl.h>
#include "urldata.h"
#include "sendf.h"
@@ -680,7 +680,10 @@ CURLcode _ftp(struct connectdata *conn)
unsigned short ip[5];
(void) memcpy(&in.s_addr, *h->h_addr_list, sizeof (in.s_addr));
#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]);
#else
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",
answer?answer->h_name:newhost,
#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
ip_addr = inet_ntoa(in),
#endif

View File

@@ -32,15 +32,18 @@
** 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
# include "config.h"
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# 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
# include <time.h>
# endif
@@ -219,7 +222,7 @@ static int yyRelSeconds;
static int yyRelYear;
#line 202 "getdate.y"
#line 205 "getdate.y"
typedef union {
int Number;
enum _MERIDIAN Meridian;
@@ -302,11 +305,11 @@ static const short yyrhs[] = { -1,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
218, 219, 222, 225, 228, 231, 234, 237, 240, 246,
252, 261, 267, 279, 282, 285, 291, 295, 299, 305,
309, 327, 333, 339, 343, 348, 352, 359, 367, 370,
373, 376, 379, 382, 385, 388, 391, 394, 397, 400,
403, 406, 409, 412, 415, 418, 421, 426, 459, 463
221, 222, 225, 228, 231, 234, 237, 240, 243, 249,
255, 264, 270, 282, 285, 288, 294, 298, 302, 308,
312, 330, 336, 342, 346, 351, 355, 362, 370, 373,
376, 379, 382, 385, 388, 391, 394, 397, 400, 403,
406, 409, 412, 415, 418, 421, 424, 429, 462, 466
};
#endif
@@ -387,7 +390,7 @@ static const short yycheck[] = { 0,
56
};
/* -*-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. */
/* Skeleton output parser for bison,
@@ -601,7 +604,7 @@ __yy_memcpy (char *to, char *from, unsigned int count)
#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
into yyparse. The argument should have type void *.
@@ -930,37 +933,37 @@ yyreduce:
switch (yyn) {
case 3:
#line 222 "getdate.y"
#line 225 "getdate.y"
{
yyHaveTime++;
;
break;}
case 4:
#line 225 "getdate.y"
#line 228 "getdate.y"
{
yyHaveZone++;
;
break;}
case 5:
#line 228 "getdate.y"
#line 231 "getdate.y"
{
yyHaveDate++;
;
break;}
case 6:
#line 231 "getdate.y"
#line 234 "getdate.y"
{
yyHaveDay++;
;
break;}
case 7:
#line 234 "getdate.y"
#line 237 "getdate.y"
{
yyHaveRel++;
;
break;}
case 9:
#line 240 "getdate.y"
#line 243 "getdate.y"
{
yyHour = yyvsp[-1].Number;
yyMinutes = 0;
@@ -969,7 +972,7 @@ case 9:
;
break;}
case 10:
#line 246 "getdate.y"
#line 249 "getdate.y"
{
yyHour = yyvsp[-3].Number;
yyMinutes = yyvsp[-1].Number;
@@ -978,7 +981,7 @@ case 10:
;
break;}
case 11:
#line 252 "getdate.y"
#line 255 "getdate.y"
{
yyHour = yyvsp[-3].Number;
yyMinutes = yyvsp[-1].Number;
@@ -990,7 +993,7 @@ case 11:
;
break;}
case 12:
#line 261 "getdate.y"
#line 264 "getdate.y"
{
yyHour = yyvsp[-5].Number;
yyMinutes = yyvsp[-3].Number;
@@ -999,7 +1002,7 @@ case 12:
;
break;}
case 13:
#line 267 "getdate.y"
#line 270 "getdate.y"
{
yyHour = yyvsp[-5].Number;
yyMinutes = yyvsp[-3].Number;
@@ -1012,53 +1015,53 @@ case 13:
;
break;}
case 14:
#line 279 "getdate.y"
#line 282 "getdate.y"
{
yyTimezone = yyvsp[0].Number;
;
break;}
case 15:
#line 282 "getdate.y"
#line 285 "getdate.y"
{
yyTimezone = yyvsp[0].Number - 60;
;
break;}
case 16:
#line 286 "getdate.y"
#line 289 "getdate.y"
{
yyTimezone = yyvsp[-1].Number - 60;
;
break;}
case 17:
#line 291 "getdate.y"
#line 294 "getdate.y"
{
yyDayOrdinal = 1;
yyDayNumber = yyvsp[0].Number;
;
break;}
case 18:
#line 295 "getdate.y"
#line 298 "getdate.y"
{
yyDayOrdinal = 1;
yyDayNumber = yyvsp[-1].Number;
;
break;}
case 19:
#line 299 "getdate.y"
#line 302 "getdate.y"
{
yyDayOrdinal = yyvsp[-1].Number;
yyDayNumber = yyvsp[0].Number;
;
break;}
case 20:
#line 305 "getdate.y"
#line 308 "getdate.y"
{
yyMonth = yyvsp[-2].Number;
yyDay = yyvsp[0].Number;
;
break;}
case 21:
#line 309 "getdate.y"
#line 312 "getdate.y"
{
/* 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
@@ -1079,7 +1082,7 @@ case 21:
;
break;}
case 22:
#line 327 "getdate.y"
#line 330 "getdate.y"
{
/* ISO 8601 format. yyyy-mm-dd. */
yyYear = yyvsp[-2].Number;
@@ -1088,7 +1091,7 @@ case 22:
;
break;}
case 23:
#line 333 "getdate.y"
#line 336 "getdate.y"
{
/* e.g. 17-JUN-1992. */
yyDay = yyvsp[-2].Number;
@@ -1097,14 +1100,14 @@ case 23:
;
break;}
case 24:
#line 339 "getdate.y"
#line 342 "getdate.y"
{
yyMonth = yyvsp[-1].Number;
yyDay = yyvsp[0].Number;
;
break;}
case 25:
#line 343 "getdate.y"
#line 346 "getdate.y"
{
yyMonth = yyvsp[-3].Number;
yyDay = yyvsp[-2].Number;
@@ -1112,14 +1115,14 @@ case 25:
;
break;}
case 26:
#line 348 "getdate.y"
#line 351 "getdate.y"
{
yyMonth = yyvsp[0].Number;
yyDay = yyvsp[-1].Number;
;
break;}
case 27:
#line 352 "getdate.y"
#line 355 "getdate.y"
{
yyMonth = yyvsp[-1].Number;
yyDay = yyvsp[-2].Number;
@@ -1127,7 +1130,7 @@ case 27:
;
break;}
case 28:
#line 359 "getdate.y"
#line 362 "getdate.y"
{
yyRelSeconds = -yyRelSeconds;
yyRelMinutes = -yyRelMinutes;
@@ -1138,115 +1141,115 @@ case 28:
;
break;}
case 30:
#line 370 "getdate.y"
{
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 31:
#line 373 "getdate.y"
{
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 32:
case 31:
#line 376 "getdate.y"
{
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 32:
#line 379 "getdate.y"
{
yyRelYear += yyvsp[0].Number;
;
break;}
case 33:
#line 379 "getdate.y"
{
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 34:
#line 382 "getdate.y"
{
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 35:
case 34:
#line 385 "getdate.y"
{
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 35:
#line 388 "getdate.y"
{
yyRelMonth += yyvsp[0].Number;
;
break;}
case 36:
#line 388 "getdate.y"
{
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 37:
#line 391 "getdate.y"
{
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 38:
case 37:
#line 394 "getdate.y"
{
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 38:
#line 397 "getdate.y"
{
yyRelDay += yyvsp[0].Number;
;
break;}
case 39:
#line 397 "getdate.y"
{
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 40:
#line 400 "getdate.y"
{
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 41:
case 40:
#line 403 "getdate.y"
{
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 41:
#line 406 "getdate.y"
{
yyRelHour += yyvsp[0].Number;
;
break;}
case 42:
#line 406 "getdate.y"
{
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 43:
#line 409 "getdate.y"
{
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 44:
case 43:
#line 412 "getdate.y"
{
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 44:
#line 415 "getdate.y"
{
yyRelMinutes += yyvsp[0].Number;
;
break;}
case 45:
#line 415 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 46:
#line 418 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 47:
case 46:
#line 421 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 47:
#line 424 "getdate.y"
{
yyRelSeconds += yyvsp[0].Number;
;
break;}
case 48:
#line 427 "getdate.y"
#line 430 "getdate.y"
{
if (yyHaveTime && yyHaveDate && !yyHaveRel)
yyYear = yyvsp[0].Number;
@@ -1279,20 +1282,20 @@ case 48:
;
break;}
case 49:
#line 460 "getdate.y"
#line 463 "getdate.y"
{
yyval.Meridian = MER24;
;
break;}
case 50:
#line 464 "getdate.y"
#line 467 "getdate.y"
{
yyval.Meridian = yyvsp[0].Meridian;
;
break;}
}
/* 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;
yyssp -= yylen;
@@ -1512,7 +1515,7 @@ yyerrhandle:
}
return 1;
}
#line 469 "getdate.y"
#line 472 "getdate.y"
/* Include this file down here because bison inserts code above which

View File

@@ -8,15 +8,18 @@
** 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
# include "config.h"
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# 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
# include <time.h>
# endif

View File

@@ -38,6 +38,8 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
/* -- WIN32 approved -- */
#include <stdio.h>
#include <string.h>
@@ -49,7 +51,6 @@
#include <errno.h>
#include "setup.h"
#include "strequal.h"
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)

View File

@@ -38,10 +38,13 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
#include <string.h>
#include <malloc.h>
#include <errno.h>
#include "setup.h"
#define _REENTRANT
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
#include <winsock.h>
@@ -52,8 +55,12 @@
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
@@ -62,9 +69,7 @@
#include "urldata.h"
#include "sendf.h"
#define _REENTRANT
#ifdef HAVE_INET_NTOA_R
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
#include "inet_ntoa_r.h"
#endif
@@ -103,6 +108,7 @@ struct hostent *GetHost(struct UrlData *data,
{
struct hostent *h = NULL;
unsigned long in;
int ret;
if ( (in=inet_addr(hostname)) != INADDR_NONE ) {
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
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_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 */
if(NULL == h)
if(ret)
#endif
{
infof(data, "gethostbyname_r(2) failed for %s\n", hostname);

View File

@@ -38,9 +38,7 @@
* ------------------------------------------------------------
****************************************************************************/
#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). */
#include "setup.h"
/* -- WIN32 approved -- */
#include <stdio.h>
@@ -53,7 +51,12 @@
#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__)
#include <winsock.h>
@@ -63,7 +66,9 @@
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <sys/time.h>
#ifdef HAVE_TIME_H
@@ -374,7 +379,7 @@ CURLcode http(struct connectdata *conn)
#ifdef HAVE_LOCALTIME_R
/* thread-safe version */
struct tm keeptime;
thistime = localtime_r(&data->timevalue, &keeptime);
thistime = (struct tm *)localtime_r(&data->timevalue, &keeptime);
#else
thistime = localtime(&data->timevalue);
#endif
@@ -488,13 +493,19 @@ CURLcode http(struct connectdata *conn)
actually set your own */
sendf(data->firstsocket, data,
"Content-Length: %d\r\n",
strlen(data->postfields));
(data->postfieldsize?data->postfieldsize:
strlen(data->postfields)) );
if(!checkheaders(data, "Content-Type:"))
sendf(data->firstsocket, data,
"Content-Type: application/x-www-form-urlencoded\r\n");
/* 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,
"\r\n"
"%s\r\n",

View File

@@ -38,11 +38,12 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "setup.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -50,12 +51,19 @@
#if ! defined(WIN32) && ! defined(__BEOS__)
#ifdef NEED_REENTRANT
#define _REENTRANT
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#include <netinet/in.h>
#ifdef HAVE_SYS_TIME_H
/* This must be before net/if.h for AIX 3.2 to enjoy life */
@@ -75,7 +83,7 @@
#include <sys/sockio.h>
#endif
#ifdef HAVE_INET_NTOA_R
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
#include "inet_ntoa_r.h"
#endif

View File

@@ -38,6 +38,8 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
/* -- WIN32 approved -- */
#include <stdio.h>
#include <string.h>
@@ -48,8 +50,6 @@
#include <sys/stat.h>
#include <errno.h>
#include "setup.h"
#if defined(WIN32) && !defined(__GNUC__)
#else
# ifdef HAVE_UNISTD_H

View File

@@ -50,11 +50,12 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "setup.h"
#include "getenv.h"
#include "strequal.h"

View File

@@ -38,9 +38,10 @@
* ------------------------------------------------------------
****************************************************************************/
#include <string.h>
#include "setup.h"
#include <string.h>
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
#if defined(__MINGW32__)
#include <winsock.h>

View File

@@ -38,12 +38,12 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include "setup.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -84,7 +84,6 @@ void failf(struct UrlData *data, char *fmt, ...)
}
/* sendf() sends the formated data to the server */
int sendf(int fd, struct UrlData *data, char *fmt, ...)
{
size_t bytes_written;
@@ -110,6 +109,25 @@ int sendf(int fd, struct UrlData *data, char *fmt, ...)
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;
}

View File

@@ -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 failf(struct UrlData *, char *fmt, ...);

View File

@@ -40,7 +40,7 @@
* ------------------------------------------------------------
****************************************************************************/
#include <stdio.h>
#if !defined(WIN32) && defined(_WIN32)
/* This _might_ be a good Borland fix. Please report whether this works or
@@ -57,6 +57,7 @@
#endif
#endif
#include <stdio.h>
#ifndef OS
#ifdef WIN32
#define OS "win32"

View File

@@ -38,6 +38,8 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
#include <stdio.h>
#if defined(__MINGW32__)
#include <winsock.h>

View File

@@ -43,7 +43,7 @@
* Linas Vepstas <linas@linas.org> and Sampo Kellomaki <sampo@iki.fi>
*/
#include "setup.h"
#include <string.h>
#include <stdlib.h>

View File

@@ -38,10 +38,10 @@
* ------------------------------------------------------------
****************************************************************************/
#include <string.h>
#include "setup.h"
#include <string.h>
int strequal(const char *first, const char *second)
{
#if defined(HAVE_STRCASECMP)

View File

@@ -46,6 +46,8 @@
*
****************************************************************************/
#include "setup.h"
/* -- WIN32 approved -- */
#include <stdio.h>
#include <string.h>
@@ -57,8 +59,6 @@
#include <errno.h>
#include "setup.h"
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
#include <winsock.h>
#include <time.h>

View File

@@ -40,6 +40,8 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
#include <time.h>
#include <winsock.h>
@@ -47,7 +49,6 @@
#include <sys/time.h>
#endif
#include "setup.h"
#ifndef HAVE_GETTIMEOFDAY
#if !defined(_WINSOCKAPI_) && !defined(__MINGW32__)

View File

@@ -39,6 +39,9 @@
****************************************************************************/
/* -- WIN32 approved -- */
#include "setup.h"
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
@@ -49,7 +52,6 @@
#include <errno.h>
#include "setup.h"
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
#include <winsock.h>
@@ -421,6 +423,9 @@ CURLcode curl_setopt(CURL *curl, CURLoption option, ...)
case CURLOPT_POSTFIELDS:
data->postfields = va_arg(param, char *);
break;
case CURLOPT_POSTFIELDSIZE:
data->postfieldsize = va_arg(param, long);
break;
case CURLOPT_REFERER:
data->referer = va_arg(param, char *);
data->bits.http_set_referer = (data->referer && *data->referer)?1:0;

View File

@@ -345,6 +345,9 @@ struct UrlData {
char *range; /* range, if used. See README for detailed specification on
this syntax. */
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
allocated */

View File

@@ -38,10 +38,11 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
#include <string.h>
#include <stdio.h>
#include "setup.h"
#include <curl/curl.h>
#include "urldata.h"

View File

@@ -38,6 +38,8 @@
* ------------------------------------------------------------
****************************************************************************/
#include "setup.h"
#include <stdio.h>
#include <string.h>

9
reconf
View File

@@ -9,8 +9,7 @@ die(){
echo "$@" ; exit
}
aclocal || die "ahhhhh"
autoheader || die "ahhhhh"
automake || die "ahhhhh"
autoconf || die "ahhhhh"
aclocal -I . || die "ahhhhh"
autoheader || die "ahhhhh"
automake || die "ahhhhh"
autoconf || die "ahhhhh"

View File

@@ -110,16 +110,32 @@ puts (
" -d/--data <data>\n"
" (HTTP) Sends the specified data in a POST request to\n"
" the HTTP server. Note that the data is sent exactly as\n"
" specified with no extra processing. The data is\n"
" expected to be \"url-encoded\". This will cause curl to\n"
" pass the data to the server using the content-type\n"
" application/x-www-form-urlencoded. Compare to -F.\n"
" specified with no extra processing (with all newlines\n"
" cut off). The data is expected to be \"url-encoded\".\n"
" This will cause curl to pass the data to the server\n"
" using the content-type application/x-www-form-urlen<EFBFBD>\n"
" coded. Compare to -F.\n"
"\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"
" you want curl to read the data from stdin. The con<EFBFBD>\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"
" you want curl to read the data from stdin. The con<6F>\n"
" tents of the file must already be url-encoded.\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"
" (HTTP/FTP) Write the HTTP headers to this file. Write\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"
" header includes things like server-name, date of the\n"
" document, HTTP-version and more...\n"
"\n"
" -I/--head\n"
" (HTTP/FTP) Fetch the HTTP-header only! HTTP-servers\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"
" they were written on the actual command line. If 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"
"\n"
" Specify the filename as '-' to make curl read the file\n"
" from stdin.\n"
"\n"
" -l/--list-only\n"
" (FTP) When listing an FTP directory, this switch forces\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"
" page has a different location (indicated with the\n"
" header line Location:) this flag will let curl attempt\n"
);
puts(
" to reattempt the get on the new place. If used together\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"
@@ -304,7 +320,6 @@ puts (
"\n"
" - (any single-letter string) to make it pick\n"
" the machine's default\n"
"\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"
" fig file.\n"
@@ -320,6 +335,7 @@ puts (
" to be run before and after the transfer. If the server\n"
" returns failure for one of the commands, the entire\n"
" operation will be aborted.\n"
"\n"
" -r/--range <range>\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"
@@ -356,7 +372,6 @@ puts (
" -s/--silent\n"
" Silent mode. Don't show progress meter or error mes<65>\n"
" sages. Makes Curl mute.\n"
"\n"
" -S/--show-error\n"
" When used with -s it makes curl show error message if\n"
" it fails.\n"
@@ -408,9 +423,9 @@ puts (
" particular file you specify it \"@filename\" and to tell\n"
" curl to read the format from stdin you write \"@-\".\n"
"\n"
" The variables present in the output format will be sub<75>\n"
" stituted by the value or text that curl thinks fit, as\n"
" described below. All variables are specified like\n"
" The variables present in the output format will be\n"
" substituted by the value or text that curl thinks fit,\n"
" as described below. All variables are specified like\n"
" %{variable_name} and to output a normal % you just\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"
@@ -424,6 +439,7 @@ puts (
" url_effective The URL that was fetched last. This is\n"
" mostly meaningful if you've told curl to\n"
" follow location: headers.\n"
"\n"
" http_code The numerical code that was found in the\n"
" last retrieved HTTP(S) page.\n"
"\n"
@@ -447,6 +463,8 @@ puts (
" transfer commands and negotiations that\n"
" are specific to the particular proto<74>\n"
" col(s) involved.\n"
);
puts(
"\n"
" size_download The total amount of bytes that were\n"
" downloaded.\n"
@@ -459,15 +477,12 @@ puts (
"\n"
" speed_upload The average upload speed that curl mea<65>\n"
" sured for the complete download.\n"
"\n"
" -x/--proxy <proxyhost[:port]>\n"
" Use specified proxy. If the port number is not speci<63>\n"
" fied, it is assumed at port 1080.\n"
"\n"
" -X/--request <command>\n"
" (HTTP) Specifies a custom request to use when communi<6E>\n"
);
puts(
" cating with the HTTP server. The specified request\n"
" will be used instead of the standard GET. Read the HTTP\n"
" 1.1 specification for details and explanations.\n"
@@ -529,6 +544,7 @@ puts (
"ENVIRONMENT\n"
" HTTP_PROXY [protocol://]<host>[:port]\n"
" Sets proxy server to use for HTTP.\n"
"\n"
" HTTPS_PROXY [protocol://]<host>[:port]\n"
" Sets proxy server to use for HTTPS.\n"
"\n"
@@ -564,7 +580,6 @@ puts (
"\n"
" 4 URL user malformatted. The user-part of the URL syntax\n"
" was not correct.\n"
"\n"
" 5 Couldn't resolve proxy. The given proxy host could not\n"
" be resolved.\n"
"\n"
@@ -580,6 +595,7 @@ puts (
"\n"
" 10 FTP user/password incorrect. Either one or both were\n"
" not accepted by the server.\n"
"\n"
" 11 FTP weird PASS reply. Curl couldn't parse the reply\n"
" sent to the PASS request.\n"
"\n"
@@ -616,7 +632,6 @@ puts (
"\n"
" 23 Write error. Curl couldn't write data to a local\n"
" filesystem or similar.\n"
"\n"
" 24 Malformat user. User name badly specified.\n"
"\n"
" 25 FTP couldn't STOR file. The server denied the STOR\n"
@@ -631,6 +646,7 @@ puts (
"\n"
" 29 FTP couldn't set ASCII. The server returned an unknown\n"
" reply.\n"
"\n"
" 30 FTP PORT failed. The PORT command failed.\n"
"\n"
" 31 FTP couldn't use REST. The REST command failed.\n"
@@ -667,7 +683,6 @@ puts (
"BUGS\n"
" If you do find any (or have other suggestions), mail Daniel\n"
" Stenberg <Daniel.Stenberg@haxx.se>.\n"
"\n"
"AUTHORS / CONTRIBUTORS\n"
" - Daniel Stenberg <Daniel.Stenberg@haxx.se>\n"
" - Rafael Sagula <sagula@inf.ufrgs.br>\n"
@@ -717,7 +732,7 @@ puts (
" - Kristian K<>hntopp <kris@koehntopp.de>\n"
" - Fred Noz <FNoz@siac.com>\n"
" - Caolan McNamara <caolan@csn.ul.ie>\n"
"\n"
" - Albert Chin-A-Young <china@thewrittenword.com>\n"
"WWW\n"
" http://curl.haxx.se\n"
"\n"
@@ -747,6 +762,8 @@ puts (
" Get a gopher document from funet's gopher server:\n"
"\n"
" curl gopher://gopher.funet.fi\n"
);
puts(
"\n"
" Get a web page from a server using port 8000:\n"
"\n"
@@ -779,8 +796,6 @@ puts (
" To ftp files using name+passwd, include them in the URL like:\n"
"\n"
" curl ftp://name:passwd@machine.domain:port/full/path/to/file\n"
);
puts(
"\n"
" or specify them with the -u flag like\n"
"\n"
@@ -1043,6 +1058,8 @@ puts (
" 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"
" 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"
" 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"
@@ -1061,8 +1078,6 @@ puts (
" 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"
" manner similar to:\n"
);
puts(
"\n"
" curl --dump-header headers www.example.com\n"
"\n"
@@ -1313,6 +1328,8 @@ puts (
"TIME CONDITIONS\n"
"\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"
" specify them with the -z/--time-cond flag.\n"
"\n"
@@ -1332,8 +1349,6 @@ puts (
" curl -z yesterday http://remote.server.com/remote.html\n"
"\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"
"\n"
"DICT\n"

View File

@@ -230,7 +230,9 @@ static void help(void)
" -B/--use-ascii Use ASCII/text transfer\n"
" -c/--continue Resume a previous transfer where we left it\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"
" -e/--referer Referer page (H)\n"
" -E/--cert <cert:passwd> Specifies your certificate file and password (HTTPS)\n"
@@ -292,6 +294,7 @@ struct Configurable {
bool use_resume;
int resume_from;
char *postfields;
long postfieldsize;
char *referer;
long timeout;
char *outfile;
@@ -385,6 +388,36 @@ static char *file2string(FILE *file)
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 */
char *nextarg, /* NULL if unset */
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)
{
char letter;
char subletter=0; /* subletters can only occur on long options */
char *parse=NULL;
int res;
int j;
time_t now;
int hit=-1;
bool longopt=FALSE;
/* single-letter,
long-name,
@@ -416,6 +452,8 @@ static int getparameter(char *flag, /* f or -long-flag */
{"c", "continue", FALSE},
{"C", "continue-at", TRUE},
{"d", "data", TRUE},
{"da", "data-ascii", TRUE},
{"db", "data-binary", TRUE},
{"D", "dump-header", TRUE},
{"e", "referer", TRUE},
{"E", "cert", TRUE},
@@ -465,6 +503,7 @@ static int getparameter(char *flag, /* f or -long-flag */
int fnam=strlen(&flag[1]);
for(j=0; j< sizeof(aliases)/sizeof(aliases[0]); j++) {
if(strnequal(aliases[j].lname, &flag[1], fnam)) {
longopt = TRUE;
if(strequal(aliases[j].lname, &flag[1])) {
parse = aliases[j].letter;
hit = j;
@@ -492,7 +531,12 @@ static int getparameter(char *flag, /* f or -long-flag */
do {
/* 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 */
#if 0
@@ -500,7 +544,7 @@ static int getparameter(char *flag, /* f or -long-flag */
#endif
if(hit < 0) {
for(j=0; j< sizeof(aliases)/sizeof(aliases[0]); j++) {
if(letter == *aliases[j].letter) {
if(letter == aliases[j].letter[0]) {
hit = j;
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
or - (stdin) follows */
FILE *file;
char *ptr;
nextarg++; /* pass the @ */
if(strequal("-", nextarg))
file = stdin;
else
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))
fclose(stdin);
}
@@ -1422,6 +1473,10 @@ int main(int argc, char *argv[])
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorbuffer);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, config.timeout);
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_AUTOREFERER, config.conf&CONF_AUTO_REFERER);
curl_easy_setopt(curl, CURLOPT_USERAGENT, config.useragent);

View File

@@ -1,3 +1,3 @@
#define CURL_NAME "curl"
#define CURL_VERSION "7.1"
#define CURL_VERSION "7.2"
#define CURL_ID CURL_NAME " " CURL_VERSION " (" OS ") "