Compare commits
70 Commits
pre-header
...
curl_7_6-p
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d80f87554c | ||
![]() |
c1d37470f6 | ||
![]() |
9c695393b2 | ||
![]() |
444024ea14 | ||
![]() |
afcd933b4c | ||
![]() |
ae0a6835bd | ||
![]() |
f2f11be8ba | ||
![]() |
e09eda9c7c | ||
![]() |
c6877a414e | ||
![]() |
a3eb91ffb1 | ||
![]() |
12708473a6 | ||
![]() |
9012f8cdb3 | ||
![]() |
e26ee09586 | ||
![]() |
7d09e51162 | ||
![]() |
18ebde6960 | ||
![]() |
b0c0e8d815 | ||
![]() |
16502d7d15 | ||
![]() |
ce05deece8 | ||
![]() |
b77e2528e7 | ||
![]() |
27f8cf6dfc | ||
![]() |
f5aa7f64bd | ||
![]() |
44254c4945 | ||
![]() |
a9ea507c6a | ||
![]() |
b137d5ec23 | ||
![]() |
4792eee5d0 | ||
![]() |
a84625eca6 | ||
![]() |
19d3fd1185 | ||
![]() |
a9be9bc7f5 | ||
![]() |
e8b99d21e5 | ||
![]() |
f6c57990ee | ||
![]() |
370d7f7527 | ||
![]() |
7d38692c4f | ||
![]() |
a997d60304 | ||
![]() |
ff8fb8cdb0 | ||
![]() |
b915ca68f9 | ||
![]() |
703fc264f0 | ||
![]() |
19d92834ed | ||
![]() |
9ade752fa7 | ||
![]() |
e8a5f3026f | ||
![]() |
2cac4a9c72 | ||
![]() |
39e939a507 | ||
![]() |
803005892c | ||
![]() |
08cfdf909e | ||
![]() |
434ce48016 | ||
![]() |
10051e6916 | ||
![]() |
d54cdf294b | ||
![]() |
2e342d5d9b | ||
![]() |
fe84071e80 | ||
![]() |
044ca343ad | ||
![]() |
f59ea9adb3 | ||
![]() |
0cec4ba6bf | ||
![]() |
14ca732a8f | ||
![]() |
53c27c7722 | ||
![]() |
c2f5b71dc9 | ||
![]() |
6403257886 | ||
![]() |
4031104404 | ||
![]() |
9f9cac7402 | ||
![]() |
06730bc905 | ||
![]() |
0d181b596b | ||
![]() |
b60f1b1d17 | ||
![]() |
4d1706798f | ||
![]() |
4ac48317cf | ||
![]() |
ed8dbf4ac2 | ||
![]() |
97f43e98e7 | ||
![]() |
f76ef1fb67 | ||
![]() |
3bcdfd5cb4 | ||
![]() |
7ce518701b | ||
![]() |
10272550b6 | ||
![]() |
784f57f9eb | ||
![]() |
24dee483e9 |
22
CVS-INFO
Normal file
22
CVS-INFO
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
This file is only present in the CVS - never in release archives.
|
||||||
|
|
||||||
|
This contains information about other files and things that the CVS repository
|
||||||
|
keeps in its inner sanctum.
|
||||||
|
|
||||||
|
CHANGES.0 contains ancient changes.
|
||||||
|
|
||||||
|
memanalyze.pl is for analyzing the output generated by curl if -DMALLOCDEBUG
|
||||||
|
is used when compiling
|
||||||
|
|
||||||
|
Makefile.dist is included as the root Makefile in distribution archives
|
||||||
|
|
||||||
|
perl/ is a subdirectory with various perl scripts
|
||||||
|
|
||||||
|
To build after having extracted everything from CVS, do this:
|
||||||
|
|
||||||
|
automake
|
||||||
|
aclocal
|
||||||
|
autoheader
|
||||||
|
autoconf
|
||||||
|
./configure
|
||||||
|
make
|
85
FILES
85
FILES
@@ -1,85 +0,0 @@
|
|||||||
CHANGES
|
|
||||||
FILES
|
|
||||||
LEGAL
|
|
||||||
MPL-1.0.txt
|
|
||||||
README
|
|
||||||
docs/BUGS
|
|
||||||
docs/CONTRIBUTE
|
|
||||||
docs/FAQ
|
|
||||||
docs/FEATURES
|
|
||||||
docs/INSTALL
|
|
||||||
docs/INTERNALS
|
|
||||||
docs/MANUAL
|
|
||||||
docs/README.win32
|
|
||||||
docs/README.libcurl
|
|
||||||
docs/RESOURCES
|
|
||||||
docs/TODO
|
|
||||||
docs/curl.1
|
|
||||||
docs/Makefile.in
|
|
||||||
docs/Makefile.am
|
|
||||||
docs/TheArtOfHttpScripting
|
|
||||||
docs/*.3
|
|
||||||
docs/examples/README
|
|
||||||
docs/examples/*.c
|
|
||||||
maketgz
|
|
||||||
Makefile.in
|
|
||||||
Makefile.am
|
|
||||||
acconfig.h
|
|
||||||
acinclude.m4
|
|
||||||
aclocal.m4
|
|
||||||
config.guess
|
|
||||||
config.h.in
|
|
||||||
config-win32.h
|
|
||||||
config.sub
|
|
||||||
configure
|
|
||||||
configure.in
|
|
||||||
install-sh
|
|
||||||
missing
|
|
||||||
mkinstalldirs
|
|
||||||
reconf
|
|
||||||
stamp-h.in
|
|
||||||
ltconfig
|
|
||||||
ltmain.sh
|
|
||||||
src/config-win32.h
|
|
||||||
src/hugehelp.c
|
|
||||||
src/main.c
|
|
||||||
src/setup.h
|
|
||||||
src/urlglob.c
|
|
||||||
src/urlglob.h
|
|
||||||
src/version.h
|
|
||||||
src/writeout.c
|
|
||||||
src/writeout.h
|
|
||||||
src/*.in
|
|
||||||
src/*.am
|
|
||||||
src/mkhelp.pl
|
|
||||||
src/Makefile.vc6
|
|
||||||
src/Makefile.b32
|
|
||||||
src/*m32
|
|
||||||
lib/getdate.y
|
|
||||||
lib/*.[ch]
|
|
||||||
lib/*in
|
|
||||||
lib/*am
|
|
||||||
lib/Makefile.vc6
|
|
||||||
lib/*m32
|
|
||||||
lib/Makefile.b32
|
|
||||||
lib/Makefile.b32.resp
|
|
||||||
lib/libcurl.def
|
|
||||||
include/README
|
|
||||||
include/Makefile.in
|
|
||||||
include/Makefile.am
|
|
||||||
include/curl/*.h
|
|
||||||
include/curl/Makefile.in
|
|
||||||
include/curl/Makefile.am
|
|
||||||
packages/Linux/RPM/curl-ssl.spec
|
|
||||||
packages/Linux/RPM/curl.spec
|
|
||||||
packages/Linux/RPM/make_curl_rpm
|
|
||||||
packages/Linux/RPM/README
|
|
||||||
packages/Win32/README
|
|
||||||
packages/README
|
|
||||||
tests/Makefile.am
|
|
||||||
tests/Makefile.in
|
|
||||||
tests/runtests.pl
|
|
||||||
tests/README
|
|
||||||
tests/httpserver.pl
|
|
||||||
tests/ftpserver.pl
|
|
||||||
tests/data/*.txt
|
|
34
LEGAL
34
LEGAL
@@ -1,21 +1,25 @@
|
|||||||
Part of this software is distributed under the Mozilla Public License
|
Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
version 1.0, which is part of this distribution (MPL-1.0.txt) and
|
|
||||||
available on-line at http://www.mozilla.org/MPL/
|
|
||||||
|
|
||||||
The terminology used here is described in the Mozilla Public License.
|
Everyone is permitted to copy and distribute verbatim copies of this license
|
||||||
|
document, but changing it is not allowed.
|
||||||
|
|
||||||
In accordance with section "4. Inability to Comply Due to Statute or
|
In order to be useful for every potential user, the curl and libcurl are
|
||||||
Regulation" the following exemptions apply to this software:
|
dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
|
|
||||||
* The Initial Developer has the right, regardless of the citizenship
|
You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
of any involved party, to choose the location for settling disputes
|
copies of the Software, and permit persons to whom the Software is furnished
|
||||||
as refered to under section "11. Miscellaneous" of the Mozilla Public
|
to do so, under the terms of the MPL or the MIT/X-derivate licenses. You may
|
||||||
License.
|
pick one of these licenses. The files MITX.txt and MPL-1.1.txt contain the
|
||||||
|
license texts.
|
||||||
|
|
||||||
Initial Developers of this software are:
|
As a courtesy to the open-source and free software community, we ask you to
|
||||||
|
dual-license any modifications that you make as well, under the terms of this
|
||||||
Daniel Stenberg <daniel@haxx.se>
|
document.
|
||||||
|
|
||||||
Curl is Copyright (C) 1996-2000 Daniel Stenberg
|
|
||||||
|
|
||||||
|
Please remember to always keep the licensing information included in
|
||||||
|
individual source files up-to-date, so as to avoid misleading anyone as to
|
||||||
|
the status of these files.
|
||||||
|
|
||||||
|
I will use a submission policy according to which I will only enter
|
||||||
|
contributions into the CVS tree if the contributor agrees to both licenses
|
||||||
|
and this dual-license approach.
|
||||||
|
28
MITX.txt
Normal file
28
MITX.txt
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
COPYRIGHT AND PERMISSION NOTICE
|
||||||
|
|
||||||
|
Copyright (c) 2000, Daniel Stenberg, <daniel@haxx.se>.
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, and/or sell copies of the
|
||||||
|
Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
provided that the above copyright notice(s) and this permission notice appear
|
||||||
|
in all copies of the Software and that both the above copyright notice(s) and
|
||||||
|
this permission notice appear in supporting documentation.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
|
||||||
|
NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE
|
||||||
|
LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY
|
||||||
|
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||||
|
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
Except as contained in this notice, the name of a copyright holder shall not
|
||||||
|
be used in advertising or otherwise to promote the sale, use or other dealings
|
||||||
|
in this Software without prior written authorization of the copyright holder.
|
||||||
|
|
360
MPL-1.0.txt
360
MPL-1.0.txt
@@ -1,360 +0,0 @@
|
|||||||
MOZILLA PUBLIC LICENSE
|
|
||||||
Version 1.0
|
|
||||||
|
|
||||||
----------------
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
1.1. ``Contributor'' means each entity that creates or contributes to
|
|
||||||
the creation of Modifications.
|
|
||||||
|
|
||||||
1.2. ``Contributor Version'' means the combination of the Original
|
|
||||||
Code, prior Modifications used by a Contributor, and the Modifications
|
|
||||||
made by that particular Contributor.
|
|
||||||
|
|
||||||
1.3. ``Covered Code'' means the Original Code or Modifications or the
|
|
||||||
combination of the Original Code and Modifications, in each case
|
|
||||||
including portions thereof.
|
|
||||||
|
|
||||||
1.4. ``Electronic Distribution Mechanism'' means a mechanism generally
|
|
||||||
accepted in the software development community for the electronic
|
|
||||||
transfer of data.
|
|
||||||
|
|
||||||
1.5. ``Executable'' means Covered Code in any form other than Source
|
|
||||||
Code.
|
|
||||||
|
|
||||||
1.6. ``Initial Developer'' means the individual or entity identified as
|
|
||||||
the Initial Developer in the Source Code notice required by Exhibit A.
|
|
||||||
|
|
||||||
1.7. ``Larger Work'' means a work which combines Covered Code or
|
|
||||||
portions thereof with code not governed by the terms of this License.
|
|
||||||
|
|
||||||
1.8. ``License'' means this document.
|
|
||||||
|
|
||||||
1.9. ``Modifications'' means any addition to or deletion from the
|
|
||||||
substance or structure of either the Original Code or any previous
|
|
||||||
Modifications. When Covered Code is released as a series of files, a
|
|
||||||
Modification is:
|
|
||||||
|
|
||||||
A. Any addition to or deletion from the contents of a file
|
|
||||||
containing Original Code or previous Modifications.
|
|
||||||
|
|
||||||
B. Any new file that contains any part of the Original Code or
|
|
||||||
previous Modifications.
|
|
||||||
|
|
||||||
1.10. ``Original Code'' means Source Code of computer software code
|
|
||||||
which is described in the Source Code notice required by Exhibit A as
|
|
||||||
Original Code, and which, at the time of its release under this License
|
|
||||||
is not already Covered Code governed by this License.
|
|
||||||
|
|
||||||
1.11. ``Source Code'' means the preferred form of the Covered Code for
|
|
||||||
making modifications to it, including all modules it contains, plus any
|
|
||||||
associated interface definition files, scripts used to control
|
|
||||||
compilation and installation of an Executable, or a list of source code
|
|
||||||
differential comparisons against either the Original Code or another
|
|
||||||
well known, available Covered Code of the Contributor's choice. The
|
|
||||||
Source Code can be in a compressed or archival form, provided the
|
|
||||||
appropriate decompression or de-archiving software is widely available
|
|
||||||
for no charge.
|
|
||||||
|
|
||||||
1.12. ``You'' means an individual or a legal entity exercising rights
|
|
||||||
under, and complying with all of the terms of, this License or a future
|
|
||||||
version of this License issued under Section 6.1. For legal entities,
|
|
||||||
``You'' includes any entity which controls, is controlled by, or is
|
|
||||||
under common control with You. For purposes of this definition,
|
|
||||||
``control'' means (a) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (b) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares or beneficial ownership of such entity.
|
|
||||||
|
|
||||||
2. Source Code License.
|
|
||||||
|
|
||||||
2.1. The Initial Developer Grant.
|
|
||||||
The Initial Developer hereby grants You a world-wide, royalty-free,
|
|
||||||
non-exclusive license, subject to third party intellectual property
|
|
||||||
claims:
|
|
||||||
|
|
||||||
(a) to use, reproduce, modify, display, perform, sublicense and
|
|
||||||
distribute the Original Code (or portions thereof) with or without
|
|
||||||
Modifications, or as part of a Larger Work; and
|
|
||||||
|
|
||||||
(b) under patents now or hereafter owned or controlled by Initial
|
|
||||||
Developer, to make, have made, use and sell (``Utilize'') the
|
|
||||||
Original Code (or portions thereof), but solely to the extent that
|
|
||||||
any such patent is reasonably necessary to enable You to Utilize
|
|
||||||
the Original Code (or portions thereof) and not to any greater
|
|
||||||
extent that may be necessary to Utilize further Modifications or
|
|
||||||
combinations.
|
|
||||||
|
|
||||||
2.2. Contributor Grant.
|
|
||||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
|
||||||
non-exclusive license, subject to third party intellectual property
|
|
||||||
claims:
|
|
||||||
|
|
||||||
(a) to use, reproduce, modify, display, perform, sublicense and
|
|
||||||
distribute the Modifications created by such Contributor (or
|
|
||||||
portions thereof) either on an unmodified basis, with other
|
|
||||||
Modifications, as Covered Code or as part of a Larger Work; and
|
|
||||||
|
|
||||||
(b) under patents now or hereafter owned or controlled by
|
|
||||||
Contributor, to Utilize the Contributor Version (or portions
|
|
||||||
thereof), but solely to the extent that any such patent is
|
|
||||||
reasonably necessary to enable You to Utilize the Contributor
|
|
||||||
Version (or portions thereof), and not to any greater extent that
|
|
||||||
may be necessary to Utilize further Modifications or combinations.
|
|
||||||
|
|
||||||
3. Distribution Obligations.
|
|
||||||
|
|
||||||
3.1. Application of License.
|
|
||||||
The Modifications which You create or to which You contribute are
|
|
||||||
governed by the terms of this License, including without limitation
|
|
||||||
Section 2.2. The Source Code version of Covered Code may be distributed
|
|
||||||
only under the terms of this License or a future version of this
|
|
||||||
License released under Section 6.1, and You must include a copy of this
|
|
||||||
License with every copy of the Source Code You distribute. You may not
|
|
||||||
offer or impose any terms on any Source Code version that alters or
|
|
||||||
restricts the applicable version of this License or the recipients'
|
|
||||||
rights hereunder. However, You may include an additional document
|
|
||||||
offering the additional rights described in Section 3.5.
|
|
||||||
|
|
||||||
3.2. Availability of Source Code.
|
|
||||||
Any Modification which You create or to which You contribute must be
|
|
||||||
made available in Source Code form under the terms of this License
|
|
||||||
either on the same media as an Executable version or via an accepted
|
|
||||||
Electronic Distribution Mechanism to anyone to whom you made an
|
|
||||||
Executable version available; and if made available via Electronic
|
|
||||||
Distribution Mechanism, must remain available for at least twelve (12)
|
|
||||||
months after the date it initially became available, or at least six
|
|
||||||
(6) months after a subsequent version of that particular Modification
|
|
||||||
has been made available to such recipients. You are responsible for
|
|
||||||
ensuring that the Source Code version remains available even if the
|
|
||||||
Electronic Distribution Mechanism is maintained by a third party.
|
|
||||||
|
|
||||||
3.3. Description of Modifications.
|
|
||||||
You must cause all Covered Code to which you contribute to contain a
|
|
||||||
file documenting the changes You made to create that Covered Code and
|
|
||||||
the date of any change. You must include a prominent statement that the
|
|
||||||
Modification is derived, directly or indirectly, from Original Code
|
|
||||||
provided by the Initial Developer and including the name of the Initial
|
|
||||||
Developer in (a) the Source Code, and (b) in any notice in an
|
|
||||||
Executable version or related documentation in which You describe the
|
|
||||||
origin or ownership of the Covered Code.
|
|
||||||
|
|
||||||
3.4. Intellectual Property Matters
|
|
||||||
|
|
||||||
(a) Third Party Claims.
|
|
||||||
If You have knowledge that a party claims an intellectual property
|
|
||||||
right in particular functionality or code (or its utilization
|
|
||||||
under this License), you must include a text file with the source
|
|
||||||
code distribution titled ``LEGAL'' which describes the claim and
|
|
||||||
the party making the claim in sufficient detail that a recipient
|
|
||||||
will know whom to contact. If you obtain such knowledge after You
|
|
||||||
make Your Modification available as described in Section 3.2, You
|
|
||||||
shall promptly modify the LEGAL file in all copies You make
|
|
||||||
available thereafter and shall take other steps (such as notifying
|
|
||||||
appropriate mailing lists or newsgroups) reasonably calculated to
|
|
||||||
inform those who received the Covered Code that new knowledge has
|
|
||||||
been obtained.
|
|
||||||
|
|
||||||
(b) Contributor APIs.
|
|
||||||
If Your Modification is an application programming interface and
|
|
||||||
You own or control patents which are reasonably necessary to
|
|
||||||
implement that API, you must also include this information in the
|
|
||||||
LEGAL file.
|
|
||||||
|
|
||||||
3.5. Required Notices.
|
|
||||||
You must duplicate the notice in Exhibit A in each file of the Source
|
|
||||||
Code, and this License in any documentation for the Source Code, where
|
|
||||||
You describe recipients' rights relating to Covered Code. If You
|
|
||||||
created one or more Modification(s), You may add your name as a
|
|
||||||
Contributor to the notice described in Exhibit A. If it is not possible
|
|
||||||
to put such notice in a particular Source Code file due to its
|
|
||||||
structure, then you must include such notice in a location (such as a
|
|
||||||
relevant directory file) where a user would be likely to look for such
|
|
||||||
a notice. You may choose to offer, and to charge a fee for, warranty,
|
|
||||||
support, indemnity or liability obligations to one or more recipients
|
|
||||||
of Covered Code. However, You may do so only on Your own behalf, and
|
|
||||||
not on behalf of the Initial Developer or any Contributor. You must
|
|
||||||
make it absolutely clear than any such warranty, support, indemnity or
|
|
||||||
liability obligation is offered by You alone, and You hereby agree to
|
|
||||||
indemnify the Initial Developer and every Contributor for any liability
|
|
||||||
incurred by the Initial Developer or such Contributor as a result of
|
|
||||||
warranty, support, indemnity or liability terms You offer.
|
|
||||||
|
|
||||||
3.6. Distribution of Executable Versions.
|
|
||||||
You may distribute Covered Code in Executable form only if the
|
|
||||||
requirements of Section 3.1-3.5 have been met for that Covered Code,
|
|
||||||
and if You include a notice stating that the Source Code version of the
|
|
||||||
Covered Code is available under the terms of this License, including a
|
|
||||||
description of how and where You have fulfilled the obligations of
|
|
||||||
Section 3.2. The notice must be conspicuously included in any notice in
|
|
||||||
an Executable version, related documentation or collateral in which You
|
|
||||||
describe recipients' rights relating to the Covered Code. You may
|
|
||||||
distribute the Executable version of Covered Code under a license of
|
|
||||||
Your choice, which may contain terms different from this License,
|
|
||||||
provided that You are in compliance with the terms of this License and
|
|
||||||
that the license for the Executable version does not attempt to limit
|
|
||||||
or alter the recipient's rights in the Source Code version from the
|
|
||||||
rights set forth in this License. If You distribute the Executable
|
|
||||||
version under a different license You must make it absolutely clear
|
|
||||||
that any terms which differ from this License are offered by You alone,
|
|
||||||
not by the Initial Developer or any Contributor. You hereby agree to
|
|
||||||
indemnify the Initial Developer and every Contributor for any liability
|
|
||||||
incurred by the Initial Developer or such Contributor as a result of
|
|
||||||
any such terms You offer.
|
|
||||||
|
|
||||||
3.7. Larger Works.
|
|
||||||
You may create a Larger Work by combining Covered Code with other code
|
|
||||||
not governed by the terms of this License and distribute the Larger
|
|
||||||
Work as a single product. In such a case, You must make sure the
|
|
||||||
requirements of this License are fulfilled for the Covered Code.
|
|
||||||
|
|
||||||
4. Inability to Comply Due to Statute or Regulation.
|
|
||||||
|
|
||||||
If it is impossible for You to comply with any of the terms of this
|
|
||||||
License with respect to some or all of the Covered Code due to statute
|
|
||||||
or regulation then You must: (a) comply with the terms of this License
|
|
||||||
to the maximum extent possible; and (b) describe the limitations and
|
|
||||||
the code they affect. Such description must be included in the LEGAL
|
|
||||||
file described in Section 3.4 and must be included with all
|
|
||||||
distributions of the Source Code. Except to the extent prohibited by
|
|
||||||
statute or regulation, such description must be sufficiently detailed
|
|
||||||
for a recipient of ordinary skill to be able to understand it.
|
|
||||||
|
|
||||||
5. Application of this License.
|
|
||||||
|
|
||||||
This License applies to code to which the Initial Developer has
|
|
||||||
attached the notice in Exhibit A, and to related Covered Code.
|
|
||||||
|
|
||||||
6. Versions of the License.
|
|
||||||
|
|
||||||
6.1. New Versions.
|
|
||||||
Netscape Communications Corporation (``Netscape'') may publish revised
|
|
||||||
and/or new versions of the License from time to time. Each version will
|
|
||||||
be given a distinguishing version number.
|
|
||||||
|
|
||||||
6.2. Effect of New Versions.
|
|
||||||
Once Covered Code has been published under a particular version of the
|
|
||||||
License, You may always continue to use it under the terms of that
|
|
||||||
version. You may also choose to use such Covered Code under the terms
|
|
||||||
of any subsequent version of the License published by Netscape. No one
|
|
||||||
other than Netscape has the right to modify the terms applicable to
|
|
||||||
Covered Code created under this License.
|
|
||||||
|
|
||||||
6.3. Derivative Works.
|
|
||||||
If you create or use a modified version of this License (which you may
|
|
||||||
only do in order to apply it to code which is not already Covered Code
|
|
||||||
governed by this License), you must (a) rename Your license so that the
|
|
||||||
phrases ``Mozilla'', ``MOZILLAPL'', ``MOZPL'', ``Netscape'', ``NPL'' or
|
|
||||||
any confusingly similar phrase do not appear anywhere in your license
|
|
||||||
and (b) otherwise make it clear that your version of the license
|
|
||||||
contains terms which differ from the Mozilla Public License and
|
|
||||||
Netscape Public License. (Filling in the name of the Initial Developer,
|
|
||||||
Original Code or Contributor in the notice described in Exhibit A shall
|
|
||||||
not of themselves be deemed to be modifications of this License.)
|
|
||||||
|
|
||||||
7. DISCLAIMER OF WARRANTY.
|
|
||||||
|
|
||||||
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS'' BASIS,
|
|
||||||
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
||||||
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
|
|
||||||
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
|
|
||||||
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
|
|
||||||
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
|
|
||||||
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
|
|
||||||
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
|
|
||||||
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
|
|
||||||
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
|
||||||
|
|
||||||
8. TERMINATION.
|
|
||||||
|
|
||||||
This License and the rights granted hereunder will terminate
|
|
||||||
automatically if You fail to comply with terms herein and fail to cure
|
|
||||||
such breach within 30 days of becoming aware of the breach. All
|
|
||||||
sublicenses to the Covered Code which are properly granted shall
|
|
||||||
survive any termination of this License. Provisions which, by their
|
|
||||||
nature, must remain in effect beyond the termination of this License
|
|
||||||
shall survive.
|
|
||||||
|
|
||||||
9. LIMITATION OF LIABILITY.
|
|
||||||
|
|
||||||
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
|
|
||||||
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL
|
|
||||||
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
|
|
||||||
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER
|
|
||||||
PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
|
||||||
OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF
|
|
||||||
GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND
|
|
||||||
ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE
|
|
||||||
BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
|
|
||||||
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
|
|
||||||
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
|
|
||||||
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
|
|
||||||
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT
|
|
||||||
EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
|
||||||
|
|
||||||
10. U.S. GOVERNMENT END USERS.
|
|
||||||
|
|
||||||
The Covered Code is a ``commercial item,'' as that term is defined in
|
|
||||||
48 C.F.R. 2.101 (Oct. 1995), consisting of ``commercial computer
|
|
||||||
software'' and ``commercial computer software documentation,'' as such
|
|
||||||
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
|
|
||||||
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
|
|
||||||
all U.S. Government End Users acquire Covered Code with only those
|
|
||||||
rights set forth herein.
|
|
||||||
|
|
||||||
11. MISCELLANEOUS.
|
|
||||||
|
|
||||||
This License represents the complete agreement concerning subject
|
|
||||||
matter hereof. If any provision of this License is held to be
|
|
||||||
unenforceable, such provision shall be reformed only to the extent
|
|
||||||
necessary to make it enforceable. This License shall be governed by
|
|
||||||
California law provisions (except to the extent applicable law, if any,
|
|
||||||
provides otherwise), excluding its conflict-of-law provisions. With
|
|
||||||
respect to disputes in which at least one party is a citizen of, or an
|
|
||||||
entity chartered or registered to do business in, the United States of
|
|
||||||
America: (a) unless otherwise agreed in writing, all disputes relating
|
|
||||||
to this License (excepting any dispute relating to intellectual
|
|
||||||
property rights) shall be subject to final and binding arbitration,
|
|
||||||
with the losing party paying all costs of arbitration; (b) any
|
|
||||||
arbitration relating to this Agreement shall be held in Santa Clara
|
|
||||||
County, California, under the auspices of JAMS/EndDispute; and (c) any
|
|
||||||
litigation relating to this Agreement shall be subject to the
|
|
||||||
jurisdiction of the Federal Courts of the Northern District of
|
|
||||||
California, with venue lying in Santa Clara County, California, with
|
|
||||||
the losing party responsible for costs, including without limitation,
|
|
||||||
court costs and reasonable attorneys fees and expenses. The application
|
|
||||||
of the United Nations Convention on Contracts for the International
|
|
||||||
Sale of Goods is expressly excluded. Any law or regulation which
|
|
||||||
provides that the language of a contract shall be construed against the
|
|
||||||
drafter shall not apply to this License.
|
|
||||||
|
|
||||||
12. RESPONSIBILITY FOR CLAIMS.
|
|
||||||
|
|
||||||
Except in cases where another Contributor has failed to comply with
|
|
||||||
Section 3.4, You are responsible for damages arising, directly or
|
|
||||||
indirectly, out of Your utilization of rights under this License, based
|
|
||||||
on the number of copies of Covered Code you made available, the
|
|
||||||
revenues you received from utilizing such rights, and other relevant
|
|
||||||
factors. You agree to work with affected parties to distribute
|
|
||||||
responsibility on an equitable basis.
|
|
||||||
|
|
||||||
EXHIBIT A.
|
|
||||||
|
|
||||||
``The contents of this file are subject to the Mozilla Public License
|
|
||||||
Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
compliance with the License. You may obtain a copy of the License at
|
|
||||||
http://www.mozilla.org/MPL/
|
|
||||||
|
|
||||||
Software distributed under the License is distributed on an "AS IS"
|
|
||||||
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
License for the specific language governing rights and limitations
|
|
||||||
under the License.
|
|
||||||
|
|
||||||
The Original Code is ______________________________________.
|
|
||||||
|
|
||||||
The Initial Developer of the Original Code is ________________________.
|
|
||||||
Portions created by ______________________ are Copyright (C) ______
|
|
||||||
_______________________. All Rights Reserved.
|
|
||||||
|
|
||||||
Contributor(s): ______________________________________.''
|
|
470
MPL-1.1.txt
Normal file
470
MPL-1.1.txt
Normal file
@@ -0,0 +1,470 @@
|
|||||||
|
MOZILLA PUBLIC LICENSE
|
||||||
|
Version 1.1
|
||||||
|
|
||||||
|
---------------
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
1.0.1. "Commercial Use" means distribution or otherwise making the
|
||||||
|
Covered Code available to a third party.
|
||||||
|
|
||||||
|
1.1. "Contributor" means each entity that creates or contributes to
|
||||||
|
the creation of Modifications.
|
||||||
|
|
||||||
|
1.2. "Contributor Version" means the combination of the Original
|
||||||
|
Code, prior Modifications used by a Contributor, and the Modifications
|
||||||
|
made by that particular Contributor.
|
||||||
|
|
||||||
|
1.3. "Covered Code" means the Original Code or Modifications or the
|
||||||
|
combination of the Original Code and Modifications, in each case
|
||||||
|
including portions thereof.
|
||||||
|
|
||||||
|
1.4. "Electronic Distribution Mechanism" means a mechanism generally
|
||||||
|
accepted in the software development community for the electronic
|
||||||
|
transfer of data.
|
||||||
|
|
||||||
|
1.5. "Executable" means Covered Code in any form other than Source
|
||||||
|
Code.
|
||||||
|
|
||||||
|
1.6. "Initial Developer" means the individual or entity identified
|
||||||
|
as the Initial Developer in the Source Code notice required by Exhibit
|
||||||
|
A.
|
||||||
|
|
||||||
|
1.7. "Larger Work" means a work which combines Covered Code or
|
||||||
|
portions thereof with code not governed by the terms of this License.
|
||||||
|
|
||||||
|
1.8. "License" means this document.
|
||||||
|
|
||||||
|
1.8.1. "Licensable" means having the right to grant, to the maximum
|
||||||
|
extent possible, whether at the time of the initial grant or
|
||||||
|
subsequently acquired, any and all of the rights conveyed herein.
|
||||||
|
|
||||||
|
1.9. "Modifications" means any addition to or deletion from the
|
||||||
|
substance or structure of either the Original Code or any previous
|
||||||
|
Modifications. When Covered Code is released as a series of files, a
|
||||||
|
Modification is:
|
||||||
|
A. Any addition to or deletion from the contents of a file
|
||||||
|
containing Original Code or previous Modifications.
|
||||||
|
|
||||||
|
B. Any new file that contains any part of the Original Code or
|
||||||
|
previous Modifications.
|
||||||
|
|
||||||
|
1.10. "Original Code" means Source Code of computer software code
|
||||||
|
which is described in the Source Code notice required by Exhibit A as
|
||||||
|
Original Code, and which, at the time of its release under this
|
||||||
|
License is not already Covered Code governed by this License.
|
||||||
|
|
||||||
|
1.10.1. "Patent Claims" means any patent claim(s), now owned or
|
||||||
|
hereafter acquired, including without limitation, method, process,
|
||||||
|
and apparatus claims, in any patent Licensable by grantor.
|
||||||
|
|
||||||
|
1.11. "Source Code" means the preferred form of the Covered Code for
|
||||||
|
making modifications to it, including all modules it contains, plus
|
||||||
|
any associated interface definition files, scripts used to control
|
||||||
|
compilation and installation of an Executable, or source code
|
||||||
|
differential comparisons against either the Original Code or another
|
||||||
|
well known, available Covered Code of the Contributor's choice. The
|
||||||
|
Source Code can be in a compressed or archival form, provided the
|
||||||
|
appropriate decompression or de-archiving software is widely available
|
||||||
|
for no charge.
|
||||||
|
|
||||||
|
1.12. "You" (or "Your") means an individual or a legal entity
|
||||||
|
exercising rights under, and complying with all of the terms of, this
|
||||||
|
License or a future version of this License issued under Section 6.1.
|
||||||
|
For legal entities, "You" includes any entity which controls, is
|
||||||
|
controlled by, or is under common control with You. For purposes of
|
||||||
|
this definition, "control" means (a) the power, direct or indirect,
|
||||||
|
to cause the direction or management of such entity, whether by
|
||||||
|
contract or otherwise, or (b) ownership of more than fifty percent
|
||||||
|
(50%) of the outstanding shares or beneficial ownership of such
|
||||||
|
entity.
|
||||||
|
|
||||||
|
2. Source Code License.
|
||||||
|
|
||||||
|
2.1. The Initial Developer Grant.
|
||||||
|
The Initial Developer hereby grants You a world-wide, royalty-free,
|
||||||
|
non-exclusive license, subject to third party intellectual property
|
||||||
|
claims:
|
||||||
|
(a) under intellectual property rights (other than patent or
|
||||||
|
trademark) Licensable by Initial Developer to use, reproduce,
|
||||||
|
modify, display, perform, sublicense and distribute the Original
|
||||||
|
Code (or portions thereof) with or without Modifications, and/or
|
||||||
|
as part of a Larger Work; and
|
||||||
|
|
||||||
|
(b) under Patents Claims infringed by the making, using or
|
||||||
|
selling of Original Code, to make, have made, use, practice,
|
||||||
|
sell, and offer for sale, and/or otherwise dispose of the
|
||||||
|
Original Code (or portions thereof).
|
||||||
|
|
||||||
|
(c) the licenses granted in this Section 2.1(a) and (b) are
|
||||||
|
effective on the date Initial Developer first distributes
|
||||||
|
Original Code under the terms of this License.
|
||||||
|
|
||||||
|
(d) Notwithstanding Section 2.1(b) above, no patent license is
|
||||||
|
granted: 1) for code that You delete from the Original Code; 2)
|
||||||
|
separate from the Original Code; or 3) for infringements caused
|
||||||
|
by: i) the modification of the Original Code or ii) the
|
||||||
|
combination of the Original Code with other software or devices.
|
||||||
|
|
||||||
|
2.2. Contributor Grant.
|
||||||
|
Subject to third party intellectual property claims, each Contributor
|
||||||
|
hereby grants You a world-wide, royalty-free, non-exclusive license
|
||||||
|
|
||||||
|
(a) under intellectual property rights (other than patent or
|
||||||
|
trademark) Licensable by Contributor, to use, reproduce, modify,
|
||||||
|
display, perform, sublicense and distribute the Modifications
|
||||||
|
created by such Contributor (or portions thereof) either on an
|
||||||
|
unmodified basis, with other Modifications, as Covered Code
|
||||||
|
and/or as part of a Larger Work; and
|
||||||
|
|
||||||
|
(b) under Patent Claims infringed by the making, using, or
|
||||||
|
selling of Modifications made by that Contributor either alone
|
||||||
|
and/or in combination with its Contributor Version (or portions
|
||||||
|
of such combination), to make, use, sell, offer for sale, have
|
||||||
|
made, and/or otherwise dispose of: 1) Modifications made by that
|
||||||
|
Contributor (or portions thereof); and 2) the combination of
|
||||||
|
Modifications made by that Contributor with its Contributor
|
||||||
|
Version (or portions of such combination).
|
||||||
|
|
||||||
|
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
|
||||||
|
effective on the date Contributor first makes Commercial Use of
|
||||||
|
the Covered Code.
|
||||||
|
|
||||||
|
(d) Notwithstanding Section 2.2(b) above, no patent license is
|
||||||
|
granted: 1) for any code that Contributor has deleted from the
|
||||||
|
Contributor Version; 2) separate from the Contributor Version;
|
||||||
|
3) for infringements caused by: i) third party modifications of
|
||||||
|
Contributor Version or ii) the combination of Modifications made
|
||||||
|
by that Contributor with other software (except as part of the
|
||||||
|
Contributor Version) or other devices; or 4) under Patent Claims
|
||||||
|
infringed by Covered Code in the absence of Modifications made by
|
||||||
|
that Contributor.
|
||||||
|
|
||||||
|
3. Distribution Obligations.
|
||||||
|
|
||||||
|
3.1. Application of License.
|
||||||
|
The Modifications which You create or to which You contribute are
|
||||||
|
governed by the terms of this License, including without limitation
|
||||||
|
Section 2.2. The Source Code version of Covered Code may be
|
||||||
|
distributed only under the terms of this License or a future version
|
||||||
|
of this License released under Section 6.1, and You must include a
|
||||||
|
copy of this License with every copy of the Source Code You
|
||||||
|
distribute. You may not offer or impose any terms on any Source Code
|
||||||
|
version that alters or restricts the applicable version of this
|
||||||
|
License or the recipients' rights hereunder. However, You may include
|
||||||
|
an additional document offering the additional rights described in
|
||||||
|
Section 3.5.
|
||||||
|
|
||||||
|
3.2. Availability of Source Code.
|
||||||
|
Any Modification which You create or to which You contribute must be
|
||||||
|
made available in Source Code form under the terms of this License
|
||||||
|
either on the same media as an Executable version or via an accepted
|
||||||
|
Electronic Distribution Mechanism to anyone to whom you made an
|
||||||
|
Executable version available; and if made available via Electronic
|
||||||
|
Distribution Mechanism, must remain available for at least twelve (12)
|
||||||
|
months after the date it initially became available, or at least six
|
||||||
|
(6) months after a subsequent version of that particular Modification
|
||||||
|
has been made available to such recipients. You are responsible for
|
||||||
|
ensuring that the Source Code version remains available even if the
|
||||||
|
Electronic Distribution Mechanism is maintained by a third party.
|
||||||
|
|
||||||
|
3.3. Description of Modifications.
|
||||||
|
You must cause all Covered Code to which You contribute to contain a
|
||||||
|
file documenting the changes You made to create that Covered Code and
|
||||||
|
the date of any change. You must include a prominent statement that
|
||||||
|
the Modification is derived, directly or indirectly, from Original
|
||||||
|
Code provided by the Initial Developer and including the name of the
|
||||||
|
Initial Developer in (a) the Source Code, and (b) in any notice in an
|
||||||
|
Executable version or related documentation in which You describe the
|
||||||
|
origin or ownership of the Covered Code.
|
||||||
|
|
||||||
|
3.4. Intellectual Property Matters
|
||||||
|
(a) Third Party Claims.
|
||||||
|
If Contributor has knowledge that a license under a third party's
|
||||||
|
intellectual property rights is required to exercise the rights
|
||||||
|
granted by such Contributor under Sections 2.1 or 2.2,
|
||||||
|
Contributor must include a text file with the Source Code
|
||||||
|
distribution titled "LEGAL" which describes the claim and the
|
||||||
|
party making the claim in sufficient detail that a recipient will
|
||||||
|
know whom to contact. If Contributor obtains such knowledge after
|
||||||
|
the Modification is made available as described in Section 3.2,
|
||||||
|
Contributor shall promptly modify the LEGAL file in all copies
|
||||||
|
Contributor makes available thereafter and shall take other steps
|
||||||
|
(such as notifying appropriate mailing lists or newsgroups)
|
||||||
|
reasonably calculated to inform those who received the Covered
|
||||||
|
Code that new knowledge has been obtained.
|
||||||
|
|
||||||
|
(b) Contributor APIs.
|
||||||
|
If Contributor's Modifications include an application programming
|
||||||
|
interface and Contributor has knowledge of patent licenses which
|
||||||
|
are reasonably necessary to implement that API, Contributor must
|
||||||
|
also include this information in the LEGAL file.
|
||||||
|
|
||||||
|
(c) Representations.
|
||||||
|
Contributor represents that, except as disclosed pursuant to
|
||||||
|
Section 3.4(a) above, Contributor believes that Contributor's
|
||||||
|
Modifications are Contributor's original creation(s) and/or
|
||||||
|
Contributor has sufficient rights to grant the rights conveyed by
|
||||||
|
this License.
|
||||||
|
|
||||||
|
3.5. Required Notices.
|
||||||
|
You must duplicate the notice in Exhibit A in each file of the Source
|
||||||
|
Code. If it is not possible to put such notice in a particular Source
|
||||||
|
Code file due to its structure, then You must include such notice in a
|
||||||
|
location (such as a relevant directory) where a user would be likely
|
||||||
|
to look for such a notice. If You created one or more Modification(s)
|
||||||
|
You may add your name as a Contributor to the notice described in
|
||||||
|
Exhibit A. You must also duplicate this License in any documentation
|
||||||
|
for the Source Code where You describe recipients' rights or ownership
|
||||||
|
rights relating to Covered Code. You may choose to offer, and to
|
||||||
|
charge a fee for, warranty, support, indemnity or liability
|
||||||
|
obligations to one or more recipients of Covered Code. However, You
|
||||||
|
may do so only on Your own behalf, and not on behalf of the Initial
|
||||||
|
Developer or any Contributor. You must make it absolutely clear than
|
||||||
|
any such warranty, support, indemnity or liability obligation is
|
||||||
|
offered by You alone, and You hereby agree to indemnify the Initial
|
||||||
|
Developer and every Contributor for any liability incurred by the
|
||||||
|
Initial Developer or such Contributor as a result of warranty,
|
||||||
|
support, indemnity or liability terms You offer.
|
||||||
|
|
||||||
|
3.6. Distribution of Executable Versions.
|
||||||
|
You may distribute Covered Code in Executable form only if the
|
||||||
|
requirements of Section 3.1-3.5 have been met for that Covered Code,
|
||||||
|
and if You include a notice stating that the Source Code version of
|
||||||
|
the Covered Code is available under the terms of this License,
|
||||||
|
including a description of how and where You have fulfilled the
|
||||||
|
obligations of Section 3.2. The notice must be conspicuously included
|
||||||
|
in any notice in an Executable version, related documentation or
|
||||||
|
collateral in which You describe recipients' rights relating to the
|
||||||
|
Covered Code. You may distribute the Executable version of Covered
|
||||||
|
Code or ownership rights under a license of Your choice, which may
|
||||||
|
contain terms different from this License, provided that You are in
|
||||||
|
compliance with the terms of this License and that the license for the
|
||||||
|
Executable version does not attempt to limit or alter the recipient's
|
||||||
|
rights in the Source Code version from the rights set forth in this
|
||||||
|
License. If You distribute the Executable version under a different
|
||||||
|
license You must make it absolutely clear that any terms which differ
|
||||||
|
from this License are offered by You alone, not by the Initial
|
||||||
|
Developer or any Contributor. You hereby agree to indemnify the
|
||||||
|
Initial Developer and every Contributor for any liability incurred by
|
||||||
|
the Initial Developer or such Contributor as a result of any such
|
||||||
|
terms You offer.
|
||||||
|
|
||||||
|
3.7. Larger Works.
|
||||||
|
You may create a Larger Work by combining Covered Code with other code
|
||||||
|
not governed by the terms of this License and distribute the Larger
|
||||||
|
Work as a single product. In such a case, You must make sure the
|
||||||
|
requirements of this License are fulfilled for the Covered Code.
|
||||||
|
|
||||||
|
4. Inability to Comply Due to Statute or Regulation.
|
||||||
|
|
||||||
|
If it is impossible for You to comply with any of the terms of this
|
||||||
|
License with respect to some or all of the Covered Code due to
|
||||||
|
statute, judicial order, or regulation then You must: (a) comply with
|
||||||
|
the terms of this License to the maximum extent possible; and (b)
|
||||||
|
describe the limitations and the code they affect. Such description
|
||||||
|
must be included in the LEGAL file described in Section 3.4 and must
|
||||||
|
be included with all distributions of the Source Code. Except to the
|
||||||
|
extent prohibited by statute or regulation, such description must be
|
||||||
|
sufficiently detailed for a recipient of ordinary skill to be able to
|
||||||
|
understand it.
|
||||||
|
|
||||||
|
5. Application of this License.
|
||||||
|
|
||||||
|
This License applies to code to which the Initial Developer has
|
||||||
|
attached the notice in Exhibit A and to related Covered Code.
|
||||||
|
|
||||||
|
6. Versions of the License.
|
||||||
|
|
||||||
|
6.1. New Versions.
|
||||||
|
Netscape Communications Corporation ("Netscape") may publish revised
|
||||||
|
and/or new versions of the License from time to time. Each version
|
||||||
|
will be given a distinguishing version number.
|
||||||
|
|
||||||
|
6.2. Effect of New Versions.
|
||||||
|
Once Covered Code has been published under a particular version of the
|
||||||
|
License, You may always continue to use it under the terms of that
|
||||||
|
version. You may also choose to use such Covered Code under the terms
|
||||||
|
of any subsequent version of the License published by Netscape. No one
|
||||||
|
other than Netscape has the right to modify the terms applicable to
|
||||||
|
Covered Code created under this License.
|
||||||
|
|
||||||
|
6.3. Derivative Works.
|
||||||
|
If You create or use a modified version of this License (which you may
|
||||||
|
only do in order to apply it to code which is not already Covered Code
|
||||||
|
governed by this License), You must (a) rename Your license so that
|
||||||
|
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
|
||||||
|
"MPL", "NPL" or any confusingly similar phrase do not appear in your
|
||||||
|
license (except to note that your license differs from this License)
|
||||||
|
and (b) otherwise make it clear that Your version of the license
|
||||||
|
contains terms which differ from the Mozilla Public License and
|
||||||
|
Netscape Public License. (Filling in the name of the Initial
|
||||||
|
Developer, Original Code or Contributor in the notice described in
|
||||||
|
Exhibit A shall not of themselves be deemed to be modifications of
|
||||||
|
this License.)
|
||||||
|
|
||||||
|
7. DISCLAIMER OF WARRANTY.
|
||||||
|
|
||||||
|
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
||||||
|
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
|
||||||
|
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
|
||||||
|
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
|
||||||
|
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
|
||||||
|
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
|
||||||
|
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
|
||||||
|
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
|
||||||
|
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
|
||||||
|
|
||||||
|
8. TERMINATION.
|
||||||
|
|
||||||
|
8.1. This License and the rights granted hereunder will terminate
|
||||||
|
automatically if You fail to comply with terms herein and fail to cure
|
||||||
|
such breach within 30 days of becoming aware of the breach. All
|
||||||
|
sublicenses to the Covered Code which are properly granted shall
|
||||||
|
survive any termination of this License. Provisions which, by their
|
||||||
|
nature, must remain in effect beyond the termination of this License
|
||||||
|
shall survive.
|
||||||
|
|
||||||
|
8.2. If You initiate litigation by asserting a patent infringement
|
||||||
|
claim (excluding declatory judgment actions) against Initial Developer
|
||||||
|
or a Contributor (the Initial Developer or Contributor against whom
|
||||||
|
You file such action is referred to as "Participant") alleging that:
|
||||||
|
|
||||||
|
(a) such Participant's Contributor Version directly or indirectly
|
||||||
|
infringes any patent, then any and all rights granted by such
|
||||||
|
Participant to You under Sections 2.1 and/or 2.2 of this License
|
||||||
|
shall, upon 60 days notice from Participant terminate prospectively,
|
||||||
|
unless if within 60 days after receipt of notice You either: (i)
|
||||||
|
agree in writing to pay Participant a mutually agreeable reasonable
|
||||||
|
royalty for Your past and future use of Modifications made by such
|
||||||
|
Participant, or (ii) withdraw Your litigation claim with respect to
|
||||||
|
the Contributor Version against such Participant. If within 60 days
|
||||||
|
of notice, a reasonable royalty and payment arrangement are not
|
||||||
|
mutually agreed upon in writing by the parties or the litigation claim
|
||||||
|
is not withdrawn, the rights granted by Participant to You under
|
||||||
|
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
|
||||||
|
the 60 day notice period specified above.
|
||||||
|
|
||||||
|
(b) any software, hardware, or device, other than such Participant's
|
||||||
|
Contributor Version, directly or indirectly infringes any patent, then
|
||||||
|
any rights granted to You by such Participant under Sections 2.1(b)
|
||||||
|
and 2.2(b) are revoked effective as of the date You first made, used,
|
||||||
|
sold, distributed, or had made, Modifications made by that
|
||||||
|
Participant.
|
||||||
|
|
||||||
|
8.3. If You assert a patent infringement claim against Participant
|
||||||
|
alleging that such Participant's Contributor Version directly or
|
||||||
|
indirectly infringes any patent where such claim is resolved (such as
|
||||||
|
by license or settlement) prior to the initiation of patent
|
||||||
|
infringement litigation, then the reasonable value of the licenses
|
||||||
|
granted by such Participant under Sections 2.1 or 2.2 shall be taken
|
||||||
|
into account in determining the amount or value of any payment or
|
||||||
|
license.
|
||||||
|
|
||||||
|
8.4. In the event of termination under Sections 8.1 or 8.2 above,
|
||||||
|
all end user license agreements (excluding distributors and resellers)
|
||||||
|
which have been validly granted by You or any distributor hereunder
|
||||||
|
prior to termination shall survive termination.
|
||||||
|
|
||||||
|
9. LIMITATION OF LIABILITY.
|
||||||
|
|
||||||
|
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
|
||||||
|
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
|
||||||
|
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
|
||||||
|
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
|
||||||
|
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
|
||||||
|
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
|
||||||
|
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
|
||||||
|
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
|
||||||
|
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
|
||||||
|
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
|
||||||
|
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
|
||||||
|
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
|
||||||
|
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
|
||||||
|
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
|
10. U.S. GOVERNMENT END USERS.
|
||||||
|
|
||||||
|
The Covered Code is a "commercial item," as that term is defined in
|
||||||
|
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
|
||||||
|
software" and "commercial computer software documentation," as such
|
||||||
|
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
|
||||||
|
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
|
||||||
|
all U.S. Government End Users acquire Covered Code with only those
|
||||||
|
rights set forth herein.
|
||||||
|
|
||||||
|
11. MISCELLANEOUS.
|
||||||
|
|
||||||
|
This License represents the complete agreement concerning subject
|
||||||
|
matter hereof. If any provision of this License is held to be
|
||||||
|
unenforceable, such provision shall be reformed only to the extent
|
||||||
|
necessary to make it enforceable. This License shall be governed by
|
||||||
|
California law provisions (except to the extent applicable law, if
|
||||||
|
any, provides otherwise), excluding its conflict-of-law provisions.
|
||||||
|
With respect to disputes in which at least one party is a citizen of,
|
||||||
|
or an entity chartered or registered to do business in the United
|
||||||
|
States of America, any litigation relating to this License shall be
|
||||||
|
subject to the jurisdiction of the Federal Courts of the Northern
|
||||||
|
District of California, with venue lying in Santa Clara County,
|
||||||
|
California, with the losing party responsible for costs, including
|
||||||
|
without limitation, court costs and reasonable attorneys' fees and
|
||||||
|
expenses. The application of the United Nations Convention on
|
||||||
|
Contracts for the International Sale of Goods is expressly excluded.
|
||||||
|
Any law or regulation which provides that the language of a contract
|
||||||
|
shall be construed against the drafter shall not apply to this
|
||||||
|
License.
|
||||||
|
|
||||||
|
12. RESPONSIBILITY FOR CLAIMS.
|
||||||
|
|
||||||
|
As between Initial Developer and the Contributors, each party is
|
||||||
|
responsible for claims and damages arising, directly or indirectly,
|
||||||
|
out of its utilization of rights under this License and You agree to
|
||||||
|
work with Initial Developer and Contributors to distribute such
|
||||||
|
responsibility on an equitable basis. Nothing herein is intended or
|
||||||
|
shall be deemed to constitute any admission of liability.
|
||||||
|
|
||||||
|
13. MULTIPLE-LICENSED CODE.
|
||||||
|
|
||||||
|
Initial Developer may designate portions of the Covered Code as
|
||||||
|
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
|
||||||
|
Developer permits you to utilize portions of the Covered Code under
|
||||||
|
Your choice of the NPL or the alternative licenses, if any, specified
|
||||||
|
by the Initial Developer in the file described in Exhibit A.
|
||||||
|
|
||||||
|
EXHIBIT A -Mozilla Public License.
|
||||||
|
|
||||||
|
``The contents of this file are subject to the Mozilla Public License
|
||||||
|
Version 1.1 (the "License"); you may not use this file except in
|
||||||
|
compliance with the License. You may obtain a copy of the License at
|
||||||
|
http://www.mozilla.org/MPL/
|
||||||
|
|
||||||
|
Software distributed under the License is distributed on an "AS IS"
|
||||||
|
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||||
|
License for the specific language governing rights and limitations
|
||||||
|
under the License.
|
||||||
|
|
||||||
|
The Original Code is ______________________________________.
|
||||||
|
|
||||||
|
The Initial Developer of the Original Code is ________________________.
|
||||||
|
Portions created by ______________________ are Copyright (C) ______
|
||||||
|
_______________________. All Rights Reserved.
|
||||||
|
|
||||||
|
Contributor(s): ______________________________________.
|
||||||
|
|
||||||
|
Alternatively, the contents of this file may be used under the terms
|
||||||
|
of the _____ license (the "[___] License"), in which case the
|
||||||
|
provisions of [______] License are applicable instead of those
|
||||||
|
above. If you wish to allow use of your version of this file only
|
||||||
|
under the terms of the [____] License and not to allow others to use
|
||||||
|
your version of this file under the MPL, indicate your decision by
|
||||||
|
deleting the provisions above and replace them with the notice and
|
||||||
|
other provisions required by the [___] License. If you do not delete
|
||||||
|
the provisions above, a recipient may use your version of this file
|
||||||
|
under either the MPL or the [___] License."
|
||||||
|
|
||||||
|
[NOTE: The text of this Exhibit A may differ slightly from the text of
|
||||||
|
the notices in the Source Code files of the Original Code. You should
|
||||||
|
use the text of this Exhibit A rather than the text found in the
|
||||||
|
Original Code Source Code for Your Modifications.]
|
||||||
|
|
39
Makefile.am
39
Makefile.am
@@ -4,9 +4,44 @@
|
|||||||
|
|
||||||
AUTOMAKE_OPTIONS = foreign no-dependencies
|
AUTOMAKE_OPTIONS = foreign no-dependencies
|
||||||
|
|
||||||
EXTRA_DIST = curl.spec curl-ssl.spec
|
EXTRA_DIST = \
|
||||||
|
CHANGES LEGAL maketgz MITX.txt MPL-1.1.txt \
|
||||||
|
config-win32.h reconf packages/README Makefile.dist
|
||||||
|
|
||||||
SUBDIRS = docs lib src include tests
|
SUBDIRS = docs lib src include tests packages
|
||||||
|
|
||||||
|
# create a root makefile in the distribution:
|
||||||
|
dist-hook:
|
||||||
|
cp $(srcdir)/Makefile.dist $(distdir)/Makefile
|
||||||
|
|
||||||
|
check: test
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@(cd tests; make quiet-test)
|
@(cd tests; make quiet-test)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
|
||||||
|
# must contain the following line:
|
||||||
|
# %_topdir /home/loic/local/rpm
|
||||||
|
# and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc.
|
||||||
|
#
|
||||||
|
# cd /home/loic/local/rpm ; mkdir -p SOURCES BUILD RPMS/i386 SPECS SRPMS
|
||||||
|
#
|
||||||
|
# If additional configure flags are needed to build the package, add the
|
||||||
|
# following in ~/.rpmmacros
|
||||||
|
# %configure CFLAGS="%{optflags}" ./configure %{_target_platform} --prefix=%{_prefix} ${AM_CONFIGFLAGS}
|
||||||
|
# and run make rpm in the following way:
|
||||||
|
# AM_CONFIGFLAGS='--with-uri=/home/users/loic/local/RedHat-6.2' make rpm
|
||||||
|
#
|
||||||
|
|
||||||
|
rpms:
|
||||||
|
$(MAKE) RPMDIST=curl rpm
|
||||||
|
$(MAKE) RPMDIST=curl-ssl rpm
|
||||||
|
|
||||||
|
rpm:
|
||||||
|
RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \
|
||||||
|
cp $(srcdir)/packages/Linux/RPM/$(RPMDIST).spec $$RPM_TOPDIR/SPECS ; \
|
||||||
|
cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \
|
||||||
|
rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(RPMDIST).spec ; \
|
||||||
|
mv $$RPM_TOPDIR/RPMS/i386/$(RPMDIST)-*.rpm . ; \
|
||||||
|
mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
|
||||||
|
@@ -1,45 +1,25 @@
|
|||||||
############################################################################
|
#############################################################################
|
||||||
# _ _ ____ _
|
# _ _ ____ _
|
||||||
# Project ___| | | | _ \| |
|
# Project ___| | | | _ \| |
|
||||||
# / __| | | | |_) | |
|
# / __| | | | |_) | |
|
||||||
# | (__| |_| | _ <| |___
|
# | (__| |_| | _ <| |___
|
||||||
# \___|\___/|_| \_\_____|
|
# \___|\___/|_| \_\_____|
|
||||||
#
|
#
|
||||||
# The contents of this file are subject to the Mozilla Public License
|
# Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
# Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
# compliance with the License. You may obtain a copy of the License at
|
|
||||||
# http://www.mozilla.org/MPL/
|
|
||||||
#
|
#
|
||||||
# Software distributed under the License is distributed on an "AS IS"
|
# In order to be useful for every potential user, curl and libcurl are
|
||||||
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
# dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
# License for the specific language governing rights and limitations
|
|
||||||
# under the License.
|
|
||||||
#
|
#
|
||||||
# The Original Code is Curl.
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
# copies of the Software, and permit persons to whom the Software is
|
||||||
|
# furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
# licenses. You may pick one of these licenses.
|
||||||
#
|
#
|
||||||
# The Initial Developer of the Original Code is Daniel Stenberg.
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
#
|
#
|
||||||
# Portions created by the Initial Developer are Copyright (C) 1999.
|
# $Id$
|
||||||
# All Rights Reserved.
|
#############################################################################
|
||||||
#
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
# Main author:
|
|
||||||
# - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
#
|
|
||||||
# http://curl.haxx.se
|
|
||||||
#
|
|
||||||
# $Source$
|
|
||||||
# $Revision$
|
|
||||||
# $Date$
|
|
||||||
# $Author$
|
|
||||||
# $State$
|
|
||||||
# $Locker$
|
|
||||||
#
|
|
||||||
# ------------------------------------------------------------
|
|
||||||
#
|
|
||||||
# In a normal unix-setup, this file will become overwritten.
|
|
||||||
#
|
|
||||||
############################################################################
|
|
||||||
|
|
||||||
all:
|
all:
|
||||||
./configure
|
./configure
|
||||||
|
4
README
4
README
@@ -12,11 +12,13 @@ README
|
|||||||
document.
|
document.
|
||||||
|
|
||||||
libcurl is a library that Curl is using to do its job. It is readily
|
libcurl is a library that Curl is using to do its job. It is readily
|
||||||
available to be used by your software. Read the README.libcurl document to
|
available to be used by your software. Read the LIBCURL document to
|
||||||
find out how!
|
find out how!
|
||||||
|
|
||||||
You find answers to the most frequent questions we get in the FAQ document.
|
You find answers to the most frequent questions we get in the FAQ document.
|
||||||
|
|
||||||
|
Study the LEGAL file for distribution terms and similar.
|
||||||
|
|
||||||
Always try the Curl web site for the latest news:
|
Always try the Curl web site for the latest news:
|
||||||
|
|
||||||
http://curl.haxx.se
|
http://curl.haxx.se
|
||||||
|
616
aclocal.m4
vendored
616
aclocal.m4
vendored
@@ -1,616 +0,0 @@
|
|||||||
dnl aclocal.m4 generated automatically by aclocal 1.4
|
|
||||||
|
|
||||||
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
|
||||||
dnl This file is free software; the Free Software Foundation
|
|
||||||
dnl gives unlimited permission to copy and/or distribute it,
|
|
||||||
dnl with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
dnl This program is distributed in the hope that it will be useful,
|
|
||||||
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,
|
|
||||||
[AC_PREREQ([2.12])
|
|
||||||
AC_CONFIG_HEADER([$1])
|
|
||||||
dnl When config.status generates a header, we must update the stamp-h file.
|
|
||||||
dnl This file resides in the same directory as the config header
|
|
||||||
dnl that is generated. We must strip everything past the first ":",
|
|
||||||
dnl and everything past the last "/".
|
|
||||||
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
|
||||||
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
|
||||||
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
|
||||||
<<am_indx=1
|
|
||||||
for am_file in <<$1>>; do
|
|
||||||
case " <<$>>CONFIG_HEADERS " in
|
|
||||||
*" <<$>>am_file "*<<)>>
|
|
||||||
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
am_indx=`expr "<<$>>am_indx" + 1`
|
|
||||||
done<<>>dnl>>)
|
|
||||||
changequote([,]))])
|
|
||||||
|
|
||||||
# Do all the work for Automake. This macro actually does too much --
|
|
||||||
# some checks are only needed if your package does certain things.
|
|
||||||
# But this isn't really a big deal.
|
|
||||||
|
|
||||||
# serial 1
|
|
||||||
|
|
||||||
dnl Usage:
|
|
||||||
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
|
||||||
|
|
||||||
AC_DEFUN(AM_INIT_AUTOMAKE,
|
|
||||||
[AC_REQUIRE([AC_PROG_INSTALL])
|
|
||||||
PACKAGE=[$1]
|
|
||||||
AC_SUBST(PACKAGE)
|
|
||||||
VERSION=[$2]
|
|
||||||
AC_SUBST(VERSION)
|
|
||||||
dnl test to see if srcdir already configured
|
|
||||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
|
||||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
|
||||||
fi
|
|
||||||
ifelse([$3],,
|
|
||||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
|
||||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
|
|
||||||
AC_REQUIRE([AM_SANITY_CHECK])
|
|
||||||
AC_REQUIRE([AC_ARG_PROGRAM])
|
|
||||||
dnl FIXME This is truly gross.
|
|
||||||
missing_dir=`cd $ac_aux_dir && pwd`
|
|
||||||
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
|
||||||
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
|
||||||
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
|
||||||
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
|
||||||
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
|
||||||
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
|
||||||
|
|
||||||
#
|
|
||||||
# Check to make sure that the build environment is sane.
|
|
||||||
#
|
|
||||||
|
|
||||||
AC_DEFUN(AM_SANITY_CHECK,
|
|
||||||
[AC_MSG_CHECKING([whether build environment is sane])
|
|
||||||
# Just in case
|
|
||||||
sleep 1
|
|
||||||
echo timestamp > conftestfile
|
|
||||||
# Do `set' in a subshell so we don't clobber the current shell's
|
|
||||||
# arguments. Must try -L first in case configure is actually a
|
|
||||||
# symlink; some systems play weird games with the mod time of symlinks
|
|
||||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
|
||||||
# directory).
|
|
||||||
if (
|
|
||||||
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
|
||||||
if test "[$]*" = "X"; then
|
|
||||||
# -L didn't work.
|
|
||||||
set X `ls -t $srcdir/configure conftestfile`
|
|
||||||
fi
|
|
||||||
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
|
||||||
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
|
||||||
|
|
||||||
# If neither matched, then we have a broken ls. This can happen
|
|
||||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
|
||||||
# broken ls alias from the environment. This has actually
|
|
||||||
# happened. Such a system could not be considered "sane".
|
|
||||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
|
||||||
alias in your environment])
|
|
||||||
fi
|
|
||||||
|
|
||||||
test "[$]2" = conftestfile
|
|
||||||
)
|
|
||||||
then
|
|
||||||
# Ok.
|
|
||||||
:
|
|
||||||
else
|
|
||||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
|
||||||
Check your system clock])
|
|
||||||
fi
|
|
||||||
rm -f conftest*
|
|
||||||
AC_MSG_RESULT(yes)])
|
|
||||||
|
|
||||||
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
|
||||||
dnl The program must properly implement --version.
|
|
||||||
AC_DEFUN(AM_MISSING_PROG,
|
|
||||||
[AC_MSG_CHECKING(for working $2)
|
|
||||||
# Run test in a subshell; some versions of sh will print an error if
|
|
||||||
# an executable is not found, even if stderr is redirected.
|
|
||||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
|
||||||
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
|
||||||
$1=$2
|
|
||||||
AC_MSG_RESULT(found)
|
|
||||||
else
|
|
||||||
$1="$3/missing $2"
|
|
||||||
AC_MSG_RESULT(missing)
|
|
||||||
fi
|
|
||||||
AC_SUBST($1)])
|
|
||||||
|
|
||||||
|
|
||||||
# serial 40 AC_PROG_LIBTOOL
|
|
||||||
AC_DEFUN(AC_PROG_LIBTOOL,
|
|
||||||
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
|
|
||||||
|
|
||||||
# Save cache, so that ltconfig can load it
|
|
||||||
AC_CACHE_SAVE
|
|
||||||
|
|
||||||
# Actually configure libtool. ac_aux_dir is where install-sh is found.
|
|
||||||
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
|
||||||
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
|
|
||||||
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
|
|
||||||
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
|
|
||||||
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
|
||||||
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|
|
||||||
|| AC_MSG_ERROR([libtool configure failed])
|
|
||||||
|
|
||||||
# Reload cache, that may have been modified by ltconfig
|
|
||||||
AC_CACHE_LOAD
|
|
||||||
|
|
||||||
# This can be used to rebuild libtool when needed
|
|
||||||
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
|
|
||||||
|
|
||||||
# Always use our own libtool.
|
|
||||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
|
||||||
AC_SUBST(LIBTOOL)dnl
|
|
||||||
|
|
||||||
# Redirect the config.log output again, so that the ltconfig log is not
|
|
||||||
# clobbered by the next message.
|
|
||||||
exec 5>>./config.log
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN(AC_LIBTOOL_SETUP,
|
|
||||||
[AC_PREREQ(2.13)dnl
|
|
||||||
AC_REQUIRE([AC_ENABLE_SHARED])dnl
|
|
||||||
AC_REQUIRE([AC_ENABLE_STATIC])dnl
|
|
||||||
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
|
|
||||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
||||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
|
||||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
|
||||||
AC_REQUIRE([AC_PROG_CC])dnl
|
|
||||||
AC_REQUIRE([AC_PROG_LD])dnl
|
|
||||||
AC_REQUIRE([AC_PROG_NM])dnl
|
|
||||||
AC_REQUIRE([AC_PROG_LN_S])dnl
|
|
||||||
dnl
|
|
||||||
|
|
||||||
case "$target" in
|
|
||||||
NONE) lt_target="$host" ;;
|
|
||||||
*) lt_target="$target" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Check for any special flags to pass to ltconfig.
|
|
||||||
libtool_flags="--cache-file=$cache_file"
|
|
||||||
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
|
||||||
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
|
||||||
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
|
||||||
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
|
||||||
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
|
||||||
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
|
|
||||||
[libtool_flags="$libtool_flags --enable-dlopen"])
|
|
||||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
|
||||||
[libtool_flags="$libtool_flags --enable-win32-dll"])
|
|
||||||
AC_ARG_ENABLE(libtool-lock,
|
|
||||||
[ --disable-libtool-lock avoid locking (might break parallel builds)])
|
|
||||||
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
|
|
||||||
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
|
||||||
|
|
||||||
# Some flags need to be propagated to the compiler or linker for good
|
|
||||||
# libtool support.
|
|
||||||
case "$lt_target" in
|
|
||||||
*-*-irix6*)
|
|
||||||
# Find out which ABI we are using.
|
|
||||||
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
|
|
||||||
if AC_TRY_EVAL(ac_compile); then
|
|
||||||
case "`/usr/bin/file conftest.o`" in
|
|
||||||
*32-bit*)
|
|
||||||
LD="${LD-ld} -32"
|
|
||||||
;;
|
|
||||||
*N32*)
|
|
||||||
LD="${LD-ld} -n32"
|
|
||||||
;;
|
|
||||||
*64-bit*)
|
|
||||||
LD="${LD-ld} -64"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
rm -rf conftest*
|
|
||||||
;;
|
|
||||||
|
|
||||||
*-*-sco3.2v5*)
|
|
||||||
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
|
||||||
SAVE_CFLAGS="$CFLAGS"
|
|
||||||
CFLAGS="$CFLAGS -belf"
|
|
||||||
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
|
|
||||||
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
|
|
||||||
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
|
|
||||||
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
|
|
||||||
CFLAGS="$SAVE_CFLAGS"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
|
||||||
[*-*-cygwin* | *-*-mingw*)
|
|
||||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
|
||||||
AC_CHECK_TOOL(AS, as, false)
|
|
||||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
|
||||||
;;
|
|
||||||
])
|
|
||||||
esac
|
|
||||||
])
|
|
||||||
|
|
||||||
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
|
|
||||||
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
|
|
||||||
|
|
||||||
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
|
|
||||||
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
|
|
||||||
|
|
||||||
# AC_ENABLE_SHARED - implement the --enable-shared flag
|
|
||||||
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
|
|
||||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
||||||
# `yes'.
|
|
||||||
AC_DEFUN(AC_ENABLE_SHARED, [dnl
|
|
||||||
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
||||||
AC_ARG_ENABLE(shared,
|
|
||||||
changequote(<<, >>)dnl
|
|
||||||
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
|
||||||
changequote([, ])dnl
|
|
||||||
[p=${PACKAGE-default}
|
|
||||||
case "$enableval" in
|
|
||||||
yes) enable_shared=yes ;;
|
|
||||||
no) enable_shared=no ;;
|
|
||||||
*)
|
|
||||||
enable_shared=no
|
|
||||||
# Look at the argument we got. We use all the common list separators.
|
|
||||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
||||||
for pkg in $enableval; do
|
|
||||||
if test "X$pkg" = "X$p"; then
|
|
||||||
enable_shared=yes
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
IFS="$ac_save_ifs"
|
|
||||||
;;
|
|
||||||
esac],
|
|
||||||
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
|
|
||||||
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
||||||
AC_ENABLE_SHARED(no)])
|
|
||||||
|
|
||||||
# AC_ENABLE_STATIC - implement the --enable-static flag
|
|
||||||
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
|
|
||||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
||||||
# `yes'.
|
|
||||||
AC_DEFUN(AC_ENABLE_STATIC, [dnl
|
|
||||||
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
||||||
AC_ARG_ENABLE(static,
|
|
||||||
changequote(<<, >>)dnl
|
|
||||||
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
|
||||||
changequote([, ])dnl
|
|
||||||
[p=${PACKAGE-default}
|
|
||||||
case "$enableval" in
|
|
||||||
yes) enable_static=yes ;;
|
|
||||||
no) enable_static=no ;;
|
|
||||||
*)
|
|
||||||
enable_static=no
|
|
||||||
# Look at the argument we got. We use all the common list separators.
|
|
||||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
||||||
for pkg in $enableval; do
|
|
||||||
if test "X$pkg" = "X$p"; then
|
|
||||||
enable_static=yes
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
IFS="$ac_save_ifs"
|
|
||||||
;;
|
|
||||||
esac],
|
|
||||||
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
# AC_DISABLE_STATIC - set the default static flag to --disable-static
|
|
||||||
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
||||||
AC_ENABLE_STATIC(no)])
|
|
||||||
|
|
||||||
|
|
||||||
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
|
|
||||||
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
|
|
||||||
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
||||||
# `yes'.
|
|
||||||
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
|
|
||||||
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
||||||
AC_ARG_ENABLE(fast-install,
|
|
||||||
changequote(<<, >>)dnl
|
|
||||||
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
|
||||||
changequote([, ])dnl
|
|
||||||
[p=${PACKAGE-default}
|
|
||||||
case "$enableval" in
|
|
||||||
yes) enable_fast_install=yes ;;
|
|
||||||
no) enable_fast_install=no ;;
|
|
||||||
*)
|
|
||||||
enable_fast_install=no
|
|
||||||
# Look at the argument we got. We use all the common list separators.
|
|
||||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
||||||
for pkg in $enableval; do
|
|
||||||
if test "X$pkg" = "X$p"; then
|
|
||||||
enable_fast_install=yes
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
IFS="$ac_save_ifs"
|
|
||||||
;;
|
|
||||||
esac],
|
|
||||||
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
|
|
||||||
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
||||||
AC_ENABLE_FAST_INSTALL(no)])
|
|
||||||
|
|
||||||
# AC_PROG_LD - find the path to the GNU or non-GNU linker
|
|
||||||
AC_DEFUN(AC_PROG_LD,
|
|
||||||
[AC_ARG_WITH(gnu-ld,
|
|
||||||
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
|
||||||
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
|
||||||
AC_REQUIRE([AC_PROG_CC])dnl
|
|
||||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
||||||
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
|
||||||
ac_prog=ld
|
|
||||||
if test "$ac_cv_prog_gcc" = yes; then
|
|
||||||
# Check if gcc -print-prog-name=ld gives a path.
|
|
||||||
AC_MSG_CHECKING([for ld used by GCC])
|
|
||||||
ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
|
||||||
case "$ac_prog" in
|
|
||||||
# Accept absolute paths.
|
|
||||||
changequote(,)dnl
|
|
||||||
[\\/]* | [A-Za-z]:[\\/]*)
|
|
||||||
re_direlt='/[^/][^/]*/\.\./'
|
|
||||||
changequote([,])dnl
|
|
||||||
# Canonicalize the path of ld
|
|
||||||
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
|
||||||
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
|
||||||
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
|
||||||
done
|
|
||||||
test -z "$LD" && LD="$ac_prog"
|
|
||||||
;;
|
|
||||||
"")
|
|
||||||
# If it fails, then pretend we aren't using GCC.
|
|
||||||
ac_prog=ld
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# If it is relative, then search for the first ld in PATH.
|
|
||||||
with_gnu_ld=unknown
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
elif test "$with_gnu_ld" = yes; then
|
|
||||||
AC_MSG_CHECKING([for GNU ld])
|
|
||||||
else
|
|
||||||
AC_MSG_CHECKING([for non-GNU ld])
|
|
||||||
fi
|
|
||||||
AC_CACHE_VAL(ac_cv_path_LD,
|
|
||||||
[if test -z "$LD"; then
|
|
||||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
|
||||||
for ac_dir in $PATH; do
|
|
||||||
test -z "$ac_dir" && ac_dir=.
|
|
||||||
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
|
||||||
ac_cv_path_LD="$ac_dir/$ac_prog"
|
|
||||||
# Check to see if the program is GNU ld. I'd rather use --version,
|
|
||||||
# but apparently some GNU ld's only accept -v.
|
|
||||||
# Break only if it was the GNU/non-GNU ld that we prefer.
|
|
||||||
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
|
||||||
test "$with_gnu_ld" != no && break
|
|
||||||
else
|
|
||||||
test "$with_gnu_ld" != yes && break
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
IFS="$ac_save_ifs"
|
|
||||||
else
|
|
||||||
ac_cv_path_LD="$LD" # Let the user override the test with a path.
|
|
||||||
fi])
|
|
||||||
LD="$ac_cv_path_LD"
|
|
||||||
if test -n "$LD"; then
|
|
||||||
AC_MSG_RESULT($LD)
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
fi
|
|
||||||
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
|
||||||
AC_PROG_LD_GNU
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN(AC_PROG_LD_GNU,
|
|
||||||
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
|
||||||
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
|
||||||
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
|
||||||
ac_cv_prog_gnu_ld=yes
|
|
||||||
else
|
|
||||||
ac_cv_prog_gnu_ld=no
|
|
||||||
fi])
|
|
||||||
])
|
|
||||||
|
|
||||||
# AC_PROG_NM - find the path to a BSD-compatible name lister
|
|
||||||
AC_DEFUN(AC_PROG_NM,
|
|
||||||
[AC_MSG_CHECKING([for BSD-compatible nm])
|
|
||||||
AC_CACHE_VAL(ac_cv_path_NM,
|
|
||||||
[if test -n "$NM"; then
|
|
||||||
# Let the user override the test.
|
|
||||||
ac_cv_path_NM="$NM"
|
|
||||||
else
|
|
||||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
|
||||||
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
|
|
||||||
test -z "$ac_dir" && ac_dir=.
|
|
||||||
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
|
|
||||||
# Check to see if the nm accepts a BSD-compat flag.
|
|
||||||
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
|
|
||||||
# nm: unknown option "B" ignored
|
|
||||||
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
|
||||||
ac_cv_path_NM="$ac_dir/nm -B"
|
|
||||||
break
|
|
||||||
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
|
||||||
ac_cv_path_NM="$ac_dir/nm -p"
|
|
||||||
break
|
|
||||||
else
|
|
||||||
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
|
|
||||||
continue # so that we can try to find one that supports BSD flags
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
IFS="$ac_save_ifs"
|
|
||||||
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
|
||||||
fi])
|
|
||||||
NM="$ac_cv_path_NM"
|
|
||||||
AC_MSG_RESULT([$NM])
|
|
||||||
])
|
|
||||||
|
|
||||||
# AC_CHECK_LIBM - check for math library
|
|
||||||
AC_DEFUN(AC_CHECK_LIBM,
|
|
||||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
||||||
LIBM=
|
|
||||||
case "$lt_target" in
|
|
||||||
*-*-beos* | *-*-cygwin*)
|
|
||||||
# These system don't have libm
|
|
||||||
;;
|
|
||||||
*-ncr-sysv4.3*)
|
|
||||||
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
|
|
||||||
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_CHECK_LIB(m, main, LIBM="-lm")
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
])
|
|
||||||
|
|
||||||
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
|
|
||||||
# the libltdl convenience library and INCLTDL to the include flags for
|
|
||||||
# the libltdl header and adds --enable-ltdl-convenience to the
|
|
||||||
# configure arguments. Note that LIBLTDL and INCLTDL are not
|
|
||||||
# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
|
|
||||||
# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
|
|
||||||
# with '${top_builddir}/' and INCLTDL will be prefixed with
|
|
||||||
# '${top_srcdir}/' (note the single quotes!). If your package is not
|
|
||||||
# flat and you're not using automake, define top_builddir and
|
|
||||||
# top_srcdir appropriately in the Makefiles.
|
|
||||||
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
||||||
case "$enable_ltdl_convenience" in
|
|
||||||
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
|
|
||||||
"") enable_ltdl_convenience=yes
|
|
||||||
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
|
||||||
esac
|
|
||||||
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
|
|
||||||
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
|
||||||
])
|
|
||||||
|
|
||||||
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
|
||||||
# the libltdl installable library and INCLTDL to the include flags for
|
|
||||||
# the libltdl header and adds --enable-ltdl-install to the configure
|
|
||||||
# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
|
|
||||||
# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
|
|
||||||
# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
|
|
||||||
# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
|
|
||||||
# with '${top_srcdir}/' (note the single quotes!). If your package is
|
|
||||||
# not flat and you're not using automake, define top_builddir and
|
|
||||||
# top_srcdir appropriately in the Makefiles.
|
|
||||||
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
|
|
||||||
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
||||||
AC_CHECK_LIB(ltdl, main,
|
|
||||||
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
|
|
||||||
[if test x"$enable_ltdl_install" = xno; then
|
|
||||||
AC_MSG_WARN([libltdl not installed, but installation disabled])
|
|
||||||
else
|
|
||||||
enable_ltdl_install=yes
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
if test x"$enable_ltdl_install" = x"yes"; then
|
|
||||||
ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
|
||||||
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
|
|
||||||
INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
|
||||||
else
|
|
||||||
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
|
||||||
LIBLTDL="-lltdl"
|
|
||||||
INCLTDL=
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl old names
|
|
||||||
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
|
|
||||||
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
|
|
||||||
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
|
|
||||||
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
|
|
||||||
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
|
|
||||||
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
|
|
||||||
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
|
||||||
|
|
||||||
dnl This is just to silence aclocal about the macro not being used
|
|
||||||
ifelse([AC_DISABLE_FAST_INSTALL])dnl
|
|
||||||
|
|
17
configure.in
17
configure.in
@@ -3,7 +3,7 @@ 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)
|
||||||
|
|
||||||
VERSION=`sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curl.h`
|
VERSION=`sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curl.h`
|
||||||
AM_INIT_AUTOMAKE(curl,$VERSION)
|
AM_INIT_AUTOMAKE(curl,$VERSION)
|
||||||
AM_PROG_LIBTOOL
|
AM_PROG_LIBTOOL
|
||||||
|
|
||||||
@@ -609,12 +609,17 @@ dnl AC_SUBST(RANLIB)
|
|||||||
|
|
||||||
AC_OUTPUT( Makefile \
|
AC_OUTPUT( Makefile \
|
||||||
docs/Makefile \
|
docs/Makefile \
|
||||||
|
docs/examples/Makefile \
|
||||||
include/Makefile \
|
include/Makefile \
|
||||||
include/curl/Makefile \
|
include/curl/Makefile \
|
||||||
src/Makefile \
|
src/Makefile \
|
||||||
lib/Makefile \
|
lib/Makefile \
|
||||||
tests/Makefile)
|
tests/Makefile \
|
||||||
dnl perl/checklinks.pl \
|
tests/data/Makefile \
|
||||||
dnl perl/getlinks.pl \
|
packages/Makefile \
|
||||||
dnl perl/formfind.pl \
|
packages/Win32/Makefile \
|
||||||
dnl perl/recursiveftpget.pl )
|
packages/Linux/Makefile \
|
||||||
|
packages/Linux/RPM/Makefile \
|
||||||
|
packages/Linux/RPM/curl.spec \
|
||||||
|
packages/Linux/RPM/curl-ssl.spec )
|
||||||
|
|
||||||
|
@@ -4,8 +4,6 @@
|
|||||||
| (__| |_| | _ <| |___
|
| (__| |_| | _ <| |___
|
||||||
\___|\___/|_| \_\_____|
|
\___|\___/|_| \_\_____|
|
||||||
|
|
||||||
CONTRIBUTE
|
|
||||||
|
|
||||||
To Think About When Contributing Source Code
|
To Think About When Contributing Source Code
|
||||||
|
|
||||||
This document is intended to offer some guidelines that can be useful to keep
|
This document is intended to offer some guidelines that can be useful to keep
|
||||||
@@ -15,15 +13,13 @@ To Think About When Contributing Source Code
|
|||||||
The License Issue
|
The License Issue
|
||||||
|
|
||||||
When contributing with code, you agree to put your changes and new code under
|
When contributing with code, you agree to put your changes and new code under
|
||||||
the same license curl and libcurl is already using. Curl uses the MozPL, the
|
the same license curl and libcurl is already using.
|
||||||
Mozilla Public License, which is *NOT* compatible with the well known GPL,
|
|
||||||
GNU Public License. We can never re-use sources from a GPL program in curl.
|
|
||||||
If you add a larger piece of code, you can opt to make that file or set of
|
If you add a larger piece of code, you can opt to make that file or set of
|
||||||
files to use a different license as long as they don't enfore any changes to
|
files to use a different license as long as they don't enfore any changes to
|
||||||
the rest of the package and they make sense. Such "separate parts" can not be
|
the rest of the package and they make sense. Such "separate parts" can not be
|
||||||
GPL either (although they should use "GPL compatible" licenses).
|
GPL (as we don't want the GPL virus to attack users of libcurl) but they must
|
||||||
|
use "GPL compatible" licenses.
|
||||||
Curl and libcurl will soon become dual licensed, MozPL/MITX!
|
|
||||||
|
|
||||||
Naming
|
Naming
|
||||||
|
|
||||||
@@ -72,6 +68,13 @@ Separate Patches Doing Different Things
|
|||||||
description exactly what they correct so that all patches can be selectively
|
description exactly what they correct so that all patches can be selectively
|
||||||
applied by the maintainer or other interested parties.
|
applied by the maintainer or other interested parties.
|
||||||
|
|
||||||
|
Patch Against Recent Sources
|
||||||
|
|
||||||
|
Please try to get the latest available sources to make your patches
|
||||||
|
against. It makes my life so much easier. The very best is if you get the
|
||||||
|
most up-to-date sources from the CVS repository, but the latest release
|
||||||
|
archive is quite OK as well!
|
||||||
|
|
||||||
Document
|
Document
|
||||||
|
|
||||||
Writing docs is dead boring and one of the big problems with many open source
|
Writing docs is dead boring and one of the big problems with many open source
|
||||||
|
118
docs/FAQ
118
docs/FAQ
@@ -1,4 +1,4 @@
|
|||||||
Updated: January 2, 2001 (http://curl.haxx.se/docs/faq.shtml)
|
Updated: January 15, 2001 (http://curl.haxx.se/docs/faq.shtml)
|
||||||
_ _ ____ _
|
_ _ ____ _
|
||||||
___| | | | _ \| |
|
___| | | | _ \| |
|
||||||
/ __| | | | |_) | |
|
/ __| | | | |_) | |
|
||||||
@@ -33,7 +33,7 @@ FAQ
|
|||||||
|
|
||||||
4. Running Problems
|
4. Running Problems
|
||||||
4.1 Problems connecting to SSL servers.
|
4.1 Problems connecting to SSL servers.
|
||||||
4.2 Why do I get problems when I use & in the URL?
|
4.2 Why do I get problems when I use & or % in the URL?
|
||||||
4.3 How can I use {, }, [ or ] to specify multiple URLs?
|
4.3 How can I use {, }, [ or ] to specify multiple URLs?
|
||||||
4.4 Why do I get downloaded data even though the web page doesn't exist?
|
4.4 Why do I get downloaded data even though the web page doesn't exist?
|
||||||
4.5 Why do I get return code XXX from a HTTP server?
|
4.5 Why do I get return code XXX from a HTTP server?
|
||||||
@@ -48,7 +48,7 @@ FAQ
|
|||||||
4.9 Curl can't authenticate to the server that requires NTLM?
|
4.9 Curl can't authenticate to the server that requires NTLM?
|
||||||
|
|
||||||
5. libcurl Issues
|
5. libcurl Issues
|
||||||
5.1 Is libcurl thread safe?
|
5.1 Is libcurl thread-safe?
|
||||||
5.2 How can I receive all data into a large memory chunk?
|
5.2 How can I receive all data into a large memory chunk?
|
||||||
5.3 How do I fetch multiple files with libcurl?
|
5.3 How do I fetch multiple files with libcurl?
|
||||||
5.4 Does libcurl do Winsock initing on win32 systems?
|
5.4 Does libcurl do Winsock initing on win32 systems?
|
||||||
@@ -73,19 +73,16 @@ FAQ
|
|||||||
fact it can also be pronounced 'see URL' also helped.
|
fact it can also be pronounced 'see URL' also helped.
|
||||||
|
|
||||||
Curl supports a range of common internet protocols, currently including
|
Curl supports a range of common internet protocols, currently including
|
||||||
HTTP, HTTPS, FTP, GOPHER, LDAP, DICT and FILE.
|
HTTP, HTTPS, FTP, GOPHER, LDAP, DICT, TELNET and FILE.
|
||||||
|
|
||||||
Please spell it cURL or just curl.
|
We spell it cURL or just curl.
|
||||||
|
|
||||||
1.2 What is libcurl?
|
1.2 What is libcurl?
|
||||||
|
|
||||||
libcurl is the engine inside curl that does all the work. curl is more or
|
libcurl is a reliable, higly portable multiprotocol file transfer library.
|
||||||
less the command line interface that converts the given options into libcurl
|
|
||||||
function invokes. libcurl is a reliable, higly portable multiprotocol file
|
|
||||||
transfer library.
|
|
||||||
|
|
||||||
Any application is free to use libcurl, even commercial or closed-source
|
Any application is free to use libcurl, even commercial or closed-source
|
||||||
ones. Just make sure changes to the lib itself are made public.
|
ones.
|
||||||
|
|
||||||
1.3 What is cURL not?
|
1.3 What is cURL not?
|
||||||
|
|
||||||
@@ -298,7 +295,7 @@ FAQ
|
|||||||
I have also seen examples where the remote server didn't like the SSLv2
|
I have also seen examples where the remote server didn't like the SSLv2
|
||||||
request and instead you had to force curl to use SSLv3 with -3/--sslv3.
|
request and instead you had to force curl to use SSLv3 with -3/--sslv3.
|
||||||
|
|
||||||
4.2. Why do I get problems when I use & in the URL?
|
4.2. Why do I get problems when I use & or % in the URL?
|
||||||
|
|
||||||
In general unix shells, the & letter is treated special and when used it
|
In general unix shells, the & letter is treated special and when used it
|
||||||
runs the specified command in the background. To safely send the & as a part
|
runs the specified command in the background. To safely send the & as a part
|
||||||
@@ -309,6 +306,9 @@ FAQ
|
|||||||
|
|
||||||
curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl'
|
curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl'
|
||||||
|
|
||||||
|
In win32, the standard DOS shell treats the %-letter specially and you may
|
||||||
|
need to quote the string properly when % is used in it.
|
||||||
|
|
||||||
4.3. How can I use {, }, [ or ] to specify multiple URLs?
|
4.3. How can I use {, }, [ or ] to specify multiple URLs?
|
||||||
|
|
||||||
Because those letters have a special meaning to the shell, and to be used in
|
Because those letters have a special meaning to the shell, and to be used in
|
||||||
@@ -318,6 +318,12 @@ FAQ
|
|||||||
|
|
||||||
curl '{curl,www}.haxx.se'
|
curl '{curl,www}.haxx.se'
|
||||||
|
|
||||||
|
To be able to use those letters as actual parts of the URL (without using
|
||||||
|
them for the curl URL "globbing" system), use the -g/--globoff option
|
||||||
|
(included in curl 7.6 and later):
|
||||||
|
|
||||||
|
curl -g 'www.site.com/weirdname[].html'
|
||||||
|
|
||||||
4.4. Why do I get downloaded data even though the web page doesn't exist?
|
4.4. Why do I get downloaded data even though the web page doesn't exist?
|
||||||
|
|
||||||
Curl asks remote servers for the page you specify. If the page doesn't exist
|
Curl asks remote servers for the page you specify. If the page doesn't exist
|
||||||
@@ -392,8 +398,7 @@ FAQ
|
|||||||
you have.
|
you have.
|
||||||
|
|
||||||
If there is a bug, post a bug report in the Curl Bug Track System over at
|
If there is a bug, post a bug report in the Curl Bug Track System over at
|
||||||
http://sourceforge.net/bugs/?group_id=976 or mail a detailed bug description
|
http://sourceforge.net/bugs/?group_id=976
|
||||||
to curl-bug@haxx.se.
|
|
||||||
|
|
||||||
Always include as many details you can think of, including curl version,
|
Always include as many details you can think of, including curl version,
|
||||||
operating system name and version and complete instructions how to repeat
|
operating system name and version and complete instructions how to repeat
|
||||||
@@ -406,11 +411,13 @@ FAQ
|
|||||||
|
|
||||||
5. libcurl Issues
|
5. libcurl Issues
|
||||||
|
|
||||||
5.1. Is libcurl thread safe?
|
5.1. Is libcurl thread-safe?
|
||||||
|
|
||||||
We have attempted to write the entire code adjusted for multi-threaded
|
Yes.
|
||||||
programs. If your system has such, curl will attempt to use threadsafe
|
|
||||||
functions instead of non-safe ones.
|
We have written the libcurl code specificly adjusted for multi-threaded
|
||||||
|
programs. libcurl will use thread-safe functions instead of non-safe ones if
|
||||||
|
your system has such.
|
||||||
|
|
||||||
I am very interested in once and for all getting some kind of report or
|
I am very interested in once and for all getting some kind of report or
|
||||||
README file from those who have used libcurl in a threaded environment,
|
README file from those who have used libcurl in a threaded environment,
|
||||||
@@ -467,74 +474,55 @@ FAQ
|
|||||||
|
|
||||||
6. License Issues
|
6. License Issues
|
||||||
|
|
||||||
Curl and libcurl are released under the MPL, the Mozilla Public License. To
|
NOTE: This section is now updated to concern curl 7.5.2 or later!
|
||||||
get a really good answer to your license conflict questions, you should
|
|
||||||
study the MPL license and the license you are about to use and check for
|
Curl and libcurl are released under a MIT/X derivate license *or* the MPL,
|
||||||
clashes yourself. This section is just a brief summary for the cases we get
|
the Mozilla Public License. To get a really good answer to your license
|
||||||
the most questions. (Parts of this section was much enhanced by Bjorn
|
conflict questions, you should study the MPL and MIT/X licenses and the
|
||||||
Reese.)
|
license you are about to use and check for clashes yourself. This section is
|
||||||
|
just a brief summary for the cases we get the most questions. (Parts of this
|
||||||
|
section was much 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, unfortunately you cannot distribute the (lib)curl code with your code.
|
Yes!
|
||||||
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, you have two alternative options:
|
Since libcurl may be distributed under the MIT/X derivate license, it can be
|
||||||
|
used together with GPL in any software.
|
||||||
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?
|
||||||
|
|
||||||
Yes, libcurl does not put any restrictions on the program that uses the
|
Yes.
|
||||||
library. If you end up doing changes to the library, only those changes must
|
|
||||||
be made available, not the ones to your program.
|
libcurl does not put any restrictions on the program that uses the
|
||||||
|
library.
|
||||||
|
|
||||||
6.3. I have a BSD licensed program, can I use the libcurl library?
|
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
|
Yes.
|
||||||
library. If you end up doing changes to the library, only those changes must
|
|
||||||
be made available, not the ones to your program.
|
libcurl does not put any restrictions on the program that uses the
|
||||||
|
library.
|
||||||
|
|
||||||
6.4. I have a program that uses LGPL libraries, can I use libcurl?
|
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
|
Yes.
|
||||||
ones do.
|
|
||||||
|
|
||||||
However, when you read paragraph (3) of the LGPL license, you'll see that
|
The LGPL license don't clash with other licenses.
|
||||||
anyone - at will - may at any time convert that LGPL program into GPL. And
|
|
||||||
GPL programs can't be distributed together with MPL programs, neither with
|
|
||||||
(lib)curl source code and not as a binary.
|
|
||||||
|
|
||||||
6.5. 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.
|
Yes.
|
||||||
|
|
||||||
|
The MIT/X derivate license practically allows you to do almost anything with
|
||||||
|
the sources, on the condition that the copyright texts in the sources are
|
||||||
|
left intact.
|
||||||
|
|
||||||
6.6. 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
|
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 we
|
have contributed with source code knowing that this is the license we
|
||||||
use. This license puts the restrictions we want on curl/libcurl and it does
|
use. This license puts the restrictions we want on curl/libcurl and it does
|
||||||
not spread to other programs or libraries that use it.
|
not spread to other programs or libraries that use it. The recent dual
|
||||||
|
license modification should make it possible for everyone to use libcurl or
|
||||||
|
curl in their projects, no matter what license they already have in use.
|
||||||
|
27
docs/INSTALL
27
docs/INSTALL
@@ -86,13 +86,28 @@ UNIX
|
|||||||
|
|
||||||
If you happen to have autoconf installed, but a version older than
|
If you happen to have autoconf installed, but a version older than
|
||||||
2.12 you will get into trouble. Then you can still build curl by
|
2.12 you will get into trouble. Then you can still build curl by
|
||||||
issuing these commands: (from Ralph Beckmann <rabe@uni-paderborn.de>)
|
issuing these commands: (from Ralph Beckmann)
|
||||||
|
|
||||||
./configure [...]
|
./configure [...]
|
||||||
cd lib; make; cd ..
|
cd lib; make; cd ..
|
||||||
cd src; make; cd ..
|
cd src; make; cd ..
|
||||||
cp src/curl elsewhere/bin/
|
cp src/curl elsewhere/bin/
|
||||||
|
|
||||||
|
As suggested by David West, you can make a faked version of autoconf and
|
||||||
|
autoheader:
|
||||||
|
|
||||||
|
----start of autoconf----
|
||||||
|
#!/bin/bash
|
||||||
|
#fake autoconf for building curl
|
||||||
|
if [ "$1" = "--version" ] then
|
||||||
|
echo "Autoconf version 2.13"
|
||||||
|
fi
|
||||||
|
----end of autoconf----
|
||||||
|
|
||||||
|
Then make autoheader a symbolic link to the same script and make sure
|
||||||
|
they're executable and set to appear in the path *BEFORE* the actual (but
|
||||||
|
obsolete) autoconf and autoheader scripts.
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
|
|
||||||
Remember, to force configure to use the standard cc compiler if both
|
Remember, to force configure to use the standard cc compiler if both
|
||||||
@@ -154,6 +169,8 @@ Win32
|
|||||||
set, then run 'nmake -f Makefile.vc6' in the lib/ dir and then
|
set, then run 'nmake -f Makefile.vc6' in the lib/ dir and then
|
||||||
'nmake -f Makefile.vc6' in the src/ dir.
|
'nmake -f Makefile.vc6' in the src/ dir.
|
||||||
|
|
||||||
|
The vcvars32.bat file is part of the Microsoft development environment.
|
||||||
|
|
||||||
IDE-style
|
IDE-style
|
||||||
-------------------------
|
-------------------------
|
||||||
If you use VC++, Borland or similar compilers. Include all lib source
|
If you use VC++, Borland or similar compilers. Include all lib source
|
||||||
@@ -199,6 +216,8 @@ Win32
|
|||||||
set, then run 'nmake -f Makefile.vc6 release-ssl' in the lib/ dir and
|
set, then run 'nmake -f Makefile.vc6 release-ssl' in the lib/ dir and
|
||||||
then 'nmake -f Makefile.vc6' in the src/ dir.
|
then 'nmake -f Makefile.vc6' in the src/ dir.
|
||||||
|
|
||||||
|
The vcvars32.bat file is part of the Microsoft development environment.
|
||||||
|
|
||||||
Microsoft / Borland style
|
Microsoft / Borland style
|
||||||
-------------------------
|
-------------------------
|
||||||
If you have OpenSSL, and want curl to take advantage of it, edit your
|
If you have OpenSSL, and want curl to take advantage of it, edit your
|
||||||
@@ -256,18 +275,20 @@ PORTS
|
|||||||
- PowerPC Mac OS X
|
- PowerPC Mac OS X
|
||||||
- Sparc Linux
|
- Sparc Linux
|
||||||
- Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8
|
- Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8
|
||||||
- Sparc SunOS 4.1.*
|
- Sparc SunOS 4.1.X
|
||||||
- i386 BeOS
|
- i386 BeOS
|
||||||
- i386 FreeBSD
|
- i386 FreeBSD
|
||||||
- i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4
|
- i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4
|
||||||
- i386 NetBSD
|
- i386 NetBSD
|
||||||
- i386 OS/2
|
- i386 OS/2
|
||||||
- i386 OpenBSD
|
- i386 OpenBSD
|
||||||
|
- i386 SCO unix
|
||||||
- i386 Solaris 2.7
|
- i386 Solaris 2.7
|
||||||
- i386 Windows 95, 98, NT, 2000
|
- i386 Windows 95, 98, ME, NT, 2000
|
||||||
- ia64 Linux 2.3.99
|
- ia64 Linux 2.3.99
|
||||||
- m68k AmigaOS 3
|
- m68k AmigaOS 3
|
||||||
- m68k OpenBSD
|
- m68k OpenBSD
|
||||||
|
- StrongARM NetBSD 1.4.1
|
||||||
|
|
||||||
OpenSSL
|
OpenSSL
|
||||||
=======
|
=======
|
||||||
|
158
docs/INTERNALS
158
docs/INTERNALS
@@ -12,9 +12,15 @@ INTERNALS
|
|||||||
|
|
||||||
Thus, the largest amount of code and complexity is in the library part.
|
Thus, the largest amount of code and complexity is in the library part.
|
||||||
|
|
||||||
|
SYMBOLS
|
||||||
|
=======
|
||||||
|
All symbols used internally must use a 'Curl_' prefix if they're used in more
|
||||||
|
than a single file. Single-file symbols must be made static. Public
|
||||||
|
(exported) symbols must use a 'curl_' prefix. (There are exceptions, but they
|
||||||
|
are destined to be changed to follow this pattern in the future.)
|
||||||
|
|
||||||
CVS
|
CVS
|
||||||
===
|
===
|
||||||
|
|
||||||
All changes to the sources are committed to the CVS repository as soon as
|
All changes to the sources are committed to the CVS repository as soon as
|
||||||
they're somewhat verified to work. Changes shall be commited as independently
|
they're somewhat verified to work. Changes shall be commited as independently
|
||||||
as possible so that individual changes can be easier spotted and tracked
|
as possible so that individual changes can be easier spotted and tracked
|
||||||
@@ -27,25 +33,28 @@ Windows vs Unix
|
|||||||
===============
|
===============
|
||||||
|
|
||||||
There are a few differences in how to program curl the unix way compared to
|
There are a few differences in how to program curl the unix way compared to
|
||||||
the Windows way. The four most notable details are:
|
the Windows way. The four perhaps most notable details are:
|
||||||
|
|
||||||
1. Different function names for close(), read(), write()
|
1. Different function names for close(), read(), write()
|
||||||
|
|
||||||
|
In curl, this is solved with defines and macros, so that the source looks
|
||||||
|
the same at all places except for the header file that defines them.
|
||||||
|
|
||||||
2. Windows requires a couple of init calls for the socket stuff
|
2. Windows requires a couple of init calls for the socket stuff
|
||||||
|
|
||||||
|
Those must be made by the application that uses libcurl, in curl that means
|
||||||
|
src/main.c has some code #ifdef'ed to do just that.
|
||||||
|
|
||||||
3. The file descriptors for network communication and file operations are
|
3. The file descriptors for network communication and file operations are
|
||||||
not easily interchangable as in unix
|
not easily interchangable as in unix
|
||||||
|
|
||||||
|
We avoid this by not trying any funny tricks on file descriptors.
|
||||||
|
|
||||||
4. When writing data to stdout, Windows makes end-of-lines the DOS way, thus
|
4. When writing data to stdout, Windows makes end-of-lines the DOS way, thus
|
||||||
destroying binary data, although you do want that conversion if it is
|
destroying binary data, although you do want that conversion if it is
|
||||||
text coming through... (sigh)
|
text coming through... (sigh)
|
||||||
|
|
||||||
In curl, (1) is made with defines and macros, so that the source looks the
|
We set stdout to binary under windows
|
||||||
same at all places except for the header file that defines them.
|
|
||||||
|
|
||||||
(2) must be made by the application that uses libcurl, in curl that means
|
|
||||||
src/main.c has some code #ifdef'ed to do just that.
|
|
||||||
|
|
||||||
(3) is simply avoided by not trying any funny tricks on file descriptors.
|
|
||||||
|
|
||||||
(4) we set stdout to binary under windows
|
|
||||||
|
|
||||||
Inside the source code, I do make an effort to avoid '#ifdef WIN32'. All
|
Inside the source code, I do make an effort to avoid '#ifdef WIN32'. All
|
||||||
conditionals that deal with features *should* instead be in the format
|
conditionals that deal with features *should* instead be in the format
|
||||||
@@ -54,6 +63,9 @@ Windows vs Unix
|
|||||||
supposed to look exactly as a config.h file would have looked like on a
|
supposed to look exactly as a config.h file would have looked like on a
|
||||||
Windows machine!
|
Windows machine!
|
||||||
|
|
||||||
|
Generally speaking: always remember that this will be compiled on dozens of
|
||||||
|
operating systems. Don't walk on the edge.
|
||||||
|
|
||||||
Library
|
Library
|
||||||
=======
|
=======
|
||||||
|
|
||||||
@@ -68,6 +80,9 @@ Library
|
|||||||
rather small and easy-to-follow. All the ones prefixed with 'curl_easy' are
|
rather small and easy-to-follow. All the ones prefixed with 'curl_easy' are
|
||||||
put in the lib/easy.c file.
|
put in the lib/easy.c file.
|
||||||
|
|
||||||
|
All printf()-style functions use the supplied clones in lib/mprintf.c. This
|
||||||
|
makes sure we stay absolutely platform independent.
|
||||||
|
|
||||||
curl_easy_init() allocates an internal struct and makes some initializations.
|
curl_easy_init() allocates an internal struct and makes some initializations.
|
||||||
The returned handle does not revail internals.
|
The returned handle does not revail internals.
|
||||||
|
|
||||||
@@ -77,27 +92,31 @@ Library
|
|||||||
|
|
||||||
curl_easy_perform() does a whole lot of things:
|
curl_easy_perform() does a whole lot of things:
|
||||||
|
|
||||||
The function analyzes the URL, get the different components and connects to
|
It starts off in the lib/easy.c file by calling curl_transfer(), but the main
|
||||||
the remote host. This may involve using a proxy and/or using SSL. The
|
work is lib/url.c. The function first analyzes the URL, it separates the
|
||||||
GetHost() function in lib/hostip.c is used for looking up host names.
|
different components and connects to the remote host. This may involve using
|
||||||
|
a proxy and/or using SSL. The Curl_gethost() function in lib/hostip.c is used
|
||||||
|
for looking up host names.
|
||||||
|
|
||||||
When connected, the proper function is called. The functions are named after
|
When connected, the proper protocol-specific function is called. The
|
||||||
the protocols they handle. ftp(), http(), dict(), etc. They all reside in
|
functions are named after the protocols they handle. Curl_ftp(), Curl_http(),
|
||||||
their respective files (ftp.c, http.c and dict.c).
|
Curl_dict(), etc. They all reside in their respective files (ftp.c, http.c
|
||||||
|
and dict.c).
|
||||||
|
|
||||||
The protocol-specific functions deal with protocol-specific negotiations and
|
The protocol-specific functions of course deal with protocol-specific
|
||||||
setup. They have access to the sendf() (from lib/sendf.c) function to send
|
negotiations and setup. They have access to the Curl_sendf() (from
|
||||||
printf-style formatted data to the remote host and when they're ready to make
|
lib/sendf.c) function to send printf-style formatted data to the remote host
|
||||||
the actual file transfer they call the Transfer() function (in
|
and when they're ready to make the actual file transfer they call the
|
||||||
lib/download.c) to do the transfer. All printf()-style functions use the
|
Curl_Transfer() function (in lib/transfer.c) to setup the transfer and
|
||||||
supplied clones in lib/mprintf.c.
|
returns. curl_transfer() then calls _Tranfer() in lib/transfer.c that
|
||||||
|
performs the entire file transfer.
|
||||||
|
|
||||||
While transfering, the progress functions in lib/progress.c are called at a
|
During transfer, the progress functions in lib/progress.c are called at a
|
||||||
frequent interval (or at the user's choice, a specified callback might get
|
frequent interval (or at the user's choice, a specified callback might get
|
||||||
called). The speedcheck functions in lib/speedcheck.c are also used to verify
|
called). The speedcheck functions in lib/speedcheck.c are also used to verify
|
||||||
that the transfer is as fast as required.
|
that the transfer is as fast as required.
|
||||||
|
|
||||||
When completed curl_easy_cleanup() should be called to free up used
|
When completed, the curl_easy_cleanup() should be called to free up used
|
||||||
resources.
|
resources.
|
||||||
|
|
||||||
HTTP(S)
|
HTTP(S)
|
||||||
@@ -106,9 +125,8 @@ Library
|
|||||||
code. There is a special file (lib/formdata.c) that offers all the multipart
|
code. There is a special file (lib/formdata.c) that offers all the multipart
|
||||||
post functions.
|
post functions.
|
||||||
|
|
||||||
base64-functions for user+password stuff is in (lib/base64.c) and all
|
base64-functions for user+password stuff (and more) is in (lib/base64.c) and
|
||||||
functions for parsing and sending cookies are found in
|
all functions for parsing and sending cookies are found in (lib/cookie.c).
|
||||||
(lib/cookie.c).
|
|
||||||
|
|
||||||
HTTPS uses in almost every means the same procedure as HTTP, with only two
|
HTTPS uses in almost every means the same procedure as HTTP, with only two
|
||||||
exceptions: the connect procedure is different and the function used to read
|
exceptions: the connect procedure is different and the function used to read
|
||||||
@@ -118,9 +136,17 @@ Library
|
|||||||
|
|
||||||
FTP
|
FTP
|
||||||
|
|
||||||
The if2ip() function can be used for getting the IP number of a specified
|
The Curl_if2ip() function can be used for getting the IP number of a
|
||||||
network interface, and it resides in lib/if2ip.c. It is only used for the FTP
|
specified network interface, and it resides in lib/if2ip.c.
|
||||||
PORT command.
|
|
||||||
|
Curl_ftpsendf() is used for sending FTP commands to the remote server. It was
|
||||||
|
made a separate function to prevent us programmers from forgetting that they
|
||||||
|
must be CRLF terminated. They must also be sent in one single write() to make
|
||||||
|
firewalls and similar happy.
|
||||||
|
|
||||||
|
Kerberos
|
||||||
|
|
||||||
|
The kerberos support is mainly in lib/krb4.c and lib/security.c.
|
||||||
|
|
||||||
TELNET
|
TELNET
|
||||||
|
|
||||||
@@ -139,32 +165,54 @@ Library
|
|||||||
URL encoding and decoding, called escaping and unescaping in the source code,
|
URL encoding and decoding, called escaping and unescaping in the source code,
|
||||||
is found in lib/escape.c.
|
is found in lib/escape.c.
|
||||||
|
|
||||||
While transfering data in Transfer() a few functions might get
|
While transfering data in _Transfer() a few functions might get
|
||||||
used. curl_getdate() in lib/getdate.c is for HTTP date comparisons (and
|
used. curl_getdate() in lib/getdate.c is for HTTP date comparisons (and
|
||||||
more).
|
more).
|
||||||
|
|
||||||
lib/getenv.c offers curl_getenv() which is for reading environment variables
|
lib/getenv.c offers curl_getenv() which is for reading environment variables
|
||||||
in a neat platform independent way. That's used in the client, but also in
|
in a neat platform independent way. That's used in the client, but also in
|
||||||
lib/url.c when checking the proxy environment variables.
|
lib/url.c when checking the proxy environment variables. Note that contrary
|
||||||
|
to the normal unix getenv(), this returns an allocated buffer that must be
|
||||||
|
free()ed after use.
|
||||||
|
|
||||||
lib/netrc.c holds the .netrc parser
|
lib/netrc.c holds the .netrc parser
|
||||||
|
|
||||||
lib/timeval.c features replacement functions for systems that don't have
|
lib/timeval.c features replacement functions for systems that don't have
|
||||||
gettimeofday().
|
gettimeofday() and a few support functions for timeval convertions.
|
||||||
|
|
||||||
A function named curl_version() that returns the full curl version string is
|
A function named curl_version() that returns the full curl version string is
|
||||||
found in lib/version.c.
|
found in lib/version.c.
|
||||||
|
|
||||||
|
If authentication is requested but no password is given, a getpass_r() clone
|
||||||
|
exists in lib/getpass.c. libcurl offers a custom callback that can be used
|
||||||
|
instead of this, but it doesn't change much to us.
|
||||||
|
|
||||||
|
Return Codes and Informationals
|
||||||
|
===============================
|
||||||
|
|
||||||
|
I've made things simple. Almost every function in libcurl returns a CURLcode,
|
||||||
|
that must be CURLE_OK if everything is OK or otherwise a suitable error code
|
||||||
|
as the curl/curl.h include file defines. The very spot that detects an error
|
||||||
|
must use the Curl_failf() function to set the human-readable error
|
||||||
|
description.
|
||||||
|
|
||||||
|
In aiding the user to understand what's happening and to debug curl usage, we
|
||||||
|
must supply a fair amount of informational messages by using the Curl_infof()
|
||||||
|
function. Those messages are only displayed when the user explicitly asks for
|
||||||
|
them. They are best used when revealing information that isn't otherwise
|
||||||
|
obvious.
|
||||||
|
|
||||||
Client
|
Client
|
||||||
======
|
======
|
||||||
|
|
||||||
main() resides in src/main.c together with most of the client code.
|
main() resides in src/main.c together with most of the client code.
|
||||||
src/hugehelp.c is automatically generated by the mkhelp.pl perl script to
|
src/hugehelp.c is automatically generated by the mkhelp.pl perl script to
|
||||||
display the complete "manual" and the src/urlglob.c file holds the functions
|
display the complete "manual" and the src/urlglob.c file holds the functions
|
||||||
used for the multiple-URL support.
|
used for the URL-"globbing" support. Globbing in the sense that the {} and []
|
||||||
|
expansion stuff is there.
|
||||||
|
|
||||||
The client mostly mess around to setup its config struct properly, then it
|
The client mostly messes around to setup its 'config' struct properly, then
|
||||||
calls the curl_easy_*() functions of the library and when it gets back
|
it calls the curl_easy_*() functions of the library and when it gets back
|
||||||
control after the curl_easy_perform() it cleans up the library, checks status
|
control after the curl_easy_perform() it cleans up the library, checks status
|
||||||
and exits.
|
and exits.
|
||||||
|
|
||||||
@@ -173,10 +221,30 @@ Client
|
|||||||
curl_easy_getinfo() function to extract useful information from the curl
|
curl_easy_getinfo() function to extract useful information from the curl
|
||||||
session.
|
session.
|
||||||
|
|
||||||
|
Recent versions may loop and do all that several times if many URLs were
|
||||||
|
specified on the command line or config file.
|
||||||
|
|
||||||
|
Memory Debugging
|
||||||
|
================
|
||||||
|
|
||||||
|
The file named lib/memdebug.c contains debug-versions of a few
|
||||||
|
functions. Functions such as malloc, free, fopen, fclose, etc that somehow
|
||||||
|
deal with resources that might give us problems if we "leak" them. The
|
||||||
|
functions in the memdebug system do nothing fancy, they do their normal
|
||||||
|
function and then log information about what they just did. The logged data
|
||||||
|
is then analyzed after a complete session,
|
||||||
|
|
||||||
|
memanalyze.pl is a perl script present only in CVS (not part of the release
|
||||||
|
archives) that analyzes a log file generated by the memdebug system. It
|
||||||
|
detects if resources are allocated but never freed and other kinds of errors
|
||||||
|
related to resource management.
|
||||||
|
|
||||||
|
Use -DMALLOCDEBUG when compiling to enable memory debugging.
|
||||||
|
|
||||||
Test Suite
|
Test Suite
|
||||||
==========
|
==========
|
||||||
|
|
||||||
During November 2000, a test suite has evolved. It is placed in its own
|
Since November 2000, a test suite has evolved. It is placed in its own
|
||||||
subdirectory directly off the root in the curl archive tree, and it contains
|
subdirectory directly off the root in the curl archive tree, and it contains
|
||||||
a bunch of scripts and a lot of test case data.
|
a bunch of scripts and a lot of test case data.
|
||||||
|
|
||||||
@@ -186,3 +254,17 @@ Test Suite
|
|||||||
|
|
||||||
You'll find a complete description of the test case data files in the README
|
You'll find a complete description of the test case data files in the README
|
||||||
file in the test directory.
|
file in the test directory.
|
||||||
|
|
||||||
|
The test suite automatically detects if curl was built with the memory
|
||||||
|
debugging enabled, and if it was it will detect memory leaks too.
|
||||||
|
|
||||||
|
Building Releases
|
||||||
|
=================
|
||||||
|
|
||||||
|
There's no magic to this. When you consider everything stable enough to be
|
||||||
|
released, run the 'maketgz' script (using 'make distcheck' will give you a
|
||||||
|
pretty good view on the status of the current sources). maketgz prompts for
|
||||||
|
version number of the client and the library before it creates a release
|
||||||
|
archive.
|
||||||
|
|
||||||
|
You must have autoconf installed to build release archives.
|
||||||
|
@@ -12,11 +12,15 @@ man_MANS = \
|
|||||||
curl_easy_perform.3 \
|
curl_easy_perform.3 \
|
||||||
curl_easy_setopt.3 \
|
curl_easy_setopt.3 \
|
||||||
curl_formparse.3 \
|
curl_formparse.3 \
|
||||||
|
curl_formfree.3 \
|
||||||
curl_getdate.3 \
|
curl_getdate.3 \
|
||||||
curl_getenv.3 \
|
curl_getenv.3 \
|
||||||
curl_slist_append.3 \
|
curl_slist_append.3 \
|
||||||
curl_slist_free_all.3 \
|
curl_slist_free_all.3 \
|
||||||
curl_version.3
|
curl_version.3
|
||||||
|
|
||||||
EXTRA_DIST = $(man_MANS)
|
EXTRA_DIST = $(man_MANS) \
|
||||||
|
MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS \
|
||||||
|
LIBCURL README.win32 RESOURCES TODO TheArtOfHttpScripting
|
||||||
|
|
||||||
|
SUBDIRS = examples
|
||||||
|
@@ -100,7 +100,13 @@ Similar Tools
|
|||||||
|
|
||||||
swebget - http://www.uni-hildesheim.de/~smol0075/swebget/
|
swebget - http://www.uni-hildesheim.de/~smol0075/swebget/
|
||||||
|
|
||||||
Kermit - http://www.columbia.edu/kermit/ftpclient/
|
Kermit - http://www.columbia.edu/kermit/ftpclient
|
||||||
|
|
||||||
|
Pavuk - http://www.idata.sk/~ondrej/pavuk/
|
||||||
|
|
||||||
|
httpr - http://zwolak.dhs.org/httpr/
|
||||||
|
|
||||||
|
puf - http://www.inf.tu-dresden.de/~ob6/sw/puf.html
|
||||||
|
|
||||||
Related Software
|
Related Software
|
||||||
----------------
|
----------------
|
||||||
|
13
docs/TODO
13
docs/TODO
@@ -16,10 +16,6 @@ For the future
|
|||||||
* Make SSL session ids get used if multiple HTTPS documents from the same
|
* Make SSL session ids get used if multiple HTTPS documents from the same
|
||||||
host is requested.
|
host is requested.
|
||||||
|
|
||||||
* Improve the command line option parser to accept '-m300' as well as the '-m
|
|
||||||
300' convention. It should be able to work if '-m300' is considered to be
|
|
||||||
space separated to the next option.
|
|
||||||
|
|
||||||
* Make the curl tool support URLs that start with @ that would then mean that
|
* Make the curl tool support URLs that start with @ that would then mean that
|
||||||
the following is a plain list with URLs to download. Thus @filename.txt
|
the following is a plain list with URLs to download. Thus @filename.txt
|
||||||
reads a list of URLs from a local file. A fancy option would then be to
|
reads a list of URLs from a local file. A fancy option would then be to
|
||||||
@@ -27,16 +23,12 @@ For the future
|
|||||||
URLs mentioned in the list. I figure -O or something would have to be
|
URLs mentioned in the list. I figure -O or something would have to be
|
||||||
implied by such an action.
|
implied by such an action.
|
||||||
|
|
||||||
* Make curl with multiple URLs, even outside of {}-letters. I could also
|
|
||||||
imagine an optional fork()ed system that downloads each URL in its own
|
|
||||||
thread. It should of course have a maximum amount of simultaneous fork()s.
|
|
||||||
|
|
||||||
* Improve the regular progress meter with --continue is used. It should be
|
* Improve the regular progress meter with --continue is used. It should be
|
||||||
noticable when there's a resume going on.
|
noticable when there's a resume going on.
|
||||||
|
|
||||||
* Add a command line option that allows the output file to get the same time
|
* Add a command line option that allows the output file to get the same time
|
||||||
stamp as the remote file. This requires some fiddling on FTP but comes
|
stamp as the remote file. We already are capable of fetching the remote
|
||||||
almost free for HTTP.
|
file's date.
|
||||||
|
|
||||||
* Make the SSL layer option capable of using the Mozilla Security Services as
|
* Make the SSL layer option capable of using the Mozilla Security Services as
|
||||||
an alternative to OpenSSL:
|
an alternative to OpenSSL:
|
||||||
@@ -47,6 +39,7 @@ For the future
|
|||||||
|
|
||||||
* Make the easy-interface support multiple file transfers. If they're done
|
* Make the easy-interface support multiple file transfers. If they're done
|
||||||
to the same host, they should use persistant connections or similar.
|
to the same host, they should use persistant connections or similar.
|
||||||
|
Figure out a nice design for this.
|
||||||
|
|
||||||
* Add asynchronous name resolving, as this enables full timeout support for
|
* Add asynchronous name resolving, as this enables full timeout support for
|
||||||
fork() systems.
|
fork() systems.
|
||||||
|
136
docs/curl.1
136
docs/curl.1
@@ -2,18 +2,19 @@
|
|||||||
.\" nroff -man curl.1
|
.\" nroff -man curl.1
|
||||||
.\" Written by Daniel Stenberg
|
.\" Written by Daniel Stenberg
|
||||||
.\"
|
.\"
|
||||||
.TH curl 1 "22 November 2000" "Curl 7.5" "Curl Manual"
|
.TH curl 1 "9 January 2001" "Curl 7.6" "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.
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B curl [options]
|
.B curl [options]
|
||||||
.I url
|
.I [URL...]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B curl
|
.B curl
|
||||||
is a client to get documents/files from servers, using any of the
|
is a client to get documents/files from or send documents to a server, using
|
||||||
supported protocols. The command is designed to work without user
|
any of the supported protocols (HTTP, HTTPS, FTP, GOPHER, DICT, TELNET, LDAP
|
||||||
interaction or any kind of interactivity.
|
or FILE). The command is designed to work without user interaction or any kind
|
||||||
|
of interactivity.
|
||||||
|
|
||||||
curl offers a busload of useful tricks like proxy support, user
|
curl offers a busload of useful tricks like proxy support, user
|
||||||
authentication, ftp upload, HTTP post, SSL (https:) connections, cookies, file
|
authentication, ftp upload, HTTP post, SSL (https:) connections, cookies, file
|
||||||
@@ -37,18 +38,26 @@ It is possible to specify up to 9 sets or series for a URL, but no nesting is
|
|||||||
supported at the moment:
|
supported at the moment:
|
||||||
|
|
||||||
http://www.any.org/archive[1996-1999]/volume[1-4]part{a,b,c,index}.html
|
http://www.any.org/archive[1996-1999]/volume[1-4]part{a,b,c,index}.html
|
||||||
|
|
||||||
|
Starting with curl 7.6, you can specify any amount of URLs on the command
|
||||||
|
line. They will be fetched in a sequential manner in the specified order.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.IP "-a/--append"
|
.IP "-a/--append"
|
||||||
(FTP)
|
(FTP)
|
||||||
When used in a ftp upload, this will tell curl to append to the target
|
When used in a ftp upload, this will tell curl to append to the target
|
||||||
file instead of overwriting it. If the file doesn't exist, it will
|
file instead of overwriting it. If the file doesn't exist, it will
|
||||||
be created.
|
be created.
|
||||||
|
|
||||||
|
If this option is used twice, the second one will disable append mode again.
|
||||||
.IP "-A/--user-agent <agent string>"
|
.IP "-A/--user-agent <agent string>"
|
||||||
(HTTP)
|
(HTTP)
|
||||||
Specify the User-Agent string to send to the HTTP server. Some badly done CGIs
|
Specify the User-Agent string to send to the HTTP server. Some badly done CGIs
|
||||||
fail if its not set to "Mozilla/4.0". To encode blanks in the string,
|
fail if its not set to "Mozilla/4.0". To encode blanks in the string,
|
||||||
surround the string with single quote marks. This can also be set with the
|
surround the string with single quote marks. This can also be set with the
|
||||||
-H/--header flag of course.
|
-H/--header flag of course.
|
||||||
|
|
||||||
|
If this option is used more than once, the last one will be the one to be
|
||||||
|
used.
|
||||||
.IP "-b/--cookie <name=data>"
|
.IP "-b/--cookie <name=data>"
|
||||||
(HTTP)
|
(HTTP)
|
||||||
Pass the data to the HTTP server as a cookie. It is supposedly the
|
Pass the data to the HTTP server as a cookie. It is supposedly the
|
||||||
@@ -67,10 +76,15 @@ format.
|
|||||||
that the file specified with -b/--cookie is only used as input. No cookies
|
that the file specified with -b/--cookie is only used as input. No cookies
|
||||||
will be stored in the file. To store cookies, save the HTTP headers to a file
|
will be stored in the file. To store cookies, save the HTTP headers to a file
|
||||||
using -D/--dump-header!
|
using -D/--dump-header!
|
||||||
|
|
||||||
|
If this option is used more than once, the last one will be the one to be
|
||||||
|
used.
|
||||||
.IP "-B/--use-ascii"
|
.IP "-B/--use-ascii"
|
||||||
Use ASCII transfer when getting an FTP file or LDAP info. For FTP, this can
|
Use ASCII transfer when getting an FTP file or LDAP info. For FTP, this can
|
||||||
also be enforced by using an URL that ends with ";type=A". This option causes
|
also be enforced by using an URL that ends with ";type=A". This option causes
|
||||||
data sent to stdout to be in text mode for win32 systems.
|
data sent to stdout to be in text mode for win32 systems.
|
||||||
|
|
||||||
|
If this option is used twice, the second one will disable ASCII usage.
|
||||||
.IP "-c/--continue"
|
.IP "-c/--continue"
|
||||||
.B Deprecated. Use '-C -' instead.
|
.B Deprecated. Use '-C -' instead.
|
||||||
Continue/Resume a previous file transfer. This instructs curl to
|
Continue/Resume a previous file transfer. This instructs curl to
|
||||||
@@ -88,6 +102,8 @@ to the destination.
|
|||||||
If used with uploads, the ftp server command SIZE will not be used by
|
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.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-d/--data <data>"
|
.IP "-d/--data <data>"
|
||||||
(HTTP) Sends the specified data in a POST request to the HTTP server. Note
|
(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
|
that the data is sent exactly as specified with no extra processing (with all
|
||||||
@@ -107,13 +123,24 @@ specified.
|
|||||||
To post data purely binary, you should instead use the --data-binary option.
|
To post data purely binary, you should instead use the --data-binary option.
|
||||||
|
|
||||||
-d/--data is the same as --data-ascii.
|
-d/--data is the same as --data-ascii.
|
||||||
|
|
||||||
|
If this option is used serveral times, the ones following the first will
|
||||||
|
append data.
|
||||||
.IP "--data-ascii <data>"
|
.IP "--data-ascii <data>"
|
||||||
(HTTP) This is an alias for the -d/--data option.
|
(HTTP) This is an alias for the -d/--data option.
|
||||||
|
|
||||||
|
If this option is used serveral times, the ones following the first will
|
||||||
|
append data.
|
||||||
.IP "--data-binary <data>"
|
.IP "--data-binary <data>"
|
||||||
(HTTP) This posts data in a similar manner as --data-ascii does, although when
|
(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
|
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
|
want to post a binary file without the strip-newlines feature of the
|
||||||
--data-ascii option, this is for you.
|
--data-ascii option, this is for you.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
|
|
||||||
|
If this option is used serveral times, the ones following the first will
|
||||||
|
append data.
|
||||||
.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
|
||||||
@@ -122,6 +149,8 @@ file if -I/--head is used.
|
|||||||
This option is handy to use when you want to store the cookies that a HTTP
|
This option is handy to use when you want to store the cookies that a HTTP
|
||||||
site sends to you. The cookies could then be read in a second curl invoke by
|
site sends to you. The cookies could then be read in a second curl invoke by
|
||||||
using the -b/--cookie option!
|
using the -b/--cookie option!
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-e/--referer <URL>"
|
.IP "-e/--referer <URL>"
|
||||||
(HTTP) Sends the "Referer Page" information to the HTTP server. This can also
|
(HTTP) Sends the "Referer Page" information to the HTTP server. This can also
|
||||||
be set with the -H/--header flag of course. When used with
|
be set with the -H/--header flag of course. When used with
|
||||||
@@ -129,6 +158,8 @@ be set with the -H/--header flag of course. When used with
|
|||||||
you can append ";auto" to the referer URL to make curl automatically set the
|
you can append ";auto" to the referer URL to make curl automatically set the
|
||||||
previous URL when it follows a Location: header. The ";auto" string can be
|
previous URL when it follows a Location: header. The ";auto" string can be
|
||||||
used alone, even if you don't set an initial referer.
|
used alone, even if you don't set an initial referer.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-E/--cert <certificate[:password]>"
|
.IP "-E/--cert <certificate[:password]>"
|
||||||
(HTTPS)
|
(HTTPS)
|
||||||
Tells curl to use the specified certificate file when getting a file
|
Tells curl to use the specified certificate file when getting a file
|
||||||
@@ -136,9 +167,13 @@ with HTTPS. The certificate must be in PEM format.
|
|||||||
If the optional password isn't specified, it will be queried for on
|
If the optional password isn't specified, it will be queried for on
|
||||||
the terminal. Note that this certificate is the private key and the private
|
the terminal. Note that this certificate is the private key and the private
|
||||||
certificate concatenated!
|
certificate concatenated!
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "--cacert <CA certificate>"
|
.IP "--cacert <CA certificate>"
|
||||||
(HTTPS) Tells curl to use the specified certificate file to verify the
|
(HTTPS) Tells curl to use the specified certificate file to verify the
|
||||||
peer. The certificate must be in PEM format.
|
peer. The certificate must be in PEM format.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-f/--fail"
|
.IP "-f/--fail"
|
||||||
(HTTP)
|
(HTTP)
|
||||||
Fail silently (no output at all) on server errors. This is mostly done
|
Fail silently (no output at all) on server errors. This is mostly done
|
||||||
@@ -147,6 +182,8 @@ attempts. In normal cases when a HTTP server fails to deliver a
|
|||||||
document, it returns a HTML document stating so (which often also
|
document, it returns a HTML document stating so (which often also
|
||||||
describes why and more). This flag will prevent curl from
|
describes why and more). This flag will prevent curl from
|
||||||
outputting that and fail silently instead.
|
outputting that and fail silently instead.
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable silent failure.
|
||||||
.IP "-F/--form <name=content>"
|
.IP "-F/--form <name=content>"
|
||||||
(HTTP) This lets curl emulate a filled in form in which a user has pressed the
|
(HTTP) This lets curl emulate a filled in form in which a user has pressed the
|
||||||
submit button. This causes curl to POST data using the content-type
|
submit button. This causes curl to POST data using the content-type
|
||||||
@@ -166,6 +203,8 @@ input:
|
|||||||
|
|
||||||
To read the file's content from stdin insted of a file, use - where the file
|
To read the file's content from stdin insted of a file, use - where the file
|
||||||
name should've been. This goes for both @ and < constructs.
|
name should've been. This goes for both @ and < constructs.
|
||||||
|
|
||||||
|
This option can be used multiple times.
|
||||||
.IP "-h/--help"
|
.IP "-h/--help"
|
||||||
Usage help.
|
Usage help.
|
||||||
.IP "-H/--header <header>"
|
.IP "-H/--header <header>"
|
||||||
@@ -177,38 +216,54 @@ trickier stuff than curl would normally do. You should not replace internally
|
|||||||
set headers without knowing perfectly well what you're doing. Replacing an
|
set headers without knowing perfectly well what you're doing. Replacing an
|
||||||
internal header with one without content on the right side of the colon will
|
internal header with one without content on the right side of the colon will
|
||||||
prevent that header from appearing.
|
prevent that header from appearing.
|
||||||
|
|
||||||
|
This option can be used multiple times.
|
||||||
.IP "-i/--include"
|
.IP "-i/--include"
|
||||||
(HTTP)
|
(HTTP)
|
||||||
Include the HTTP-header in the output. The HTTP-header includes things
|
Include the HTTP-header in the output. The HTTP-header includes things
|
||||||
like server-name, date of the document, HTTP-version and more...
|
like server-name, date of the document, HTTP-version and more...
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable header include.
|
||||||
.IP "--interface <name>"
|
.IP "--interface <name>"
|
||||||
Perform an operation using a specified interface. You can enter interface
|
Perform an operation using a specified interface. You can enter interface
|
||||||
name, IP address or host name. An example could look like:
|
name, IP address or host name. An example could look like:
|
||||||
|
|
||||||
.B "curl --interface eth0:1 http://www.netscape.com/"
|
.B "curl --interface eth0:1 http://www.netscape.com/"
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-I/--head"
|
.IP "-I/--head"
|
||||||
(HTTP/FTP)
|
(HTTP/FTP)
|
||||||
Fetch the HTTP-header only! HTTP-servers feature the command HEAD
|
Fetch the HTTP-header only! HTTP-servers feature the command HEAD
|
||||||
which this uses to get nothing but the header of a document. When used
|
which this uses to get nothing but the header of a document. When used
|
||||||
on a FTP file, curl displays the file size only.
|
on a FTP file, curl displays the file size only.
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable header only.
|
||||||
.IP "--krb4 <level>"
|
.IP "--krb4 <level>"
|
||||||
(FTP) Enable kerberos4 authentication and use. The level must be entered and
|
(FTP) Enable kerberos4 authentication and use. The level must be entered and
|
||||||
should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use
|
should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use
|
||||||
a level that is not one of these, 'private' will instead be used.
|
a level that is not one of these, 'private' will instead be used.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-K/--config <config file>"
|
.IP "-K/--config <config file>"
|
||||||
Specify which config file to read curl arguments from. The config
|
Specify which config file to read curl arguments from. The config file is a
|
||||||
file is a text file in which command line arguments can be written
|
text file in which command line arguments can be written which then will be
|
||||||
which then will be used as if they were written on the actual command
|
used as if they were written on the actual command line. Options and their
|
||||||
line. If the first column of a config line is a '#' character, the
|
parameters must be specified on the same config file line. If the parameter is
|
||||||
rest of the line will be treated as a comment.
|
to contain white spaces, the parameter must be inclosed within quotes. If the
|
||||||
|
first column of a config line is a '#' character, the rest of the line will be
|
||||||
|
treated as a comment.
|
||||||
|
|
||||||
Specify the filename as '-' to make curl read the file from stdin.
|
Specify the filename as '-' to make curl read the file from stdin.
|
||||||
|
|
||||||
|
This option can be used multiple times.
|
||||||
.IP "-l/--list-only"
|
.IP "-l/--list-only"
|
||||||
(FTP)
|
(FTP)
|
||||||
When listing an FTP directory, this switch forces a name-only view.
|
When listing an FTP directory, this switch forces a name-only view.
|
||||||
Especially useful if you want to machine-parse the contents of an FTP
|
Especially useful if you want to machine-parse the contents of an FTP
|
||||||
directory since the normal directory view doesn't use a standard look
|
directory since the normal directory view doesn't use a standard look
|
||||||
or format.
|
or format.
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable list only.
|
||||||
.IP "-L/--location"
|
.IP "-L/--location"
|
||||||
(HTTP/HTTPS) If the server reports that the requested page has a different
|
(HTTP/HTTPS) If the server reports that the requested page has a different
|
||||||
location (indicated with the header line Location:) this flag will let curl
|
location (indicated with the header line Location:) this flag will let curl
|
||||||
@@ -216,10 +271,14 @@ attempt to reattempt the get on the new place. If used together with -i or -I,
|
|||||||
headers from all requested pages will be shown. If this flag is used when
|
headers from all requested pages will be shown. If this flag is used when
|
||||||
making a HTTP POST, curl will automatically switch to GET after the initial
|
making a HTTP POST, curl will automatically switch to GET after the initial
|
||||||
POST has been done.
|
POST has been done.
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable location following.
|
||||||
.IP "-m/--max-time <seconds>"
|
.IP "-m/--max-time <seconds>"
|
||||||
Maximum time in seconds that you allow the whole operation to take. This is
|
Maximum time in seconds that you allow the whole operation to take. This is
|
||||||
useful for preventing your batch jobs from hanging for hours due to slow
|
useful for preventing your batch jobs from hanging for hours due to slow
|
||||||
networks or links going down. This doesn't work fully in win32 systems.
|
networks or links going down. This doesn't work fully in win32 systems.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-M/--manual"
|
.IP "-M/--manual"
|
||||||
Manual. Display the huge help text.
|
Manual. Display the huge help text.
|
||||||
.IP "-n/--netrc"
|
.IP "-n/--netrc"
|
||||||
@@ -240,11 +299,15 @@ to allow curl to ftp to the machine host.domain.com with user name
|
|||||||
'myself' and password 'secret' should look similar to:
|
'myself' and password 'secret' should look similar to:
|
||||||
|
|
||||||
.B "machine host.domain.com login myself password secret"
|
.B "machine host.domain.com login myself password secret"
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable netrc usage.
|
||||||
.IP "-N/--no-buffer"
|
.IP "-N/--no-buffer"
|
||||||
Disables the buffering of the output stream. In normal work situations, curl
|
Disables the buffering of the output stream. In normal work situations, curl
|
||||||
will use a standard buffered output stream that will have the effect that it
|
will use a standard buffered output stream that will have the effect that it
|
||||||
will output the data in chunks, not necessarily exactly when the data arrives.
|
will output the data in chunks, not necessarily exactly when the data arrives.
|
||||||
Using this option will disable that buffering.
|
Using this option will disable that buffering.
|
||||||
|
|
||||||
|
If this option is used twice, the second will again switch on buffering.
|
||||||
.IP "-o/--output <file>"
|
.IP "-o/--output <file>"
|
||||||
Write output to <file> instead of stdout. If you are using {} or [] to fetch
|
Write output to <file> instead of stdout. If you are using {} or [] to fetch
|
||||||
multiple documents, you can use '#' followed by a number in the <file>
|
multiple documents, you can use '#' followed by a number in the <file>
|
||||||
@@ -256,15 +319,21 @@ being fetched. Like in:
|
|||||||
or use several variables like:
|
or use several variables like:
|
||||||
|
|
||||||
curl http://{site,host}.host[1-5].com -o "#1_#2"
|
curl http://{site,host}.host[1-5].com -o "#1_#2"
|
||||||
|
|
||||||
|
You may use this option as many times as you have number of URLs.
|
||||||
.IP "-O/--remote-name"
|
.IP "-O/--remote-name"
|
||||||
Write output to a local file named like the remote file we get. (Only
|
Write output to a local file named like the remote file we get. (Only
|
||||||
the file part of the remote file is used, the path is cut off.)
|
the file part of the remote file is used, the path is cut off.)
|
||||||
|
|
||||||
|
You may use this option as many times as you have number of URLs.
|
||||||
.IP "-p/--proxytunnel"
|
.IP "-p/--proxytunnel"
|
||||||
When an HTTP proxy is used, this option will cause non-HTTP protocols to
|
When an HTTP proxy is used, this option will cause non-HTTP protocols to
|
||||||
attempt to tunnel through the proxy instead of merely using it to do HTTP-like
|
attempt to tunnel through the proxy instead of merely using it to do HTTP-like
|
||||||
operations. The tunnel approach is made with the HTTP proxy CONNECT request
|
operations. The tunnel approach is made with the HTTP proxy CONNECT request
|
||||||
and requires that the proxy allows direct connect to the remote port number
|
and requires that the proxy allows direct connect to the remote port number
|
||||||
curl wants to tunnel through to.
|
curl wants to tunnel through to.
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable proxy tunnel.
|
||||||
.IP "-P/--ftpport <address>"
|
.IP "-P/--ftpport <address>"
|
||||||
(FTP)
|
(FTP)
|
||||||
Reverses the initiator/listener roles when connecting with ftp. This
|
Reverses the initiator/listener roles when connecting with ftp. This
|
||||||
@@ -286,6 +355,8 @@ i.e "my.host.domain" to specify machine
|
|||||||
.B "-"
|
.B "-"
|
||||||
(any single-letter string) to make it pick the machine's default
|
(any single-letter string) to make it pick the machine's default
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-q"
|
.IP "-q"
|
||||||
If used as the first parameter on the command line, the
|
If used as the first parameter on the command line, the
|
||||||
.I $HOME/.curlrc
|
.I $HOME/.curlrc
|
||||||
@@ -298,6 +369,8 @@ transfer is taking place. To make commands take place after a successful
|
|||||||
transfer, prefix them with a dash '-'. You may specify any amount of commands
|
transfer, prefix them with a dash '-'. You may specify any amount of commands
|
||||||
to be run before and after the transfer. If the server returns failure for one
|
to be run before and after the transfer. If the server returns failure for one
|
||||||
of the commands, the entire operation will be aborted.
|
of the commands, the entire operation will be aborted.
|
||||||
|
|
||||||
|
This option can be used multiple times.
|
||||||
.IP "-r/--range <range>"
|
.IP "-r/--range <range>"
|
||||||
(HTTP/FTP)
|
(HTTP/FTP)
|
||||||
Retrieve a byte range (i.e a partial document) from a HTTP/1.1 or FTP
|
Retrieve a byte range (i.e a partial document) from a HTTP/1.1 or FTP
|
||||||
@@ -335,11 +408,17 @@ document.
|
|||||||
|
|
||||||
FTP range downloads only support the simple syntax 'start-stop' (optionally
|
FTP range downloads only support the simple syntax 'start-stop' (optionally
|
||||||
with one of the numbers omitted). It depends on the non-RFC command SIZE.
|
with one of the numbers omitted). It depends on the non-RFC command SIZE.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-s/--silent"
|
.IP "-s/--silent"
|
||||||
Silent mode. Don't show progress meter or error messages. Makes
|
Silent mode. Don't show progress meter or error messages. Makes
|
||||||
Curl mute.
|
Curl mute.
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable mute.
|
||||||
.IP "-S/--show-error"
|
.IP "-S/--show-error"
|
||||||
When used with -s it makes curl show error message if it fails.
|
When used with -s it makes curl show error message if it fails.
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable show error.
|
||||||
.IP "-t/--upload"
|
.IP "-t/--upload"
|
||||||
.B Deprecated. Use '-T -' instead.
|
.B Deprecated. Use '-T -' instead.
|
||||||
Transfer the stdin data to the specified file. Curl will read
|
Transfer the stdin data to the specified file. Curl will read
|
||||||
@@ -353,21 +432,35 @@ really prove to Curl that there is no file name or curl will
|
|||||||
think that your last directory name is the remote file name to
|
think that your last directory name is the remote file name to
|
||||||
use. That will most likely cause the upload operation to fail. If
|
use. That will most likely cause the upload operation to fail. If
|
||||||
this is used on a http(s) server, the PUT command will be used.
|
this is used on a http(s) server, the PUT command will be used.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-u/--user <user:password>"
|
.IP "-u/--user <user:password>"
|
||||||
Specify user and password to use when fetching. See README.curl for detailed
|
Specify user and password to use when fetching. See README.curl for detailed
|
||||||
examples of how to use this. If no password is specified, curl will
|
examples of how to use this. If no password is specified, curl will
|
||||||
ask for it interactively.
|
ask for it interactively.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-U/--proxy-user <user:password>"
|
.IP "-U/--proxy-user <user:password>"
|
||||||
Specify user and password to use for Proxy authentication. If no
|
Specify user and password to use for Proxy authentication. If no
|
||||||
password is specified, curl will ask for it interactively.
|
password is specified, curl will ask for it interactively.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "--url <URL>"
|
.IP "--url <URL>"
|
||||||
Set the URL to fetch. This option is mostly handy when you wanna specify URL
|
Specify a URL to fetch. This option is mostly handy when you wanna specify
|
||||||
in a config file.
|
URL(s) in a config file.
|
||||||
|
|
||||||
|
This option may be used any number of times. To control where this URL is written, use the
|
||||||
|
.I -o
|
||||||
|
or the
|
||||||
|
.I -O
|
||||||
|
options.
|
||||||
.IP "-v/--verbose"
|
.IP "-v/--verbose"
|
||||||
Makes the fetching more verbose/talkative. Mostly usable for
|
Makes the fetching more verbose/talkative. Mostly usable for
|
||||||
debugging. Lines starting with '>' means data sent by curl, '<'
|
debugging. Lines starting with '>' means data sent by curl, '<'
|
||||||
means data received by curl that is hidden in normal cases and lines
|
means data received by curl that is hidden in normal cases and lines
|
||||||
starting with '*' means additional info provided by curl.
|
starting with '*' means additional info provided by curl.
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable verbose.
|
||||||
.IP "-V/--version"
|
.IP "-V/--version"
|
||||||
Displays the full version of curl, libcurl and other 3rd party libraries
|
Displays the full version of curl, libcurl and other 3rd party libraries
|
||||||
linked with the executable.
|
linked with the executable.
|
||||||
@@ -433,9 +526,13 @@ The average download speed that curl measured for the complete download.
|
|||||||
.B speed_upload
|
.B speed_upload
|
||||||
The average upload speed that curl measured for the complete upload.
|
The average upload speed that curl measured for the complete upload.
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-x/--proxy <proxyhost[:port]>"
|
.IP "-x/--proxy <proxyhost[:port]>"
|
||||||
Use specified proxy. If the port number is not specified, it is assumed at
|
Use specified proxy. If the port number is not specified, it is assumed at
|
||||||
port 1080.
|
port 1080.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-X/--request <command>"
|
.IP "-X/--request <command>"
|
||||||
(HTTP)
|
(HTTP)
|
||||||
Specifies a custom request to use when communicating with the HTTP server.
|
Specifies a custom request to use when communicating with the HTTP server.
|
||||||
@@ -445,14 +542,20 @@ HTTP 1.1 specification for details and explanations.
|
|||||||
(FTP)
|
(FTP)
|
||||||
Specifies a custom FTP command to use instead of LIST when doing file lists
|
Specifies a custom FTP command to use instead of LIST when doing file lists
|
||||||
with ftp.
|
with ftp.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-y/--speed-time <time>"
|
.IP "-y/--speed-time <time>"
|
||||||
If a download is slower than speed-limit bytes per second during a speed-time
|
If a download is slower than speed-limit bytes per second during a speed-time
|
||||||
period, the download gets aborted. If speed-time is used, the default
|
period, the download gets aborted. If speed-time is used, the default
|
||||||
speed-limit will be 1 unless set with -y.
|
speed-limit will be 1 unless set with -y.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-Y/--speed-limit <speed>"
|
.IP "-Y/--speed-limit <speed>"
|
||||||
If a download is slower than this given speed, in bytes per second, for
|
If a download is slower than this given speed, in bytes per second, for
|
||||||
speed-time seconds it gets aborted. speed-time is set with -Y and is 30 if
|
speed-time seconds it gets aborted. speed-time is set with -Y and is 30 if
|
||||||
not set.
|
not set.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-z/--time-cond <date expression>"
|
.IP "-z/--time-cond <date expression>"
|
||||||
(HTTP)
|
(HTTP)
|
||||||
Request to get a file that has been modified later than the given time and
|
Request to get a file that has been modified later than the given time and
|
||||||
@@ -467,6 +570,8 @@ man pages for date expression details.
|
|||||||
Start the date expression with a dash (-) to make it request for a document
|
Start the date expression with a dash (-) to make it request for a document
|
||||||
that is older than the given date/time, default is a document that is newer
|
that is older than the given date/time, default is a document that is newer
|
||||||
than the specified date/time.
|
than the specified date/time.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.IP "-3/--sslv3"
|
.IP "-3/--sslv3"
|
||||||
(HTTPS)
|
(HTTPS)
|
||||||
Forces curl to use SSL version 3 when negotiating with a remote SSL server.
|
Forces curl to use SSL version 3 when negotiating with a remote SSL server.
|
||||||
@@ -476,12 +581,18 @@ Forces curl to use SSL version 2 when negotiating with a remote SSL server.
|
|||||||
.IP "-#/--progress-bar"
|
.IP "-#/--progress-bar"
|
||||||
Make curl display progress information as a progress bar instead of the
|
Make curl display progress information as a progress bar instead of the
|
||||||
default statistics.
|
default statistics.
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable the progress bar.
|
||||||
.IP "--crlf"
|
.IP "--crlf"
|
||||||
(FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
|
(FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
|
||||||
|
|
||||||
|
If this option is used twice, the second will again disable crlf converting.
|
||||||
.IP "--stderr <file>"
|
.IP "--stderr <file>"
|
||||||
Redirect all writes to stderr to the specified file instead. If the file name
|
Redirect all writes to stderr to the specified file instead. If the file name
|
||||||
is a plain '-', it is instead written to stdout. This option has no point when
|
is a plain '-', it is instead written to stdout. This option has no point when
|
||||||
you're using a shell with decent redirecting capabilities.
|
you're using a shell with decent redirecting capabilities.
|
||||||
|
|
||||||
|
If this option is used serveral times, the last one will be used.
|
||||||
.SH FILES
|
.SH FILES
|
||||||
.I ~/.curlrc
|
.I ~/.curlrc
|
||||||
.RS
|
.RS
|
||||||
@@ -668,6 +779,7 @@ If you do find bugs, mail them to curl-bug@haxx.se.
|
|||||||
- T. Bharath <TBharath@responsenetworks.com>
|
- T. Bharath <TBharath@responsenetworks.com>
|
||||||
- Alexander Kourakos <awk@users.sourceforge.net>
|
- Alexander Kourakos <awk@users.sourceforge.net>
|
||||||
- James Griffiths <griffiths_james@yahoo.com>
|
- James Griffiths <griffiths_james@yahoo.com>
|
||||||
|
- Loic Dachary <loic@senga.org>
|
||||||
|
|
||||||
.SH WWW
|
.SH WWW
|
||||||
http://curl.haxx.se
|
http://curl.haxx.se
|
||||||
|
11
docs/examples/Makefile.am
Normal file
11
docs/examples/Makefile.am
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = foreign no-dependencies
|
||||||
|
|
||||||
|
EXTRA_DIST =
|
||||||
|
README curlgtk.c sepheaders.c simple.c
|
||||||
|
|
||||||
|
all:
|
||||||
|
@echo "done"
|
@@ -7,38 +7,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
/* The include stuff here is mainly for time_t! */
|
/* The include stuff here is mainly for time_t! */
|
||||||
@@ -452,8 +435,10 @@ typedef enum {
|
|||||||
|
|
||||||
NOTE: they return TRUE if the strings match *case insensitively*.
|
NOTE: they return TRUE if the strings match *case insensitively*.
|
||||||
*/
|
*/
|
||||||
extern int (strequal)(const char *s1, const char *s2);
|
extern int (Curl_strequal)(const char *s1, const char *s2);
|
||||||
extern int (strnequal)(const char *s1, const char *s2, size_t n);
|
extern int (Curl_strnequal)(const char *s1, const char *s2, size_t n);
|
||||||
|
#define strequal(a,b) Curl_strequal(a,b)
|
||||||
|
#define strnequal(a,b,c) Curl_strnequal(a,b,c)
|
||||||
|
|
||||||
/* external form function */
|
/* external form function */
|
||||||
int curl_formparse(char *string,
|
int curl_formparse(char *string,
|
||||||
@@ -471,8 +456,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.5.2-pre1"
|
#define LIBCURL_VERSION "7.6-pre3"
|
||||||
#define LIBCURL_VERSION_NUM 0x070502
|
#define LIBCURL_VERSION_NUM 0x070600
|
||||||
|
|
||||||
/* linked-list structure for the CURLOPT_QUOTE option (and other) */
|
/* linked-list structure for the CURLOPT_QUOTE option (and other) */
|
||||||
struct curl_slist {
|
struct curl_slist {
|
||||||
|
@@ -7,38 +7,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <Daniel.Stenberg@haxx.nu>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.nu
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@@ -2,27 +2,14 @@
|
|||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
* copyright notice and this permission notice appear in all copies.
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
* the License for the specific language governing rights and limitations
|
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
|
||||||
* under the License.
|
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
|
||||||
*
|
|
||||||
* The Original Code is Triacle.
|
|
||||||
*
|
|
||||||
* The Initial Developers of the Original Code are Bjorn Reese and
|
|
||||||
* Daniel Stenberg.
|
|
||||||
*
|
|
||||||
* Portions created by Initial Developers are
|
|
||||||
*
|
|
||||||
* Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*
|
*
|
||||||
*************************************************************************
|
*************************************************************************
|
||||||
*
|
*
|
||||||
@@ -68,26 +55,28 @@
|
|||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
int mprintf(const char *format, ...);
|
int curl_mprintf(const char *format, ...);
|
||||||
int mfprintf(FILE *fd, const char *format, ...);
|
int curl_mfprintf(FILE *fd, const char *format, ...);
|
||||||
int msprintf(char *buffer, const char *format, ...);
|
int curl_msprintf(char *buffer, const char *format, ...);
|
||||||
int msnprintf(char *buffer, size_t maxlength, const char *format, ...);
|
int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...);
|
||||||
int mvprintf(const char *format, va_list args);
|
int curl_mvprintf(const char *format, va_list args);
|
||||||
int mvfprintf(FILE *fd, const char *format, va_list args);
|
int curl_mvfprintf(FILE *fd, const char *format, va_list args);
|
||||||
int mvsprintf(char *buffer, const char *format, va_list args);
|
int curl_mvsprintf(char *buffer, const char *format, va_list args);
|
||||||
int mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args);
|
int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args);
|
||||||
char *maprintf(const char *format, ...);
|
char *curl_maprintf(const char *format, ...);
|
||||||
char *mvaprintf(const char *format, va_list args);
|
char *curl_mvaprintf(const char *format, va_list args);
|
||||||
|
|
||||||
#ifdef _MPRINTF_REPLACE
|
#ifdef _MPRINTF_REPLACE
|
||||||
# define printf mprintf
|
# define printf curl_mprintf
|
||||||
# define fprintf mfprintf
|
# define fprintf curl_mfprintf
|
||||||
# define sprintf msprintf
|
# define sprintf curl_msprintf
|
||||||
# define snprintf msnprintf
|
# define snprintf curl_msnprintf
|
||||||
# define vprintf mvprintf
|
# define vprintf curl_mvprintf
|
||||||
# define vfprintf mvfprintf
|
# define vfprintf curl_mvfprintf
|
||||||
# define vsprintf mvsprintf
|
# define vsprintf curl_mvsprintf
|
||||||
# define vsnprintf mvsnprintf
|
# define vsnprintf curl_mvsnprintf
|
||||||
|
# define aprintf curl_maprintf
|
||||||
|
# define vaprintf curl_mvaprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* H_MPRINTF */
|
#endif /* H_MPRINTF */
|
||||||
|
@@ -7,38 +7,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <Daniel.Stenberg@haxx.nu>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.nu
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@@ -7,38 +7,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
typedef void CURL;
|
typedef void CURL;
|
||||||
typedef void CURLconnect;
|
typedef void CURLconnect;
|
||||||
|
|
||||||
|
@@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
AUTOMAKE_OPTIONS = foreign
|
AUTOMAKE_OPTIONS = foreign
|
||||||
|
|
||||||
|
EXTRA_DIST = getdate.y \
|
||||||
|
Makefile.b32 Makefile.b32.resp Makefile.m32 Makefile.vc6 \
|
||||||
|
libcurl.def dllinit.c
|
||||||
|
|
||||||
lib_LTLIBRARIES = libcurl.la
|
lib_LTLIBRARIES = libcurl.la
|
||||||
|
|
||||||
# Some flags needed when trying to cause warnings ;-)
|
# Some flags needed when trying to cause warnings ;-)
|
||||||
@@ -49,12 +53,14 @@ cookie.c formdata.h http.c sendf.c \
|
|||||||
cookie.h ftp.c http.h sendf.h url.c \
|
cookie.h ftp.c http.h sendf.h url.c \
|
||||||
dict.c ftp.h if2ip.c speedcheck.c url.h \
|
dict.c ftp.h if2ip.c speedcheck.c url.h \
|
||||||
dict.h getdate.c if2ip.h speedcheck.h urldata.h \
|
dict.h getdate.c if2ip.h speedcheck.h urldata.h \
|
||||||
download.c getdate.h ldap.c ssluse.c version.c \
|
getdate.h ldap.c ssluse.c version.c \
|
||||||
download.h getenv.c ldap.h ssluse.h \
|
getenv.c ldap.h ssluse.h \
|
||||||
escape.c getenv.h mprintf.c telnet.c \
|
escape.c getenv.h mprintf.c telnet.c \
|
||||||
escape.h getpass.c netrc.c telnet.h \
|
escape.h getpass.c netrc.c telnet.h \
|
||||||
getinfo.c highlevel.c strequal.c strequal.h easy.c \
|
getinfo.c transfer.c strequal.c strequal.h easy.c \
|
||||||
security.h security.c krb4.c memdebug.c memdebug.h
|
security.h security.c krb4.c krb4.h memdebug.c memdebug.h inet_ntoa_r.h
|
||||||
|
|
||||||
|
noinst_HEADERS = setup.h transfer.h
|
||||||
|
|
||||||
# Say $(srcdir), so GNU make does not report an ambiguity with the .y.c rule.
|
# Say $(srcdir), so GNU make does not report an ambiguity with the .y.c rule.
|
||||||
$(srcdir)/getdate.c: getdate.y
|
$(srcdir)/getdate.c: getdate.y
|
||||||
|
@@ -29,7 +29,7 @@ LIBCURLLIB = libcurl.lib
|
|||||||
SOURCES = \
|
SOURCES = \
|
||||||
base64.c \
|
base64.c \
|
||||||
cookie.c \
|
cookie.c \
|
||||||
download.c \
|
transfer.c \
|
||||||
escape.c \
|
escape.c \
|
||||||
formdata.c \
|
formdata.c \
|
||||||
ftp.c \
|
ftp.c \
|
||||||
@@ -54,7 +54,6 @@ SOURCES = \
|
|||||||
getinfo.c \
|
getinfo.c \
|
||||||
version.c \
|
version.c \
|
||||||
easy.c \
|
easy.c \
|
||||||
highlevel.c \
|
|
||||||
strequal.c
|
strequal.c
|
||||||
|
|
||||||
OBJECTS = $(SOURCES:.c=.obj)
|
OBJECTS = $(SOURCES:.c=.obj)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
+base64.obj &
|
+base64.obj &
|
||||||
+cookie.obj &
|
+cookie.obj &
|
||||||
+download.obj &
|
+transfer.obj &
|
||||||
+escape.obj &
|
+escape.obj &
|
||||||
+formdata.obj &
|
+formdata.obj &
|
||||||
+ftp.obj &
|
+ftp.obj &
|
||||||
@@ -25,5 +25,4 @@
|
|||||||
+getinfo.obj &
|
+getinfo.obj &
|
||||||
+version.obj &
|
+version.obj &
|
||||||
+easy.obj &
|
+easy.obj &
|
||||||
+highlevel.obj &
|
|
||||||
+strequal.obj
|
+strequal.obj
|
||||||
|
357
lib/Makefile.in
357
lib/Makefile.in
@@ -1,357 +0,0 @@
|
|||||||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
#
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
SHELL = @SHELL@
|
|
||||||
|
|
||||||
srcdir = @srcdir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
|
|
||||||
bindir = @bindir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
datadir = @datadir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
libdir = @libdir@
|
|
||||||
infodir = @infodir@
|
|
||||||
mandir = @mandir@
|
|
||||||
includedir = @includedir@
|
|
||||||
oldincludedir = /usr/include
|
|
||||||
|
|
||||||
DESTDIR =
|
|
||||||
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
|
|
||||||
top_builddir = ..
|
|
||||||
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
transform = @program_transform_name@
|
|
||||||
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_triplet = @host@
|
|
||||||
AS = @AS@
|
|
||||||
CC = @CC@
|
|
||||||
DLLTOOL = @DLLTOOL@
|
|
||||||
LIBTOOL = @LIBTOOL@
|
|
||||||
LN_S = @LN_S@
|
|
||||||
MAKEINFO = @MAKEINFO@
|
|
||||||
NROFF = @NROFF@
|
|
||||||
OBJDUMP = @OBJDUMP@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
PERL = @PERL@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
YACC = @YACC@
|
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = foreign
|
|
||||||
|
|
||||||
lib_LTLIBRARIES = libcurl.la
|
|
||||||
|
|
||||||
# Some flags needed when trying to cause warnings ;-)
|
|
||||||
# CFLAGS = -DMALLOCDEBUG -g # -Wall #-pedantic
|
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/include
|
|
||||||
|
|
||||||
libcurl_la_LDFLAGS = -version-info 1:0:0
|
|
||||||
# This flag accepts an argument of the form current[:revision[:age]]. So,
|
|
||||||
# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
|
|
||||||
# 1.
|
|
||||||
#
|
|
||||||
# If either revision or age are omitted, they default to 0. Also note that age
|
|
||||||
# must be less than or equal to the current interface number.
|
|
||||||
#
|
|
||||||
# Here are a set of rules to help you update your library version information:
|
|
||||||
#
|
|
||||||
# 1.Start with version information of 0:0:0 for each libtool library.
|
|
||||||
#
|
|
||||||
# 2.Update the version information only immediately before a public release of
|
|
||||||
# your software. More frequent updates are unnecessary, and only guarantee
|
|
||||||
# that the current interface number gets larger faster.
|
|
||||||
#
|
|
||||||
# 3.If the library source code has changed at all since the last update, then
|
|
||||||
# increment revision (c:r:a becomes c:r+1:a).
|
|
||||||
#
|
|
||||||
# 4.If any interfaces have been added, removed, or changed since the last
|
|
||||||
# update, increment current, and set revision to 0.
|
|
||||||
#
|
|
||||||
# 5.If any interfaces have been added since the last public release, then
|
|
||||||
# increment age.
|
|
||||||
#
|
|
||||||
# 6.If any interfaces have been removed since the last public release, then
|
|
||||||
# set age to 0.
|
|
||||||
#
|
|
||||||
|
|
||||||
libcurl_la_SOURCES = arpa_telnet.h file.c getpass.h netrc.h timeval.c base64.c file.h hostip.c progress.c timeval.h base64.h formdata.c hostip.h progress.h cookie.c formdata.h http.c sendf.c cookie.h ftp.c http.h sendf.h url.c dict.c ftp.h if2ip.c speedcheck.c url.h dict.h getdate.c if2ip.h speedcheck.h urldata.h download.c getdate.h ldap.c ssluse.c version.c download.h getenv.c ldap.h ssluse.h escape.c getenv.h mprintf.c telnet.c escape.h getpass.c netrc.c telnet.h getinfo.c highlevel.c strequal.c strequal.h easy.c security.h security.c krb4.c memdebug.c memdebug.h
|
|
||||||
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
|
||||||
CONFIG_HEADER = ../config.h ../src/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
|
||||||
|
|
||||||
|
|
||||||
DEFS = @DEFS@ -I. -I$(srcdir) -I.. -I../src
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
libcurl_la_LIBADD =
|
|
||||||
libcurl_la_OBJECTS = file.lo timeval.lo base64.lo hostip.lo progress.lo \
|
|
||||||
formdata.lo cookie.lo http.lo sendf.lo ftp.lo url.lo dict.lo if2ip.lo \
|
|
||||||
speedcheck.lo getdate.lo download.lo ldap.lo ssluse.lo version.lo \
|
|
||||||
getenv.lo escape.lo mprintf.lo telnet.lo getpass.lo netrc.lo getinfo.lo \
|
|
||||||
highlevel.lo strequal.lo easy.lo security.lo krb4.lo memdebug.lo
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
|
||||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
|
||||||
CCLD = $(CC)
|
|
||||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
|
||||||
DIST_COMMON = Makefile.am Makefile.in
|
|
||||||
|
|
||||||
|
|
||||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
|
|
||||||
TAR = gtar
|
|
||||||
GZIP_ENV = --best
|
|
||||||
SOURCES = $(libcurl_la_SOURCES)
|
|
||||||
OBJECTS = $(libcurl_la_OBJECTS)
|
|
||||||
|
|
||||||
all: all-redirect
|
|
||||||
.SUFFIXES:
|
|
||||||
.SUFFIXES: .S .c .lo .o .s
|
|
||||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
|
||||||
cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps lib/Makefile
|
|
||||||
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
cd $(top_builddir) \
|
|
||||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
|
||||||
|
|
||||||
|
|
||||||
mostlyclean-libLTLIBRARIES:
|
|
||||||
|
|
||||||
clean-libLTLIBRARIES:
|
|
||||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
|
||||||
|
|
||||||
distclean-libLTLIBRARIES:
|
|
||||||
|
|
||||||
maintainer-clean-libLTLIBRARIES:
|
|
||||||
|
|
||||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
|
||||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
|
||||||
if test -f $$p; then \
|
|
||||||
echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
|
|
||||||
$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
|
|
||||||
else :; fi; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-libLTLIBRARIES:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
|
||||||
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
|
|
||||||
done
|
|
||||||
|
|
||||||
.c.o:
|
|
||||||
$(COMPILE) -c $<
|
|
||||||
|
|
||||||
.s.o:
|
|
||||||
$(COMPILE) -c $<
|
|
||||||
|
|
||||||
.S.o:
|
|
||||||
$(COMPILE) -c $<
|
|
||||||
|
|
||||||
mostlyclean-compile:
|
|
||||||
-rm -f *.o core *.core
|
|
||||||
|
|
||||||
clean-compile:
|
|
||||||
|
|
||||||
distclean-compile:
|
|
||||||
-rm -f *.tab.c
|
|
||||||
|
|
||||||
maintainer-clean-compile:
|
|
||||||
|
|
||||||
.c.lo:
|
|
||||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
|
||||||
|
|
||||||
.s.lo:
|
|
||||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
|
||||||
|
|
||||||
.S.lo:
|
|
||||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
|
||||||
|
|
||||||
mostlyclean-libtool:
|
|
||||||
-rm -f *.lo
|
|
||||||
|
|
||||||
clean-libtool:
|
|
||||||
-rm -rf .libs _libs
|
|
||||||
|
|
||||||
distclean-libtool:
|
|
||||||
|
|
||||||
maintainer-clean-libtool:
|
|
||||||
|
|
||||||
libcurl.la: $(libcurl_la_OBJECTS) $(libcurl_la_DEPENDENCIES)
|
|
||||||
$(LINK) -rpath $(libdir) $(libcurl_la_LDFLAGS) $(libcurl_la_OBJECTS) $(libcurl_la_LIBADD) $(LIBS)
|
|
||||||
|
|
||||||
tags: TAGS
|
|
||||||
|
|
||||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
|
||||||
list='$(SOURCES) $(HEADERS)'; \
|
|
||||||
unique=`for i in $$list; do echo $$i; done | \
|
|
||||||
awk ' { files[$$0] = 1; } \
|
|
||||||
END { for (i in files) print i; }'`; \
|
|
||||||
here=`pwd` && cd $(srcdir) \
|
|
||||||
&& mkid -f$$here/ID $$unique $(LISP)
|
|
||||||
|
|
||||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
|
||||||
tags=; \
|
|
||||||
here=`pwd`; \
|
|
||||||
list='$(SOURCES) $(HEADERS)'; \
|
|
||||||
unique=`for i in $$list; do echo $$i; done | \
|
|
||||||
awk ' { files[$$0] = 1; } \
|
|
||||||
END { for (i in files) print i; }'`; \
|
|
||||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
|
||||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
|
||||||
|
|
||||||
mostlyclean-tags:
|
|
||||||
|
|
||||||
clean-tags:
|
|
||||||
|
|
||||||
distclean-tags:
|
|
||||||
-rm -f TAGS ID
|
|
||||||
|
|
||||||
maintainer-clean-tags:
|
|
||||||
|
|
||||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
|
||||||
|
|
||||||
subdir = lib
|
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
|
||||||
@for file in $(DISTFILES); do \
|
|
||||||
d=$(srcdir); \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
cp -pr $$/$$file $(distdir)/$$file; \
|
|
||||||
else \
|
|
||||||
test -f $(distdir)/$$file \
|
|
||||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
|
||||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
info-am:
|
|
||||||
info: info-am
|
|
||||||
dvi-am:
|
|
||||||
dvi: dvi-am
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
installcheck-am:
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-exec-am: install-libLTLIBRARIES
|
|
||||||
install-exec: install-exec-am
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
install-data: install-data-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
install: install-am
|
|
||||||
uninstall-am: uninstall-libLTLIBRARIES
|
|
||||||
uninstall: uninstall-am
|
|
||||||
all-am: Makefile $(LTLIBRARIES)
|
|
||||||
all-redirect: all-am
|
|
||||||
install-strip:
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
|
||||||
installdirs:
|
|
||||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
|
||||||
|
|
||||||
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
|
||||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \
|
|
||||||
mostlyclean-libtool mostlyclean-tags \
|
|
||||||
mostlyclean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \
|
|
||||||
clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
distclean-am: distclean-libLTLIBRARIES distclean-compile \
|
|
||||||
distclean-libtool distclean-tags distclean-generic \
|
|
||||||
clean-am
|
|
||||||
-rm -f libtool
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
|
|
||||||
maintainer-clean-am: maintainer-clean-libLTLIBRARIES \
|
|
||||||
maintainer-clean-compile maintainer-clean-libtool \
|
|
||||||
maintainer-clean-tags maintainer-clean-generic \
|
|
||||||
distclean-am
|
|
||||||
@echo "This command is intended for maintainers to use;"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
|
|
||||||
.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
|
|
||||||
clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
|
|
||||||
uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
|
|
||||||
distclean-compile clean-compile maintainer-clean-compile \
|
|
||||||
mostlyclean-libtool distclean-libtool clean-libtool \
|
|
||||||
maintainer-clean-libtool tags mostlyclean-tags distclean-tags \
|
|
||||||
clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
|
|
||||||
check-am installcheck-am installcheck install-exec-am install-exec \
|
|
||||||
install-data-am install-data install-am install uninstall-am uninstall \
|
|
||||||
all-redirect all-am all installdirs mostlyclean-generic \
|
|
||||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
|
||||||
mostlyclean distclean maintainer-clean
|
|
||||||
|
|
||||||
|
|
||||||
# Say $(srcdir), so GNU make does not report an ambiguity with the .y.c rule.
|
|
||||||
$(srcdir)/getdate.c: getdate.y
|
|
||||||
cd $(srcdir) && \
|
|
||||||
$(YACC) $(YFLAGS) getdate.y; \
|
|
||||||
mv -f y.tab.c getdate.c
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
@@ -30,16 +30,16 @@ libcurl_a_SOURCES = arpa_telnet.h file.c getpass.h netrc.h timeval.c base64.c \
|
|||||||
file.h hostip.c progress.c timeval.h base64.h formdata.c hostip.h progress.h \
|
file.h hostip.c progress.c timeval.h base64.h formdata.c hostip.h progress.h \
|
||||||
cookie.c formdata.h http.c sendf.c cookie.h ftp.c http.h sendf.h url.c dict.c \
|
cookie.c formdata.h http.c sendf.c cookie.h ftp.c http.h sendf.h url.c dict.c \
|
||||||
ftp.h if2ip.c speedcheck.c url.h dict.h getdate.c if2ip.h speedcheck.h \
|
ftp.h if2ip.c speedcheck.c url.h dict.h getdate.c if2ip.h speedcheck.h \
|
||||||
urldata.h download.c getdate.h ldap.c ssluse.c version.c download.h getenv.c \
|
urldata.h transfer.c getdate.h ldap.c ssluse.c version.c transfer.h getenv.c \
|
||||||
ldap.h ssluse.h escape.c getenv.h mprintf.c telnet.c escape.h getpass.c netrc.c \
|
ldap.h ssluse.h escape.c getenv.h mprintf.c telnet.c escape.h getpass.c netrc.c \
|
||||||
telnet.h getinfo.c highlevel.c strequal.c strequal.h easy.c security.h \
|
telnet.h getinfo.c strequal.c strequal.h easy.c security.h \
|
||||||
security.c krb4.c
|
security.c krb4.c
|
||||||
|
|
||||||
libcurl_a_OBJECTS = file.o timeval.o base64.o hostip.o progress.o \
|
libcurl_a_OBJECTS = file.o timeval.o base64.o hostip.o progress.o \
|
||||||
formdata.o cookie.o http.o sendf.o ftp.o url.o dict.o if2ip.o \
|
formdata.o cookie.o http.o sendf.o ftp.o url.o dict.o if2ip.o \
|
||||||
speedcheck.o getdate.o download.o ldap.o ssluse.o version.o \
|
speedcheck.o getdate.o transfer.o ldap.o ssluse.o version.o \
|
||||||
getenv.o escape.o mprintf.o telnet.o getpass.o netrc.o getinfo.o \
|
getenv.o escape.o mprintf.o telnet.o getpass.o netrc.o getinfo.o \
|
||||||
highlevel.o strequal.o easy.o security.o krb4.o
|
strequal.o easy.o security.o krb4.o
|
||||||
|
|
||||||
LIBRARIES = $(libcurl_a_LIBRARIES)
|
LIBRARIES = $(libcurl_a_LIBRARIES)
|
||||||
SOURCES = $(libcurl_a_SOURCES)
|
SOURCES = $(libcurl_a_SOURCES)
|
||||||
|
@@ -33,7 +33,7 @@ LINKSLIBS = libeay32.lib ssleay32.lib RSAglue.lib
|
|||||||
RELEASE_OBJS= \
|
RELEASE_OBJS= \
|
||||||
base64r.obj \
|
base64r.obj \
|
||||||
cookier.obj \
|
cookier.obj \
|
||||||
downloadr.obj \
|
transferr.obj \
|
||||||
escaper.obj \
|
escaper.obj \
|
||||||
formdatar.obj \
|
formdatar.obj \
|
||||||
ftpr.obj \
|
ftpr.obj \
|
||||||
@@ -58,13 +58,12 @@ RELEASE_OBJS= \
|
|||||||
getinfor.obj \
|
getinfor.obj \
|
||||||
versionr.obj \
|
versionr.obj \
|
||||||
easyr.obj \
|
easyr.obj \
|
||||||
highlevelr.obj \
|
|
||||||
strequalr.obj
|
strequalr.obj
|
||||||
|
|
||||||
DEBUG_OBJS= \
|
DEBUG_OBJS= \
|
||||||
base64d.obj \
|
base64d.obj \
|
||||||
cookied.obj \
|
cookied.obj \
|
||||||
downloadd.obj \
|
transferd.obj \
|
||||||
escaped.obj \
|
escaped.obj \
|
||||||
formdatad.obj \
|
formdatad.obj \
|
||||||
ftpd.obj \
|
ftpd.obj \
|
||||||
@@ -89,13 +88,12 @@ DEBUG_OBJS= \
|
|||||||
getinfod.obj \
|
getinfod.obj \
|
||||||
versiond.obj \
|
versiond.obj \
|
||||||
easyd.obj \
|
easyd.obj \
|
||||||
highleveld.obj \
|
|
||||||
strequald.obj
|
strequald.obj
|
||||||
|
|
||||||
RELEASE_SSL_OBJS= \
|
RELEASE_SSL_OBJS= \
|
||||||
base64rs.obj \
|
base64rs.obj \
|
||||||
cookiers.obj \
|
cookiers.obj \
|
||||||
downloadrs.obj \
|
transferrs.obj \
|
||||||
escapers.obj \
|
escapers.obj \
|
||||||
formdatars.obj \
|
formdatars.obj \
|
||||||
ftprs.obj \
|
ftprs.obj \
|
||||||
@@ -120,13 +118,12 @@ RELEASE_SSL_OBJS= \
|
|||||||
getinfors.obj \
|
getinfors.obj \
|
||||||
versionrs.obj \
|
versionrs.obj \
|
||||||
easyrs.obj \
|
easyrs.obj \
|
||||||
highlevelrs.obj \
|
|
||||||
strequalrs.obj
|
strequalrs.obj
|
||||||
|
|
||||||
LINK_OBJS= \
|
LINK_OBJS= \
|
||||||
base64.obj \
|
base64.obj \
|
||||||
cookie.obj \
|
cookie.obj \
|
||||||
download.obj \
|
transfer.obj \
|
||||||
escape.obj \
|
escape.obj \
|
||||||
formdata.obj \
|
formdata.obj \
|
||||||
ftp.obj \
|
ftp.obj \
|
||||||
@@ -151,7 +148,6 @@ LINK_OBJS= \
|
|||||||
getinfo.obj \
|
getinfo.obj \
|
||||||
version.obj \
|
version.obj \
|
||||||
easy.obj \
|
easy.obj \
|
||||||
highlevel.obj \
|
|
||||||
strequal.obj
|
strequal.obj
|
||||||
|
|
||||||
all : release
|
all : release
|
||||||
@@ -170,8 +166,8 @@ base64r.obj: base64.c
|
|||||||
$(CCR) $(CFLAGS) base64.c
|
$(CCR) $(CFLAGS) base64.c
|
||||||
cookier.obj: cookie.c
|
cookier.obj: cookie.c
|
||||||
$(CCR) $(CFLAGS) cookie.c
|
$(CCR) $(CFLAGS) cookie.c
|
||||||
downloadr.obj: download.c
|
transferr.obj: transfer.c
|
||||||
$(CCR) $(CFLAGS) download.c
|
$(CCR) $(CFLAGS) transfer.c
|
||||||
escaper.obj: escape.c
|
escaper.obj: escape.c
|
||||||
$(CCR) $(CFLAGS) escape.c
|
$(CCR) $(CFLAGS) escape.c
|
||||||
formdatar.obj: formdata.c
|
formdatar.obj: formdata.c
|
||||||
@@ -220,8 +216,6 @@ versionr.obj: version.c
|
|||||||
$(CCR) $(CFLAGS) version.c
|
$(CCR) $(CFLAGS) version.c
|
||||||
easyr.obj: easy.c
|
easyr.obj: easy.c
|
||||||
$(CCR) $(CFLAGS) easy.c
|
$(CCR) $(CFLAGS) easy.c
|
||||||
highlevelr.obj: highlevel.c
|
|
||||||
$(CCR) $(CFLAGS) highlevel.c
|
|
||||||
strequalr.obj: strequal.c
|
strequalr.obj: strequal.c
|
||||||
$(CCR) $(CFLAGS) strequal.c
|
$(CCR) $(CFLAGS) strequal.c
|
||||||
|
|
||||||
@@ -230,8 +224,8 @@ base64d.obj: base64.c
|
|||||||
$(CCD) $(CFLAGS) base64.c
|
$(CCD) $(CFLAGS) base64.c
|
||||||
cookied.obj: cookie.c
|
cookied.obj: cookie.c
|
||||||
$(CCD) $(CFLAGS) cookie.c
|
$(CCD) $(CFLAGS) cookie.c
|
||||||
downloadd.obj: download.c
|
transferd.obj: transfer.c
|
||||||
$(CCD) $(CFLAGS) download.c
|
$(CCD) $(CFLAGS) transfer.c
|
||||||
escaped.obj: escape.c
|
escaped.obj: escape.c
|
||||||
$(CCD) $(CFLAGS) escape.c
|
$(CCD) $(CFLAGS) escape.c
|
||||||
formdatad.obj: formdata.c
|
formdatad.obj: formdata.c
|
||||||
@@ -280,8 +274,6 @@ versiond.obj: version.c
|
|||||||
$(CCD) $(CFLAGS) version.c
|
$(CCD) $(CFLAGS) version.c
|
||||||
easyd.obj: easy.c
|
easyd.obj: easy.c
|
||||||
$(CCD) $(CFLAGS) easy.c
|
$(CCD) $(CFLAGS) easy.c
|
||||||
highleveld.obj: highlevel.c
|
|
||||||
$(CCD) $(CFLAGS) highlevel.c
|
|
||||||
strequald.obj: strequal.c
|
strequald.obj: strequal.c
|
||||||
$(CCD) $(CFLAGS) strequal.c
|
$(CCD) $(CFLAGS) strequal.c
|
||||||
|
|
||||||
@@ -291,8 +283,8 @@ base64rs.obj: base64.c
|
|||||||
$(CCRS) $(CFLAGS) base64.c
|
$(CCRS) $(CFLAGS) base64.c
|
||||||
cookiers.obj: cookie.c
|
cookiers.obj: cookie.c
|
||||||
$(CCRS) $(CFLAGS) cookie.c
|
$(CCRS) $(CFLAGS) cookie.c
|
||||||
downloadrs.obj: download.c
|
transferrs.obj: transfer.c
|
||||||
$(CCRS) $(CFLAGS) download.c
|
$(CCRS) $(CFLAGS) transfer.c
|
||||||
escapers.obj: escape.c
|
escapers.obj: escape.c
|
||||||
$(CCRS) $(CFLAGS) escape.c
|
$(CCRS) $(CFLAGS) escape.c
|
||||||
formdatars.obj: formdata.c
|
formdatars.obj: formdata.c
|
||||||
@@ -341,8 +333,6 @@ versionrs.obj: version.c
|
|||||||
$(CCRS) $(CFLAGS) version.c
|
$(CCRS) $(CFLAGS) version.c
|
||||||
easyrs.obj: easy.c
|
easyrs.obj: easy.c
|
||||||
$(CCRS) $(CFLAGS) easy.c
|
$(CCRS) $(CFLAGS) easy.c
|
||||||
highlevelrs.obj: highlevel.c
|
|
||||||
$(CCRS) $(CFLAGS) highlevel.c
|
|
||||||
strequalrs.obj: strequal.c
|
strequalrs.obj: strequal.c
|
||||||
$(CCRS) $(CFLAGS) strequal.c
|
$(CCRS) $(CFLAGS) strequal.c
|
||||||
|
|
||||||
|
@@ -63,6 +63,7 @@
|
|||||||
#define SYNCH 242 /* for telfunc calls */
|
#define SYNCH 242 /* for telfunc calls */
|
||||||
|
|
||||||
#ifdef TELCMDS
|
#ifdef TELCMDS
|
||||||
|
static
|
||||||
char *telcmds[] = {
|
char *telcmds[] = {
|
||||||
"EOF", "SUSP", "ABORT", "EOR",
|
"EOF", "SUSP", "ABORT", "EOR",
|
||||||
"SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
|
"SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
|
||||||
@@ -124,6 +125,7 @@ extern char *telcmds[];
|
|||||||
|
|
||||||
#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
|
#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
|
||||||
#ifdef TELOPTS
|
#ifdef TELOPTS
|
||||||
|
static
|
||||||
char *telopts[NTELOPTS+1] = {
|
char *telopts[NTELOPTS+1] = {
|
||||||
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
|
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
|
||||||
"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
|
"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
|
||||||
|
@@ -55,7 +55,7 @@ static int pos(char c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
int base64_encode(const void *data, int size, char **str)
|
int Curl_base64_encode(const void *data, int size, char **str)
|
||||||
{
|
{
|
||||||
char *s, *p;
|
char *s, *p;
|
||||||
int i;
|
int i;
|
||||||
@@ -93,7 +93,7 @@ int base64_encode(const void *data, int size, char **str)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int base64_decode(const char *str, void *data)
|
int Curl_base64_decode(const char *str, void *data)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
unsigned char *q;
|
unsigned char *q;
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#ifndef __BASE64_H
|
#ifndef __BASE64_H
|
||||||
#define __BASE64_H
|
#define __BASE64_H
|
||||||
|
|
||||||
int base64_encode(const void *data, int size, char **str);
|
int Curl_base64_encode(const void *data, int size, char **str);
|
||||||
|
int Curl_base64_decode(const char *str, void *data);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
37
lib/cookie.c
37
lib/cookie.c
@@ -1,3 +1,25 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
*
|
||||||
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
|
*
|
||||||
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
|
||||||
@@ -78,7 +100,8 @@ Example set of cookies:
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
struct Cookie *cookie_add(struct CookieInfo *c,
|
struct Cookie *
|
||||||
|
Curl_cookie_add(struct CookieInfo *c,
|
||||||
bool httpheader, /* TRUE if HTTP header-style line */
|
bool httpheader, /* TRUE if HTTP header-style line */
|
||||||
char *lineptr) /* first non-space of the line */
|
char *lineptr) /* first non-space of the line */
|
||||||
{
|
{
|
||||||
@@ -325,7 +348,7 @@ struct Cookie *cookie_add(struct CookieInfo *c,
|
|||||||
* called before any cookies are set. File may be NULL.
|
* called before any cookies are set. File may be NULL.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
struct CookieInfo *cookie_init(char *file)
|
struct CookieInfo *Curl_cookie_init(char *file)
|
||||||
{
|
{
|
||||||
char line[MAX_COOKIE_LINE];
|
char line[MAX_COOKIE_LINE];
|
||||||
struct CookieInfo *c;
|
struct CookieInfo *c;
|
||||||
@@ -353,7 +376,7 @@ struct CookieInfo *cookie_init(char *file)
|
|||||||
while(*lineptr && isspace((int)*lineptr))
|
while(*lineptr && isspace((int)*lineptr))
|
||||||
lineptr++;
|
lineptr++;
|
||||||
|
|
||||||
cookie_add(c, TRUE, lineptr);
|
Curl_cookie_add(c, TRUE, lineptr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* This might be a netscape cookie-file line, get it! */
|
/* This might be a netscape cookie-file line, get it! */
|
||||||
@@ -361,7 +384,7 @@ struct CookieInfo *cookie_init(char *file)
|
|||||||
while(*lineptr && isspace((int)*lineptr))
|
while(*lineptr && isspace((int)*lineptr))
|
||||||
lineptr++;
|
lineptr++;
|
||||||
|
|
||||||
cookie_add(c, FALSE, lineptr);
|
Curl_cookie_add(c, FALSE, lineptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(fromfile)
|
if(fromfile)
|
||||||
@@ -383,7 +406,7 @@ struct CookieInfo *cookie_init(char *file)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
struct Cookie *cookie_getlist(struct CookieInfo *c,
|
struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
|
||||||
char *host, char *path, bool secure)
|
char *host, char *path, bool secure)
|
||||||
{
|
{
|
||||||
struct Cookie *newco;
|
struct Cookie *newco;
|
||||||
@@ -451,7 +474,7 @@ struct Cookie *cookie_getlist(struct CookieInfo *c,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void cookie_freelist(struct Cookie *co)
|
void Curl_cookie_freelist(struct Cookie *co)
|
||||||
{
|
{
|
||||||
struct Cookie *next;
|
struct Cookie *next;
|
||||||
if(co) {
|
if(co) {
|
||||||
@@ -471,7 +494,7 @@ void cookie_freelist(struct Cookie *co)
|
|||||||
* Free a "cookie object" previous created with cookie_init().
|
* Free a "cookie object" previous created with cookie_init().
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
void cookie_cleanup(struct CookieInfo *c)
|
void Curl_cookie_cleanup(struct CookieInfo *c)
|
||||||
{
|
{
|
||||||
struct Cookie *co;
|
struct Cookie *co;
|
||||||
struct Cookie *next;
|
struct Cookie *next;
|
||||||
|
32
lib/cookie.h
32
lib/cookie.h
@@ -1,5 +1,27 @@
|
|||||||
#ifndef __COOKIE_H
|
#ifndef __COOKIE_H
|
||||||
#define __COOKIE_H
|
#define __COOKIE_H
|
||||||
|
/*****************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
*
|
||||||
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
|
*
|
||||||
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@@ -41,10 +63,10 @@ struct CookieInfo {
|
|||||||
#define MAX_NAME 256
|
#define MAX_NAME 256
|
||||||
#define MAX_NAME_TXT "255"
|
#define MAX_NAME_TXT "255"
|
||||||
|
|
||||||
struct Cookie *cookie_add(struct CookieInfo *, bool, char *);
|
struct Cookie *Curl_cookie_add(struct CookieInfo *, bool, char *);
|
||||||
struct CookieInfo *cookie_init(char *);
|
struct CookieInfo *Curl_cookie_init(char *);
|
||||||
struct Cookie *cookie_getlist(struct CookieInfo *, char *, char *, bool);
|
struct Cookie *Curl_cookie_getlist(struct CookieInfo *, char *, char *, bool);
|
||||||
void cookie_freelist(struct Cookie *);
|
void Curl_cookie_freelist(struct Cookie *);
|
||||||
void cookie_cleanup(struct CookieInfo *);
|
void Curl_cookie_cleanup(struct CookieInfo *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
51
lib/dict.c
51
lib/dict.c
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -88,7 +71,7 @@
|
|||||||
|
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include "download.h"
|
#include "transfer.h"
|
||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
|
|
||||||
#include "progress.h"
|
#include "progress.h"
|
||||||
@@ -97,12 +80,12 @@
|
|||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
|
|
||||||
CURLcode dict_done(struct connectdata *conn)
|
CURLcode Curl_dict_done(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode dict(struct connectdata *conn)
|
CURLcode Curl_dict(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
int nth;
|
int nth;
|
||||||
char *word;
|
char *word;
|
||||||
@@ -171,7 +154,7 @@ CURLcode dict(struct connectdata *conn)
|
|||||||
word
|
word
|
||||||
);
|
);
|
||||||
|
|
||||||
result = Transfer(conn, data->firstsocket, -1, FALSE, bytecount,
|
result = Curl_Transfer(conn, data->firstsocket, -1, FALSE, bytecount,
|
||||||
-1, NULL); /* no upload */
|
-1, NULL); /* no upload */
|
||||||
|
|
||||||
if(result)
|
if(result)
|
||||||
@@ -219,7 +202,7 @@ CURLcode dict(struct connectdata *conn)
|
|||||||
word
|
word
|
||||||
);
|
);
|
||||||
|
|
||||||
result = Transfer(conn, data->firstsocket, -1, FALSE, bytecount,
|
result = Curl_Transfer(conn, data->firstsocket, -1, FALSE, bytecount,
|
||||||
-1, NULL); /* no upload */
|
-1, NULL); /* no upload */
|
||||||
|
|
||||||
if(result)
|
if(result)
|
||||||
@@ -243,7 +226,7 @@ CURLcode dict(struct connectdata *conn)
|
|||||||
"QUIT\n",
|
"QUIT\n",
|
||||||
ppath);
|
ppath);
|
||||||
|
|
||||||
result = Transfer(conn, data->firstsocket, -1, FALSE, bytecount,
|
result = Curl_Transfer(conn, data->firstsocket, -1, FALSE, bytecount,
|
||||||
-1, NULL);
|
-1, NULL);
|
||||||
|
|
||||||
if(result)
|
if(result)
|
||||||
|
43
lib/dict.h
43
lib/dict.h
@@ -8,39 +8,22 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
CURLcode Curl_dict(struct connectdata *conn);
|
||||||
* ------------------------------------------------------------
|
CURLcode Curl_dict_done(struct connectdata *conn);
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
CURLcode dict(struct connectdata *conn);
|
|
||||||
CURLcode dict_done(struct connectdata *conn);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
117
lib/download.c
117
lib/download.c
@@ -1,117 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* _ _ ____ _
|
|
||||||
* Project ___| | | | _ \| |
|
|
||||||
* / __| | | | |_) | |
|
|
||||||
* | (__| |_| | _ <| |___
|
|
||||||
* \___|\___/|_| \_\_____|
|
|
||||||
*
|
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* The Original Code is Curl.
|
|
||||||
*
|
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
|
||||||
*
|
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
|
||||||
#include <sys/types.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SYS_SELECT_H
|
|
||||||
#include <sys/select.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "urldata.h"
|
|
||||||
#include <curl/curl.h>
|
|
||||||
|
|
||||||
#ifdef __BEOS__
|
|
||||||
#include <net/socket.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#if !defined( __GNUC__) || defined(__MINGW32__)
|
|
||||||
#include <winsock.h>
|
|
||||||
#endif
|
|
||||||
#include <time.h> /* for the time_t typedef! */
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(TIME_WITH_SYS_TIME)
|
|
||||||
#include <sys/time.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "progress.h"
|
|
||||||
#include "speedcheck.h"
|
|
||||||
#include "sendf.h"
|
|
||||||
|
|
||||||
#include <curl/types.h>
|
|
||||||
|
|
||||||
/* --- download and upload a stream from/to a socket --- */
|
|
||||||
|
|
||||||
/* Parts of this function was brought to us by the friendly Mark Butler
|
|
||||||
<butlerm@xmission.com>. */
|
|
||||||
|
|
||||||
CURLcode
|
|
||||||
Transfer(CURLconnect *c_conn,
|
|
||||||
/* READ stuff */
|
|
||||||
int sockfd, /* socket to read from or -1 */
|
|
||||||
int size, /* -1 if unknown at this point */
|
|
||||||
bool getheader, /* TRUE if header parsing is wanted */
|
|
||||||
long *bytecountp, /* return number of bytes read or NULL */
|
|
||||||
|
|
||||||
/* WRITE stuff */
|
|
||||||
int writesockfd, /* socket to write to, it may very well be
|
|
||||||
the same we read from. -1 disables */
|
|
||||||
long *writebytecountp /* return number of bytes written or NULL */
|
|
||||||
)
|
|
||||||
{
|
|
||||||
struct connectdata *conn = (struct connectdata *)c_conn;
|
|
||||||
if(!conn)
|
|
||||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
|
||||||
|
|
||||||
/* now copy all input parameters */
|
|
||||||
conn->sockfd = sockfd;
|
|
||||||
conn->size = size;
|
|
||||||
conn->getheader = getheader;
|
|
||||||
conn->bytecountp = bytecountp;
|
|
||||||
conn->writesockfd = writesockfd;
|
|
||||||
conn->writebytecountp = writebytecountp;
|
|
||||||
|
|
||||||
return CURLE_OK;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@@ -1,53 +0,0 @@
|
|||||||
#ifndef __DOWNLOAD_H
|
|
||||||
#define __DOWNLOAD_H
|
|
||||||
/*****************************************************************************
|
|
||||||
* _ _ ____ _
|
|
||||||
* Project ___| | | | _ \| |
|
|
||||||
* / __| | | | |_) | |
|
|
||||||
* | (__| |_| | _ <| |___
|
|
||||||
* \___|\___/|_| \_\_____|
|
|
||||||
*
|
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* The Original Code is Curl.
|
|
||||||
*
|
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
|
||||||
*
|
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
CURLcode
|
|
||||||
Transfer (struct connectdata *data,
|
|
||||||
int sockfd, /* socket to read from or -1 */
|
|
||||||
int size, /* -1 if unknown at this point */
|
|
||||||
bool getheader, /* TRUE if header parsing is wanted */
|
|
||||||
long *bytecountp, /* return number of bytes read */
|
|
||||||
int writesockfd, /* socket to write to, it may very well be
|
|
||||||
the same we read from. -1 disables */
|
|
||||||
long *writebytecountp /* return number of bytes written */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif
|
|
41
lib/easy.c
41
lib/easy.c
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -89,7 +72,7 @@
|
|||||||
|
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include "highlevel.h"
|
#include "transfer.h"
|
||||||
#include <curl/types.h>
|
#include <curl/types.h>
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
|
39
lib/escape.c
39
lib/escape.c
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/* Escape and unescape URL encoding in strings. The functions return a new
|
/* Escape and unescape URL encoding in strings. The functions return a new
|
||||||
* allocated string or NULL if an error occurred. */
|
* allocated string or NULL if an error occurred. */
|
||||||
|
39
lib/escape.h
39
lib/escape.h
@@ -8,38 +8,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
/* Escape and unescape URL encoding in strings. The functions return a new
|
/* Escape and unescape URL encoding in strings. The functions return a new
|
||||||
* allocated string or NULL if an error occurred. */
|
* allocated string or NULL if an error occurred. */
|
||||||
|
|
||||||
|
53
lib/file.c
53
lib/file.c
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1999.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -123,7 +106,7 @@ CURLcode file(struct connectdata *conn)
|
|||||||
struct UrlData *data = conn->data;
|
struct UrlData *data = conn->data;
|
||||||
char *buf = data->buffer;
|
char *buf = data->buffer;
|
||||||
int bytecount = 0;
|
int bytecount = 0;
|
||||||
struct timeval start = tvnow();
|
struct timeval start = Curl_tvnow();
|
||||||
struct timeval now = start;
|
struct timeval now = start;
|
||||||
int fd;
|
int fd;
|
||||||
char *actual_path = curl_unescape(path, 0);
|
char *actual_path = curl_unescape(path, 0);
|
||||||
@@ -156,7 +139,7 @@ CURLcode file(struct connectdata *conn)
|
|||||||
it avoids problems with select() and recv() on file descriptors
|
it avoids problems with select() and recv() on file descriptors
|
||||||
in Winsock */
|
in Winsock */
|
||||||
if(expected_size != -1)
|
if(expected_size != -1)
|
||||||
pgrsSetDownloadSize(data, expected_size);
|
Curl_pgrsSetDownloadSize(data, expected_size);
|
||||||
|
|
||||||
while (res == CURLE_OK) {
|
while (res == CURLE_OK) {
|
||||||
nread = read(fd, buf, BUFSIZE-1);
|
nread = read(fd, buf, BUFSIZE-1);
|
||||||
@@ -172,16 +155,16 @@ CURLcode file(struct connectdata *conn)
|
|||||||
to prevent CR/LF translation (this then goes to a binary mode
|
to prevent CR/LF translation (this then goes to a binary mode
|
||||||
file descriptor). */
|
file descriptor). */
|
||||||
|
|
||||||
res = client_write(data, CLIENTWRITE_BODY, buf, nread);
|
res = Curl_client_write(data, CLIENTWRITE_BODY, buf, nread);
|
||||||
if(res)
|
if(res)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
now = tvnow();
|
now = Curl_tvnow();
|
||||||
if(pgrsUpdate(data))
|
if(Curl_pgrsUpdate(data))
|
||||||
res = CURLE_ABORTED_BY_CALLBACK;
|
res = CURLE_ABORTED_BY_CALLBACK;
|
||||||
}
|
}
|
||||||
now = tvnow();
|
now = Curl_tvnow();
|
||||||
if(pgrsUpdate(data))
|
if(Curl_pgrsUpdate(data))
|
||||||
res = CURLE_ABORTED_BY_CALLBACK;
|
res = CURLE_ABORTED_BY_CALLBACK;
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
39
lib/file.h
39
lib/file.h
@@ -8,38 +8,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
CURLcode file(struct connectdata *conn);
|
CURLcode file(struct connectdata *conn);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Debug the form generator stand-alone by compiling this source file with:
|
Debug the form generator stand-alone by compiling this source file with:
|
||||||
@@ -108,16 +91,10 @@ static void GetStr(char **string,
|
|||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
int curl_formparse(char *input,
|
|
||||||
struct HttpPost **httppost,
|
|
||||||
struct HttpPost **last_post)
|
|
||||||
{
|
|
||||||
return FormParse(input, httppost, last_post);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define FORM_FILE_SEPARATOR ','
|
#define FORM_FILE_SEPARATOR ','
|
||||||
#define FORM_TYPE_SEPARATOR ';'
|
#define FORM_TYPE_SEPARATOR ';'
|
||||||
|
|
||||||
|
static
|
||||||
int FormParse(char *input,
|
int FormParse(char *input,
|
||||||
struct HttpPost **httppost,
|
struct HttpPost **httppost,
|
||||||
struct HttpPost **last_post)
|
struct HttpPost **last_post)
|
||||||
@@ -315,6 +292,13 @@ int FormParse(char *input,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int curl_formparse(char *input,
|
||||||
|
struct HttpPost **httppost,
|
||||||
|
struct HttpPost **last_post)
|
||||||
|
{
|
||||||
|
return FormParse(input, httppost, last_post);
|
||||||
|
}
|
||||||
|
|
||||||
static int AddFormData(struct FormData **formp,
|
static int AddFormData(struct FormData **formp,
|
||||||
void *line,
|
void *line,
|
||||||
long length)
|
long length)
|
||||||
@@ -356,7 +340,7 @@ static int AddFormDataf(struct FormData **formp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char *MakeFormBoundary(void)
|
char *Curl_FormBoundary(void)
|
||||||
{
|
{
|
||||||
char *retstring;
|
char *retstring;
|
||||||
static int randomizer=0; /* this is just so that two boundaries within
|
static int randomizer=0; /* this is just so that two boundaries within
|
||||||
@@ -384,7 +368,7 @@ char *MakeFormBoundary(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Used from http.c */
|
/* Used from http.c */
|
||||||
void FormFree(struct FormData *form)
|
void Curl_FormFree(struct FormData *form)
|
||||||
{
|
{
|
||||||
struct FormData *next;
|
struct FormData *next;
|
||||||
do {
|
do {
|
||||||
@@ -417,7 +401,7 @@ void curl_formfree(struct HttpPost *form)
|
|||||||
} while((form=next)); /* continue */
|
} while((form=next)); /* continue */
|
||||||
}
|
}
|
||||||
|
|
||||||
struct FormData *getFormData(struct HttpPost *post,
|
struct FormData *Curl_getFormData(struct HttpPost *post,
|
||||||
int *sizep)
|
int *sizep)
|
||||||
{
|
{
|
||||||
struct FormData *form = NULL;
|
struct FormData *form = NULL;
|
||||||
@@ -432,7 +416,7 @@ struct FormData *getFormData(struct HttpPost *post,
|
|||||||
if(!post)
|
if(!post)
|
||||||
return NULL; /* no input => no output! */
|
return NULL; /* no input => no output! */
|
||||||
|
|
||||||
boundary = MakeFormBoundary();
|
boundary = Curl_FormBoundary();
|
||||||
|
|
||||||
/* Make the first line of the output */
|
/* Make the first line of the output */
|
||||||
AddFormDataf(&form,
|
AddFormDataf(&form,
|
||||||
@@ -456,7 +440,7 @@ struct FormData *getFormData(struct HttpPost *post,
|
|||||||
/* If used, this is a link to more file names, we must then do
|
/* If used, this is a link to more file names, we must then do
|
||||||
the magic to include several files with the same field name */
|
the magic to include several files with the same field name */
|
||||||
|
|
||||||
fileboundary = MakeFormBoundary();
|
fileboundary = Curl_FormBoundary();
|
||||||
|
|
||||||
size += AddFormDataf(&form,
|
size += AddFormDataf(&form,
|
||||||
"\r\nContent-Type: multipart/mixed,"
|
"\r\nContent-Type: multipart/mixed,"
|
||||||
@@ -552,24 +536,11 @@ struct FormData *getFormData(struct HttpPost *post,
|
|||||||
return firstform;
|
return firstform;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FormInit(struct Form *form, struct FormData *formdata )
|
int Curl_FormInit(struct Form *form, struct FormData *formdata )
|
||||||
{
|
{
|
||||||
if(!formdata)
|
if(!formdata)
|
||||||
return 1; /* error */
|
return 1; /* error */
|
||||||
|
|
||||||
#if 0
|
|
||||||
struct FormData *lastnode=formdata;
|
|
||||||
|
|
||||||
/* find the last node in the list */
|
|
||||||
while(lastnode->next) {
|
|
||||||
lastnode = lastnode->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now, make sure that we'll send a nice terminating sequence at the end
|
|
||||||
* of the post. We *DONT* add this string to the size of the data since this
|
|
||||||
* is actually AFTER the data. */
|
|
||||||
AddFormDataf(&lastnode, "\r\n\r\n");
|
|
||||||
#endif
|
|
||||||
form->data = formdata;
|
form->data = formdata;
|
||||||
form->sent = 0;
|
form->sent = 0;
|
||||||
|
|
||||||
@@ -577,7 +548,7 @@ int FormInit(struct Form *form, struct FormData *formdata )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* fread() emulation */
|
/* fread() emulation */
|
||||||
int FormReader(char *buffer,
|
int Curl_FormReader(char *buffer,
|
||||||
size_t size,
|
size_t size,
|
||||||
size_t nitems,
|
size_t nitems,
|
||||||
FILE *mydata)
|
FILE *mydata)
|
||||||
@@ -655,7 +626,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
form=getFormData(httppost, &size);
|
form=Curl_getFormData(httppost, &size);
|
||||||
|
|
||||||
FormInit(&formread, form);
|
FormInit(&formread, form);
|
||||||
|
|
||||||
|
@@ -8,69 +8,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
* Rafael Sagula <sagula@inf.ufrgs.br>
|
|
||||||
* Sampo Kellomaki <sampo@iki.fi>
|
|
||||||
* Linas Vepstas <linas@linas.org>
|
|
||||||
* Bjorn Reese <breese@imada.ou.dk>
|
|
||||||
* Johan Anderson <johan@homemail.com>
|
|
||||||
* Kjell Ericson <Kjell.Ericson@haxx.se>
|
|
||||||
* Troy Engel <tengel@palladium.net>
|
|
||||||
* Ryan Nelson <ryan@inch.com>
|
|
||||||
* Bjorn Stenberg <Bjorn.Stenberg@haxx.se>
|
|
||||||
* Angus Mackay <amackay@gus.ml.org>
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* $Log$
|
|
||||||
* Revision 1.3 2000-06-20 15:31:26 bagder
|
|
||||||
* haxx.nu => haxx.se
|
|
||||||
*
|
|
||||||
* Revision 1.2 2000/01/10 23:36:14 bagder
|
|
||||||
* syncing with local edit
|
|
||||||
*
|
|
||||||
* Revision 1.4 1999/09/06 06:59:40 dast
|
|
||||||
* Changed email info
|
|
||||||
*
|
|
||||||
* Revision 1.3 1999/08/13 07:34:47 dast
|
|
||||||
* Changed the URL in the header
|
|
||||||
*
|
|
||||||
* Revision 1.2 1999/07/30 12:59:47 dast
|
|
||||||
* FormFree() was added to properly cleanup after a form was posted.
|
|
||||||
*
|
|
||||||
* Revision 1.1.1.1 1999/03/11 22:23:34 dast
|
|
||||||
* Imported sources
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
/* plain and simple linked list with lines to send */
|
/* plain and simple linked list with lines to send */
|
||||||
struct FormData {
|
struct FormData {
|
||||||
struct FormData *next;
|
struct FormData *next;
|
||||||
@@ -84,23 +36,19 @@ struct Form {
|
|||||||
been sent in a previous invoke */
|
been sent in a previous invoke */
|
||||||
};
|
};
|
||||||
|
|
||||||
int FormParse(char *string,
|
int Curl_FormInit(struct Form *form, struct FormData *formdata );
|
||||||
struct HttpPost **httppost,
|
|
||||||
struct HttpPost **last_post);
|
|
||||||
|
|
||||||
int FormInit(struct Form *form, struct FormData *formdata );
|
struct FormData *Curl_getFormData(struct HttpPost *post,
|
||||||
|
|
||||||
struct FormData *getFormData(struct HttpPost *post,
|
|
||||||
int *size);
|
int *size);
|
||||||
|
|
||||||
/* fread() emulation */
|
/* fread() emulation */
|
||||||
int FormReader(char *buffer,
|
int Curl_FormReader(char *buffer,
|
||||||
size_t size,
|
size_t size,
|
||||||
size_t nitems,
|
size_t nitems,
|
||||||
FILE *mydata);
|
FILE *mydata);
|
||||||
|
|
||||||
char *MakeFormBoundary(void);
|
char *Curl_FormBoundary(void);
|
||||||
|
|
||||||
void FormFree(struct FormData *);
|
void Curl_FormFree(struct FormData *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
171
lib/ftp.c
171
lib/ftp.c
@@ -5,44 +5,28 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdarg.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@@ -83,18 +67,27 @@
|
|||||||
#include "if2ip.h"
|
#include "if2ip.h"
|
||||||
#include "hostip.h"
|
#include "hostip.h"
|
||||||
#include "progress.h"
|
#include "progress.h"
|
||||||
#include "download.h"
|
#include "transfer.h"
|
||||||
#include "escape.h"
|
#include "escape.h"
|
||||||
#include "http.h" /* for HTTP proxy tunnel stuff */
|
#include "http.h" /* for HTTP proxy tunnel stuff */
|
||||||
|
#include "ftp.h"
|
||||||
|
|
||||||
#ifdef KRB4
|
#ifdef KRB4
|
||||||
#include "security.h"
|
#include "security.h"
|
||||||
|
#include "krb4.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
|
#include <curl/mprintf.h>
|
||||||
|
|
||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
#ifdef MALLOCDEBUG
|
#ifdef MALLOCDEBUG
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* easy-to-use macro: */
|
||||||
|
#define ftpsendf Curl_ftpsendf
|
||||||
|
|
||||||
/* returns last node in linked list */
|
/* returns last node in linked list */
|
||||||
static struct curl_slist *slist_get_last(struct curl_slist *list)
|
static struct curl_slist *slist_get_last(struct curl_slist *list)
|
||||||
{
|
{
|
||||||
@@ -219,7 +212,11 @@ static CURLcode AllowServerConnect(struct UrlData *data,
|
|||||||
#define lastline(line) (isdigit((int)line[0]) && isdigit((int)line[1]) && \
|
#define lastline(line) (isdigit((int)line[0]) && isdigit((int)line[1]) && \
|
||||||
isdigit((int)line[2]) && (' ' == line[3]))
|
isdigit((int)line[2]) && (' ' == line[3]))
|
||||||
|
|
||||||
int GetLastResponse(int sockfd, char *buf,
|
/*
|
||||||
|
* We allow the ftpcode pointer to be NULL if no reply integer is wanted
|
||||||
|
*/
|
||||||
|
|
||||||
|
int Curl_GetFTPResponse(int sockfd, char *buf,
|
||||||
struct connectdata *conn,
|
struct connectdata *conn,
|
||||||
int *ftpcode)
|
int *ftpcode)
|
||||||
{
|
{
|
||||||
@@ -237,12 +234,13 @@ int GetLastResponse(int sockfd, char *buf,
|
|||||||
#define SELECT_TIMEOUT 2
|
#define SELECT_TIMEOUT 2
|
||||||
int error = SELECT_OK;
|
int error = SELECT_OK;
|
||||||
|
|
||||||
|
if(ftpcode)
|
||||||
*ftpcode=0; /* 0 for errors */
|
*ftpcode=0; /* 0 for errors */
|
||||||
|
|
||||||
if(data->timeout) {
|
if(data->timeout) {
|
||||||
/* if timeout is requested, find out how much remaining time we have */
|
/* if timeout is requested, find out how much remaining time we have */
|
||||||
timeout = data->timeout - /* timeout time */
|
timeout = data->timeout - /* timeout time */
|
||||||
(tvlong(tvnow()) - tvlong(conn->now)); /* spent time */
|
(Curl_tvlong(Curl_tvnow()) - Curl_tvlong(conn->now)); /* spent time */
|
||||||
if(timeout <=0 ) {
|
if(timeout <=0 ) {
|
||||||
failf(data, "Transfer aborted due to timeout");
|
failf(data, "Transfer aborted due to timeout");
|
||||||
return -SELECT_TIMEOUT; /* already too little time */
|
return -SELECT_TIMEOUT; /* already too little time */
|
||||||
@@ -323,13 +321,14 @@ int GetLastResponse(int sockfd, char *buf,
|
|||||||
if(error)
|
if(error)
|
||||||
return -error;
|
return -error;
|
||||||
|
|
||||||
|
if(ftpcode)
|
||||||
*ftpcode=atoi(buf); /* return the initial number like this */
|
*ftpcode=atoi(buf); /* return the initial number like this */
|
||||||
|
|
||||||
return nread;
|
return nread;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -- who are we? -- */
|
/* -- who are we? -- */
|
||||||
char *getmyhost(char *buf, int buf_size)
|
char *Curl_getmyhost(char *buf, int buf_size)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_GETHOSTNAME)
|
#if defined(HAVE_GETHOSTNAME)
|
||||||
gethostname(buf, buf_size);
|
gethostname(buf, buf_size);
|
||||||
@@ -347,7 +346,7 @@ char *getmyhost(char *buf, int buf_size)
|
|||||||
|
|
||||||
/* ftp_connect() should do everything that is to be considered a part
|
/* ftp_connect() should do everything that is to be considered a part
|
||||||
of the connection phase. */
|
of the connection phase. */
|
||||||
CURLcode ftp_connect(struct connectdata *conn)
|
CURLcode Curl_ftp_connect(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
/* this is FTP and no proxy */
|
/* this is FTP and no proxy */
|
||||||
int nread;
|
int nread;
|
||||||
@@ -373,14 +372,14 @@ CURLcode ftp_connect(struct connectdata *conn)
|
|||||||
|
|
||||||
if (data->bits.tunnel_thru_httpproxy) {
|
if (data->bits.tunnel_thru_httpproxy) {
|
||||||
/* We want "seamless" FTP operations through HTTP proxy tunnel */
|
/* We want "seamless" FTP operations through HTTP proxy tunnel */
|
||||||
result = GetHTTPProxyTunnel(data, data->firstsocket,
|
result = Curl_ConnectHTTPProxyTunnel(data, data->firstsocket,
|
||||||
data->hostname, data->remote_port);
|
data->hostname, data->remote_port);
|
||||||
if(CURLE_OK != result)
|
if(CURLE_OK != result)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The first thing we do is wait for the "220*" line: */
|
/* The first thing we do is wait for the "220*" line: */
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -413,7 +412,7 @@ CURLcode ftp_connect(struct connectdata *conn)
|
|||||||
ftpsendf(data->firstsocket, conn, "USER %s", ftp->user);
|
ftpsendf(data->firstsocket, conn, "USER %s", ftp->user);
|
||||||
|
|
||||||
/* wait for feedback */
|
/* wait for feedback */
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -427,7 +426,7 @@ CURLcode ftp_connect(struct connectdata *conn)
|
|||||||
/* 331 Password required for ...
|
/* 331 Password required for ...
|
||||||
(the server requires to send the user's password too) */
|
(the server requires to send the user's password too) */
|
||||||
ftpsendf(data->firstsocket, conn, "PASS %s", ftp->passwd);
|
ftpsendf(data->firstsocket, conn, "PASS %s", ftp->passwd);
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -476,7 +475,7 @@ CURLcode ftp_connect(struct connectdata *conn)
|
|||||||
|
|
||||||
|
|
||||||
/* argument is already checked for validity */
|
/* argument is already checked for validity */
|
||||||
CURLcode ftp_done(struct connectdata *conn)
|
CURLcode Curl_ftp_done(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
struct UrlData *data = conn->data;
|
struct UrlData *data = conn->data;
|
||||||
struct FTP *ftp = data->proto.ftp;
|
struct FTP *ftp = data->proto.ftp;
|
||||||
@@ -513,7 +512,7 @@ CURLcode ftp_done(struct connectdata *conn)
|
|||||||
if(!data->bits.no_body) {
|
if(!data->bits.no_body) {
|
||||||
/* now let's see what the server says about the transfer we
|
/* now let's see what the server says about the transfer we
|
||||||
just performed: */
|
just performed: */
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -533,7 +532,7 @@ CURLcode ftp_done(struct connectdata *conn)
|
|||||||
if (qitem->data) {
|
if (qitem->data) {
|
||||||
ftpsendf(data->firstsocket, conn, "%s", qitem->data);
|
ftpsendf(data->firstsocket, conn, "%s", qitem->data);
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -587,7 +586,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
if (qitem->data) {
|
if (qitem->data) {
|
||||||
ftpsendf(data->firstsocket, conn, "%s", qitem->data);
|
ftpsendf(data->firstsocket, conn, "%s", qitem->data);
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -604,7 +603,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
/* change directory first! */
|
/* change directory first! */
|
||||||
if(ftp->dir && ftp->dir[0]) {
|
if(ftp->dir && ftp->dir[0]) {
|
||||||
ftpsendf(data->firstsocket, conn, "CWD %s", ftp->dir);
|
ftpsendf(data->firstsocket, conn, "CWD %s", ftp->dir);
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -619,7 +618,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
again a grey area as the MDTM is not kosher RFC959 */
|
again a grey area as the MDTM is not kosher RFC959 */
|
||||||
ftpsendf(data->firstsocket, conn, "MDTM %s", ftp->file);
|
ftpsendf(data->firstsocket, conn, "MDTM %s", ftp->file);
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -656,7 +655,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
ftpsendf(data->firstsocket, conn, "TYPE %s",
|
ftpsendf(data->firstsocket, conn, "TYPE %s",
|
||||||
(data->bits.ftp_ascii)?"A":"I");
|
(data->bits.ftp_ascii)?"A":"I");
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -669,7 +668,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
|
|
||||||
ftpsendf(data->firstsocket, conn, "SIZE %s", ftp->file);
|
ftpsendf(data->firstsocket, conn, "SIZE %s", ftp->file);
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -681,7 +680,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
filesize = atoi(buf+4);
|
filesize = atoi(buf+4);
|
||||||
|
|
||||||
sprintf(buf, "Content-Length: %d\r\n", filesize);
|
sprintf(buf, "Content-Length: %d\r\n", filesize);
|
||||||
result = client_write(data, CLIENTWRITE_BOTH, buf, 0);
|
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
@@ -697,7 +696,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
|
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
|
||||||
strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S %Z\r\n",
|
strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S %Z\r\n",
|
||||||
tm);
|
tm);
|
||||||
result = client_write(data, CLIENTWRITE_BOTH, buf, 0);
|
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -716,18 +715,20 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
char myhost[256] = "";
|
char myhost[256] = "";
|
||||||
|
|
||||||
if(data->ftpport) {
|
if(data->ftpport) {
|
||||||
if(if2ip(data->ftpport, myhost, sizeof(myhost))) {
|
if(Curl_if2ip(data->ftpport, myhost, sizeof(myhost))) {
|
||||||
h = GetHost(data, myhost, &hostdataptr);
|
h = Curl_gethost(data, myhost, &hostdataptr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(strlen(data->ftpport)>1)
|
if(strlen(data->ftpport)>1)
|
||||||
h = GetHost(data, data->ftpport, &hostdataptr);
|
h = Curl_gethost(data, data->ftpport, &hostdataptr);
|
||||||
if(h)
|
if(h)
|
||||||
strcpy(myhost, data->ftpport); /* buffer overflow risk */
|
strcpy(myhost, data->ftpport); /* buffer overflow risk */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(! *myhost) {
|
if(! *myhost) {
|
||||||
h=GetHost(data, getmyhost(myhost, sizeof(myhost)), &hostdataptr);
|
h=Curl_gethost(data,
|
||||||
|
Curl_getmyhost(myhost, sizeof(myhost)),
|
||||||
|
&hostdataptr);
|
||||||
}
|
}
|
||||||
infof(data, "We connect from %s\n", myhost);
|
infof(data, "We connect from %s\n", myhost);
|
||||||
|
|
||||||
@@ -805,7 +806,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
porttouse & 255);
|
porttouse & 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -818,7 +819,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
|
|
||||||
ftpsendf(data->firstsocket, conn, "PASV");
|
ftpsendf(data->firstsocket, conn, "PASV");
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -873,7 +874,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* normal, direct, ftp connection */
|
/* normal, direct, ftp connection */
|
||||||
he = GetHost(data, newhost, &hostdataptr);
|
he = Curl_gethost(data, newhost, &hostdataptr);
|
||||||
if(!he) {
|
if(!he) {
|
||||||
failf(data, "Can't resolve new host %s", newhost);
|
failf(data, "Can't resolve new host %s", newhost);
|
||||||
return CURLE_FTP_CANT_GET_HOST;
|
return CURLE_FTP_CANT_GET_HOST;
|
||||||
@@ -978,7 +979,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
|
|
||||||
if (data->bits.tunnel_thru_httpproxy) {
|
if (data->bits.tunnel_thru_httpproxy) {
|
||||||
/* We want "seamless" FTP operations through HTTP proxy tunnel */
|
/* We want "seamless" FTP operations through HTTP proxy tunnel */
|
||||||
result = GetHTTPProxyTunnel(data, data->secondarysocket,
|
result = Curl_ConnectHTTPProxyTunnel(data, data->secondarysocket,
|
||||||
newhost, newport);
|
newhost, newport);
|
||||||
if(CURLE_OK != result)
|
if(CURLE_OK != result)
|
||||||
return result;
|
return result;
|
||||||
@@ -994,7 +995,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
ftpsendf(data->firstsocket, conn, "TYPE %s",
|
ftpsendf(data->firstsocket, conn, "TYPE %s",
|
||||||
(data->bits.ftp_ascii)?"A":"I");
|
(data->bits.ftp_ascii)?"A":"I");
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -1025,7 +1026,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
|
|
||||||
ftpsendf(data->firstsocket, conn, "SIZE %s", ftp->file);
|
ftpsendf(data->firstsocket, conn, "SIZE %s", ftp->file);
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -1086,7 +1087,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
else
|
else
|
||||||
ftpsendf(data->firstsocket, conn, "STOR %s", ftp->file);
|
ftpsendf(data->firstsocket, conn, "STOR %s", ftp->file);
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -1107,9 +1108,9 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
/* When we know we're uploading a specified file, we can get the file
|
/* When we know we're uploading a specified file, we can get the file
|
||||||
size prior to the actual upload. */
|
size prior to the actual upload. */
|
||||||
|
|
||||||
pgrsSetUploadSize(data, data->infilesize);
|
Curl_pgrsSetUploadSize(data, data->infilesize);
|
||||||
|
|
||||||
result = Transfer(conn, -1, -1, FALSE, NULL, /* no download */
|
result = Curl_Transfer(conn, -1, -1, FALSE, NULL, /* no download */
|
||||||
data->secondarysocket, bytecountp);
|
data->secondarysocket, bytecountp);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
@@ -1166,7 +1167,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
/* Set type to ASCII */
|
/* Set type to ASCII */
|
||||||
ftpsendf(data->firstsocket, conn, "TYPE A");
|
ftpsendf(data->firstsocket, conn, "TYPE A");
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -1188,7 +1189,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
ftpsendf(data->firstsocket, conn, "TYPE %s",
|
ftpsendf(data->firstsocket, conn, "TYPE %s",
|
||||||
(data->bits.ftp_ascii)?"A":"I");
|
(data->bits.ftp_ascii)?"A":"I");
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -1209,7 +1210,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
|
|
||||||
ftpsendf(data->firstsocket, conn, "SIZE %s", ftp->file);
|
ftpsendf(data->firstsocket, conn, "SIZE %s", ftp->file);
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -1253,7 +1254,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
|
|
||||||
ftpsendf(data->firstsocket, conn, "REST %d", data->resume_from);
|
ftpsendf(data->firstsocket, conn, "REST %d", data->resume_from);
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -1266,7 +1267,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
ftpsendf(data->firstsocket, conn, "RETR %s", ftp->file);
|
ftpsendf(data->firstsocket, conn, "RETR %s", ftp->file);
|
||||||
}
|
}
|
||||||
|
|
||||||
nread = GetLastResponse(data->firstsocket, buf, conn, &ftpcode);
|
nread = Curl_GetFTPResponse(data->firstsocket, buf, conn, &ftpcode);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
|
|
||||||
@@ -1338,7 +1339,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
infof(data, "Getting file with size: %d\n", size);
|
infof(data, "Getting file with size: %d\n", size);
|
||||||
|
|
||||||
/* FTP download: */
|
/* FTP download: */
|
||||||
result=Transfer(conn, data->secondarysocket, size, FALSE,
|
result=Curl_Transfer(conn, data->secondarysocket, size, FALSE,
|
||||||
bytecountp,
|
bytecountp,
|
||||||
-1, NULL); /* no upload here */
|
-1, NULL); /* no upload here */
|
||||||
if(result)
|
if(result)
|
||||||
@@ -1358,7 +1359,7 @@ CURLcode _ftp(struct connectdata *conn)
|
|||||||
/* -- deal with the ftp server! -- */
|
/* -- deal with the ftp server! -- */
|
||||||
|
|
||||||
/* argument is already checked for validity */
|
/* argument is already checked for validity */
|
||||||
CURLcode ftp(struct connectdata *conn)
|
CURLcode Curl_ftp(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
CURLcode retcode;
|
CURLcode retcode;
|
||||||
|
|
||||||
@@ -1420,3 +1421,39 @@ CURLcode ftp(struct connectdata *conn)
|
|||||||
return retcode;
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ftpsendf() sends the formated string as a ftp command to a ftp server
|
||||||
|
*
|
||||||
|
* NOTE: we build the command in a fixed-length buffer, which sets length
|
||||||
|
* restrictions on the command!
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
size_t Curl_ftpsendf(int fd, struct connectdata *conn, char *fmt, ...)
|
||||||
|
{
|
||||||
|
size_t bytes_written;
|
||||||
|
char s[256];
|
||||||
|
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, fmt);
|
||||||
|
vsnprintf(s, 250, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
if(conn->data->bits.verbose)
|
||||||
|
fprintf(conn->data->err, "> %s\n", s);
|
||||||
|
|
||||||
|
strcat(s, "\r\n"); /* append a trailing CRLF */
|
||||||
|
|
||||||
|
#ifdef KRB4
|
||||||
|
if(conn->sec_complete && conn->data->cmdchannel) {
|
||||||
|
bytes_written = sec_fprintf(conn, conn->data->cmdchannel, s);
|
||||||
|
fflush(conn->data->cmdchannel);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif /* KRB4 */
|
||||||
|
{
|
||||||
|
bytes_written = swrite(fd, s, strlen(s));
|
||||||
|
}
|
||||||
|
return(bytes_written);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
52
lib/ftp.h
52
lib/ftp.h
@@ -8,43 +8,33 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
CURLcode Curl_ftp(struct connectdata *conn);
|
||||||
* ------------------------------------------------------------
|
CURLcode Curl_ftp_done(struct connectdata *conn);
|
||||||
* Main author:
|
CURLcode Curl_ftp_connect(struct connectdata *conn);
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
size_t Curl_ftpsendf(int fd, struct connectdata *, char *fmt, ...);
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
CURLcode ftp(struct connectdata *conn);
|
|
||||||
CURLcode ftp_done(struct connectdata *conn);
|
|
||||||
CURLcode ftp_connect(struct connectdata *conn);
|
|
||||||
|
|
||||||
struct curl_slist *curl_slist_append(struct curl_slist *list, char *data);
|
struct curl_slist *curl_slist_append(struct curl_slist *list, char *data);
|
||||||
void curl_slist_free_all(struct curl_slist *list);
|
void curl_slist_free_all(struct curl_slist *list);
|
||||||
|
|
||||||
|
/* The kerberos stuff needs this: */
|
||||||
|
int Curl_GetFTPResponse(int sockfd, char *buf,
|
||||||
|
struct connectdata *conn,
|
||||||
|
int *ftpcode);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
39
lib/getenv.c
39
lib/getenv.c
@@ -5,37 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -49,6 +33,7 @@
|
|||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static
|
||||||
char *GetEnv(char *variable)
|
char *GetEnv(char *variable)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
70
lib/getenv.h
70
lib/getenv.h
@@ -7,68 +7,22 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
* Rafael Sagula <sagula@inf.ufrgs.br>
|
|
||||||
* Sampo Kellomaki <sampo@iki.fi>
|
|
||||||
* Linas Vepstas <linas@linas.org>
|
|
||||||
* Bjorn Reese <breese@imada.ou.dk>
|
|
||||||
* Johan Anderson <johan@homemail.com>
|
|
||||||
* Kjell Ericson <Kjell.Ericson@haxx.se>
|
|
||||||
* Troy Engel <tengel@palladium.net>
|
|
||||||
* Ryan Nelson <ryan@inch.com>
|
|
||||||
* Bjorn Stenberg <Bjorn.Stenberg@haxx.se>
|
|
||||||
* Angus Mackay <amackay@gus.ml.org>
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* $Log$
|
|
||||||
* Revision 1.3 2000-06-20 15:31:26 bagder
|
|
||||||
* haxx.nu => haxx.se
|
|
||||||
*
|
|
||||||
* Revision 1.2 2000/01/10 23:36:14 bagder
|
|
||||||
* syncing with local edit
|
|
||||||
*
|
|
||||||
* Revision 1.3 1999/09/06 06:59:40 dast
|
|
||||||
* Changed email info
|
|
||||||
*
|
|
||||||
* Revision 1.2 1999/08/13 07:34:48 dast
|
|
||||||
* Changed the URL in the header
|
|
||||||
*
|
|
||||||
* Revision 1.1.1.1 1999/03/11 22:23:34 dast
|
|
||||||
* Imported sources
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/* Unix and Win32 getenv function call */
|
#include <curl/curl.h>
|
||||||
char *GetEnv(char *variable);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1999.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
|
@@ -1,8 +1,35 @@
|
|||||||
#ifndef __GETPASS_H
|
#ifndef __GETPASS_H
|
||||||
#define __GETPASS_H
|
#define __GETPASS_H
|
||||||
|
/*****************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
*
|
||||||
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
|
*
|
||||||
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*****************************************************************************/
|
||||||
|
#ifndef HAVE_GETPASS_R
|
||||||
|
/* If there's a system-provided function named like this, we trust it is
|
||||||
|
also found in one of the standard headers. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returning NULL will abort the continued operation!
|
* Returning NULL will abort the continued operation!
|
||||||
*/
|
*/
|
||||||
char* getpass_r(char *prompt, char* buffer, size_t buflen );
|
char* getpass_r(char *prompt, char* buffer, size_t buflen );
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,43 +0,0 @@
|
|||||||
#ifndef __HIGHLEVEL_H
|
|
||||||
#define __HIGHLEVEL_H
|
|
||||||
/*****************************************************************************
|
|
||||||
* _ _ ____ _
|
|
||||||
* Project ___| | | | _ \| |
|
|
||||||
* / __| | | | |_) | |
|
|
||||||
* | (__| |_| | _ <| |___
|
|
||||||
* \___|\___/|_| \_\_____|
|
|
||||||
*
|
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* The Original Code is Curl.
|
|
||||||
*
|
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
|
||||||
*
|
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
CURLcode curl_transfer(CURL *curl);
|
|
||||||
#endif
|
|
50
lib/hostip.c
50
lib/hostip.c
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -79,7 +62,7 @@
|
|||||||
|
|
||||||
/* --- resolve name or IP-number --- */
|
/* --- resolve name or IP-number --- */
|
||||||
|
|
||||||
char *MakeIP(unsigned long num,char *addr, int addr_len)
|
static char *MakeIP(unsigned long num,char *addr, int addr_len)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_INET_NTOA) || defined(HAVE_INET_NTOA_R)
|
#if defined(HAVE_INET_NTOA) || defined(HAVE_INET_NTOA_R)
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
@@ -100,12 +83,15 @@ char *MakeIP(unsigned long num,char *addr, int addr_len)
|
|||||||
return (addr);
|
return (addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The original code to this function was stolen from the Dancer source code,
|
/* The original code to this function was once stolen from the Dancer source
|
||||||
written by Bjorn Reese, it has since been patched and modified. */
|
code, written by Bjorn Reese, it has since been patched and modified
|
||||||
|
considerably. */
|
||||||
|
|
||||||
#ifndef INADDR_NONE
|
#ifndef INADDR_NONE
|
||||||
#define INADDR_NONE (unsigned long) ~0
|
#define INADDR_NONE (unsigned long) ~0
|
||||||
#endif
|
#endif
|
||||||
struct hostent *GetHost(struct UrlData *data,
|
|
||||||
|
struct hostent *Curl_gethost(struct UrlData *data,
|
||||||
char *hostname,
|
char *hostname,
|
||||||
char **bufp)
|
char **bufp)
|
||||||
{
|
{
|
||||||
|
43
lib/hostip.h
43
lib/hostip.h
@@ -7,39 +7,24 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
struct hostent *GetHost(struct UrlData *data, char *hostname, char **bufp );
|
struct hostent *Curl_gethost(struct UrlData *data,
|
||||||
|
char *hostname,
|
||||||
|
char **bufp);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
240
lib/http.c
240
lib/http.c
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -104,7 +87,7 @@
|
|||||||
|
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include "download.h"
|
#include "transfer.h"
|
||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
#include "formdata.h"
|
#include "formdata.h"
|
||||||
#include "progress.h"
|
#include "progress.h"
|
||||||
@@ -122,6 +105,150 @@
|
|||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The add_buffer series of functions are used to build one large memory chunk
|
||||||
|
* from repeated function invokes. Used so that the entire HTTP request can
|
||||||
|
* be sent in one go.
|
||||||
|
*/
|
||||||
|
static CURLcode
|
||||||
|
add_buffer(send_buffer *in, void *inptr, size_t size);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* add_buffer_init() returns a fine buffer struct
|
||||||
|
*/
|
||||||
|
static
|
||||||
|
send_buffer *add_buffer_init(void)
|
||||||
|
{
|
||||||
|
send_buffer *blonk;
|
||||||
|
blonk=(send_buffer *)malloc(sizeof(send_buffer));
|
||||||
|
if(blonk) {
|
||||||
|
memset(blonk, 0, sizeof(send_buffer));
|
||||||
|
return blonk;
|
||||||
|
}
|
||||||
|
return NULL; /* failed, go home */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* add_buffer_send() sends a buffer and frees all associated memory.
|
||||||
|
*/
|
||||||
|
static
|
||||||
|
size_t add_buffer_send(int sockfd, struct connectdata *conn, send_buffer *in)
|
||||||
|
{
|
||||||
|
size_t amount;
|
||||||
|
if(conn->data->bits.verbose) {
|
||||||
|
fputs("> ", conn->data->err);
|
||||||
|
/* this data _may_ contain binary stuff */
|
||||||
|
fwrite(in->buffer, in->size_used, 1, conn->data->err);
|
||||||
|
}
|
||||||
|
|
||||||
|
amount = ssend(sockfd, conn, in->buffer, in->size_used);
|
||||||
|
|
||||||
|
if(in->buffer)
|
||||||
|
free(in->buffer);
|
||||||
|
free(in);
|
||||||
|
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* add_bufferf() builds a buffer from the formatted input
|
||||||
|
*/
|
||||||
|
static
|
||||||
|
CURLcode add_bufferf(send_buffer *in, char *fmt, ...)
|
||||||
|
{
|
||||||
|
CURLcode result = CURLE_OUT_OF_MEMORY;
|
||||||
|
char *s;
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, fmt);
|
||||||
|
s = vaprintf(fmt, ap); /* this allocs a new string to append */
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
if(s) {
|
||||||
|
result = add_buffer(in, s, strlen(s));
|
||||||
|
free(s);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* add_buffer() appends a memory chunk to the existing one
|
||||||
|
*/
|
||||||
|
static
|
||||||
|
CURLcode add_buffer(send_buffer *in, void *inptr, size_t size)
|
||||||
|
{
|
||||||
|
char *new_rb;
|
||||||
|
int new_size;
|
||||||
|
|
||||||
|
if(size > 0) {
|
||||||
|
if(!in->buffer ||
|
||||||
|
((in->size_used + size) > (in->size_max - 1))) {
|
||||||
|
new_size = (in->size_used+size)*2;
|
||||||
|
if(in->buffer)
|
||||||
|
/* we have a buffer, enlarge the existing one */
|
||||||
|
new_rb = (char *)realloc(in->buffer, new_size);
|
||||||
|
else
|
||||||
|
/* create a new buffer */
|
||||||
|
new_rb = (char *)malloc(new_size);
|
||||||
|
|
||||||
|
if(!new_rb)
|
||||||
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
in->buffer = new_rb;
|
||||||
|
in->size_max = new_size;
|
||||||
|
}
|
||||||
|
memcpy(&in->buffer[in->size_used], inptr, size);
|
||||||
|
|
||||||
|
in->size_used += size;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CURLE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* end of the add_buffer functions */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read everything until a newline.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static
|
||||||
|
int GetLine(int sockfd, char *buf, struct UrlData *data)
|
||||||
|
{
|
||||||
|
int nread;
|
||||||
|
int read_rc=1;
|
||||||
|
char *ptr;
|
||||||
|
ptr=buf;
|
||||||
|
|
||||||
|
/* get us a full line, terminated with a newline */
|
||||||
|
for(nread=0;
|
||||||
|
(nread<BUFSIZE) && read_rc;
|
||||||
|
nread++, ptr++) {
|
||||||
|
#ifdef USE_SSLEAY
|
||||||
|
if (data->ssl.use) {
|
||||||
|
read_rc = SSL_read(data->ssl.handle, ptr, 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#endif
|
||||||
|
read_rc = sread(sockfd, ptr, 1);
|
||||||
|
#ifdef USE_SSLEAY
|
||||||
|
}
|
||||||
|
#endif /* USE_SSLEAY */
|
||||||
|
if (*ptr == '\n')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*ptr=0; /* zero terminate */
|
||||||
|
|
||||||
|
if(data->bits.verbose) {
|
||||||
|
fputs("< ", data->err);
|
||||||
|
fwrite(buf, 1, nread, data->err);
|
||||||
|
fputs("\n", data->err);
|
||||||
|
}
|
||||||
|
return nread;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function checks the linked list of custom HTTP headers for a particular
|
* This function checks the linked list of custom HTTP headers for a particular
|
||||||
* header (prefix).
|
* header (prefix).
|
||||||
@@ -140,12 +267,12 @@ bool static checkheaders(struct UrlData *data, char *thisheader)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GetHTTPProxyTunnel() requires that we're connected to a HTTP proxy. This
|
* ConnectHTTPProxyTunnel() requires that we're connected to a HTTP proxy. This
|
||||||
* function will issue the necessary commands to get a seamless tunnel through
|
* function will issue the necessary commands to get a seamless tunnel through
|
||||||
* this proxy. After that, the socket can be used just as a normal socket.
|
* this proxy. After that, the socket can be used just as a normal socket.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CURLcode GetHTTPProxyTunnel(struct UrlData *data, int tunnelsocket,
|
CURLcode Curl_ConnectHTTPProxyTunnel(struct UrlData *data, int tunnelsocket,
|
||||||
char *hostname, int remote_port)
|
char *hostname, int remote_port)
|
||||||
{
|
{
|
||||||
int httperror=0;
|
int httperror=0;
|
||||||
@@ -187,7 +314,7 @@ CURLcode GetHTTPProxyTunnel(struct UrlData *data, int tunnelsocket,
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode http_connect(struct connectdata *conn)
|
CURLcode Curl_http_connect(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
struct UrlData *data;
|
struct UrlData *data;
|
||||||
CURLcode result;
|
CURLcode result;
|
||||||
@@ -203,17 +330,16 @@ CURLcode http_connect(struct connectdata *conn)
|
|||||||
if (conn->protocol & PROT_HTTPS) {
|
if (conn->protocol & PROT_HTTPS) {
|
||||||
if (data->bits.httpproxy) {
|
if (data->bits.httpproxy) {
|
||||||
/* HTTPS through a proxy can only be done with a tunnel */
|
/* HTTPS through a proxy can only be done with a tunnel */
|
||||||
result = GetHTTPProxyTunnel(data, data->firstsocket,
|
result = Curl_ConnectHTTPProxyTunnel(data, data->firstsocket,
|
||||||
data->hostname, data->remote_port);
|
data->hostname, data->remote_port);
|
||||||
if(CURLE_OK != result)
|
if(CURLE_OK != result)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now, perform the SSL initialization for this socket */
|
/* now, perform the SSL initialization for this socket */
|
||||||
if(UrgSSLConnect (data)) {
|
if(Curl_SSLConnect(data))
|
||||||
return CURLE_SSL_CONNECT_ERROR;
|
return CURLE_SSL_CONNECT_ERROR;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(data->bits.user_passwd && !data->bits.this_is_a_follow) {
|
if(data->bits.user_passwd && !data->bits.this_is_a_follow) {
|
||||||
/* Authorization: is requested, this is not a followed location, get the
|
/* Authorization: is requested, this is not a followed location, get the
|
||||||
@@ -226,14 +352,14 @@ CURLcode http_connect(struct connectdata *conn)
|
|||||||
|
|
||||||
/* called from curl_close() when this struct is about to get wasted, free
|
/* called from curl_close() when this struct is about to get wasted, free
|
||||||
protocol-specific resources */
|
protocol-specific resources */
|
||||||
CURLcode http_close(struct connectdata *conn)
|
CURLcode Curl_http_close(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
if(conn->data->auth_host)
|
if(conn->data->auth_host)
|
||||||
free(conn->data->auth_host);
|
free(conn->data->auth_host);
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode http_done(struct connectdata *conn)
|
CURLcode Curl_http_done(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
struct UrlData *data;
|
struct UrlData *data;
|
||||||
long *bytecount = &conn->bytecount;
|
long *bytecount = &conn->bytecount;
|
||||||
@@ -245,7 +371,7 @@ CURLcode http_done(struct connectdata *conn)
|
|||||||
if(data->bits.http_formpost) {
|
if(data->bits.http_formpost) {
|
||||||
*bytecount = http->readbytecount + http->writebytecount;
|
*bytecount = http->readbytecount + http->writebytecount;
|
||||||
|
|
||||||
FormFree(http->sendit); /* Now free that whole lot */
|
Curl_FormFree(http->sendit); /* Now free that whole lot */
|
||||||
|
|
||||||
data->fread = http->storefread; /* restore */
|
data->fread = http->storefread; /* restore */
|
||||||
data->in = http->in; /* restore */
|
data->in = http->in; /* restore */
|
||||||
@@ -261,7 +387,7 @@ CURLcode http_done(struct connectdata *conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CURLcode http(struct connectdata *conn)
|
CURLcode Curl_http(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
struct UrlData *data=conn->data;
|
struct UrlData *data=conn->data;
|
||||||
char *buf = data->buffer; /* this is a short cut to the buffer */
|
char *buf = data->buffer; /* this is a short cut to the buffer */
|
||||||
@@ -301,26 +427,26 @@ CURLcode http(struct connectdata *conn)
|
|||||||
!data->auth_host ||
|
!data->auth_host ||
|
||||||
strequal(data->auth_host, data->hostname)) {
|
strequal(data->auth_host, data->hostname)) {
|
||||||
sprintf(data->buffer, "%s:%s", data->user, data->passwd);
|
sprintf(data->buffer, "%s:%s", data->user, data->passwd);
|
||||||
if(base64_encode(data->buffer, strlen(data->buffer),
|
if(Curl_base64_encode(data->buffer, strlen(data->buffer),
|
||||||
&authorization) >= 0) {
|
&authorization) >= 0) {
|
||||||
data->ptr_userpwd = maprintf( "Authorization: Basic %s\015\012",
|
data->ptr_userpwd = aprintf( "Authorization: Basic %s\015\012",
|
||||||
authorization);
|
authorization);
|
||||||
free(authorization);
|
free(authorization);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if((data->bits.set_range) && !checkheaders(data, "Range:")) {
|
if((data->bits.set_range) && !checkheaders(data, "Range:")) {
|
||||||
data->ptr_rangeline = maprintf("Range: bytes=%s\015\012", data->range);
|
data->ptr_rangeline = aprintf("Range: bytes=%s\015\012", data->range);
|
||||||
}
|
}
|
||||||
if((data->bits.http_set_referer) && !checkheaders(data, "Referer:")) {
|
if((data->bits.http_set_referer) && !checkheaders(data, "Referer:")) {
|
||||||
data->ptr_ref = maprintf("Referer: %s\015\012", data->referer);
|
data->ptr_ref = aprintf("Referer: %s\015\012", data->referer);
|
||||||
}
|
}
|
||||||
if(data->cookie && !checkheaders(data, "Cookie:")) {
|
if(data->cookie && !checkheaders(data, "Cookie:")) {
|
||||||
data->ptr_cookie = maprintf("Cookie: %s\015\012", data->cookie);
|
data->ptr_cookie = aprintf("Cookie: %s\015\012", data->cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data->cookies) {
|
if(data->cookies) {
|
||||||
co = cookie_getlist(data->cookies,
|
co = Curl_cookie_getlist(data->cookies,
|
||||||
host,
|
host,
|
||||||
ppath,
|
ppath,
|
||||||
conn->protocol&PROT_HTTPS?TRUE:FALSE);
|
conn->protocol&PROT_HTTPS?TRUE:FALSE);
|
||||||
@@ -332,7 +458,7 @@ CURLcode http(struct connectdata *conn)
|
|||||||
if(data->bits.http_formpost) {
|
if(data->bits.http_formpost) {
|
||||||
/* we must build the whole darned post sequence first, so that we have
|
/* we must build the whole darned post sequence first, so that we have
|
||||||
a size of the whole shebang before we start to send it */
|
a size of the whole shebang before we start to send it */
|
||||||
http->sendit = getFormData(data->httppost, &http->postsize);
|
http->sendit = Curl_getFormData(data->httppost, &http->postsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!checkheaders(data, "Host:")) {
|
if(!checkheaders(data, "Host:")) {
|
||||||
@@ -340,9 +466,9 @@ CURLcode http(struct connectdata *conn)
|
|||||||
(!(conn->protocol&PROT_HTTPS) && (data->remote_port == PORT_HTTP)) )
|
(!(conn->protocol&PROT_HTTPS) && (data->remote_port == PORT_HTTP)) )
|
||||||
/* If (HTTPS on port 443) OR (non-HTTPS on port 80) then don't include
|
/* If (HTTPS on port 443) OR (non-HTTPS on port 80) then don't include
|
||||||
the port number in the host string */
|
the port number in the host string */
|
||||||
data->ptr_host = maprintf("Host: %s\r\n", host);
|
data->ptr_host = aprintf("Host: %s\r\n", host);
|
||||||
else
|
else
|
||||||
data->ptr_host = maprintf("Host: %s:%d\r\n", host, data->remote_port);
|
data->ptr_host = aprintf("Host: %s:%d\r\n", host, data->remote_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!checkheaders(data, "Pragma:"))
|
if(!checkheaders(data, "Pragma:"))
|
||||||
@@ -406,7 +532,7 @@ CURLcode http(struct connectdata *conn)
|
|||||||
if(count) {
|
if(count) {
|
||||||
add_buffer(req_buffer, "\r\n", 2);
|
add_buffer(req_buffer, "\r\n", 2);
|
||||||
}
|
}
|
||||||
cookie_freelist(store); /* free the cookie list */
|
Curl_cookie_freelist(store); /* free the cookie list */
|
||||||
co=NULL;
|
co=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -468,7 +594,7 @@ CURLcode http(struct connectdata *conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(data->bits.http_formpost) {
|
if(data->bits.http_formpost) {
|
||||||
if(FormInit(&http->form, http->sendit)) {
|
if(Curl_FormInit(&http->form, http->sendit)) {
|
||||||
failf(data, "Internal HTTP POST error!\n");
|
failf(data, "Internal HTTP POST error!\n");
|
||||||
return CURLE_HTTP_POST_ERROR;
|
return CURLE_HTTP_POST_ERROR;
|
||||||
}
|
}
|
||||||
@@ -478,7 +604,7 @@ CURLcode http(struct connectdata *conn)
|
|||||||
|
|
||||||
data->fread =
|
data->fread =
|
||||||
(size_t (*)(char *, size_t, size_t, FILE *))
|
(size_t (*)(char *, size_t, size_t, FILE *))
|
||||||
FormReader; /* set the read function to read from the
|
Curl_FormReader; /* set the read function to read from the
|
||||||
generated form data */
|
generated form data */
|
||||||
data->in = (FILE *)&http->form;
|
data->in = (FILE *)&http->form;
|
||||||
|
|
||||||
@@ -486,16 +612,16 @@ CURLcode http(struct connectdata *conn)
|
|||||||
"Content-Length: %d\r\n", http->postsize-2);
|
"Content-Length: %d\r\n", http->postsize-2);
|
||||||
|
|
||||||
/* set upload size to the progress meter */
|
/* set upload size to the progress meter */
|
||||||
pgrsSetUploadSize(data, http->postsize);
|
Curl_pgrsSetUploadSize(data, http->postsize);
|
||||||
|
|
||||||
data->request_size =
|
data->request_size =
|
||||||
add_buffer_send(data->firstsocket, conn, req_buffer);
|
add_buffer_send(data->firstsocket, conn, req_buffer);
|
||||||
result = Transfer(conn, data->firstsocket, -1, TRUE,
|
result = Curl_Transfer(conn, data->firstsocket, -1, TRUE,
|
||||||
&http->readbytecount,
|
&http->readbytecount,
|
||||||
data->firstsocket,
|
data->firstsocket,
|
||||||
&http->writebytecount);
|
&http->writebytecount);
|
||||||
if(result) {
|
if(result) {
|
||||||
FormFree(http->sendit); /* free that whole lot */
|
Curl_FormFree(http->sendit); /* free that whole lot */
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -511,14 +637,14 @@ CURLcode http(struct connectdata *conn)
|
|||||||
add_bufferf(req_buffer, "\015\012");
|
add_bufferf(req_buffer, "\015\012");
|
||||||
|
|
||||||
/* set the upload size to the progress meter */
|
/* set the upload size to the progress meter */
|
||||||
pgrsSetUploadSize(data, data->infilesize);
|
Curl_pgrsSetUploadSize(data, data->infilesize);
|
||||||
|
|
||||||
/* this sends the buffer and frees all the buffer resources */
|
/* this sends the buffer and frees all the buffer resources */
|
||||||
data->request_size =
|
data->request_size =
|
||||||
add_buffer_send(data->firstsocket, conn, req_buffer);
|
add_buffer_send(data->firstsocket, conn, req_buffer);
|
||||||
|
|
||||||
/* prepare for transfer */
|
/* prepare for transfer */
|
||||||
result = Transfer(conn, data->firstsocket, -1, TRUE,
|
result = Curl_Transfer(conn, data->firstsocket, -1, TRUE,
|
||||||
&http->readbytecount,
|
&http->readbytecount,
|
||||||
data->firstsocket,
|
data->firstsocket,
|
||||||
&http->writebytecount);
|
&http->writebytecount);
|
||||||
@@ -564,7 +690,7 @@ CURLcode http(struct connectdata *conn)
|
|||||||
add_buffer_send(data->firstsocket, conn, req_buffer);
|
add_buffer_send(data->firstsocket, conn, req_buffer);
|
||||||
|
|
||||||
/* HTTP GET/HEAD download: */
|
/* HTTP GET/HEAD download: */
|
||||||
result = Transfer(conn, data->firstsocket, -1, TRUE, bytecount,
|
result = Curl_Transfer(conn, data->firstsocket, -1, TRUE, bytecount,
|
||||||
-1, NULL); /* nothing to upload */
|
-1, NULL); /* nothing to upload */
|
||||||
}
|
}
|
||||||
if(result)
|
if(result)
|
||||||
|
49
lib/http.h
49
lib/http.h
@@ -8,47 +8,30 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/* ftp can use this as well */
|
/* ftp can use this as well */
|
||||||
CURLcode GetHTTPProxyTunnel(struct UrlData *data, int tunnelsocket,
|
CURLcode Curl_ConnectHTTPProxyTunnel(struct UrlData *data, int tunnelsocket,
|
||||||
char *hostname, int remote_port);
|
char *hostname, int remote_port);
|
||||||
|
|
||||||
/* protocol-specific functions set up to be called by the main engine */
|
/* protocol-specific functions set up to be called by the main engine */
|
||||||
CURLcode http(struct connectdata *conn);
|
CURLcode Curl_http(struct connectdata *conn);
|
||||||
CURLcode http_done(struct connectdata *conn);
|
CURLcode Curl_http_done(struct connectdata *conn);
|
||||||
CURLcode http_connect(struct connectdata *conn);
|
CURLcode Curl_http_connect(struct connectdata *conn);
|
||||||
CURLcode http_close(struct connectdata *conn);
|
CURLcode Curl_http_close(struct connectdata *conn);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
41
lib/if2ip.c
41
lib/if2ip.c
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -89,7 +72,7 @@
|
|||||||
|
|
||||||
#define SYS_ERROR -1
|
#define SYS_ERROR -1
|
||||||
|
|
||||||
char *if2ip(char *interface, char *buf, int buf_size)
|
char *Curl_if2ip(char *interface, char *buf, int buf_size)
|
||||||
{
|
{
|
||||||
int dummy;
|
int dummy;
|
||||||
char *ip=NULL;
|
char *ip=NULL;
|
||||||
|
43
lib/if2ip.h
43
lib/if2ip.h
@@ -7,44 +7,27 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#if ! defined(WIN32) && ! defined(__BEOS__)
|
#if ! defined(WIN32) && ! defined(__BEOS__)
|
||||||
extern char *if2ip(char *interface, char *buf, int buf_size);
|
extern char *Curl_if2ip(char *interface, char *buf, int buf_size);
|
||||||
#else
|
#else
|
||||||
#define if2ip(a,b,c) NULL
|
#define Curl_if2ip(a,b,c) NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
35
lib/krb4.c
35
lib/krb4.c
@@ -47,6 +47,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <krb.h>
|
#include <krb.h>
|
||||||
|
|
||||||
|
#include "ftp.h"
|
||||||
|
#include "sendf.h"
|
||||||
|
|
||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
#ifdef MALLOCDEBUG
|
#ifdef MALLOCDEBUG
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
@@ -95,7 +98,8 @@ strlcpy (char *dst, const char *src, size_t dst_sz)
|
|||||||
else
|
else
|
||||||
return n + strlen (src);
|
return n + strlen (src);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
size_t strlcpy (char *dst, const char *src, size_t dst_sz);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -284,7 +288,8 @@ krb4_auth(void *app_data, struct connectdata *conn)
|
|||||||
size_t nread;
|
size_t nread;
|
||||||
int l = sizeof(local_addr);
|
int l = sizeof(local_addr);
|
||||||
|
|
||||||
if(getsockname(conn->data->firstsocket, LOCAL_ADDR, &l) < 0)
|
if(getsockname(conn->data->firstsocket,
|
||||||
|
(struct sockaddr *)LOCAL_ADDR, &l) < 0)
|
||||||
perror("getsockname()");
|
perror("getsockname()");
|
||||||
|
|
||||||
checksum = getpid();
|
checksum = getpid();
|
||||||
@@ -327,15 +332,15 @@ krb4_auth(void *app_data, struct connectdata *conn)
|
|||||||
/*printf("Local address is %s\n", inet_ntoa(localaddr->sin_addr));***/
|
/*printf("Local address is %s\n", inet_ntoa(localaddr->sin_addr));***/
|
||||||
/*printf("Remote address is %s\n", inet_ntoa(remoteaddr->sin_addr));***/
|
/*printf("Remote address is %s\n", inet_ntoa(remoteaddr->sin_addr));***/
|
||||||
|
|
||||||
if(base64_encode(adat.dat, adat.length, &p) < 0) {
|
if(Curl_base64_encode(adat.dat, adat.length, &p) < 0) {
|
||||||
printf("Out of memory base64-encoding.\n");
|
printf("Out of memory base64-encoding.\n");
|
||||||
return AUTH_CONTINUE;
|
return AUTH_CONTINUE;
|
||||||
}
|
}
|
||||||
/*ret = command("ADAT %s", p)*/
|
/*ret = command("ADAT %s", p)*/
|
||||||
ftpsendf(conn->data->firstsocket, conn, "ADAT %s", p);
|
Curl_ftpsendf(conn->data->firstsocket, conn, "ADAT %s", p);
|
||||||
/* wait for feedback */
|
/* wait for feedback */
|
||||||
nread = GetLastResponse(conn->data->firstsocket,
|
nread = Curl_GetFTPResponse(conn->data->firstsocket,
|
||||||
conn->data->buffer, conn);
|
conn->data->buffer, conn, NULL);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return /*CURLE_OPERATION_TIMEOUTED*/-1;
|
return /*CURLE_OPERATION_TIMEOUTED*/-1;
|
||||||
free(p);
|
free(p);
|
||||||
@@ -351,7 +356,7 @@ krb4_auth(void *app_data, struct connectdata *conn)
|
|||||||
return AUTH_ERROR;
|
return AUTH_ERROR;
|
||||||
}
|
}
|
||||||
p += 5;
|
p += 5;
|
||||||
len = base64_decode(p, adat.dat);
|
len = Curl_base64_decode(p, adat.dat);
|
||||||
if(len < 0){
|
if(len < 0){
|
||||||
printf("Failed to decode base64 from server.\n");
|
printf("Failed to decode base64 from server.\n");
|
||||||
return AUTH_ERROR;
|
return AUTH_ERROR;
|
||||||
@@ -389,8 +394,6 @@ struct sec_client_mech krb4_client_mech = {
|
|||||||
|
|
||||||
void krb_kauth(struct connectdata *conn)
|
void krb_kauth(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
char buf[1024];
|
|
||||||
des_cblock key;
|
des_cblock key;
|
||||||
des_key_schedule schedule;
|
des_key_schedule schedule;
|
||||||
KTEXT_ST tkt, tktcopy;
|
KTEXT_ST tkt, tktcopy;
|
||||||
@@ -405,10 +408,11 @@ void krb_kauth(struct connectdata *conn)
|
|||||||
|
|
||||||
save = set_command_prot(conn, prot_private);
|
save = set_command_prot(conn, prot_private);
|
||||||
/*ret = command("SITE KAUTH %s", name);***/
|
/*ret = command("SITE KAUTH %s", name);***/
|
||||||
ftpsendf(conn->data->firstsocket, conn,
|
Curl_ftpsendf(conn->data->firstsocket, conn,
|
||||||
"SITE KAUTH %s", conn->data->user);
|
"SITE KAUTH %s", conn->data->user);
|
||||||
/* wait for feedback */
|
/* wait for feedback */
|
||||||
nread = GetLastResponse(conn->data->firstsocket, conn->data->buffer, conn);
|
nread = Curl_GetFTPResponse(conn->data->firstsocket, conn->data->buffer,
|
||||||
|
conn, NULL);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return /*CURLE_OPERATION_TIMEOUTED*/;
|
return /*CURLE_OPERATION_TIMEOUTED*/;
|
||||||
|
|
||||||
@@ -427,7 +431,7 @@ void krb_kauth(struct connectdata *conn)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
p += 2;
|
p += 2;
|
||||||
tmp = base64_decode(p, &tkt.dat);
|
tmp = Curl_base64_decode(p, &tkt.dat);
|
||||||
if(tmp < 0){
|
if(tmp < 0){
|
||||||
printf("Failed to decode base64 in reply.\n");
|
printf("Failed to decode base64 in reply.\n");
|
||||||
set_command_prot(conn, save);
|
set_command_prot(conn, save);
|
||||||
@@ -476,7 +480,7 @@ void krb_kauth(struct connectdata *conn)
|
|||||||
memset(key, 0, sizeof(key));
|
memset(key, 0, sizeof(key));
|
||||||
memset(schedule, 0, sizeof(schedule));
|
memset(schedule, 0, sizeof(schedule));
|
||||||
memset(passwd, 0, sizeof(passwd));
|
memset(passwd, 0, sizeof(passwd));
|
||||||
if(base64_encode(tktcopy.dat, tktcopy.length, &p) < 0) {
|
if(Curl_base64_encode(tktcopy.dat, tktcopy.length, &p) < 0) {
|
||||||
failf(conn->data, "Out of memory base64-encoding.\n");
|
failf(conn->data, "Out of memory base64-encoding.\n");
|
||||||
set_command_prot(conn, save);
|
set_command_prot(conn, save);
|
||||||
/*code = -1;***/
|
/*code = -1;***/
|
||||||
@@ -484,10 +488,11 @@ void krb_kauth(struct connectdata *conn)
|
|||||||
}
|
}
|
||||||
memset (tktcopy.dat, 0, tktcopy.length);
|
memset (tktcopy.dat, 0, tktcopy.length);
|
||||||
/*ret = command("SITE KAUTH %s %s", name, p);***/
|
/*ret = command("SITE KAUTH %s %s", name, p);***/
|
||||||
ftpsendf(conn->data->firstsocket, conn,
|
Curl_ftpsendf(conn->data->firstsocket, conn,
|
||||||
"SITE KAUTH %s %s", name, p);
|
"SITE KAUTH %s %s", name, p);
|
||||||
/* wait for feedback */
|
/* wait for feedback */
|
||||||
nread = GetLastResponse(conn->data->firstsocket, conn->data->buffer, conn);
|
nread = Curl_GetFTPResponse(conn->data->firstsocket, conn->data->buffer,
|
||||||
|
conn, NULL);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return /*CURLE_OPERATION_TIMEOUTED*/;
|
return /*CURLE_OPERATION_TIMEOUTED*/;
|
||||||
free(p);
|
free(p);
|
||||||
|
27
lib/krb4.h
Normal file
27
lib/krb4.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#ifndef __KRB4_H
|
||||||
|
#define __KRB4_H
|
||||||
|
/*****************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
*
|
||||||
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
|
*
|
||||||
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*****************************************************************************/
|
||||||
|
void krb_kauth(struct connectdata *conn);
|
||||||
|
|
||||||
|
#endif
|
45
lib/ldap.c
45
lib/ldap.c
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Contributor(s):
|
|
||||||
* Bj<42>rn Reese <breese@mail1.stofanet.dk>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -134,18 +117,18 @@ static void * DynaGetFunction(char *name)
|
|||||||
static int WriteProc(void *param, char *text, int len)
|
static int WriteProc(void *param, char *text, int len)
|
||||||
{
|
{
|
||||||
struct UrlData *data = (struct UrlData *)param;
|
struct UrlData *data = (struct UrlData *)param;
|
||||||
client_write(data, CLIENTWRITE_BODY, text, 0);
|
Curl_client_write(data, CLIENTWRITE_BODY, text, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode ldap_done(struct connectdata *conn)
|
CURLcode Curl_ldap_done(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*/
|
*/
|
||||||
CURLcode ldap(struct connectdata *conn)
|
CURLcode Curl_ldap(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
CURLcode status = CURLE_OK;
|
CURLcode status = CURLE_OK;
|
||||||
int rc;
|
int rc;
|
||||||
|
43
lib/ldap.h
43
lib/ldap.h
@@ -8,39 +8,22 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
CURLcode Curl_ldap(struct connectdata *conn);
|
||||||
* ------------------------------------------------------------
|
CURLcode Curl_ldap_done(struct connectdata *conn);
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://www.fts.frontec.se/~dast/curl/
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
CURLcode ldap(struct connectdata *conn);
|
|
||||||
CURLcode ldap_done(struct connectdata *conn);
|
|
||||||
|
|
||||||
#endif /* __LDAP_H */
|
#endif /* __LDAP_H */
|
||||||
|
@@ -6,38 +6,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1999.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -152,7 +135,7 @@ int curl_sclose(int sockfd, int line, char *source)
|
|||||||
int res=sclose(sockfd);
|
int res=sclose(sockfd);
|
||||||
fprintf(logfile?logfile:stderr, "FD %s:%d sclose(%d)\n",
|
fprintf(logfile?logfile:stderr, "FD %s:%d sclose(%d)\n",
|
||||||
source, line, sockfd);
|
source, line, sockfd);
|
||||||
return sockfd;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *curl_fopen(char *file, char *mode, int line, char *source)
|
FILE *curl_fopen(char *file, char *mode, int line, char *source)
|
||||||
|
@@ -4,6 +4,15 @@
|
|||||||
*
|
*
|
||||||
*************************************************************************
|
*************************************************************************
|
||||||
*
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
|
||||||
|
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
|
||||||
|
*
|
||||||
* Purpose:
|
* Purpose:
|
||||||
* A merge of Bjorn Reese's format() function and Daniel's dsprintf()
|
* A merge of Bjorn Reese's format() function and Daniel's dsprintf()
|
||||||
* 1.0. A full blooded printf() clone with full support for <num>$
|
* 1.0. A full blooded printf() clone with full support for <num>$
|
||||||
@@ -198,7 +207,7 @@ struct asprintf {
|
|||||||
size_t alloc; /* length of alloc */
|
size_t alloc; /* length of alloc */
|
||||||
};
|
};
|
||||||
|
|
||||||
int msprintf(char *buffer, const char *format, ...);
|
int curl_msprintf(char *buffer, const char *format, ...);
|
||||||
|
|
||||||
static int dprintf_DollarString(char *input, char **end)
|
static int dprintf_DollarString(char *input, char **end)
|
||||||
{
|
{
|
||||||
@@ -946,11 +955,11 @@ static int dprintf_formatf(
|
|||||||
|
|
||||||
if(width >= 0) {
|
if(width >= 0) {
|
||||||
/* RECURSIVE USAGE */
|
/* RECURSIVE USAGE */
|
||||||
fptr += msprintf(fptr, "%d", width);
|
fptr += curl_msprintf(fptr, "%d", width);
|
||||||
}
|
}
|
||||||
if(prec >= 0) {
|
if(prec >= 0) {
|
||||||
/* RECURSIVE USAGE */
|
/* RECURSIVE USAGE */
|
||||||
fptr += msprintf(fptr, ".%d", prec);
|
fptr += curl_msprintf(fptr, ".%d", prec);
|
||||||
}
|
}
|
||||||
if (p->flags & FLAGS_LONG)
|
if (p->flags & FLAGS_LONG)
|
||||||
strcat(fptr, "l");
|
strcat(fptr, "l");
|
||||||
@@ -1016,7 +1025,7 @@ static int addbyter(int output, FILE *data)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int msnprintf(char *buffer, size_t maxlength, const char *format, ...)
|
int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap_save; /* argument pointer */
|
va_list ap_save; /* argument pointer */
|
||||||
int retcode;
|
int retcode;
|
||||||
@@ -1036,7 +1045,7 @@ int msnprintf(char *buffer, size_t maxlength, const char *format, ...)
|
|||||||
return retcode;
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list ap_save)
|
int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list ap_save)
|
||||||
{
|
{
|
||||||
int retcode;
|
int retcode;
|
||||||
struct nsprintf info;
|
struct nsprintf info;
|
||||||
@@ -1083,7 +1092,7 @@ static int alloc_addbyter(int output, FILE *data)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char *maprintf(const char *format, ...)
|
char *curl_maprintf(const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap_save; /* argument pointer */
|
va_list ap_save; /* argument pointer */
|
||||||
int retcode;
|
int retcode;
|
||||||
@@ -1104,7 +1113,7 @@ char *maprintf(const char *format, ...)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *mvaprintf(const char *format, va_list ap_save)
|
char *curl_mvaprintf(const char *format, va_list ap_save)
|
||||||
{
|
{
|
||||||
int retcode;
|
int retcode;
|
||||||
struct asprintf info;
|
struct asprintf info;
|
||||||
@@ -1131,7 +1140,7 @@ static int storebuffer(int output, FILE *data)
|
|||||||
return output; /* act like fputc() ! */
|
return output; /* act like fputc() ! */
|
||||||
}
|
}
|
||||||
|
|
||||||
int msprintf(char *buffer, const char *format, ...)
|
int curl_msprintf(char *buffer, const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap_save; /* argument pointer */
|
va_list ap_save; /* argument pointer */
|
||||||
int retcode;
|
int retcode;
|
||||||
@@ -1144,7 +1153,7 @@ int msprintf(char *buffer, const char *format, ...)
|
|||||||
|
|
||||||
extern int fputc(int, FILE *);
|
extern int fputc(int, FILE *);
|
||||||
|
|
||||||
int mprintf(const char *format, ...)
|
int curl_mprintf(const char *format, ...)
|
||||||
{
|
{
|
||||||
int retcode;
|
int retcode;
|
||||||
va_list ap_save; /* argument pointer */
|
va_list ap_save; /* argument pointer */
|
||||||
@@ -1154,7 +1163,7 @@ int mprintf(const char *format, ...)
|
|||||||
return retcode;
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mfprintf(FILE *whereto, const char *format, ...)
|
int curl_mfprintf(FILE *whereto, const char *format, ...)
|
||||||
{
|
{
|
||||||
int retcode;
|
int retcode;
|
||||||
va_list ap_save; /* argument pointer */
|
va_list ap_save; /* argument pointer */
|
||||||
@@ -1164,7 +1173,7 @@ int mfprintf(FILE *whereto, const char *format, ...)
|
|||||||
return retcode;
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mvsprintf(char *buffer, const char *format, va_list ap_save)
|
int curl_mvsprintf(char *buffer, const char *format, va_list ap_save)
|
||||||
{
|
{
|
||||||
int retcode;
|
int retcode;
|
||||||
retcode = dprintf_formatf(&buffer, storebuffer, format, ap_save);
|
retcode = dprintf_formatf(&buffer, storebuffer, format, ap_save);
|
||||||
@@ -1172,12 +1181,12 @@ int mvsprintf(char *buffer, const char *format, va_list ap_save)
|
|||||||
return retcode;
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mvprintf(const char *format, va_list ap_save)
|
int curl_mvprintf(const char *format, va_list ap_save)
|
||||||
{
|
{
|
||||||
return dprintf_formatf(stdout, fputc, format, ap_save);
|
return dprintf_formatf(stdout, fputc, format, ap_save);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mvfprintf(FILE *whereto, const char *format, va_list ap_save)
|
int curl_mvfprintf(FILE *whereto, const char *format, va_list ap_save)
|
||||||
{
|
{
|
||||||
return dprintf_formatf(whereto, fputc, format, ap_save);
|
return dprintf_formatf(whereto, fputc, format, ap_save);
|
||||||
}
|
}
|
||||||
|
55
lib/netrc.c
55
lib/netrc.c
@@ -5,50 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
* Rafael Sagula <sagula@inf.ufrgs.br>
|
|
||||||
* Sampo Kellomaki <sampo@iki.fi>
|
|
||||||
* Linas Vepstas <linas@linas.org>
|
|
||||||
* Bjorn Reese <breese@imada.ou.dk>
|
|
||||||
* Johan Anderson <johan@homemail.com>
|
|
||||||
* Kjell Ericson <Kjell.Ericson@haxx.se>
|
|
||||||
* Troy Engel <tengel@palladium.net>
|
|
||||||
* Ryan Nelson <ryan@inch.com>
|
|
||||||
* Bjorn Stenberg <Bjorn.Stenberg@haxx.se>
|
|
||||||
* Angus Mackay <amackay@gus.ml.org>
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -80,7 +51,7 @@ enum {
|
|||||||
#define LOGINSIZE 64
|
#define LOGINSIZE 64
|
||||||
#define PASSWORDSIZE 64
|
#define PASSWORDSIZE 64
|
||||||
|
|
||||||
int ParseNetrc(char *host,
|
int Curl_parsenetrc(char *host,
|
||||||
char *login,
|
char *login,
|
||||||
char *password)
|
char *password)
|
||||||
{
|
{
|
||||||
@@ -88,7 +59,7 @@ int ParseNetrc(char *host,
|
|||||||
char netrcbuffer[256];
|
char netrcbuffer[256];
|
||||||
int retcode=1;
|
int retcode=1;
|
||||||
|
|
||||||
char *home = GetEnv("HOME"); /* portable environment reader */
|
char *home = curl_getenv("HOME"); /* portable environment reader */
|
||||||
int state=NOTHING;
|
int state=NOTHING;
|
||||||
|
|
||||||
char state_login=0;
|
char state_login=0;
|
||||||
|
69
lib/netrc.h
69
lib/netrc.h
@@ -7,67 +7,22 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
int Curl_parsenetrc(char *host,
|
||||||
* Contributor(s):
|
|
||||||
* Rafael Sagula <sagula@inf.ufrgs.br>
|
|
||||||
* Sampo Kellomaki <sampo@iki.fi>
|
|
||||||
* Linas Vepstas <linas@linas.org>
|
|
||||||
* Bjorn Reese <breese@imada.ou.dk>
|
|
||||||
* Johan Anderson <johan@homemail.com>
|
|
||||||
* Kjell Ericson <Kjell.Ericson@haxx.se>
|
|
||||||
* Troy Engel <tengel@palladium.net>
|
|
||||||
* Ryan Nelson <ryan@inch.com>
|
|
||||||
* Bjorn Stenberg <Bjorn.Stenberg@haxx.se>
|
|
||||||
* Angus Mackay <amackay@gus.ml.org>
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* $Log$
|
|
||||||
* Revision 1.3 2000-06-20 15:31:26 bagder
|
|
||||||
* haxx.nu => haxx.se
|
|
||||||
*
|
|
||||||
* Revision 1.2 2000/01/10 23:36:15 bagder
|
|
||||||
* syncing with local edit
|
|
||||||
*
|
|
||||||
* Revision 1.3 1999/09/06 06:59:41 dast
|
|
||||||
* Changed email info
|
|
||||||
*
|
|
||||||
* Revision 1.2 1999/08/13 07:34:48 dast
|
|
||||||
* Changed the URL in the header
|
|
||||||
*
|
|
||||||
* Revision 1.1.1.1 1999/03/11 22:23:34 dast
|
|
||||||
* Imported sources
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
int ParseNetrc(char *host,
|
|
||||||
char *login,
|
char *login,
|
||||||
char *password);
|
char *password);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -62,7 +45,7 @@
|
|||||||
|
|
||||||
#include "progress.h"
|
#include "progress.h"
|
||||||
|
|
||||||
void time2str(char *r, int t)
|
static void time2str(char *r, int t)
|
||||||
{
|
{
|
||||||
int h = (t/3600);
|
int h = (t/3600);
|
||||||
int m = (t-(h*3600))/60;
|
int m = (t-(h*3600))/60;
|
||||||
@@ -72,7 +55,7 @@ void time2str(char *r, int t)
|
|||||||
|
|
||||||
/* The point of this function would be to return a string of the input data,
|
/* The point of this function would be to return a string of the input data,
|
||||||
but never longer than 5 columns. Add suffix k, M, G when suitable... */
|
but never longer than 5 columns. Add suffix k, M, G when suitable... */
|
||||||
char *max5data(double bytes, char *max5)
|
static char *max5data(double bytes, char *max5)
|
||||||
{
|
{
|
||||||
#define ONE_KILOBYTE 1024
|
#define ONE_KILOBYTE 1024
|
||||||
#define ONE_MEGABYTE (1024*1024)
|
#define ONE_MEGABYTE (1024*1024)
|
||||||
@@ -108,16 +91,16 @@ char *max5data(double bytes, char *max5)
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void pgrsDone(struct UrlData *data)
|
void Curl_pgrsDone(struct UrlData *data)
|
||||||
{
|
{
|
||||||
if(!(data->progress.flags & PGRS_HIDE)) {
|
if(!(data->progress.flags & PGRS_HIDE)) {
|
||||||
data->progress.lastshow=0;
|
data->progress.lastshow=0;
|
||||||
pgrsUpdate(data); /* the final (forced) update */
|
Curl_pgrsUpdate(data); /* the final (forced) update */
|
||||||
fprintf(data->err, "\n");
|
fprintf(data->err, "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pgrsTime(struct UrlData *data, timerid timer)
|
void Curl_pgrsTime(struct UrlData *data, timerid timer)
|
||||||
{
|
{
|
||||||
switch(timer) {
|
switch(timer) {
|
||||||
default:
|
default:
|
||||||
@@ -128,19 +111,19 @@ void pgrsTime(struct UrlData *data, timerid timer)
|
|||||||
/* This is set at the start of a single fetch, there may be several
|
/* This is set at the start of a single fetch, there may be several
|
||||||
fetches within an operation, why we add all other times relative
|
fetches within an operation, why we add all other times relative
|
||||||
to this one */
|
to this one */
|
||||||
data->progress.t_startsingle = tvnow();
|
data->progress.t_startsingle = Curl_tvnow();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TIMER_NAMELOOKUP:
|
case TIMER_NAMELOOKUP:
|
||||||
data->progress.t_nslookup += tvdiff(tvnow(),
|
data->progress.t_nslookup += Curl_tvdiff(Curl_tvnow(),
|
||||||
data->progress.t_startsingle);
|
data->progress.t_startsingle);
|
||||||
break;
|
break;
|
||||||
case TIMER_CONNECT:
|
case TIMER_CONNECT:
|
||||||
data->progress.t_connect += tvdiff(tvnow(),
|
data->progress.t_connect += Curl_tvdiff(Curl_tvnow(),
|
||||||
data->progress.t_startsingle);
|
data->progress.t_startsingle);
|
||||||
break;
|
break;
|
||||||
case TIMER_PRETRANSFER:
|
case TIMER_PRETRANSFER:
|
||||||
data->progress.t_pretransfer += tvdiff(tvnow(),
|
data->progress.t_pretransfer += Curl_tvdiff(Curl_tvnow(),
|
||||||
data->progress.t_startsingle);
|
data->progress.t_startsingle);
|
||||||
break;
|
break;
|
||||||
case TIMER_POSTRANSFER:
|
case TIMER_POSTRANSFER:
|
||||||
@@ -149,22 +132,22 @@ void pgrsTime(struct UrlData *data, timerid timer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pgrsStartNow(struct UrlData *data)
|
void Curl_pgrsStartNow(struct UrlData *data)
|
||||||
{
|
{
|
||||||
data->progress.start = tvnow();
|
data->progress.start = Curl_tvnow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void pgrsSetDownloadCounter(struct UrlData *data, double size)
|
void Curl_pgrsSetDownloadCounter(struct UrlData *data, double size)
|
||||||
{
|
{
|
||||||
data->progress.downloaded = size;
|
data->progress.downloaded = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pgrsSetUploadCounter(struct UrlData *data, double size)
|
void Curl_pgrsSetUploadCounter(struct UrlData *data, double size)
|
||||||
{
|
{
|
||||||
data->progress.uploaded = size;
|
data->progress.uploaded = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pgrsSetDownloadSize(struct UrlData *data, double size)
|
void Curl_pgrsSetDownloadSize(struct UrlData *data, double size)
|
||||||
{
|
{
|
||||||
if(size > 0) {
|
if(size > 0) {
|
||||||
data->progress.size_dl = size;
|
data->progress.size_dl = size;
|
||||||
@@ -172,7 +155,7 @@ void pgrsSetDownloadSize(struct UrlData *data, double size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pgrsSetUploadSize(struct UrlData *data, double size)
|
void Curl_pgrsSetUploadSize(struct UrlData *data, double size)
|
||||||
{
|
{
|
||||||
if(size > 0) {
|
if(size > 0) {
|
||||||
data->progress.size_ul = size;
|
data->progress.size_ul = size;
|
||||||
@@ -188,7 +171,7 @@ void pgrsSetUploadSize(struct UrlData *data, double size)
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int pgrsUpdate(struct UrlData *data)
|
int Curl_pgrsUpdate(struct UrlData *data)
|
||||||
{
|
{
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
int result;
|
int result;
|
||||||
@@ -227,15 +210,15 @@ int pgrsUpdate(struct UrlData *data)
|
|||||||
data->progress.flags |= PGRS_HEADERS_OUT; /* headers are shown */
|
data->progress.flags |= PGRS_HEADERS_OUT; /* headers are shown */
|
||||||
}
|
}
|
||||||
|
|
||||||
now = tvnow(); /* what time is it */
|
now = Curl_tvnow(); /* what time is it */
|
||||||
|
|
||||||
if(data->progress.lastshow == tvlong(now))
|
if(data->progress.lastshow == Curl_tvlong(now))
|
||||||
return 0; /* never update this more than once a second if the end isn't
|
return 0; /* never update this more than once a second if the end isn't
|
||||||
reached */
|
reached */
|
||||||
data->progress.lastshow = now.tv_sec;
|
data->progress.lastshow = now.tv_sec;
|
||||||
|
|
||||||
/* The exact time spent so far */
|
/* The exact time spent so far */
|
||||||
data->progress.timespent = tvdiff (now, data->progress.start);
|
data->progress.timespent = Curl_tvdiff (now, data->progress.start);
|
||||||
|
|
||||||
/* The average download speed this far */
|
/* The average download speed this far */
|
||||||
data->progress.dlspeed = data->progress.downloaded/(data->progress.timespent!=0.0?data->progress.timespent:1.0);
|
data->progress.dlspeed = data->progress.downloaded/(data->progress.timespent!=0.0?data->progress.timespent:1.0);
|
||||||
|
@@ -7,38 +7,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "timeval.h"
|
#include "timeval.h"
|
||||||
|
|
||||||
@@ -53,14 +36,14 @@ typedef enum {
|
|||||||
TIMER_LAST /* must be last */
|
TIMER_LAST /* must be last */
|
||||||
} timerid;
|
} timerid;
|
||||||
|
|
||||||
void pgrsDone(struct UrlData *data);
|
void Curl_pgrsDone(struct UrlData *data);
|
||||||
void pgrsStartNow(struct UrlData *data);
|
void Curl_pgrsStartNow(struct UrlData *data);
|
||||||
void pgrsSetDownloadSize(struct UrlData *data, double size);
|
void Curl_pgrsSetDownloadSize(struct UrlData *data, double size);
|
||||||
void pgrsSetUploadSize(struct UrlData *data, double size);
|
void Curl_pgrsSetUploadSize(struct UrlData *data, double size);
|
||||||
void pgrsSetDownloadCounter(struct UrlData *data, double size);
|
void Curl_pgrsSetDownloadCounter(struct UrlData *data, double size);
|
||||||
void pgrsSetUploadCounter(struct UrlData *data, double size);
|
void Curl_pgrsSetUploadCounter(struct UrlData *data, double size);
|
||||||
int pgrsUpdate(struct UrlData *data);
|
int Curl_pgrsUpdate(struct UrlData *data);
|
||||||
void pgrsTime(struct UrlData *data, timerid timer);
|
void Curl_pgrsTime(struct UrlData *data, timerid timer);
|
||||||
|
|
||||||
|
|
||||||
/* Don't show progress for sizes smaller than: */
|
/* Don't show progress for sizes smaller than: */
|
||||||
|
@@ -40,13 +40,22 @@
|
|||||||
|
|
||||||
#ifdef KRB4
|
#ifdef KRB4
|
||||||
|
|
||||||
|
#define _MPRINTF_REPLACE /* we want curl-functions instead of native ones */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
|
|
||||||
#include "security.h"
|
#include "security.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "base64.h"
|
#include "base64.h"
|
||||||
|
#include "sendf.h"
|
||||||
|
#include "ftp.h"
|
||||||
|
|
||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
#ifdef MALLOCDEBUG
|
#ifdef MALLOCDEBUG
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
@@ -64,6 +73,7 @@ static struct {
|
|||||||
{ prot_private, "private" }
|
{ prot_private, "private" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if 0
|
||||||
static const char *
|
static const char *
|
||||||
level_to_name(enum protection_level level)
|
level_to_name(enum protection_level level)
|
||||||
{
|
{
|
||||||
@@ -73,6 +83,7 @@ level_to_name(enum protection_level level)
|
|||||||
return level_names[i].name;
|
return level_names[i].name;
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef FTP_SERVER /* not used in server */
|
#ifndef FTP_SERVER /* not used in server */
|
||||||
static enum protection_level
|
static enum protection_level
|
||||||
@@ -319,7 +330,7 @@ sec_vfprintf2(struct connectdata *conn, FILE *f, const char *fmt, va_list ap)
|
|||||||
if(conn->data_prot == prot_clear)
|
if(conn->data_prot == prot_clear)
|
||||||
return vfprintf(f, fmt, ap);
|
return vfprintf(f, fmt, ap);
|
||||||
else {
|
else {
|
||||||
buf = maprintf(fmt, ap);
|
buf = aprintf(fmt, ap);
|
||||||
ret = buffer_write(&conn->out_buffer, buf, strlen(buf));
|
ret = buffer_write(&conn->out_buffer, buf, strlen(buf));
|
||||||
free(buf);
|
free(buf);
|
||||||
return ret;
|
return ret;
|
||||||
@@ -360,7 +371,7 @@ sec_read_msg(struct connectdata *conn, char *s, int level)
|
|||||||
int code;
|
int code;
|
||||||
|
|
||||||
buf = malloc(strlen(s));
|
buf = malloc(strlen(s));
|
||||||
len = base64_decode(s + 4, buf); /* XXX */
|
len = Curl_base64_decode(s + 4, buf); /* XXX */
|
||||||
|
|
||||||
len = (*mech->decode)(conn->app_data, buf, len, level, conn);
|
len = (*mech->decode)(conn->app_data, buf, len, level, conn);
|
||||||
if(len < 0)
|
if(len < 0)
|
||||||
@@ -390,7 +401,7 @@ sec_vfprintf(struct connectdata *conn, FILE *f, const char *fmt, va_list ap)
|
|||||||
if(!conn->sec_complete)
|
if(!conn->sec_complete)
|
||||||
return vfprintf(f, fmt, ap);
|
return vfprintf(f, fmt, ap);
|
||||||
|
|
||||||
buf = maprintf(fmt, ap);
|
buf = aprintf(fmt, ap);
|
||||||
len = (*mech->encode)(conn->app_data, buf, strlen(buf),
|
len = (*mech->encode)(conn->app_data, buf, strlen(buf),
|
||||||
conn->command_prot, &enc,
|
conn->command_prot, &enc,
|
||||||
conn);
|
conn);
|
||||||
@@ -399,7 +410,7 @@ sec_vfprintf(struct connectdata *conn, FILE *f, const char *fmt, va_list ap)
|
|||||||
failf(conn->data, "Failed to encode command.\n");
|
failf(conn->data, "Failed to encode command.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(base64_encode(enc, len, &buf) < 0){
|
if(Curl_base64_encode(enc, len, &buf) < 0){
|
||||||
failf(conn->data, "Out of memory base64-encoding.\n");
|
failf(conn->data, "Out of memory base64-encoding.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -461,7 +472,6 @@ sec_status(void)
|
|||||||
static int
|
static int
|
||||||
sec_prot_internal(struct connectdata *conn, int level)
|
sec_prot_internal(struct connectdata *conn, int level)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
char *p;
|
char *p;
|
||||||
unsigned int s = 1048576;
|
unsigned int s = 1048576;
|
||||||
size_t nread;
|
size_t nread;
|
||||||
@@ -472,11 +482,11 @@ sec_prot_internal(struct connectdata *conn, int level)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(level){
|
if(level){
|
||||||
ftpsendf(conn->data->firstsocket, conn,
|
Curl_ftpsendf(conn->data->firstsocket, conn,
|
||||||
"PBSZ %u", s);
|
"PBSZ %u", s);
|
||||||
/* wait for feedback */
|
/* wait for feedback */
|
||||||
nread = GetLastResponse(conn->data->firstsocket,
|
nread = Curl_GetFTPResponse(conn->data->firstsocket,
|
||||||
conn->data->buffer, conn);
|
conn->data->buffer, conn, NULL);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return /*CURLE_OPERATION_TIMEOUTED*/-1;
|
return /*CURLE_OPERATION_TIMEOUTED*/-1;
|
||||||
if(/*ret != COMPLETE*/conn->data->buffer[0] != '2'){
|
if(/*ret != COMPLETE*/conn->data->buffer[0] != '2'){
|
||||||
@@ -491,11 +501,11 @@ sec_prot_internal(struct connectdata *conn, int level)
|
|||||||
conn->buffer_size = s;
|
conn->buffer_size = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
ftpsendf(conn->data->firstsocket, conn,
|
Curl_ftpsendf(conn->data->firstsocket, conn,
|
||||||
"PROT %c", level["CSEP"]);
|
"PROT %c", level["CSEP"]);
|
||||||
/* wait for feedback */
|
/* wait for feedback */
|
||||||
nread = GetLastResponse(conn->data->firstsocket,
|
nread = Curl_GetFTPResponse(conn->data->firstsocket,
|
||||||
conn->data->buffer, conn);
|
conn->data->buffer, conn, NULL);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return /*CURLE_OPERATION_TIMEOUTED*/-1;
|
return /*CURLE_OPERATION_TIMEOUTED*/-1;
|
||||||
if(/*ret != COMPLETE*/conn->data->buffer[0] != '2'){
|
if(/*ret != COMPLETE*/conn->data->buffer[0] != '2'){
|
||||||
@@ -600,11 +610,11 @@ sec_login(struct connectdata *conn)
|
|||||||
}
|
}
|
||||||
infof(data, "Trying %s...\n", (*m)->name);
|
infof(data, "Trying %s...\n", (*m)->name);
|
||||||
/*ret = command("AUTH %s", (*m)->name);***/
|
/*ret = command("AUTH %s", (*m)->name);***/
|
||||||
ftpsendf(conn->data->firstsocket, conn,
|
Curl_ftpsendf(conn->data->firstsocket, conn,
|
||||||
"AUTH %s", (*m)->name);
|
"AUTH %s", (*m)->name);
|
||||||
/* wait for feedback */
|
/* wait for feedback */
|
||||||
nread = GetLastResponse(conn->data->firstsocket,
|
nread = Curl_GetFTPResponse(conn->data->firstsocket,
|
||||||
conn->data->buffer, conn);
|
conn->data->buffer, conn, NULL);
|
||||||
if(nread < 0)
|
if(nread < 0)
|
||||||
return /*CURLE_OPERATION_TIMEOUTED*/-1;
|
return /*CURLE_OPERATION_TIMEOUTED*/-1;
|
||||||
if(/*ret != CONTINUE*/conn->data->buffer[0] != '3'){
|
if(/*ret != CONTINUE*/conn->data->buffer[0] != '3'){
|
||||||
|
175
lib/sendf.c
175
lib/sendf.c
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -69,7 +52,7 @@
|
|||||||
|
|
||||||
/* infof() is for info message along the way */
|
/* infof() is for info message along the way */
|
||||||
|
|
||||||
void infof(struct UrlData *data, char *fmt, ...)
|
void Curl_infof(struct UrlData *data, char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
if(data->bits.verbose) {
|
if(data->bits.verbose) {
|
||||||
@@ -83,7 +66,7 @@ void infof(struct UrlData *data, char *fmt, ...)
|
|||||||
/* failf() is for messages stating why we failed, the LAST one will be
|
/* failf() is for messages stating why we failed, the LAST one will be
|
||||||
returned for the user (if requested) */
|
returned for the user (if requested) */
|
||||||
|
|
||||||
void failf(struct UrlData *data, char *fmt, ...)
|
void Curl_failf(struct UrlData *data, char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
@@ -95,13 +78,13 @@ void failf(struct UrlData *data, char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* sendf() sends the formated data to the server */
|
/* sendf() sends the formated data to the server */
|
||||||
size_t sendf(int fd, struct UrlData *data, char *fmt, ...)
|
size_t Curl_sendf(int fd, struct UrlData *data, char *fmt, ...)
|
||||||
{
|
{
|
||||||
size_t bytes_written;
|
size_t bytes_written;
|
||||||
char *s;
|
char *s;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
s = mvaprintf(fmt, ap);
|
s = vaprintf(fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
if(!s)
|
if(!s)
|
||||||
return 0; /* failure */
|
return 0; /* failure */
|
||||||
@@ -121,43 +104,8 @@ size_t sendf(int fd, struct UrlData *data, char *fmt, ...)
|
|||||||
return(bytes_written);
|
return(bytes_written);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* ftpsendf() sends the formated string as a ftp command to a ftp server
|
|
||||||
*
|
|
||||||
* NOTE: we build the command in a fixed-length buffer, which sets length
|
|
||||||
* restrictions on the command!
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
size_t ftpsendf(int fd, struct connectdata *conn, char *fmt, ...)
|
|
||||||
{
|
|
||||||
size_t bytes_written;
|
|
||||||
char s[256];
|
|
||||||
|
|
||||||
va_list ap;
|
|
||||||
va_start(ap, fmt);
|
|
||||||
vsnprintf(s, 250, fmt, ap);
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
if(conn->data->bits.verbose)
|
|
||||||
fprintf(conn->data->err, "> %s\n", s);
|
|
||||||
|
|
||||||
strcat(s, "\r\n"); /* append a trailing CRLF */
|
|
||||||
|
|
||||||
#ifdef KRB4
|
|
||||||
if(conn->sec_complete && conn->data->cmdchannel) {
|
|
||||||
bytes_written = sec_fprintf(conn, conn->data->cmdchannel, s);
|
|
||||||
fflush(conn->data->cmdchannel);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif /* KRB4 */
|
|
||||||
{
|
|
||||||
bytes_written = swrite(fd, s, strlen(s));
|
|
||||||
}
|
|
||||||
return(bytes_written);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ssend() sends plain (binary) data to the server */
|
/* ssend() sends plain (binary) data to the server */
|
||||||
size_t ssend(int fd, struct connectdata *conn, void *mem, size_t len)
|
size_t Curl_ssend(int fd, struct connectdata *conn, void *mem, size_t len)
|
||||||
{
|
{
|
||||||
size_t bytes_written;
|
size_t bytes_written;
|
||||||
struct UrlData *data=conn->data; /* conn knows data, not vice versa */
|
struct UrlData *data=conn->data; /* conn knows data, not vice versa */
|
||||||
@@ -187,7 +135,7 @@ size_t ssend(int fd, struct connectdata *conn, void *mem, size_t len)
|
|||||||
The bit pattern defines to what "streams" to write to. Body and/or header.
|
The bit pattern defines to what "streams" to write to. Body and/or header.
|
||||||
The defines are in sendf.h of course.
|
The defines are in sendf.h of course.
|
||||||
*/
|
*/
|
||||||
CURLcode client_write(struct UrlData *data,
|
CURLcode Curl_client_write(struct UrlData *data,
|
||||||
int type,
|
int type,
|
||||||
char *ptr,
|
char *ptr,
|
||||||
size_t len)
|
size_t len)
|
||||||
@@ -215,92 +163,3 @@ CURLcode client_write(struct UrlData *data,
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* add_buffer_init() returns a fine buffer struct
|
|
||||||
*/
|
|
||||||
send_buffer *add_buffer_init(void)
|
|
||||||
{
|
|
||||||
send_buffer *blonk;
|
|
||||||
blonk=(send_buffer *)malloc(sizeof(send_buffer));
|
|
||||||
if(blonk) {
|
|
||||||
memset(blonk, 0, sizeof(send_buffer));
|
|
||||||
return blonk;
|
|
||||||
}
|
|
||||||
return NULL; /* failed, go home */
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* add_buffer_send() sends a buffer and frees all associated memory.
|
|
||||||
*/
|
|
||||||
size_t add_buffer_send(int sockfd, struct connectdata *conn, send_buffer *in)
|
|
||||||
{
|
|
||||||
size_t amount;
|
|
||||||
if(conn->data->bits.verbose) {
|
|
||||||
fputs("> ", conn->data->err);
|
|
||||||
/* this data _may_ contain binary stuff */
|
|
||||||
fwrite(in->buffer, in->size_used, 1, conn->data->err);
|
|
||||||
}
|
|
||||||
|
|
||||||
amount = ssend(sockfd, conn, in->buffer, in->size_used);
|
|
||||||
|
|
||||||
if(in->buffer)
|
|
||||||
free(in->buffer);
|
|
||||||
free(in);
|
|
||||||
|
|
||||||
return amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* add_bufferf() builds a buffer from the formatted input
|
|
||||||
*/
|
|
||||||
CURLcode add_bufferf(send_buffer *in, char *fmt, ...)
|
|
||||||
{
|
|
||||||
CURLcode result = CURLE_OUT_OF_MEMORY;
|
|
||||||
char *s;
|
|
||||||
va_list ap;
|
|
||||||
va_start(ap, fmt);
|
|
||||||
s = mvaprintf(fmt, ap); /* this allocs a new string to append */
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
if(s) {
|
|
||||||
result = add_buffer(in, s, strlen(s));
|
|
||||||
free(s);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* add_buffer() appends a memory chunk to the existing one
|
|
||||||
*/
|
|
||||||
CURLcode add_buffer(send_buffer *in, void *inptr, size_t size)
|
|
||||||
{
|
|
||||||
char *new_rb;
|
|
||||||
int new_size;
|
|
||||||
|
|
||||||
if(size > 0) {
|
|
||||||
if(!in->buffer ||
|
|
||||||
((in->size_used + size) > (in->size_max - 1))) {
|
|
||||||
new_size = (in->size_used+size)*2;
|
|
||||||
if(in->buffer)
|
|
||||||
/* we have a buffer, enlarge the existing one */
|
|
||||||
new_rb = (char *)realloc(in->buffer, new_size);
|
|
||||||
else
|
|
||||||
/* create a new buffer */
|
|
||||||
new_rb = (char *)malloc(new_size);
|
|
||||||
|
|
||||||
if(!new_rb)
|
|
||||||
return CURLE_OUT_OF_MEMORY;
|
|
||||||
|
|
||||||
in->buffer = new_rb;
|
|
||||||
in->size_max = new_size;
|
|
||||||
}
|
|
||||||
memcpy(&in->buffer[in->size_used], inptr, size);
|
|
||||||
|
|
||||||
in->size_used += size;
|
|
||||||
}
|
|
||||||
|
|
||||||
return CURLE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
60
lib/sendf.h
60
lib/sendf.h
@@ -7,44 +7,31 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
size_t ftpsendf(int fd, struct connectdata *, char *fmt, ...);
|
size_t Curl_sendf(int fd, struct UrlData *, char *fmt, ...);
|
||||||
size_t sendf(int fd, struct UrlData *, char *fmt, ...);
|
size_t Curl_ssend(int fd, struct connectdata *, void *fmt, size_t len);
|
||||||
size_t ssend(int fd, struct connectdata *, void *fmt, size_t len);
|
void Curl_infof(struct UrlData *, char *fmt, ...);
|
||||||
void infof(struct UrlData *, char *fmt, ...);
|
void Curl_failf(struct UrlData *, char *fmt, ...);
|
||||||
void failf(struct UrlData *, char *fmt, ...);
|
|
||||||
|
#define sendf Curl_sendf
|
||||||
|
#define ssend Curl_ssend
|
||||||
|
#define infof Curl_infof
|
||||||
|
#define failf Curl_failf
|
||||||
|
|
||||||
struct send_buffer {
|
struct send_buffer {
|
||||||
char *buffer;
|
char *buffer;
|
||||||
@@ -57,12 +44,7 @@ typedef struct send_buffer send_buffer;
|
|||||||
#define CLIENTWRITE_HEADER 2
|
#define CLIENTWRITE_HEADER 2
|
||||||
#define CLIENTWRITE_BOTH (CLIENTWRITE_BODY|CLIENTWRITE_HEADER)
|
#define CLIENTWRITE_BOTH (CLIENTWRITE_BODY|CLIENTWRITE_HEADER)
|
||||||
|
|
||||||
CURLcode client_write(struct UrlData *data, int type, char *ptr,
|
CURLcode Curl_client_write(struct UrlData *data, int type, char *ptr,
|
||||||
size_t len);
|
size_t len);
|
||||||
send_buffer *add_buffer_init(void);
|
|
||||||
CURLcode add_buffer(send_buffer *in, void *inptr, size_t size);
|
|
||||||
CURLcode add_bufferf(send_buffer *in, char *fmt, ...);
|
|
||||||
size_t add_buffer_send(int sockfd, struct connectdata *conn, send_buffer *in);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
39
lib/setup.h
39
lib/setup.h
@@ -7,38 +7,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -50,24 +33,24 @@
|
|||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
#include "speedcheck.h"
|
#include "speedcheck.h"
|
||||||
|
|
||||||
void speedinit(struct UrlData *data)
|
void Curl_speedinit(struct UrlData *data)
|
||||||
{
|
{
|
||||||
memset(&data->keeps_speed, 0, sizeof(struct timeval));
|
memset(&data->keeps_speed, 0, sizeof(struct timeval));
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode speedcheck(struct UrlData *data,
|
CURLcode Curl_speedcheck(struct UrlData *data,
|
||||||
struct timeval now)
|
struct timeval now)
|
||||||
{
|
{
|
||||||
if((data->progress.current_speed >= 0) &&
|
if((data->progress.current_speed >= 0) &&
|
||||||
data->low_speed_time &&
|
data->low_speed_time &&
|
||||||
(tvlong(data->keeps_speed) != 0) &&
|
(Curl_tvlong(data->keeps_speed) != 0) &&
|
||||||
(data->progress.current_speed < data->low_speed_limit)) {
|
(data->progress.current_speed < data->low_speed_limit)) {
|
||||||
|
|
||||||
/* We are now below the "low speed limit". If we are below it
|
/* We are now below the "low speed limit". If we are below it
|
||||||
for "low speed time" seconds we consider that enough reason
|
for "low speed time" seconds we consider that enough reason
|
||||||
to abort the download. */
|
to abort the download. */
|
||||||
|
|
||||||
if( tvdiff(now, data->keeps_speed) > data->low_speed_time) {
|
if( Curl_tvdiff(now, data->keeps_speed) > data->low_speed_time) {
|
||||||
/* we have been this slow for long enough, now die */
|
/* we have been this slow for long enough, now die */
|
||||||
failf(data,
|
failf(data,
|
||||||
"Operation too slow. "
|
"Operation too slow. "
|
||||||
|
@@ -7,45 +7,28 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#include "timeval.h"
|
#include "timeval.h"
|
||||||
|
|
||||||
void speedinit(struct UrlData *data);
|
void Curl_speedinit(struct UrlData *data);
|
||||||
CURLcode speedcheck(struct UrlData *data,
|
CURLcode Curl_speedcheck(struct UrlData *data,
|
||||||
struct timeval now);
|
struct timeval now);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
49
lib/ssluse.c
49
lib/ssluse.c
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The original SSL code was written by
|
* The original SSL code was written by
|
||||||
@@ -79,7 +62,8 @@ static int passwd_callback(char *buf, int num, int verify
|
|||||||
* from) source from the SSLeay package written by Eric Young
|
* from) source from the SSLeay package written by Eric Young
|
||||||
* (eay@cryptsoft.com). */
|
* (eay@cryptsoft.com). */
|
||||||
|
|
||||||
int SSL_cert_stuff(struct UrlData *data,
|
static
|
||||||
|
int cert_stuff(struct UrlData *data,
|
||||||
char *cert_file,
|
char *cert_file,
|
||||||
char *key_file)
|
char *key_file)
|
||||||
{
|
{
|
||||||
@@ -141,6 +125,7 @@ int SSL_cert_stuff(struct UrlData *data,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_SSLEAY
|
#ifdef USE_SSLEAY
|
||||||
|
static
|
||||||
int cert_verify_callback(int ok, X509_STORE_CTX *ctx)
|
int cert_verify_callback(int ok, X509_STORE_CTX *ctx)
|
||||||
{
|
{
|
||||||
X509 *err_cert;
|
X509 *err_cert;
|
||||||
@@ -156,7 +141,7 @@ int cert_verify_callback(int ok, X509_STORE_CTX *ctx)
|
|||||||
|
|
||||||
/* ====================================================== */
|
/* ====================================================== */
|
||||||
int
|
int
|
||||||
UrgSSLConnect (struct UrlData *data)
|
Curl_SSLConnect (struct UrlData *data)
|
||||||
{
|
{
|
||||||
#ifdef USE_SSLEAY
|
#ifdef USE_SSLEAY
|
||||||
int err;
|
int err;
|
||||||
@@ -180,7 +165,7 @@ UrgSSLConnect (struct UrlData *data)
|
|||||||
RAND_screen();
|
RAND_screen();
|
||||||
#else
|
#else
|
||||||
int len;
|
int len;
|
||||||
char *area = MakeFormBoundary();
|
char *area = Curl_FormBoundary();
|
||||||
if(!area)
|
if(!area)
|
||||||
return 3; /* out of memory */
|
return 3; /* out of memory */
|
||||||
|
|
||||||
@@ -215,7 +200,7 @@ UrgSSLConnect (struct UrlData *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(data->cert) {
|
if(data->cert) {
|
||||||
if (!SSL_cert_stuff(data, data->cert, data->cert)) {
|
if (!cert_stuff(data, data->cert, data->cert)) {
|
||||||
failf(data, "couldn't use certificate!\n");
|
failf(data, "couldn't use certificate!\n");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
44
lib/ssluse.h
44
lib/ssluse.h
@@ -7,40 +7,20 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
int Curl_SSLConnect (struct UrlData *data);
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
int SSL_cert_stuff(struct UrlData *data,
|
|
||||||
char *cert_file,
|
|
||||||
char *key_file);
|
|
||||||
int UrgSSLConnect (struct UrlData *data);
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -5,44 +5,27 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2000.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int strequal(const char *first, const char *second)
|
int Curl_strequal(const char *first, const char *second)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_STRCASECMP)
|
#if defined(HAVE_STRCASECMP)
|
||||||
return !strcasecmp(first, second);
|
return !strcasecmp(first, second);
|
||||||
@@ -62,7 +45,7 @@ int strequal(const char *first, const char *second)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int strnequal(const char *first, const char *second, size_t max)
|
int Curl_strnequal(const char *first, const char *second, size_t max)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_STRCASECMP)
|
#if defined(HAVE_STRCASECMP)
|
||||||
return !strncasecmp(first, second, max);
|
return !strncasecmp(first, second, max);
|
||||||
|
@@ -7,39 +7,25 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 2000.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
int Curl_strequal(const char *first, const char *second);
|
||||||
* ------------------------------------------------------------
|
int Curl_strnequal(const char *first, const char *second, size_t max);
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
#define strequal(a,b) Curl_strequal(a,b)
|
||||||
*
|
#define strnequal(a,b,c) Curl_strnequal(a,b,c)
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
int strequal(const char *first, const char *second);
|
|
||||||
int strnequal(const char *first, const char *second, size_t max);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
70
lib/telnet.c
70
lib/telnet.c
@@ -5,46 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* This implementation of the TELNET protocol is written by
|
|
||||||
* Linus Nielsen <Linus.Nielsen@haxx.se>,
|
|
||||||
* with some code snippets stolen from the BSD Telnet client.
|
|
||||||
*
|
|
||||||
* The negotiation is performed according to RFC 1143 (D. Bernstein,
|
|
||||||
* "The Q Method of Implementing TELNET Option Negotiation")
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -96,7 +71,7 @@
|
|||||||
|
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include "download.h"
|
#include "transfer.h"
|
||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
#include "formdata.h"
|
#include "formdata.h"
|
||||||
#include "progress.h"
|
#include "progress.h"
|
||||||
@@ -106,7 +81,6 @@
|
|||||||
|
|
||||||
#define TELOPTS
|
#define TELOPTS
|
||||||
#define TELCMDS
|
#define TELCMDS
|
||||||
#define SLC_NAMES
|
|
||||||
|
|
||||||
#include "arpa_telnet.h"
|
#include "arpa_telnet.h"
|
||||||
|
|
||||||
@@ -123,10 +97,12 @@
|
|||||||
#define SB_EOF() (subpointer >= subend)
|
#define SB_EOF() (subpointer >= subend)
|
||||||
#define SB_LEN() (subend - subpointer)
|
#define SB_LEN() (subend - subpointer)
|
||||||
|
|
||||||
|
static
|
||||||
void telwrite(struct UrlData *data,
|
void telwrite(struct UrlData *data,
|
||||||
unsigned char *buffer, /* Data to write */
|
unsigned char *buffer, /* Data to write */
|
||||||
int count); /* Number of bytes to write */
|
int count); /* Number of bytes to write */
|
||||||
|
|
||||||
|
static
|
||||||
void telrcv(struct UrlData *data,
|
void telrcv(struct UrlData *data,
|
||||||
unsigned char *inbuf, /* Data received from socket */
|
unsigned char *inbuf, /* Data received from socket */
|
||||||
int count); /* Number of bytes received */
|
int count); /* Number of bytes received */
|
||||||
@@ -180,6 +156,7 @@ static int him[256];
|
|||||||
static int himq[256];
|
static int himq[256];
|
||||||
static int him_preferred[256];
|
static int him_preferred[256];
|
||||||
|
|
||||||
|
static
|
||||||
void init_telnet(struct UrlData *data)
|
void init_telnet(struct UrlData *data)
|
||||||
{
|
{
|
||||||
telrcv_state = TS_DATA;
|
telrcv_state = TS_DATA;
|
||||||
@@ -271,6 +248,7 @@ static void send_negotiation(struct UrlData *data, int cmd, int option)
|
|||||||
printoption(data, "SENT", cmd, option);
|
printoption(data, "SENT", cmd, option);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
void set_remote_option(struct UrlData *data, int option, int newstate)
|
void set_remote_option(struct UrlData *data, int option, int newstate)
|
||||||
{
|
{
|
||||||
if(newstate == YES)
|
if(newstate == YES)
|
||||||
@@ -351,6 +329,7 @@ void set_remote_option(struct UrlData *data, int option, int newstate)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
void rec_will(struct UrlData *data, int option)
|
void rec_will(struct UrlData *data, int option)
|
||||||
{
|
{
|
||||||
switch(him[option])
|
switch(him[option])
|
||||||
@@ -402,6 +381,7 @@ void rec_will(struct UrlData *data, int option)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
void rec_wont(struct UrlData *data, int option)
|
void rec_wont(struct UrlData *data, int option)
|
||||||
{
|
{
|
||||||
switch(him[option])
|
switch(him[option])
|
||||||
@@ -525,6 +505,7 @@ void set_local_option(struct UrlData *data, int option, int newstate)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
void rec_do(struct UrlData *data, int option)
|
void rec_do(struct UrlData *data, int option)
|
||||||
{
|
{
|
||||||
switch(us[option])
|
switch(us[option])
|
||||||
@@ -576,6 +557,7 @@ void rec_do(struct UrlData *data, int option)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
void rec_dont(struct UrlData *data, int option)
|
void rec_dont(struct UrlData *data, int option)
|
||||||
{
|
{
|
||||||
switch(us[option])
|
switch(us[option])
|
||||||
@@ -694,6 +676,7 @@ static void suboption(struct UrlData *data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
void telrcv(struct UrlData *data,
|
void telrcv(struct UrlData *data,
|
||||||
unsigned char *inbuf, /* Data received from socket */
|
unsigned char *inbuf, /* Data received from socket */
|
||||||
int count) /* Number of bytes received */
|
int count) /* Number of bytes received */
|
||||||
@@ -714,7 +697,7 @@ void telrcv(struct UrlData *data,
|
|||||||
break; /* Ignore \0 after CR */
|
break; /* Ignore \0 after CR */
|
||||||
}
|
}
|
||||||
|
|
||||||
client_write(data, CLIENTWRITE_BODY, (char *)&c, 1);
|
Curl_client_write(data, CLIENTWRITE_BODY, (char *)&c, 1);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case TS_DATA:
|
case TS_DATA:
|
||||||
@@ -728,7 +711,7 @@ void telrcv(struct UrlData *data,
|
|||||||
telrcv_state = TS_CR;
|
telrcv_state = TS_CR;
|
||||||
}
|
}
|
||||||
|
|
||||||
client_write(data, CLIENTWRITE_BODY, (char *)&c, 1);
|
Curl_client_write(data, CLIENTWRITE_BODY, (char *)&c, 1);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case TS_IAC:
|
case TS_IAC:
|
||||||
@@ -752,7 +735,7 @@ void telrcv(struct UrlData *data,
|
|||||||
telrcv_state = TS_SB;
|
telrcv_state = TS_SB;
|
||||||
continue;
|
continue;
|
||||||
case IAC:
|
case IAC:
|
||||||
client_write(data, CLIENTWRITE_BODY, (char *)&c, 1);
|
Curl_client_write(data, CLIENTWRITE_BODY, (char *)&c, 1);
|
||||||
break;
|
break;
|
||||||
case DM:
|
case DM:
|
||||||
case NOP:
|
case NOP:
|
||||||
@@ -843,6 +826,7 @@ void telrcv(struct UrlData *data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
void telwrite(struct UrlData *data,
|
void telwrite(struct UrlData *data,
|
||||||
unsigned char *buffer, /* Data to write */
|
unsigned char *buffer, /* Data to write */
|
||||||
int count) /* Number of bytes to write */
|
int count) /* Number of bytes to write */
|
||||||
@@ -872,12 +856,12 @@ void telwrite(struct UrlData *data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode telnet_done(struct connectdata *conn)
|
CURLcode Curl_telnet_done(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode telnet(struct connectdata *conn)
|
CURLcode Curl_telnet(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
struct UrlData *data = conn->data;
|
struct UrlData *data = conn->data;
|
||||||
int sockfd = data->firstsocket;
|
int sockfd = data->firstsocket;
|
||||||
|
43
lib/telnet.h
43
lib/telnet.h
@@ -8,39 +8,22 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
CURLcode Curl_telnet(struct connectdata *conn);
|
||||||
* ------------------------------------------------------------
|
CURLcode Curl_telnet_done(struct connectdata *conn);
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
CURLcode telnet(struct connectdata *conn);
|
|
||||||
CURLcode telnet_done(struct connectdata *conn);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@@ -70,7 +53,7 @@ gettimeofday (struct timeval *tp, void *nothing)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct timeval tvnow ()
|
struct timeval Curl_tvnow ()
|
||||||
{
|
{
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
#ifdef HAVE_GETTIMEOFDAY
|
#ifdef HAVE_GETTIMEOFDAY
|
||||||
@@ -82,12 +65,12 @@ struct timeval tvnow ()
|
|||||||
return now;
|
return now;
|
||||||
}
|
}
|
||||||
|
|
||||||
double tvdiff (struct timeval t1, struct timeval t2)
|
double Curl_tvdiff (struct timeval t1, struct timeval t2)
|
||||||
{
|
{
|
||||||
return (double)(t1.tv_sec - t2.tv_sec) + ((t1.tv_usec-t2.tv_usec)/1000000.0);
|
return (double)(t1.tv_sec - t2.tv_sec) + ((t1.tv_usec-t2.tv_usec)/1000000.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
long tvlong (struct timeval t1)
|
long Curl_tvlong (struct timeval t1)
|
||||||
{
|
{
|
||||||
return t1.tv_sec;
|
return t1.tv_sec;
|
||||||
}
|
}
|
||||||
|
@@ -7,38 +7,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -59,8 +42,8 @@ struct timeval {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct timeval tvnow ();
|
struct timeval Curl_tvnow ();
|
||||||
double tvdiff (struct timeval t1, struct timeval t2);
|
double Curl_tvdiff (struct timeval t1, struct timeval t2);
|
||||||
long tvlong (struct timeval t1);
|
long Curl_tvlong (struct timeval t1);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -101,7 +84,7 @@
|
|||||||
|
|
||||||
#include "getenv.h"
|
#include "getenv.h"
|
||||||
#include "hostip.h"
|
#include "hostip.h"
|
||||||
#include "download.h"
|
#include "transfer.h"
|
||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
#include "speedcheck.h"
|
#include "speedcheck.h"
|
||||||
#include "getpass.h"
|
#include "getpass.h"
|
||||||
@@ -120,14 +103,17 @@
|
|||||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CURLcode
|
/* Parts of this function was written by the friendly Mark Butler
|
||||||
|
<butlerm@xmission.com>. */
|
||||||
|
|
||||||
|
CURLcode static
|
||||||
_Transfer(struct connectdata *c_conn)
|
_Transfer(struct connectdata *c_conn)
|
||||||
{
|
{
|
||||||
size_t nread; /* number of bytes read */
|
size_t nread; /* number of bytes read */
|
||||||
int bytecount = 0; /* total number of bytes read */
|
int bytecount = 0; /* total number of bytes read */
|
||||||
int writebytecount = 0; /* number of bytes written */
|
int writebytecount = 0; /* number of bytes written */
|
||||||
long contentlength=0; /* size of incoming data */
|
long contentlength=0; /* size of incoming data */
|
||||||
struct timeval start = tvnow();
|
struct timeval start = Curl_tvnow();
|
||||||
struct timeval now = start; /* current time */
|
struct timeval now = start; /* current time */
|
||||||
bool header = TRUE; /* incoming data has HTTP header */
|
bool header = TRUE; /* incoming data has HTTP header */
|
||||||
int headerline = 0; /* counts header lines to better track the
|
int headerline = 0; /* counts header lines to better track the
|
||||||
@@ -168,19 +154,19 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
|
|
||||||
myalarm (0); /* switch off the alarm-style timeout */
|
myalarm (0); /* switch off the alarm-style timeout */
|
||||||
|
|
||||||
now = tvnow();
|
now = Curl_tvnow();
|
||||||
start = now;
|
start = now;
|
||||||
|
|
||||||
#define KEEP_READ 1
|
#define KEEP_READ 1
|
||||||
#define KEEP_WRITE 2
|
#define KEEP_WRITE 2
|
||||||
|
|
||||||
pgrsTime(data, TIMER_PRETRANSFER);
|
Curl_pgrsTime(data, TIMER_PRETRANSFER);
|
||||||
speedinit(data);
|
Curl_speedinit(data);
|
||||||
|
|
||||||
if (!conn->getheader) {
|
if (!conn->getheader) {
|
||||||
header = FALSE;
|
header = FALSE;
|
||||||
if(conn->size > 0)
|
if(conn->size > 0)
|
||||||
pgrsSetDownloadSize(data, conn->size);
|
Curl_pgrsSetDownloadSize(data, conn->size);
|
||||||
}
|
}
|
||||||
/* we want header and/or body, if neither then don't do this! */
|
/* we want header and/or body, if neither then don't do this! */
|
||||||
if(conn->getheader ||
|
if(conn->getheader ||
|
||||||
@@ -331,7 +317,7 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
if ('\n' == *p)
|
if ('\n' == *p)
|
||||||
p++; /* pass the \n byte */
|
p++; /* pass the \n byte */
|
||||||
|
|
||||||
pgrsSetDownloadSize(data, conn->size);
|
Curl_pgrsSetDownloadSize(data, conn->size);
|
||||||
|
|
||||||
header = FALSE; /* no more header to parse! */
|
header = FALSE; /* no more header to parse! */
|
||||||
|
|
||||||
@@ -341,7 +327,7 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
if (data->bits.http_include_header)
|
if (data->bits.http_include_header)
|
||||||
writetype |= CLIENTWRITE_BODY;
|
writetype |= CLIENTWRITE_BODY;
|
||||||
|
|
||||||
urg = client_write(data, writetype, data->headerbuff,
|
urg = Curl_client_write(data, writetype, data->headerbuff,
|
||||||
p - data->headerbuff);
|
p - data->headerbuff);
|
||||||
if(urg)
|
if(urg)
|
||||||
return urg;
|
return urg;
|
||||||
@@ -391,7 +377,7 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
}
|
}
|
||||||
else if(data->cookies &&
|
else if(data->cookies &&
|
||||||
strnequal("Set-Cookie: ", p, 11)) {
|
strnequal("Set-Cookie: ", p, 11)) {
|
||||||
cookie_add(data->cookies, TRUE, &p[12]);
|
Curl_cookie_add(data->cookies, TRUE, &p[12]);
|
||||||
}
|
}
|
||||||
else if(strnequal("Last-Modified:", p,
|
else if(strnequal("Last-Modified:", p,
|
||||||
strlen("Last-Modified:")) &&
|
strlen("Last-Modified:")) &&
|
||||||
@@ -415,7 +401,7 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
if (data->bits.http_include_header)
|
if (data->bits.http_include_header)
|
||||||
writetype |= CLIENTWRITE_BODY;
|
writetype |= CLIENTWRITE_BODY;
|
||||||
|
|
||||||
urg = client_write(data, writetype, p, hbuflen);
|
urg = Curl_client_write(data, writetype, p, hbuflen);
|
||||||
if(urg)
|
if(urg)
|
||||||
return urg;
|
return urg;
|
||||||
|
|
||||||
@@ -473,14 +459,14 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
default:
|
default:
|
||||||
if(timeofdoc < data->timevalue) {
|
if(timeofdoc < data->timevalue) {
|
||||||
infof(data,
|
infof(data,
|
||||||
"The requested document is not new enough");
|
"The requested document is not new enough\n");
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TIMECOND_IFUNMODSINCE:
|
case TIMECOND_IFUNMODSINCE:
|
||||||
if(timeofdoc > data->timevalue) {
|
if(timeofdoc > data->timevalue) {
|
||||||
infof(data,
|
infof(data,
|
||||||
"The requested document is not old enough");
|
"The requested document is not old enough\n");
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -501,9 +487,9 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
|
|
||||||
bytecount += nread;
|
bytecount += nread;
|
||||||
|
|
||||||
pgrsSetDownloadCounter(data, (double)bytecount);
|
Curl_pgrsSetDownloadCounter(data, (double)bytecount);
|
||||||
|
|
||||||
urg = client_write(data, CLIENTWRITE_BODY, str, nread);
|
urg = Curl_client_write(data, CLIENTWRITE_BODY, str, nread);
|
||||||
if(urg)
|
if(urg)
|
||||||
return urg;
|
return urg;
|
||||||
|
|
||||||
@@ -530,7 +516,7 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
writebytecount += nread;
|
writebytecount += nread;
|
||||||
pgrsSetUploadCounter(data, (double)writebytecount);
|
Curl_pgrsSetUploadCounter(data, (double)writebytecount);
|
||||||
|
|
||||||
/* convert LF to CRLF if so asked */
|
/* convert LF to CRLF if so asked */
|
||||||
if (data->crlf) {
|
if (data->crlf) {
|
||||||
@@ -560,11 +546,11 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
now = tvnow();
|
now = Curl_tvnow();
|
||||||
if(pgrsUpdate(data))
|
if(Curl_pgrsUpdate(data))
|
||||||
urg = CURLE_ABORTED_BY_CALLBACK;
|
urg = CURLE_ABORTED_BY_CALLBACK;
|
||||||
else
|
else
|
||||||
urg = speedcheck (data, now);
|
urg = Curl_speedcheck (data, now);
|
||||||
if (urg)
|
if (urg)
|
||||||
return urg;
|
return urg;
|
||||||
|
|
||||||
@@ -577,7 +563,7 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
conn->upload_bufsize=(long)min(data->progress.ulspeed, BUFSIZE);
|
conn->upload_bufsize=(long)min(data->progress.ulspeed, BUFSIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->timeout && (tvdiff (now, start) > data->timeout)) {
|
if (data->timeout && (Curl_tvdiff (now, start) > data->timeout)) {
|
||||||
failf (data, "Operation timed out with %d out of %d bytes received",
|
failf (data, "Operation timed out with %d out of %d bytes received",
|
||||||
bytecount, conn->size);
|
bytecount, conn->size);
|
||||||
return CURLE_OPERATION_TIMEOUTED;
|
return CURLE_OPERATION_TIMEOUTED;
|
||||||
@@ -590,7 +576,7 @@ _Transfer(struct connectdata *c_conn)
|
|||||||
contentlength-bytecount);
|
contentlength-bytecount);
|
||||||
return CURLE_PARTIAL_FILE;
|
return CURLE_PARTIAL_FILE;
|
||||||
}
|
}
|
||||||
if(pgrsUpdate(data))
|
if(Curl_pgrsUpdate(data))
|
||||||
return CURLE_ABORTED_BY_CALLBACK;
|
return CURLE_ABORTED_BY_CALLBACK;
|
||||||
|
|
||||||
if(conn->bytecountp)
|
if(conn->bytecountp)
|
||||||
@@ -609,10 +595,10 @@ CURLcode curl_transfer(CURL *curl)
|
|||||||
struct UrlData *data = curl;
|
struct UrlData *data = curl;
|
||||||
struct connectdata *c_connect=NULL;
|
struct connectdata *c_connect=NULL;
|
||||||
|
|
||||||
pgrsStartNow(data);
|
Curl_pgrsStartNow(data);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
pgrsTime(data, TIMER_STARTSINGLE);
|
Curl_pgrsTime(data, TIMER_STARTSINGLE);
|
||||||
res = curl_connect(curl, (CURLconnect **)&c_connect);
|
res = curl_connect(curl, (CURLconnect **)&c_connect);
|
||||||
if(res == CURLE_OK) {
|
if(res == CURLE_OK) {
|
||||||
res = curl_do(c_connect);
|
res = curl_do(c_connect);
|
||||||
@@ -750,3 +736,32 @@ CURLcode curl_transfer(CURL *curl)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CURLcode
|
||||||
|
Curl_Transfer(struct connectdata *c_conn, /* connection data */
|
||||||
|
int sockfd, /* socket to read from or -1 */
|
||||||
|
int size, /* -1 if unknown at this point */
|
||||||
|
bool getheader, /* TRUE if header parsing is wanted */
|
||||||
|
long *bytecountp, /* return number of bytes read or NULL */
|
||||||
|
int writesockfd, /* socket to write to, it may very well be
|
||||||
|
the same we read from. -1 disables */
|
||||||
|
long *writebytecountp /* return number of bytes written or
|
||||||
|
NULL */
|
||||||
|
)
|
||||||
|
{
|
||||||
|
struct connectdata *conn = (struct connectdata *)c_conn;
|
||||||
|
if(!conn)
|
||||||
|
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||||
|
|
||||||
|
/* now copy all input parameters */
|
||||||
|
conn->sockfd = sockfd;
|
||||||
|
conn->size = size;
|
||||||
|
conn->getheader = getheader;
|
||||||
|
conn->bytecountp = bytecountp;
|
||||||
|
conn->writesockfd = writesockfd;
|
||||||
|
conn->writebytecountp = writebytecountp;
|
||||||
|
|
||||||
|
return CURLE_OK;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
44
lib/transfer.h
Normal file
44
lib/transfer.h
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
#ifndef __TRANSFER_H
|
||||||
|
#define __TRANSFER_H
|
||||||
|
/*****************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
*
|
||||||
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
|
*
|
||||||
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*****************************************************************************/
|
||||||
|
CURLcode curl_transfer(CURL *curl);
|
||||||
|
|
||||||
|
CURLcode
|
||||||
|
Curl_Transfer (struct connectdata *data,
|
||||||
|
int sockfd, /* socket to read from or -1 */
|
||||||
|
int size, /* -1 if unknown at this point */
|
||||||
|
bool getheader, /* TRUE if header parsing is wanted */
|
||||||
|
long *bytecountp, /* return number of bytes read */
|
||||||
|
int writesockfd, /* socket to write to, it may very well be
|
||||||
|
the same we read from. -1 disables */
|
||||||
|
long *writebytecountp /* return number of bytes written */
|
||||||
|
);
|
||||||
|
|
||||||
|
#ifdef _OLDCURL
|
||||||
|
/* "hackish" define to make sources compile without too much human editing.
|
||||||
|
Don't use "Tranfer()" anymore! */
|
||||||
|
#define Transfer(a,b,c,d,e,f,g) Curl_Transfer(a,b,c,d,e,f,g)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
183
lib/url.c
183
lib/url.c
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/* -- WIN32 approved -- */
|
/* -- WIN32 approved -- */
|
||||||
|
|
||||||
@@ -102,9 +85,8 @@
|
|||||||
#include "ssluse.h"
|
#include "ssluse.h"
|
||||||
#include "hostip.h"
|
#include "hostip.h"
|
||||||
#include "if2ip.h"
|
#include "if2ip.h"
|
||||||
#include "download.h"
|
#include "transfer.h"
|
||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
#include "speedcheck.h"
|
|
||||||
#include "getpass.h"
|
#include "getpass.h"
|
||||||
#include "progress.h"
|
#include "progress.h"
|
||||||
#include "cookie.h"
|
#include "cookie.h"
|
||||||
@@ -241,7 +223,7 @@ void static urlfree(struct UrlData *data, bool totally)
|
|||||||
/* the URL is allocated, free it! */
|
/* the URL is allocated, free it! */
|
||||||
free(data->url);
|
free(data->url);
|
||||||
|
|
||||||
cookie_cleanup(data->cookies);
|
Curl_cookie_cleanup(data->cookies);
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
@@ -265,6 +247,7 @@ CURLcode curl_close(CURL *curl)
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
int my_getpass(void *clientp, char *prompt, char* buffer, int buflen )
|
int my_getpass(void *clientp, char *prompt, char* buffer, int buflen )
|
||||||
{
|
{
|
||||||
char *retbuf;
|
char *retbuf;
|
||||||
@@ -398,7 +381,7 @@ CURLcode curl_setopt(CURL *curl, CURLoption option, ...)
|
|||||||
case CURLOPT_COOKIEFILE:
|
case CURLOPT_COOKIEFILE:
|
||||||
cookiefile = (char *)va_arg(param, void *);
|
cookiefile = (char *)va_arg(param, void *);
|
||||||
if(cookiefile) {
|
if(cookiefile) {
|
||||||
data->cookies = cookie_init(cookiefile);
|
data->cookies = Curl_cookie_init(cookiefile);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CURLOPT_WRITEHEADER:
|
case CURLOPT_WRITEHEADER:
|
||||||
@@ -550,50 +533,11 @@ CURLcode curl_setopt(CURL *curl, CURLoption option, ...)
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read everything until a newline.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int GetLine(int sockfd, char *buf, struct UrlData *data)
|
|
||||||
{
|
|
||||||
int nread;
|
|
||||||
int read_rc=1;
|
|
||||||
char *ptr;
|
|
||||||
ptr=buf;
|
|
||||||
|
|
||||||
/* get us a full line, terminated with a newline */
|
|
||||||
for(nread=0;
|
|
||||||
(nread<BUFSIZE) && read_rc;
|
|
||||||
nread++, ptr++) {
|
|
||||||
#ifdef USE_SSLEAY
|
|
||||||
if (data->ssl.use) {
|
|
||||||
read_rc = SSL_read(data->ssl.handle, ptr, 1);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#endif
|
|
||||||
read_rc = sread(sockfd, ptr, 1);
|
|
||||||
#ifdef USE_SSLEAY
|
|
||||||
}
|
|
||||||
#endif /* USE_SSLEAY */
|
|
||||||
if (*ptr == '\n')
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*ptr=0; /* zero terminate */
|
|
||||||
|
|
||||||
if(data->bits.verbose) {
|
|
||||||
fputs("< ", data->err);
|
|
||||||
fwrite(buf, 1, nread, data->err);
|
|
||||||
fputs("\n", data->err);
|
|
||||||
}
|
|
||||||
return nread;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#ifndef RETSIGTYPE
|
#ifndef RETSIGTYPE
|
||||||
#define RETSIGTYPE void
|
#define RETSIGTYPE void
|
||||||
#endif
|
#endif
|
||||||
|
static
|
||||||
RETSIGTYPE alarmfunc(int signal)
|
RETSIGTYPE alarmfunc(int signal)
|
||||||
{
|
{
|
||||||
/* this is for "-ansi -Wall -pedantic" to stop complaining! (rabe) */
|
/* this is for "-ansi -Wall -pedantic" to stop complaining! (rabe) */
|
||||||
@@ -882,9 +826,9 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
char *proxy=NULL;
|
char *proxy=NULL;
|
||||||
char proxy_env[128];
|
char proxy_env[128];
|
||||||
|
|
||||||
no_proxy=GetEnv("no_proxy");
|
no_proxy=curl_getenv("no_proxy");
|
||||||
if(!no_proxy)
|
if(!no_proxy)
|
||||||
no_proxy=GetEnv("NO_PROXY");
|
no_proxy=curl_getenv("NO_PROXY");
|
||||||
|
|
||||||
if(!no_proxy || !strequal("*", no_proxy)) {
|
if(!no_proxy || !strequal("*", no_proxy)) {
|
||||||
/* NO_PROXY wasn't specified or it wasn't just an asterisk */
|
/* NO_PROXY wasn't specified or it wasn't just an asterisk */
|
||||||
@@ -916,22 +860,22 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
strcpy(envp, "_proxy");
|
strcpy(envp, "_proxy");
|
||||||
|
|
||||||
/* read the protocol proxy: */
|
/* read the protocol proxy: */
|
||||||
prox=GetEnv(proxy_env);
|
prox=curl_getenv(proxy_env);
|
||||||
|
|
||||||
if(!prox) {
|
if(!prox) {
|
||||||
/* There was no lowercase variable, try the uppercase version: */
|
/* There was no lowercase variable, try the uppercase version: */
|
||||||
for(envp = proxy_env; *envp; envp++)
|
for(envp = proxy_env; *envp; envp++)
|
||||||
*envp = toupper(*envp);
|
*envp = toupper(*envp);
|
||||||
prox=GetEnv(proxy_env);
|
prox=curl_getenv(proxy_env);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(prox && *prox) { /* don't count "" strings */
|
if(prox && *prox) { /* don't count "" strings */
|
||||||
proxy = prox; /* use this */
|
proxy = prox; /* use this */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
proxy = GetEnv("all_proxy"); /* default proxy to use */
|
proxy = curl_getenv("all_proxy"); /* default proxy to use */
|
||||||
if(!proxy)
|
if(!proxy)
|
||||||
proxy=GetEnv("ALL_PROXY");
|
proxy=curl_getenv("ALL_PROXY");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(proxy && *proxy) {
|
if(proxy && *proxy) {
|
||||||
@@ -952,7 +896,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
*/
|
*/
|
||||||
char *reurl;
|
char *reurl;
|
||||||
|
|
||||||
reurl = maprintf("%s://%s", conn->proto, data->url);
|
reurl = aprintf("%s://%s", conn->proto, data->url);
|
||||||
|
|
||||||
if(!reurl)
|
if(!reurl)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
@@ -1001,9 +945,9 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
data->port = PORT_HTTP;
|
data->port = PORT_HTTP;
|
||||||
data->remote_port = PORT_HTTP;
|
data->remote_port = PORT_HTTP;
|
||||||
conn->protocol |= PROT_HTTP;
|
conn->protocol |= PROT_HTTP;
|
||||||
conn->curl_do = http;
|
conn->curl_do = Curl_http;
|
||||||
conn->curl_done = http_done;
|
conn->curl_done = Curl_http_done;
|
||||||
conn->curl_close = http_close;
|
conn->curl_close = Curl_http_close;
|
||||||
}
|
}
|
||||||
else if (strequal(conn->proto, "HTTPS")) {
|
else if (strequal(conn->proto, "HTTPS")) {
|
||||||
#ifdef USE_SSLEAY
|
#ifdef USE_SSLEAY
|
||||||
@@ -1013,10 +957,10 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
conn->protocol |= PROT_HTTP;
|
conn->protocol |= PROT_HTTP;
|
||||||
conn->protocol |= PROT_HTTPS;
|
conn->protocol |= PROT_HTTPS;
|
||||||
|
|
||||||
conn->curl_do = http;
|
conn->curl_do = Curl_http;
|
||||||
conn->curl_done = http_done;
|
conn->curl_done = Curl_http_done;
|
||||||
conn->curl_connect = http_connect;
|
conn->curl_connect = Curl_http_connect;
|
||||||
conn->curl_close = http_close;
|
conn->curl_close = Curl_http_close;
|
||||||
|
|
||||||
#else /* USE_SSLEAY */
|
#else /* USE_SSLEAY */
|
||||||
failf(data, "libcurl was built with SSL disabled, https: not supported!");
|
failf(data, "libcurl was built with SSL disabled, https: not supported!");
|
||||||
@@ -1034,9 +978,9 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
conn->ppath = conn->path;
|
conn->ppath = conn->path;
|
||||||
}
|
}
|
||||||
conn->protocol |= PROT_GOPHER;
|
conn->protocol |= PROT_GOPHER;
|
||||||
conn->curl_do = http;
|
conn->curl_do = Curl_http;
|
||||||
conn->curl_done = http_done;
|
conn->curl_done = Curl_http_done;
|
||||||
conn->curl_close = http_close;
|
conn->curl_close = Curl_http_close;
|
||||||
}
|
}
|
||||||
else if(strequal(conn->proto, "FTP")) {
|
else if(strequal(conn->proto, "FTP")) {
|
||||||
char *type;
|
char *type;
|
||||||
@@ -1049,14 +993,14 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
!data->bits.tunnel_thru_httpproxy) {
|
!data->bits.tunnel_thru_httpproxy) {
|
||||||
/* Unless we have asked to tunnel ftp operations through the proxy, we
|
/* Unless we have asked to tunnel ftp operations through the proxy, we
|
||||||
switch and use HTTP operations only */
|
switch and use HTTP operations only */
|
||||||
conn->curl_do = http;
|
conn->curl_do = Curl_http;
|
||||||
conn->curl_done = http_done;
|
conn->curl_done = Curl_http_done;
|
||||||
conn->curl_close = http_close;
|
conn->curl_close = Curl_http_close;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
conn->curl_do = ftp;
|
conn->curl_do = Curl_ftp;
|
||||||
conn->curl_done = ftp_done;
|
conn->curl_done = Curl_ftp_done;
|
||||||
conn->curl_connect = ftp_connect;
|
conn->curl_connect = Curl_ftp_connect;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn->ppath++; /* don't include the initial slash */
|
conn->ppath++; /* don't include the initial slash */
|
||||||
@@ -1093,8 +1037,8 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
data->port = PORT_TELNET;
|
data->port = PORT_TELNET;
|
||||||
data->remote_port = PORT_TELNET;
|
data->remote_port = PORT_TELNET;
|
||||||
|
|
||||||
conn->curl_do = telnet;
|
conn->curl_do = Curl_telnet;
|
||||||
conn->curl_done = telnet_done;
|
conn->curl_done = Curl_telnet_done;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (strequal(conn->proto, "DICT")) {
|
else if (strequal(conn->proto, "DICT")) {
|
||||||
@@ -1102,16 +1046,16 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
if(!data->port)
|
if(!data->port)
|
||||||
data->port = PORT_DICT;
|
data->port = PORT_DICT;
|
||||||
data->remote_port = PORT_DICT;
|
data->remote_port = PORT_DICT;
|
||||||
conn->curl_do = dict;
|
conn->curl_do = Curl_dict;
|
||||||
conn->curl_done = dict_done;
|
conn->curl_done = Curl_dict_done;
|
||||||
}
|
}
|
||||||
else if (strequal(conn->proto, "LDAP")) {
|
else if (strequal(conn->proto, "LDAP")) {
|
||||||
conn->protocol |= PROT_LDAP;
|
conn->protocol |= PROT_LDAP;
|
||||||
if(!data->port)
|
if(!data->port)
|
||||||
data->port = PORT_LDAP;
|
data->port = PORT_LDAP;
|
||||||
data->remote_port = PORT_LDAP;
|
data->remote_port = PORT_LDAP;
|
||||||
conn->curl_do = ldap;
|
conn->curl_do = Curl_ldap;
|
||||||
conn->curl_done = ldap_done;
|
conn->curl_done = Curl_ldap_done;
|
||||||
}
|
}
|
||||||
else if (strequal(conn->proto, "FILE")) {
|
else if (strequal(conn->proto, "FILE")) {
|
||||||
conn->protocol |= PROT_FILE;
|
conn->protocol |= PROT_FILE;
|
||||||
@@ -1119,7 +1063,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
conn->curl_do = file;
|
conn->curl_do = file;
|
||||||
/* no done() function */
|
/* no done() function */
|
||||||
|
|
||||||
result = Transfer(conn, -1, -1, FALSE, NULL, /* no download */
|
result = Curl_Transfer(conn, -1, -1, FALSE, NULL, /* no download */
|
||||||
-1, NULL); /* no upload */
|
-1, NULL); /* no upload */
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
@@ -1131,7 +1075,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(data->bits.use_netrc) {
|
if(data->bits.use_netrc) {
|
||||||
if(ParseNetrc(data->hostname, data->user, data->passwd)) {
|
if(Curl_parsenetrc(data->hostname, data->user, data->passwd)) {
|
||||||
infof(data, "Couldn't find host %s in the .netrc file, using defaults",
|
infof(data, "Couldn't find host %s in the .netrc file, using defaults",
|
||||||
data->hostname);
|
data->hostname);
|
||||||
}
|
}
|
||||||
@@ -1213,7 +1157,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
data->remote_port = data->port; /* it is the same port */
|
data->remote_port = data->port; /* it is the same port */
|
||||||
|
|
||||||
/* Connect to target host right on */
|
/* Connect to target host right on */
|
||||||
conn->hp = GetHost(data, conn->name, &conn->hostent_buf);
|
conn->hp = Curl_gethost(data, conn->name, &conn->hostent_buf);
|
||||||
if(!conn->hp) {
|
if(!conn->hp) {
|
||||||
failf(data, "Couldn't resolve host '%s'", conn->name);
|
failf(data, "Couldn't resolve host '%s'", conn->name);
|
||||||
return CURLE_COULDNT_RESOLVE_HOST;
|
return CURLE_COULDNT_RESOLVE_HOST;
|
||||||
@@ -1269,7 +1213,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* connect to proxy */
|
/* connect to proxy */
|
||||||
conn->hp = GetHost(data, proxyptr, &conn->hostent_buf);
|
conn->hp = Curl_gethost(data, proxyptr, &conn->hostent_buf);
|
||||||
if(!conn->hp) {
|
if(!conn->hp) {
|
||||||
failf(data, "Couldn't resolve proxy '%s'", proxyptr);
|
failf(data, "Couldn't resolve proxy '%s'", proxyptr);
|
||||||
return CURLE_COULDNT_RESOLVE_PROXY;
|
return CURLE_COULDNT_RESOLVE_PROXY;
|
||||||
@@ -1277,7 +1221,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
|
|
||||||
free(proxydup); /* free the duplicate pointer and not the modified */
|
free(proxydup); /* free the duplicate pointer and not the modified */
|
||||||
}
|
}
|
||||||
pgrsTime(data, TIMER_NAMELOOKUP);
|
Curl_pgrsTime(data, TIMER_NAMELOOKUP);
|
||||||
|
|
||||||
data->firstsocket = socket(AF_INET, SOCK_STREAM, 0);
|
data->firstsocket = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
|
||||||
@@ -1309,12 +1253,12 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
char myhost[256] = "";
|
char myhost[256] = "";
|
||||||
unsigned long in;
|
unsigned long in;
|
||||||
|
|
||||||
if(if2ip(data->device, myhost, sizeof(myhost))) {
|
if(Curl_if2ip(data->device, myhost, sizeof(myhost))) {
|
||||||
h = GetHost(data, myhost, &hostdataptr);
|
h = Curl_gethost(data, myhost, &hostdataptr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(strlen(data->device)>1) {
|
if(strlen(data->device)>1) {
|
||||||
h = GetHost(data, data->device, &hostdataptr);
|
h = Curl_gethost(data, data->device, &hostdataptr);
|
||||||
}
|
}
|
||||||
if(h) {
|
if(h) {
|
||||||
/* we know data->device is shorter than the myhost array */
|
/* we know data->device is shorter than the myhost array */
|
||||||
@@ -1324,7 +1268,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
|
|
||||||
if(! *myhost) {
|
if(! *myhost) {
|
||||||
/* need to fix this
|
/* need to fix this
|
||||||
h=GetHost(data,
|
h=Curl_gethost(data,
|
||||||
getmyhost(*myhost,sizeof(myhost)),
|
getmyhost(*myhost,sizeof(myhost)),
|
||||||
hostent_buf,
|
hostent_buf,
|
||||||
sizeof(hostent_buf));
|
sizeof(hostent_buf));
|
||||||
@@ -1401,7 +1345,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(hostdataptr)
|
if(hostdataptr)
|
||||||
free(hostdataptr); /* allocated by GetHost() */
|
free(hostdataptr); /* allocated by Curl_gethost() */
|
||||||
|
|
||||||
} /* end of device selection support */
|
} /* end of device selection support */
|
||||||
#endif /* end of HAVE_INET_NTOA */
|
#endif /* end of HAVE_INET_NTOA */
|
||||||
@@ -1460,32 +1404,35 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
|
|||||||
char *authorization;
|
char *authorization;
|
||||||
snprintf(data->buffer, BUFSIZE, "%s:%s",
|
snprintf(data->buffer, BUFSIZE, "%s:%s",
|
||||||
data->proxyuser, data->proxypasswd);
|
data->proxyuser, data->proxypasswd);
|
||||||
if(base64_encode(data->buffer, strlen(data->buffer),
|
if(Curl_base64_encode(data->buffer, strlen(data->buffer),
|
||||||
&authorization) >= 0) {
|
&authorization) >= 0) {
|
||||||
data->ptr_proxyuserpwd =
|
data->ptr_proxyuserpwd =
|
||||||
maprintf("Proxy-authorization: Basic %s\015\012", authorization);
|
aprintf("Proxy-authorization: Basic %s\015\012", authorization);
|
||||||
free(authorization);
|
free(authorization);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if((conn->protocol&PROT_HTTP) || data->bits.httpproxy) {
|
if((conn->protocol&PROT_HTTP) || data->bits.httpproxy) {
|
||||||
if(data->useragent) {
|
if(data->useragent) {
|
||||||
data->ptr_uagent = maprintf("User-Agent: %s\015\012", data->useragent);
|
data->ptr_uagent =
|
||||||
|
aprintf("User-Agent: %s\015\012", data->useragent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(conn->curl_connect) {
|
if(conn->curl_connect) {
|
||||||
/* is there a connect() procedure? */
|
/* is there a connect() procedure? */
|
||||||
conn->now = tvnow(); /* set this here for timeout purposes in the
|
|
||||||
|
/* set start time here for timeout purposes in the
|
||||||
connect procedure, it is later set again for the
|
connect procedure, it is later set again for the
|
||||||
progress meter purpose */
|
progress meter purpose */
|
||||||
|
conn->now = Curl_tvnow();
|
||||||
result = conn->curl_connect(conn);
|
result = conn->curl_connect(conn);
|
||||||
if(result != CURLE_OK)
|
if(result != CURLE_OK)
|
||||||
return result; /* pass back errors */
|
return result; /* pass back errors */
|
||||||
}
|
}
|
||||||
|
|
||||||
pgrsTime(data, TIMER_CONNECT); /* we're connected */
|
Curl_pgrsTime(data, TIMER_CONNECT); /* we're connected */
|
||||||
|
|
||||||
conn->now = tvnow(); /* time this *after* the connect is done */
|
conn->now = Curl_tvnow(); /* time this *after* the connect is done */
|
||||||
conn->bytecount = 0;
|
conn->bytecount = 0;
|
||||||
|
|
||||||
/* Figure out the ip-number and the first host name it shows: */
|
/* Figure out the ip-number and the first host name it shows: */
|
||||||
@@ -1577,7 +1524,7 @@ CURLcode curl_done(CURLconnect *c_connect)
|
|||||||
else
|
else
|
||||||
result = CURLE_OK;
|
result = CURLE_OK;
|
||||||
|
|
||||||
pgrsDone(data); /* done with the operation */
|
Curl_pgrsDone(data); /* done with the operation */
|
||||||
|
|
||||||
conn->state = CONN_DONE;
|
conn->state = CONN_DONE;
|
||||||
|
|
||||||
|
42
lib/url.h
42
lib/url.h
@@ -7,38 +7,22 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
/* empty */
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
int GetLine(int sockfd, char *buf, struct UrlData *data);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -7,38 +7,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/* This file is for lib internal stuff */
|
/* This file is for lib internal stuff */
|
||||||
|
|
||||||
|
@@ -5,38 +5,21 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the Mozilla Public License
|
* Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
* Version 1.0 (the "License"); you may not use this file except in
|
|
||||||
* compliance with the License. You may obtain a copy of the License at
|
|
||||||
* http://www.mozilla.org/MPL/
|
|
||||||
*
|
*
|
||||||
* Software distributed under the License is distributed on an "AS IS"
|
* In order to be useful for every potential user, curl and libcurl are
|
||||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
* dual-licensed under the MPL and the MIT/X-derivate licenses.
|
||||||
* License for the specific language governing rights and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
*
|
||||||
* The Original Code is Curl.
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
* copies of the Software, and permit persons to whom the Software is
|
||||||
|
* furnished to do so, under the terms of the MPL or the MIT/X-derivate
|
||||||
|
* licenses. You may pick one of these licenses.
|
||||||
*
|
*
|
||||||
* The Initial Developer of the Original Code is Daniel Stenberg.
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
* Portions created by the Initial Developer are Copyright (C) 1998.
|
* $Id$
|
||||||
* All Rights Reserved.
|
*****************************************************************************/
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
* Main author:
|
|
||||||
* - Daniel Stenberg <daniel@haxx.se>
|
|
||||||
*
|
|
||||||
* http://curl.haxx.se
|
|
||||||
*
|
|
||||||
* $Source$
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
* $State$
|
|
||||||
* $Locker$
|
|
||||||
*
|
|
||||||
* ------------------------------------------------------------
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
@@ -50,9 +33,6 @@ char *curl_version(void)
|
|||||||
{
|
{
|
||||||
static char version[200];
|
static char version[200];
|
||||||
char *ptr;
|
char *ptr;
|
||||||
#if defined(USE_SSLEAY)
|
|
||||||
static char sub[2];
|
|
||||||
#endif
|
|
||||||
strcpy(version, LIBCURL_NAME " " LIBCURL_VERSION );
|
strcpy(version, LIBCURL_NAME " " LIBCURL_VERSION );
|
||||||
ptr=strchr(version, '\0');
|
ptr=strchr(version, '\0');
|
||||||
|
|
||||||
@@ -64,6 +44,8 @@ char *curl_version(void)
|
|||||||
(SSLEAY_VERSION_NUMBER>>20)&0xff,
|
(SSLEAY_VERSION_NUMBER>>20)&0xff,
|
||||||
(SSLEAY_VERSION_NUMBER>>12)&0xf);
|
(SSLEAY_VERSION_NUMBER>>12)&0xf);
|
||||||
#else
|
#else
|
||||||
|
{
|
||||||
|
char sub[2];
|
||||||
if(SSLEAY_VERSION_NUMBER&0x0f) {
|
if(SSLEAY_VERSION_NUMBER&0x0f) {
|
||||||
sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1;
|
sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1;
|
||||||
}
|
}
|
||||||
@@ -74,7 +56,7 @@ char *curl_version(void)
|
|||||||
(SSLEAY_VERSION_NUMBER>>12)&0xff,
|
(SSLEAY_VERSION_NUMBER>>12)&0xff,
|
||||||
(SSLEAY_VERSION_NUMBER>>8)&0xf,
|
(SSLEAY_VERSION_NUMBER>>8)&0xf,
|
||||||
(SSLEAY_VERSION_NUMBER>>4)&0xf, sub);
|
(SSLEAY_VERSION_NUMBER>>4)&0xf, sub);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
ptr=strchr(ptr, '\0');
|
ptr=strchr(ptr, '\0');
|
||||||
#endif
|
#endif
|
||||||
|
85
maketgz
85
maketgz
@@ -58,29 +58,10 @@ findprog()
|
|||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
#
|
#
|
||||||
# If we have autoconf we can just as well update configure.in to contain our
|
# Enforce a rerun of configure (updates the VERSION)
|
||||||
# brand new version number:
|
|
||||||
#
|
#
|
||||||
|
|
||||||
#if { findprog autoconf >/dev/null 2>/dev/null; } then
|
./config.status --recheck
|
||||||
# echo "- No autoconf found, we leave configure as it is"
|
|
||||||
#else
|
|
||||||
# # Replace version number in configure.in file:
|
|
||||||
#
|
|
||||||
# CONF="configure.in"
|
|
||||||
#
|
|
||||||
# sed 's/^AM_INIT_AUTOMAKE.*/AM_INIT_AUTOMAKE(curl,"'$version'")/g' $CONF >$CONF.new
|
|
||||||
#
|
|
||||||
# # Save old file
|
|
||||||
# cp -p $CONF $CONF.old
|
|
||||||
#
|
|
||||||
# # Make new configure.in
|
|
||||||
# mv $CONF.new $CONF
|
|
||||||
#
|
|
||||||
# # Update the configure script
|
|
||||||
# echo "Runs autoconf"
|
|
||||||
# autoconf
|
|
||||||
#fi
|
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
#
|
#
|
||||||
@@ -97,65 +78,7 @@ fi
|
|||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
#
|
#
|
||||||
# Now run make first to make the file dates decent and make sure that it
|
# Now run make dist
|
||||||
# compiles just before release!
|
|
||||||
#
|
#
|
||||||
|
|
||||||
make
|
make dist
|
||||||
|
|
||||||
# get current dir
|
|
||||||
dir=`pwd`
|
|
||||||
|
|
||||||
# Get basename
|
|
||||||
orig=`basename $dir`
|
|
||||||
|
|
||||||
# Get the left part of the dash (-)
|
|
||||||
new=`echo $orig | cut -d- -f1`
|
|
||||||
|
|
||||||
# Build new directory name
|
|
||||||
n=$new-$version;
|
|
||||||
|
|
||||||
# Tell the world what we're doing
|
|
||||||
echo "Copying files into distribution archive";
|
|
||||||
|
|
||||||
if [ -r $n ]; then
|
|
||||||
echo "Directory already exists!"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create the new dir
|
|
||||||
mkdir $n
|
|
||||||
|
|
||||||
# Copy all relevant files, with path and permissions!
|
|
||||||
tar -cf - `cat FILES` | (cd $n; tar -xBpf -)
|
|
||||||
|
|
||||||
# Create the distribution root Makefile from Makefile.dist
|
|
||||||
cp -p Makefile.dist $n/Makefile
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
#
|
|
||||||
# Replace @SHELL@ with /bin/sh in the Makefile.in files!
|
|
||||||
#
|
|
||||||
echo "Replace @SHELL@ with /bin/sh in the Makefile.in files"
|
|
||||||
temp=/tmp/curl$$
|
|
||||||
for file in Makefile.in lib/Makefile.in src/Makefile.in; do
|
|
||||||
in="$n/$file"
|
|
||||||
sed "s:@SHELL@:/bin/sh:g" $in >$temp
|
|
||||||
cp $temp $in
|
|
||||||
done
|
|
||||||
rm -rf $temp
|
|
||||||
|
|
||||||
# Tell the world what we're doing
|
|
||||||
echo "creates $n.tar.gz";
|
|
||||||
|
|
||||||
# Make a tar archive of it all
|
|
||||||
tar -cvf $n.tar $n
|
|
||||||
|
|
||||||
# gzip the archive
|
|
||||||
gzip $n.tar
|
|
||||||
|
|
||||||
# Make it world readable
|
|
||||||
chmod a+r $n.tar.gz ;
|
|
||||||
|
|
||||||
# Delete the temp dir
|
|
||||||
rm -rf $n
|
|
||||||
|
1
packages/Linux/Makefile.am
Normal file
1
packages/Linux/Makefile.am
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SUBDIRS = RPM
|
2
packages/Linux/RPM/Makefile.am
Normal file
2
packages/Linux/RPM/Makefile.am
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
EXTRA_DIST = README curl-ssl.spec.in curl.spec.in make_curl_rpm
|
||||||
|
|
@@ -1,98 +0,0 @@
|
|||||||
%define ver 7.4.2
|
|
||||||
%define rel 1
|
|
||||||
%define prefix /usr
|
|
||||||
|
|
||||||
Summary: get a file from a FTP, GOPHER or HTTP server.
|
|
||||||
Name: curl-ssl
|
|
||||||
Version: %ver
|
|
||||||
Release: %rel
|
|
||||||
Copyright: MPL
|
|
||||||
Group: Utilities/Console
|
|
||||||
Source: curl-%{version}.tar.gz
|
|
||||||
URL: http://curl.haxx.se
|
|
||||||
BuildPrereq: openssl
|
|
||||||
BuildRoot: /tmp/%{name}-%{version}-%{rel}-root
|
|
||||||
Packager: Fill In As You Wish
|
|
||||||
Docdir: %{prefix}/doc
|
|
||||||
|
|
||||||
%description
|
|
||||||
curl-ssl is a client to get documents/files from servers, using
|
|
||||||
any of the supported protocols. The command is designed to
|
|
||||||
work without user interaction or any kind of interactivity.
|
|
||||||
|
|
||||||
curl-ssl offers a busload of useful tricks like proxy support,
|
|
||||||
user authentication, ftp upload, HTTP post, file transfer
|
|
||||||
resume and more.
|
|
||||||
|
|
||||||
Note: this version is compiled with SSL (https:) support.
|
|
||||||
|
|
||||||
Authors:
|
|
||||||
Daniel Stenberg <daniel@haxx.se>
|
|
||||||
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup -n %{name}-%{version}
|
|
||||||
|
|
||||||
|
|
||||||
%build
|
|
||||||
# Needed for snapshot releases.
|
|
||||||
if [ ! -f configure ]; then
|
|
||||||
CONF="./autogen.sh"
|
|
||||||
else
|
|
||||||
CONF="./configure"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
|
||||||
# Configuring the package
|
|
||||||
#
|
|
||||||
CFLAGS="${RPM_OPT_FLAGS}" ${CONF} \
|
|
||||||
--prefix=%{prefix} \
|
|
||||||
--with-ssl
|
|
||||||
|
|
||||||
|
|
||||||
[ "$SMP" != "" ] && JSMP = '"MAKE=make -k -j $SMP"'
|
|
||||||
|
|
||||||
make ${JSMP} CFLAGS="-DUSE_SSLEAY -I/usr/include/openssl";
|
|
||||||
|
|
||||||
|
|
||||||
%install
|
|
||||||
[ -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT}
|
|
||||||
|
|
||||||
make prefix=${RPM_BUILD_ROOT}%{prefix} install-strip
|
|
||||||
|
|
||||||
#
|
|
||||||
# Generating file lists and store them in file-lists
|
|
||||||
# Starting with the directory listings
|
|
||||||
#
|
|
||||||
find ${RPM_BUILD_ROOT}%{prefix}/{bin,lib,man} -type d | sed "s#^${RPM_BUILD_ROOT}#\%attr (-\,root\,root) \%dir #" > file-lists
|
|
||||||
|
|
||||||
#
|
|
||||||
# Then, the file listings
|
|
||||||
#
|
|
||||||
echo "%defattr (-, root, root)" >> file-lists
|
|
||||||
find ${RPM_BUILD_ROOT}%{prefix} -type f | sed -e "s#^${RPM_BUILD_ROOT}##g" >> file-lists
|
|
||||||
|
|
||||||
|
|
||||||
%clean
|
|
||||||
(cd ..; rm -rf curl-7.4.2 ${RPM_BUILD_ROOT})
|
|
||||||
|
|
||||||
|
|
||||||
%files -f file-lists
|
|
||||||
%defattr (-, root, root)
|
|
||||||
%doc BUGS
|
|
||||||
%doc CHANGES
|
|
||||||
%doc CONTRIBUTE
|
|
||||||
%doc FAQ
|
|
||||||
%doc FEATURES
|
|
||||||
%doc FILES
|
|
||||||
%doc INSTALL
|
|
||||||
%doc LEGAL
|
|
||||||
%doc MPL-1.0.txt
|
|
||||||
%doc README
|
|
||||||
%doc README.curl
|
|
||||||
%doc README.libcurl
|
|
||||||
%doc RESOURCES
|
|
||||||
%doc TODO
|
|
||||||
%doc %{name}-ssl.spec.in
|
|
||||||
%doc %{name}.spec.in
|
|
||||||
|
|
78
packages/Linux/RPM/curl-ssl.spec.in
Normal file
78
packages/Linux/RPM/curl-ssl.spec.in
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
%define name curl-ssl
|
||||||
|
%define tarball curl
|
||||||
|
%define version @VERSION@
|
||||||
|
%define release 1
|
||||||
|
%define prefix /usr
|
||||||
|
|
||||||
|
%define builddir $RPM_BUILD_DIR/%{tarball}-%{version}
|
||||||
|
|
||||||
|
Summary: get a file from a FTP, GOPHER or HTTP server.
|
||||||
|
Name: %{name}
|
||||||
|
Version: %{version}
|
||||||
|
Release: %{release}
|
||||||
|
Copyright: MPL
|
||||||
|
Vendor: Daniel Stenberg <Daniel.Stenberg@haxx.se>
|
||||||
|
Packager: Loic Dachary <loic@senga.org>
|
||||||
|
Group: Utilities/Console
|
||||||
|
Source: %{tarball}-%{version}.tar.gz
|
||||||
|
URL: http://curl.haxx.se/
|
||||||
|
BuildRoot: /tmp/%{tarball}-%{version}-root
|
||||||
|
Requires: openssl >= 0.9.5
|
||||||
|
|
||||||
|
%description
|
||||||
|
curl is a client to get documents/files from servers, using any of the
|
||||||
|
supported protocols. The command is designed to work without user
|
||||||
|
interaction or any kind of interactivity.
|
||||||
|
|
||||||
|
curl offers a busload of useful tricks like proxy support, user
|
||||||
|
authentication, ftp upload, HTTP post, file transfer resume and more.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: The includes, libs, and man pages to develop with libcurl
|
||||||
|
Group: Development/Libraries
|
||||||
|
Requires: openssl-devel >= 0.9.5
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
libcurl is the core engine of curl; this packages contains all the libs,
|
||||||
|
headers, and manual pages to develop applications using libcurl.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
rm -rf %{builddir}
|
||||||
|
|
||||||
|
%setup -n %{tarball}-%{version}
|
||||||
|
|
||||||
|
%build
|
||||||
|
%configure --prefix=%{prefix} --with-ssl
|
||||||
|
make
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
make DESTDIR=$RPM_BUILD_ROOT install-strip
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
rm -rf %{builddir}
|
||||||
|
|
||||||
|
%post
|
||||||
|
/sbin/ldconfig
|
||||||
|
|
||||||
|
%postun
|
||||||
|
/sbin/ldconfig
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%attr(0755,root,root) %{_bindir}/curl
|
||||||
|
%attr(0644,root,root) %{_mandir}/man1/*
|
||||||
|
%{_libdir}/libcurl.so*
|
||||||
|
%doc CHANGES LEGAL MITX.txt MPL-1.1.txt README docs/BUGS
|
||||||
|
%doc docs/CONTRIBUTE docs/FAQ docs/FEATURES docs/INSTALL docs/INTERNALS
|
||||||
|
%doc docs/LIBCURL docs/MANUAL docs/README* docs/RESOURCES docs/TODO
|
||||||
|
%doc docs/TheArtOfHttpScripting
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%attr(0644,root,root) %{_mandir}/man3/*
|
||||||
|
%attr(0644,root,root) %{_includedir}/curl/*
|
||||||
|
%{_libdir}/libcurl.a
|
||||||
|
%{_libdir}/libcurl.la
|
||||||
|
%doc docs/examples/*
|
@@ -1,96 +0,0 @@
|
|||||||
%define ver 7.4.2
|
|
||||||
%define rel 1
|
|
||||||
%define prefix /usr
|
|
||||||
|
|
||||||
Summary: get a file from a FTP, GOPHER or HTTP server.
|
|
||||||
Name: curl
|
|
||||||
Version: %ver
|
|
||||||
Release: %rel
|
|
||||||
Copyright: MPL
|
|
||||||
Group: Utilities/Console
|
|
||||||
Source: %{name}-%{version}.tar.gz
|
|
||||||
URL: http://curl.haxx.se
|
|
||||||
BuildRoot: /tmp/%{name}-%{version}-%{rel}-root
|
|
||||||
Packager: Fill In As You Wish
|
|
||||||
Docdir: %{prefix}/doc
|
|
||||||
|
|
||||||
%description
|
|
||||||
curl is a client to get documents/files from servers, using
|
|
||||||
any of the supported protocols. The command is designed to
|
|
||||||
work without user interaction or any kind of interactivity.
|
|
||||||
|
|
||||||
curl offers a busload of useful tricks like proxy support,
|
|
||||||
user authentication, ftp upload, HTTP post, file transfer
|
|
||||||
resume and more.
|
|
||||||
|
|
||||||
Note: this version is compiled without SSL (https:) support.
|
|
||||||
|
|
||||||
Authors:
|
|
||||||
Daniel Stenberg <daniel@haxx.se>
|
|
||||||
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup -n %{name}-%{version}
|
|
||||||
|
|
||||||
|
|
||||||
%build
|
|
||||||
# Needed for snapshot releases.
|
|
||||||
if [ ! -f configure ]; then
|
|
||||||
CONF="./autogen.sh"
|
|
||||||
else
|
|
||||||
CONF="./configure"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
|
||||||
# Configuring the package
|
|
||||||
#
|
|
||||||
CFLAGS="${RPM_OPT_FLAGS}" ${CONF} \
|
|
||||||
--prefix=%{prefix}
|
|
||||||
|
|
||||||
|
|
||||||
[ "$SMP" != "" ] && JSMP = '"MAKE=make -k -j $SMP"'
|
|
||||||
|
|
||||||
make ${JSMP};
|
|
||||||
|
|
||||||
|
|
||||||
%install
|
|
||||||
[ -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT}
|
|
||||||
|
|
||||||
make prefix=${RPM_BUILD_ROOT}%{prefix} install-strip
|
|
||||||
|
|
||||||
#
|
|
||||||
# Generating file lists and store them in file-lists
|
|
||||||
# Starting with the directory listings
|
|
||||||
#
|
|
||||||
find ${RPM_BUILD_ROOT}%{prefix}/{bin,lib,man} -type d | sed "s#^${RPM_BUILD_ROOT}#\%attr (-\,root\,root) \%dir #" > file-lists
|
|
||||||
|
|
||||||
#
|
|
||||||
# Then, the file listings
|
|
||||||
#
|
|
||||||
echo "%defattr (-, root, root)" >> file-lists
|
|
||||||
find ${RPM_BUILD_ROOT}%{prefix} -type f | sed -e "s#^${RPM_BUILD_ROOT}##g" >> file-lists
|
|
||||||
|
|
||||||
|
|
||||||
%clean
|
|
||||||
(cd ..; rm -rf %{name}-%{version} ${RPM_BUILD_ROOT})
|
|
||||||
|
|
||||||
|
|
||||||
%files -f file-lists
|
|
||||||
%defattr (-, root, root)
|
|
||||||
%doc BUGS
|
|
||||||
%doc CHANGES
|
|
||||||
%doc CONTRIBUTE
|
|
||||||
%doc FAQ
|
|
||||||
%doc FEATURES
|
|
||||||
%doc FILES
|
|
||||||
%doc INSTALL
|
|
||||||
%doc LEGAL
|
|
||||||
%doc MPL-1.0.txt
|
|
||||||
%doc README
|
|
||||||
%doc README.curl
|
|
||||||
%doc README.libcurl
|
|
||||||
%doc RESOURCES
|
|
||||||
%doc TODO
|
|
||||||
%doc %{name}-ssl.spec.in
|
|
||||||
%doc %{name}.spec.in
|
|
||||||
|
|
84
packages/Linux/RPM/curl.spec.in
Normal file
84
packages/Linux/RPM/curl.spec.in
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
%define name curl
|
||||||
|
%define version @VERSION@
|
||||||
|
%define release 1
|
||||||
|
%define prefix /usr
|
||||||
|
|
||||||
|
%define builddir $RPM_BUILD_DIR/%{name}-%{version}
|
||||||
|
|
||||||
|
Summary: get a file from a FTP, GOPHER or HTTP server.
|
||||||
|
Name: %{name}
|
||||||
|
Version: %{version}
|
||||||
|
Release: %{release}
|
||||||
|
Copyright: MPL
|
||||||
|
Vendor: Daniel Stenberg <Daniel.Stenberg@haxx.se>
|
||||||
|
Packager: Loic Dachary <loic@senga.org>
|
||||||
|
Group: Utilities/Console
|
||||||
|
Source: %{name}-%{version}.tar.gz
|
||||||
|
URL: http://curl.haxx.se/
|
||||||
|
BuildRoot: /tmp/%{name}-%{version}-root
|
||||||
|
|
||||||
|
%description
|
||||||
|
curl is a client to get documents/files from servers, using any of the
|
||||||
|
supported protocols. The command is designed to work without user
|
||||||
|
interaction or any kind of interactivity.
|
||||||
|
|
||||||
|
curl offers a busload of useful tricks like proxy support, user
|
||||||
|
authentication, ftp upload, HTTP post, file transfer resume and more.
|
||||||
|
|
||||||
|
Note: this version is compiled without SSL (https:) support.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: The includes, libs, and man pages to develop with libcurl
|
||||||
|
Group: Development/Libraries
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
libcurl is the core engine of curl; this packages contains all the libs,
|
||||||
|
headers, and manual pages to develop applications using libcurl.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
rm -rf %{builddir}
|
||||||
|
|
||||||
|
%setup
|
||||||
|
|
||||||
|
%build
|
||||||
|
%configure --without-ssl --prefix=%{prefix}
|
||||||
|
make
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
make DESTDIR=$RPM_BUILD_ROOT install-strip
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
rm -rf %{builddir}
|
||||||
|
|
||||||
|
%post
|
||||||
|
/sbin/ldconfig
|
||||||
|
|
||||||
|
%postun
|
||||||
|
/sbin/ldconfig
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%attr(0755,root,root) %{_bindir}/curl
|
||||||
|
%attr(0644,root,root) %{_mandir}/man1/*
|
||||||
|
%{prefix}/lib/libcurl.so*
|
||||||
|
%doc CHANGES LEGAL MITX.txt MPL-1.1.txt README docs/BUGS
|
||||||
|
%doc docs/CONTRIBUTE docs/FAQ docs/FEATURES docs/INSTALL docs/INTERNALS
|
||||||
|
%doc docs/LIBCURL docs/MANUAL docs/README* docs/RESOURCES docs/TODO
|
||||||
|
%doc docs/TheArtOfHttpScripting
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%attr(0644,root,root) %{_mandir}/man3/*
|
||||||
|
%attr(0644,root,root) %{_includedir}/curl/*
|
||||||
|
%{prefix}/lib/libcurl.a
|
||||||
|
%{prefix}/lib/libcurl.la
|
||||||
|
%doc docs/examples/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Sun Jan 7 2001 Loic Dachary <loic@senga.org>
|
||||||
|
|
||||||
|
- use _mandir instead of prefix to locate man pages because
|
||||||
|
_mandir is not always prefix/man/man?.
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user