Compare commits
352 Commits
curl-7_12_
...
curl-7_12_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
da30242640 | ||
![]() |
811edcde18 | ||
![]() |
4934e6471b | ||
![]() |
9dbd6659dc | ||
![]() |
5ddad4cdb3 | ||
![]() |
338c2da24f | ||
![]() |
b5cafc0b83 | ||
![]() |
c50ced6cc2 | ||
![]() |
f4783bda27 | ||
![]() |
b55507c8a7 | ||
![]() |
827a805966 | ||
![]() |
e23ba31eb9 | ||
![]() |
02c6fde11e | ||
![]() |
d003f6e125 | ||
![]() |
1dfff2487f | ||
![]() |
4ff9cd39c5 | ||
![]() |
9c4ffcc250 | ||
![]() |
6b5a04cf83 | ||
![]() |
55e61c092e | ||
![]() |
de6ab3de22 | ||
![]() |
5e1eb58e5a | ||
![]() |
d892a4dc23 | ||
![]() |
496ea65f39 | ||
![]() |
6577b15d08 | ||
![]() |
f2e35fad27 | ||
![]() |
81c48aa43d | ||
![]() |
0cfa9b52ae | ||
![]() |
48b92c163f | ||
![]() |
b7575b39c4 | ||
![]() |
ae2f002b44 | ||
![]() |
89c312691e | ||
![]() |
1d23affbc5 | ||
![]() |
26ffaa263b | ||
![]() |
ca5e6160b7 | ||
![]() |
6d60ff6ea1 | ||
![]() |
43ae26f146 | ||
![]() |
3e01f70468 | ||
![]() |
b9f1dd7691 | ||
![]() |
a7bed4fc7c | ||
![]() |
7ca49dc91d | ||
![]() |
645ee8a42a | ||
![]() |
115dd6f095 | ||
![]() |
0e03165467 | ||
![]() |
6574f4106e | ||
![]() |
8e7fcd9ee1 | ||
![]() |
ad63e1e698 | ||
![]() |
d784526dae | ||
![]() |
79d480e1e7 | ||
![]() |
b3b2ba31f7 | ||
![]() |
7f78bc3c6d | ||
![]() |
f508f30fb6 | ||
![]() |
d20a05161a | ||
![]() |
6769ab2797 | ||
![]() |
85867cbe94 | ||
![]() |
5e8d3988a2 | ||
![]() |
1cd0a08575 | ||
![]() |
efd71af2a1 | ||
![]() |
2ea80c29fa | ||
![]() |
e3fc0d5e78 | ||
![]() |
33f42aacca | ||
![]() |
c85bf83e88 | ||
![]() |
060b6ce148 | ||
![]() |
35618b4712 | ||
![]() |
cd2e99e980 | ||
![]() |
0359ae8f40 | ||
![]() |
972d39234f | ||
![]() |
798349fce6 | ||
![]() |
9612fda886 | ||
![]() |
4b217efb84 | ||
![]() |
555cfb3059 | ||
![]() |
c0d1d6926c | ||
![]() |
fca8fcec3e | ||
![]() |
6844d5dcad | ||
![]() |
d759e97166 | ||
![]() |
cbfc737d79 | ||
![]() |
ab64bf6fb1 | ||
![]() |
0b0d20021c | ||
![]() |
932a6f6b77 | ||
![]() |
1318760ad2 | ||
![]() |
15a403a98d | ||
![]() |
a92b7c1b16 | ||
![]() |
0c54013ee3 | ||
![]() |
ca5d1e7a8d | ||
![]() |
40a39e2270 | ||
![]() |
982530b186 | ||
![]() |
fadc08445a | ||
![]() |
783381c163 | ||
![]() |
5f26bee7c8 | ||
![]() |
2be57d0833 | ||
![]() |
6e6748f051 | ||
![]() |
a8d544d9b3 | ||
![]() |
5f1490e1bd | ||
![]() |
2c3e557b5c | ||
![]() |
08df4b8971 | ||
![]() |
11f58ea896 | ||
![]() |
15f3b4b6d1 | ||
![]() |
35270e50c2 | ||
![]() |
8c975657e7 | ||
![]() |
03cb3b9db1 | ||
![]() |
19ad942739 | ||
![]() |
3cf452b923 | ||
![]() |
2a6f9aa155 | ||
![]() |
570455b21d | ||
![]() |
dccdf9e66c | ||
![]() |
dd4d5bb1e0 | ||
![]() |
842e4aaa0d | ||
![]() |
ebb09cd9c4 | ||
![]() |
9a6df07d3d | ||
![]() |
c59c429a69 | ||
![]() |
69f9d0c916 | ||
![]() |
56edbe3804 | ||
![]() |
94c4a18541 | ||
![]() |
bdcf8d626d | ||
![]() |
576b40b1b0 | ||
![]() |
954575a19d | ||
![]() |
47bbe36725 | ||
![]() |
1a8f7e830c | ||
![]() |
dfc85b7291 | ||
![]() |
1457b80617 | ||
![]() |
dba40b35f2 | ||
![]() |
e9d95f1a25 | ||
![]() |
67e40a2b16 | ||
![]() |
25f5f14d35 | ||
![]() |
dfda9cc007 | ||
![]() |
e39b29fc48 | ||
![]() |
4c17ba4fc0 | ||
![]() |
4511f7ac50 | ||
![]() |
b9f76f11bb | ||
![]() |
17841a20e3 | ||
![]() |
d90d40b5d1 | ||
![]() |
d2e6a0583a | ||
![]() |
b2c9277e66 | ||
![]() |
31c332af93 | ||
![]() |
90af60a6ef | ||
![]() |
80c7566203 | ||
![]() |
efb1fdbec8 | ||
![]() |
bada8cc259 | ||
![]() |
c3a076176e | ||
![]() |
2cda3070d5 | ||
![]() |
728bed8c98 | ||
![]() |
6e72ea7442 | ||
![]() |
a4aac27fd3 | ||
![]() |
5b8816dcb7 | ||
![]() |
fc0df97278 | ||
![]() |
592658e874 | ||
![]() |
5a70e42428 | ||
![]() |
e4caa98901 | ||
![]() |
c211a7c685 | ||
![]() |
7876c078bc | ||
![]() |
aedadfc779 | ||
![]() |
2046a6b9e5 | ||
![]() |
d1d53b2bbf | ||
![]() |
950aa1c743 | ||
![]() |
a9572bf88a | ||
![]() |
5a93f50394 | ||
![]() |
60af1cbcc2 | ||
![]() |
8952ef933b | ||
![]() |
b350d5da59 | ||
![]() |
6df3bf3644 | ||
![]() |
35840a2c5c | ||
![]() |
090b89cc76 | ||
![]() |
f05d47ddd6 | ||
![]() |
fcfd4bef2d | ||
![]() |
18dc8fbc26 | ||
![]() |
d9ceee1c75 | ||
![]() |
097281f459 | ||
![]() |
087748c48e | ||
![]() |
e35187741b | ||
![]() |
574e911375 | ||
![]() |
ce945bd2f0 | ||
![]() |
8efa6f407d | ||
![]() |
85bd4621db | ||
![]() |
6c3759d78d | ||
![]() |
4af08a19f8 | ||
![]() |
c14650caec | ||
![]() |
c7a9e07909 | ||
![]() |
185baf036b | ||
![]() |
3523613826 | ||
![]() |
782ade7223 | ||
![]() |
ba40eccc90 | ||
![]() |
4191741fb6 | ||
![]() |
7a52f44bd4 | ||
![]() |
efa5485744 | ||
![]() |
c81ac51e5c | ||
![]() |
fd17cf2e3c | ||
![]() |
d4b0999415 | ||
![]() |
03f8ec89db | ||
![]() |
f633ab688b | ||
![]() |
808621ab22 | ||
![]() |
6ed5feda2b | ||
![]() |
964066c0de | ||
![]() |
a913e93667 | ||
![]() |
a7b99fc463 | ||
![]() |
6f252f4704 | ||
![]() |
b596c34bed | ||
![]() |
b0cd96478c | ||
![]() |
387ec712e6 | ||
![]() |
f2a99d7d74 | ||
![]() |
8b6b15dccc | ||
![]() |
bbb72b7b6b | ||
![]() |
785bad388b | ||
![]() |
cf10df6c68 | ||
![]() |
5b55dcbfbb | ||
![]() |
e7dbbd16a5 | ||
![]() |
62f0457961 | ||
![]() |
8879b57b73 | ||
![]() |
e49a6feabb | ||
![]() |
feb2dd2835 | ||
![]() |
5e34f3dc01 | ||
![]() |
0031d76f2a | ||
![]() |
00ee738fdd | ||
![]() |
8d0a823124 | ||
![]() |
9729df1756 | ||
![]() |
cdb419d65e | ||
![]() |
d6f9a41539 | ||
![]() |
1daa258b8a | ||
![]() |
560c257bd0 | ||
![]() |
d7aae417b1 | ||
![]() |
c39858aac0 | ||
![]() |
818aed35e2 | ||
![]() |
2ed524f07e | ||
![]() |
5f1eefd03f | ||
![]() |
522b4d7576 | ||
![]() |
d6dcb08407 | ||
![]() |
806c756a2d | ||
![]() |
2494701347 | ||
![]() |
1c10272e15 | ||
![]() |
0badcf381a | ||
![]() |
35558e6bd7 | ||
![]() |
7659747e6f | ||
![]() |
53189fb2d7 | ||
![]() |
450c178d77 | ||
![]() |
a20eb6df1b | ||
![]() |
d73425061a | ||
![]() |
0051d5ac88 | ||
![]() |
76920413d9 | ||
![]() |
44d9a8ba4e | ||
![]() |
38dc548a87 | ||
![]() |
dca6386234 | ||
![]() |
2a701a1aac | ||
![]() |
0cb297abc9 | ||
![]() |
821a23535b | ||
![]() |
bc80599178 | ||
![]() |
941374b573 | ||
![]() |
1886893d66 | ||
![]() |
7291772b1f | ||
![]() |
8e28721057 | ||
![]() |
8d2120566e | ||
![]() |
67341c4cbe | ||
![]() |
f8188ddfee | ||
![]() |
29c546b426 | ||
![]() |
0d259b898b | ||
![]() |
c136b80af5 | ||
![]() |
83b87d53c1 | ||
![]() |
1e99f1ee41 | ||
![]() |
d7fe136d54 | ||
![]() |
cd7a0f829f | ||
![]() |
cf3f1ef284 | ||
![]() |
a737864a1c | ||
![]() |
c68a6805b3 | ||
![]() |
bd3d5a17b4 | ||
![]() |
d4b577114b | ||
![]() |
713effb6e4 | ||
![]() |
b92e2ab6b1 | ||
![]() |
05baf94b43 | ||
![]() |
a76288b99a | ||
![]() |
557e95c0a3 | ||
![]() |
0a83fa90bb | ||
![]() |
daeb143177 | ||
![]() |
9f752120c0 | ||
![]() |
80a1e972fc | ||
![]() |
5e65d48ffa | ||
![]() |
752ef08141 | ||
![]() |
070e0e8b0a | ||
![]() |
2ed0728cef | ||
![]() |
a79b9e9d4a | ||
![]() |
24572daccc | ||
![]() |
1770563fff | ||
![]() |
4cd96483f6 | ||
![]() |
8f1783b8a7 | ||
![]() |
be72eaa327 | ||
![]() |
61bded1d82 | ||
![]() |
4b3937373a | ||
![]() |
08bf0907d4 | ||
![]() |
eb044f8787 | ||
![]() |
8d0c77403c | ||
![]() |
601062455c | ||
![]() |
5be788ba36 | ||
![]() |
281559b31b | ||
![]() |
ef1aa4e5e9 | ||
![]() |
7b7ac04895 | ||
![]() |
60f5b2b275 | ||
![]() |
c0f9d7fdb7 | ||
![]() |
fc4d6f73a6 | ||
![]() |
295169f9d9 | ||
![]() |
1a3797a699 | ||
![]() |
977e106924 | ||
![]() |
8d76d4016d | ||
![]() |
9f92657f76 | ||
![]() |
9f341f9ce5 | ||
![]() |
2098871509 | ||
![]() |
3d00c86f4c | ||
![]() |
90037b85d1 | ||
![]() |
6ec145d4b4 | ||
![]() |
40a58c392f | ||
![]() |
9733cd59bb | ||
![]() |
b3caf7bfa8 | ||
![]() |
23fbb89805 | ||
![]() |
bd1adaf7ea | ||
![]() |
0c9e23fc0c | ||
![]() |
f091ce64ac | ||
![]() |
55a69ebea6 | ||
![]() |
d6b3850562 | ||
![]() |
80197cf493 | ||
![]() |
8ee564c216 | ||
![]() |
5bfeb60a83 | ||
![]() |
1ab4a2f870 | ||
![]() |
2a627059ac | ||
![]() |
3f739acf24 | ||
![]() |
d3454ceb94 | ||
![]() |
59695c05b1 | ||
![]() |
f0969c9692 | ||
![]() |
18dd8154e2 | ||
![]() |
4c58797607 | ||
![]() |
d620f1e529 | ||
![]() |
e0b436f8e1 | ||
![]() |
e99d1e97de | ||
![]() |
1fb74b4fa2 | ||
![]() |
473f6ea9f0 | ||
![]() |
0b04c52119 | ||
![]() |
8383945acc | ||
![]() |
fce9d51122 | ||
![]() |
7c3ee84295 | ||
![]() |
a8db25f48b | ||
![]() |
20705ca311 | ||
![]() |
af33c6b549 | ||
![]() |
2b8775dff7 | ||
![]() |
ea81dd9e2e | ||
![]() |
7dcb102733 | ||
![]() |
aa0e32060e | ||
![]() |
2e8f37aca5 | ||
![]() |
195d769c4b | ||
![]() |
70f08b5baa | ||
![]() |
9e987ac6a2 | ||
![]() |
de03f172ad | ||
![]() |
0078944486 | ||
![]() |
d3f796ac59 | ||
![]() |
3d38080d54 | ||
![]() |
fe07962f9c | ||
![]() |
938a72b2db | ||
![]() |
a8827b1ed6 | ||
![]() |
ff40cd71ac |
288
CHANGES
288
CHANGES
@@ -6,6 +6,294 @@
|
||||
|
||||
Changelog
|
||||
|
||||
Version 7.12.1 (10 August 2004)
|
||||
|
||||
Daniel (10 August 2004)
|
||||
- In OpenSSL 0.9.7d and earlier, ASN1_STRING_to_UTF8 fails if the input is
|
||||
already UTF-8 encoded. This made the certificate verification fail if the
|
||||
remote server used a certificate with the name UTF-8 encoded.
|
||||
|
||||
Work-around brought by Alexis S. L. Carvalho.
|
||||
|
||||
Daniel (9 August 2004)
|
||||
- I fixed the configure script for krb4 to use -lcom_err as well, as I started
|
||||
to get link problems with it unless I did that on my Solaris 2.7 box. I
|
||||
don't understand why I started to get problems with this now!
|
||||
|
||||
Daniel (5 August 2004)
|
||||
- Enrico Scholz fixed the HTTP-Negotiate service name to be uppercase as
|
||||
reported in bug report #1004105
|
||||
|
||||
Daniel (4 August 2004)
|
||||
- Gisle Vanem provided a fix for the multi interface and connecting to a host
|
||||
using multiple IP (bad) addresses.
|
||||
|
||||
- Dylan Salisbury made libcurl no longer accept cookies set to a TLD only (it
|
||||
previously allowed that on the seven three-letter domains).
|
||||
|
||||
Daniel (31 July 2004)
|
||||
- Joel Chen reported that the digest code assumed quotes around the contents a
|
||||
bit too much.
|
||||
|
||||
Daniel (28 July 2004)
|
||||
- Bertrand Demiddelaer fixed the host name to get setup properly even when a
|
||||
connection is re-used, when a proxy is in use. Previously the wrong Host:
|
||||
header could get sent when re-using a proxy connection to a different target
|
||||
host.
|
||||
|
||||
- Fixed Brian Akins' reported problems with duplicate Host: headers on re-used
|
||||
connections. If you attempted to replace the Host: header in the second
|
||||
request, you got two such headers!
|
||||
|
||||
- src/Makefile.am now includes the Makefile.inc file to get info about files
|
||||
|
||||
Daniel (26 July 2004)
|
||||
- Made "curl [URL] -o name#2" work as expected. If there's no globbing for the
|
||||
#-number, it will simply be used as #2 in the file name.
|
||||
|
||||
- Bertrand Demiddelaer fixed testing with valgrind 2.1.x and added two missing
|
||||
newlines in the cookie informationals.
|
||||
|
||||
Daniel (24 July 2004)
|
||||
- I fixed the autobuilds with ares, since they now need to have buildconf run
|
||||
in the ares dir before the configure script is run.
|
||||
|
||||
- Added Casey O'Donnell's curl_easy_reset() function. It has a proto in
|
||||
curl/curl.h but we have no man page yet.
|
||||
|
||||
Daniel (20 July 2004)
|
||||
- Added buildconf and buildconf.bat to the release archives, since they are
|
||||
handy for rebuilding curl when using a daily snapshot (and not a pure CVS
|
||||
checkout).
|
||||
|
||||
Daniel (16 July 2004)
|
||||
- As suggested by Toby Peterson, libcurl now ignores Content-Length data if the
|
||||
given size is a negative number. Test case 178 verifies this.
|
||||
|
||||
Daniel (14 July 2004)
|
||||
- G<>nter Knauf has made the Netware builds do without the config-netware.h
|
||||
files, so they are now removed from the dist packages.
|
||||
|
||||
- G<>nter Knauf made curl and libcurl build with Borland again.
|
||||
|
||||
- Andres Garcia fixed the common test 505 failures on windows.
|
||||
|
||||
Daniel (6 July 2004)
|
||||
- Andr<64>s Garc<72>a found out why the windows tests failed on file:// "uploads".
|
||||
|
||||
Daniel (2 July 2004)
|
||||
- Andr<64>s Garc<72>a reported a curl_share_cleanup() crash that occurs when no
|
||||
lock/unlock callbacks have been set and the share is cleaned up.
|
||||
|
||||
Daniel (1 July 2004)
|
||||
- When using curl --trace or --trace-ascii, no trace messages that were sent
|
||||
by curl_easy_cleanup() were included in the trace file. This made the
|
||||
message "Closing connection #0" never appear in trace dumps.
|
||||
|
||||
Daniel (30 June 2004)
|
||||
- Niels van Tongeren found that setting CURLOPT_NOBODY to TRUE doesn't disable
|
||||
a previously set POST request, making a very odd request get sent (unless
|
||||
you disabled the POST) a HEAD request with a POST request-body. I've now
|
||||
made CURLOPT_NOBODY enforce a proper HEAD. Added test case 514 for this.
|
||||
|
||||
Daniel (29 June 2004)
|
||||
- G<>nter Knauf made the testcurl.pl script capable of using a custom setup
|
||||
file to easier run multiple autobuilds on the same source tree.
|
||||
|
||||
- Gisle fixed the djgpp build and fixed a memory problem in some of the
|
||||
reorged name resolved code.
|
||||
|
||||
- Fixed code to allow connects done using the multi interface to attempt the
|
||||
next IP when connecting to a host that resolves to multiple IPs and a
|
||||
connect attempt fails.
|
||||
|
||||
Daniel (27 June 2004)
|
||||
- Based on Rob Stanzel's bug report #979480, I wrote a configure check that
|
||||
checks if poll() can be used to wait on NULL as otherwise select() should be
|
||||
used to do it. The select() usage was also fixed according to his report.
|
||||
|
||||
Mac OS X 10.3 says "poll() functionality for Mac OS X is implemented via an
|
||||
emulation layer on top of select(), not in the kernel directly. It is
|
||||
recommended that programs running under OS X 10.3 prefer select() over
|
||||
poll(). Configure scripts should look for the _POLL_EMUL_H_ define (instead
|
||||
of _POLL_H_ or _SYS_POLL_H_) and avoid implementations where poll is not
|
||||
implemented in the kernel."
|
||||
|
||||
Yes, we can probably use select() on most platforms but today I prefered to
|
||||
leave the code unaltered.
|
||||
|
||||
Daniel (24 June 2004)
|
||||
- The standard curl_version() string now only includes version info about
|
||||
involved libraries and not about particular features. Thus it will no longer
|
||||
include info about ipv6 nor GSS. That info is of course still available in
|
||||
the feature bitmask curl_version_info() offers.
|
||||
|
||||
- Replaced all occurances of sprintf() with snprintf(). This is mostly because
|
||||
it is "A Good Thing" rather than actually fixing any known problem. This
|
||||
will help preventing future possible mistakes to cause buffer overflows.
|
||||
|
||||
- Major reorganization in the host resolve code (again). This time, I've
|
||||
modified the code to now always use a linked list of Curl_addrinfo structs
|
||||
to return resolved info in, no matter what resolver method or support that
|
||||
is available on the platform. It makes it a lot easier to write code that
|
||||
uses or depends on resolved data.
|
||||
|
||||
Internally, this means amongst other things that we can stop doing the weird
|
||||
"increase buffer size until it works" trick when resolving hosts on
|
||||
ipv4-only with gethostbyname_r(), we support socks even on libcurls built
|
||||
with ipv6 enabled (but only to socks servers that resolve to an ipv4
|
||||
address) and we no longer deep-copy or relocate hostent structs (we create
|
||||
Curl_addrinfo chains instead).
|
||||
|
||||
The new "hostent to Curl_addrinfo" converter function is named Curl_he2ai()
|
||||
and is slightly naive and simple, yet I believe it is functional enough to
|
||||
work for libcurl.
|
||||
|
||||
Daniel (22 June 2004)
|
||||
- David Cohen pointed out that RFC2109 says clients should allow cookies to
|
||||
contain least 4096 bytes while libcurl only allowed 2047. I raised the limit
|
||||
to 4999 now and made the used buffer get malloc()ed instead of simply
|
||||
allocated on stack as before. Extended test case 46 to include a cookie with
|
||||
very huge content to verify the fix.
|
||||
|
||||
- G<>nter Knauf fixed getdate.y to remove a few warnings. I removed the
|
||||
ifdef'ed test we never ever use anyway.
|
||||
|
||||
- Gisle Vanem fixed the certificate wildcard checks to support a '*'-letter
|
||||
anywhere in the wildcard string, support multiple '*'-letters in the
|
||||
wildcard and to allow the '*'-letter to match a string that includes a dot.
|
||||
|
||||
Daniel (21 June 2004)
|
||||
- testcurl.sh is now removed completely, tests/testcurl.pl is the script to
|
||||
use when autobuilding curl!
|
||||
|
||||
- Kjetil Jacobsen brought my attention to the fact that you cannot properly
|
||||
abort an upload with the readfunction callback, since returning 0 or -1 only
|
||||
stops the upload and libcurl will continue waiting for downloaded data and
|
||||
the server often waits for the rest of the upload data to arrive.
|
||||
|
||||
Thus, I've now added the ability for read callbacks to return
|
||||
CURL_READFUNC_ABORT to abort an upload from a read callback. This will stop
|
||||
the transfer immediately with a CURLE_ABORTED_BY_CALLBACK return code.
|
||||
|
||||
Test case 513 was added to verify that it works. I had to improve the test
|
||||
HTTP server too to dump the request to a file even when the client
|
||||
disconnects prematurely.
|
||||
|
||||
Daniel (19 June 2004)
|
||||
- Luca Alteas provided a test case with a failing curl operation: when we POST
|
||||
to a site with --digest (or similar) set, and the server responded with a 302
|
||||
Location: to the "authprobe" request, it was not treated correctly. We still
|
||||
will behave badly if FOLLOWLOCATION is enabled for this case, but I'm not
|
||||
in the mood to dive into this right now and will leave it as-is for now.
|
||||
Verified my fix with test case 177.
|
||||
|
||||
Daniel (18 June 2004)
|
||||
- Gisle Vanem's patch that provides more details from the SSL layers (if you
|
||||
use an OpenSSL version that supports it). It also introduces two new types
|
||||
of data that can be sent to the debug callback: CURLINFO_SSL_DATA_IN and
|
||||
CURLINFO_SSL_DATA_OUT.
|
||||
|
||||
- With David Byron's test server I could repeat his problem and make sure that
|
||||
POSTing over HTTPS:// with NTLM works fine now. There was a general problem
|
||||
with multi-pass authentication with non-GET operations with CONNECT.
|
||||
|
||||
Daniel (16 June 2004)
|
||||
- Modified to keep the upload byte counter in an curl_off_t, not an int as
|
||||
before. 32bits is not enough. This is most likely the bug Jean-Louis Lemaire
|
||||
reported that makes 2GB FTP uploads to report error ("unaligned file sizes")
|
||||
when completed.
|
||||
|
||||
Daniel (15 June 2004)
|
||||
- Luca Alteas reported a problem that I fixed: if you did a POST with
|
||||
CURLAUTH_DIGEST set but the server didn't require any authentication,
|
||||
libcurl would repeatedly send HEAD lots of times until it gives up. This was
|
||||
actually the case for all multi-pass authentications. Added test case 174,
|
||||
175 and 176 to verify this.
|
||||
|
||||
Daniel (14 June 2004)
|
||||
- Multipart formposts uploading files no longer inserts the files themselves
|
||||
into the huge prebuilt chunk. This enables libcurl to formpost files that is
|
||||
larger than the amount of system memory. When the file given is passed on
|
||||
stdin, libcurl still uses the old method of reading the full fill before the
|
||||
upload takes place. This approach was selected in order to not alter the
|
||||
behavior for existing applications, as when using stdin libcurl can't know
|
||||
the size of the upload and chunked transfer-encoding can only be used on
|
||||
HTTP 1.1 servers.
|
||||
|
||||
Daniel (13 June 2004)
|
||||
- Gisle found out that we did wildcard cert name checks wrong, so that parts
|
||||
of the check wrongly was case sensitive.
|
||||
|
||||
Daniel (11 June 2004)
|
||||
- Tim Sneddon brought a minor VMS fix to make curl build properly on his VMS
|
||||
machine. He also had some interesting libcurl patches... they might be able
|
||||
to do in a slightly nicer way. Discussions are in progress.
|
||||
|
||||
Daniel (10 June 2004)
|
||||
- Gisle Vanem brought code cleanupsm better verbose output and better connect
|
||||
timeout handling when attempting to connect to a host that resolves to
|
||||
multiple IP addresses.
|
||||
|
||||
- Steven Bazyl and Seshubabu Pasam pointed out a bug on win32 when freeing the
|
||||
path after a file:// transfer.
|
||||
|
||||
Daniel (9 June 2004)
|
||||
- Alexander Krasnostavsky made 'configure --disable-http' work to build libcurl
|
||||
without HTTP support. I added a new return code for curl_formadd() in case
|
||||
libcurl is built with HTTP disable: CURL_FORMADD_DISABLED.
|
||||
|
||||
- Alexander Krasnostavsky pointed out a missing file in the generated
|
||||
curllib.dsp file, and now people building with this should get a libcurl.lib
|
||||
file generated as it used to do before we generated this file.
|
||||
|
||||
Daniel (8 June 2004)
|
||||
- Marty Kuhrt fixed a minor build problem for VMS.
|
||||
|
||||
Daniel (7 June 2004)
|
||||
- Reverted the configure check from the 4th since it obviously didn't work.
|
||||
Remade it in a different manner that hopefully works better.
|
||||
|
||||
Daniel (4 June 2004)
|
||||
- G<>nter Knauf brought patches to make curl build fine on NetWare again.
|
||||
|
||||
- Made the configure checks for strerror_r() not exit the configure script
|
||||
when built for cross-compiling.
|
||||
|
||||
Daniel (3 June 2004)
|
||||
- Chris Gaukroger pointed out that 'make test' attempts to run the tests even
|
||||
if curl is built cross-compiled. I've now made it output a short message
|
||||
instead, saying it isn't possible to do.
|
||||
|
||||
- Alexander Krasnostavsky brought FTP 3rd party transfer support to libcurl.
|
||||
You can now use libcurl to transfer files between two remote hosts using
|
||||
FTP. There are a bunch of new options to control this with:
|
||||
CURLOPT_SOURCE_HOST
|
||||
CURLOPT_SOURCE_USERPWD
|
||||
CURLOPT_SOURCE_PATH
|
||||
CURLOPT_SOURCE_PORT
|
||||
CURLOPT_PASV_HOST
|
||||
CURLOPT_SOURCE_PREQUOTE
|
||||
CURLOPT_SOURCE_POSTQUOTE
|
||||
|
||||
(They still remain to be documented properly in the curl_easy_setopt man
|
||||
page.)
|
||||
|
||||
When using this, the ordinary CURLOPT_URL specifies the target URL, and you
|
||||
specify the source data with these additional options. ftp3rdparty.c is a
|
||||
new example source code showing how to use this.
|
||||
|
||||
- Vincent Bronner fixed the HTTP Digest code to use the proxy user name and
|
||||
password when doing proxy authentication, it previously always used the host
|
||||
user name and password!
|
||||
|
||||
Daniel (2 June 2004)
|
||||
- CURLOPT_UPLOAD and CURLOPT_PUT now do the exact same thing internally, which
|
||||
fixes some old confusions on when which of these should be used and what the
|
||||
differences are.
|
||||
|
||||
- Applied Gisle's fixes to make curl build fine with lcc-win32
|
||||
|
||||
Version 7.12.0 (2 June 2004)
|
||||
|
||||
Daniel (1 June 2004)
|
||||
|
6
CVS-INFO
6
CVS-INFO
@@ -15,12 +15,6 @@ Compile and build instructions follow below.
|
||||
CHANGES.0 contains ancient changes.
|
||||
CHANGES.$year contains changes for the particular year.
|
||||
|
||||
tests/memanalyze.pl
|
||||
is for analyzing the output generated by curl if -DCURLDEBUG
|
||||
is used when compiling (run configure with --enable-debug)
|
||||
|
||||
buildconf builds the makefiles and configure stuff
|
||||
|
||||
Makefile.dist is included as the root Makefile in distribution archives
|
||||
|
||||
perl/ is a subdirectory with various perl scripts
|
||||
|
@@ -23,8 +23,8 @@
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
EXTRA_DIST = CHANGES COPYING maketgz reconf Makefile.dist \
|
||||
curl-config.in curl-style.el sample.emacs testcurl.sh RELEASE-NOTES
|
||||
EXTRA_DIST = CHANGES COPYING maketgz reconf Makefile.dist curl-config.in \
|
||||
curl-style.el sample.emacs RELEASE-NOTES buildconf buildconf.bat
|
||||
|
||||
bin_SCRIPTS = curl-config
|
||||
|
||||
|
@@ -30,8 +30,28 @@ ssl:
|
||||
make
|
||||
|
||||
borland:
|
||||
cd lib & make -f Makefile.b32
|
||||
cd src & make -f Makefile.b32
|
||||
cd lib
|
||||
make -f Makefile.b32
|
||||
cd ..\src
|
||||
make -f Makefile.b32
|
||||
|
||||
borland-ssl:
|
||||
cd lib
|
||||
make -f Makefile.b32 WITH_SSL=1
|
||||
cd ..\src
|
||||
make -f Makefile.b32 WITH_SSL=1
|
||||
|
||||
borland-ssl-zlib:
|
||||
cd lib
|
||||
make -f Makefile.b32 WITH_SSL=1 WITH_ZLIB=1
|
||||
cd ..\src
|
||||
make -f Makefile.b32 WITH_SSL=1 WITH_ZLIB=1
|
||||
|
||||
borland-clean:
|
||||
cd lib
|
||||
make -f Makefile.b32 clean
|
||||
cd ..\src
|
||||
make -f Makefile.b32 clean
|
||||
|
||||
mingw32:
|
||||
cd lib & make -f Makefile.m32 ZLIB=1
|
||||
@@ -41,18 +61,34 @@ mingw32-ssl:
|
||||
cd lib & make -f Makefile.m32 SSL=1 ZLIB=1
|
||||
cd src & make -f Makefile.m32 SSL=1 ZLIB=1
|
||||
|
||||
mingw32-clean:
|
||||
cd lib & make -f Makefile.m32 clean
|
||||
cd src & make -f Makefile.m32 clean
|
||||
|
||||
vc:
|
||||
cd lib
|
||||
nmake /f Makefile.vc6 cfg=release
|
||||
cd ..\src
|
||||
nmake /f Makefile.vc6
|
||||
|
||||
vc-zlib:
|
||||
cd lib
|
||||
nmake /f Makefile.vc6 cfg=release-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.vc6 cfg=release-zlib
|
||||
|
||||
vc-ssl:
|
||||
cd lib
|
||||
nmake /f Makefile.vc6 cfg=release-ssl
|
||||
cd ..\src
|
||||
nmake /f Makefile.vc6 cfg=release-ssl
|
||||
|
||||
vc-ssl-zlib:
|
||||
cd lib
|
||||
nmake /f Makefile.vc6 cfg=release-ssl-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.vc6 cfg=release-ssl-zlib
|
||||
|
||||
vc-ssl-dll:
|
||||
cd lib
|
||||
nmake /f Makefile.vc6 cfg=release-ssl-dll
|
||||
@@ -82,8 +118,16 @@ amiga:
|
||||
cd ./src && make -f makefile.amiga
|
||||
|
||||
netware:
|
||||
cd lib && make -f Makefile.netware
|
||||
cd src && make -f Makefile.netware
|
||||
$(MAKE) -C lib -f Makefile.netware
|
||||
$(MAKE) -C src -f Makefile.netware
|
||||
|
||||
netware-ssl:
|
||||
$(MAKE) -C lib -f Makefile.netware SSL=1
|
||||
$(MAKE) -C src -f Makefile.netware SSL=1
|
||||
|
||||
netware-clean:
|
||||
$(MAKE) -C lib -f Makefile.netware clean
|
||||
$(MAKE) -C src -f Makefile.netware clean
|
||||
|
||||
unix: all
|
||||
|
||||
|
109
RELEASE-NOTES
109
RELEASE-NOTES
@@ -1,62 +1,83 @@
|
||||
Curl and libcurl 7.12.0.
|
||||
Curl and libcurl 7.12.1
|
||||
|
||||
Public curl release number: 81
|
||||
Releases counted from the very beginning: 108
|
||||
Public curl release number: 82
|
||||
Releases counted from the very beginning: 109
|
||||
Available command line options: 96
|
||||
Available curl_easy_setopt() options: 113
|
||||
Available curl_easy_setopt() options: 120
|
||||
Number of public functions in libcurl: 36
|
||||
|
||||
A special thanks to:
|
||||
|
||||
archivas.com and Alan Pinstein, for paying me to focus on their requests
|
||||
Amount of public web site mirrors: 12
|
||||
Number of known libcurl bindings: 26
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o added ability to "upload" to file:// URLs
|
||||
o added curl_global_init_mem()
|
||||
o removed curl_formparse()
|
||||
o the MSVC project file in the release archive is automatically built
|
||||
o curl --proxy-digest is a new command line option
|
||||
o the Windows version of libcurl can use wldap32.dll for LDAP
|
||||
o added curl_easy_strerror(), curl_multi_strerror() and curl_share_strerror()
|
||||
o IPv6-enabled Windows hosts now resolves names threaded/asynch as well
|
||||
o configure --with-libidn can be used to point out the root dir of a libidn
|
||||
installation (version 0.4.5 or later) for curl to use, then libcurl can
|
||||
resolve and use IDNA names (domain names with "international" letters)
|
||||
o the version string now only contains info about (sub) package versions,
|
||||
while for example krb4 and ipv6 now only are available as 'features'
|
||||
o added curl_easy_reset()
|
||||
o socks proxy support even when libcurl is built ipv6-enabled
|
||||
o read callbacks can stop the transfer by returning CURL_READFUNC_ABORT
|
||||
o libcurl-tutorial.3 is the new man page formerly known as libcurl-the-guide
|
||||
o additional SSL trace data might be sent to the debug callback using two new
|
||||
types: CURLINFO_SSL_DATA_IN and CURLINFO_SSL_DATA_OUT
|
||||
o multipart formposts can upload files larger than system memory
|
||||
o the curl tool continues with the next URL even if one transfer fails
|
||||
o FTP 3rd party transfer support - seven new setopt() options
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o incoming cookies with domains set with a prefixed dot now works better
|
||||
o CURLOPT_COOKIEFILE and CURLOPT_COOKIE can be used in the same request
|
||||
o improved peer certificate name verification
|
||||
o allocation failures cause no leaks nor crashes
|
||||
o the progress meter display now handles file sizes up to full 8 exabytes
|
||||
(which is as high a signed 64 bit number can reach)
|
||||
o general HTTP authentication improvements
|
||||
o HTTP Digest authentication with the proxy works
|
||||
o mulipart formposting with -F and file names with spaces work again
|
||||
o curl_easy_duphandle() now works when ares-enabled
|
||||
o HTTP Digest authentication works a lot more like the RFC says
|
||||
o curl works with telnet and stdin properly on Windows
|
||||
o configure --without-ssl works even when pkg-config has OpenSSL details
|
||||
o src/hugehelp.c builds correct again in non-configure build environments
|
||||
o UTF-8 encoded certificate names can now be verified properly
|
||||
o krb4 link problem
|
||||
o HTTP Negotiate service name now provided in uppercase
|
||||
o no longer accepts any cookies with domain set to just a TLD
|
||||
o HTTP Digest properties without quotes in the header
|
||||
o bad Host: header case on re-used connections over proxy
|
||||
o duplicate Host: header case on re-used connections
|
||||
o curl -o name#[num] now works when no globbing for [num] exists
|
||||
o test suite runs fine with valgrind 2.1.x
|
||||
o negative Content-Length is ignored
|
||||
o test 505 runs fine on windows
|
||||
o curl_share_cleanup() crash
|
||||
o --trace files now get the final info lines too
|
||||
o multi interface connects fine to multi-IP resolving hosts
|
||||
o --limit-rate works on Mac OS X (and other systems with bad poll()s)
|
||||
o cookies can now hold 4999 bytes of content
|
||||
o HTTP POST/PUT with NTLM/Digest/Negotiate to a URL returning 3XX
|
||||
o HTTPS POST/PUT over a proxy requiring NTLM/Digest/Negotiate
|
||||
o less restrictive libidn requirements, 0.4.1 or later is fine
|
||||
o HTTP POST or PUT with Digest/Negotiate/NTLM selected but the server
|
||||
didn't require any authentication
|
||||
o win32 file:// transfer free memory bug
|
||||
o configure --disable-http builds a libcurl without HTTP support
|
||||
o CURLOPT_FILETIME had wrong type in curl.h, it expects a long argument
|
||||
o builds fine with Borland on Windows
|
||||
o the msvc curllib.dsp now builds the libcurl.lib file
|
||||
o builds fine on VMS
|
||||
o builds fine on NetWare
|
||||
o HTTP Digest authentication with proxies uses correct user name + password
|
||||
o builds fine with lcc-win32
|
||||
|
||||
Other curl-related news since the previous public release:
|
||||
|
||||
o The CVS repository was moved to cool.haxx.se
|
||||
o AdacURL 7.11.2 was released: http://www.almroth.com/adacurl/
|
||||
o PycURL 7.11.3 was released: http://pycurl.sourceforge.net
|
||||
o A new German download mirror: http://www.mirrorspace.org/curl/
|
||||
o Two new mailing lists are available:
|
||||
curl-and-python - for python programmers using pycurl or curl
|
||||
curl-perl-commmits - receives commits done to the curl-perl CVS module
|
||||
o James Hu took over after Kevin Roth as maintainer of the curl package on
|
||||
cygwin. Many saludos to Kevin for a work well done during many years.
|
||||
o Gambas binding: http://gambas.sf.net
|
||||
o pycurl 7.12.0 was released http://pycurl.sf.net
|
||||
o wxWidgets binding: http://homepage.mac.com/codonnell/wxcurldav/
|
||||
o New Austrian curl web mirror: http://curl.gds.tuwien.ac.at
|
||||
o TclCurl 0.12.0 was released:
|
||||
http://personal1.iddeo.es/andresgarci/tclcurl/english/
|
||||
o Ch binding: http://chcurl.sourceforge.net
|
||||
o New US curl web mirror: http://curl.109k.com
|
||||
o glib/GTK+ binding: http://atterer.net/glibcurl/
|
||||
o New French curl web mirror: http://curl.mirror.internet.tp
|
||||
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Gisle Vanem, Tommy Tam, Luca Altea, James Bursa, Mihai Ionescu, Michael
|
||||
Benedict, Andr<64>s Garc<72>a, Joe Halpin, Seshubabu Pasam, Peter Sylvester, Robert
|
||||
D. Young, Jesse Noller, David Byron, Massimiliano Ziccardi, Mohun Biswas,
|
||||
Renaud Duhaut
|
||||
Gisle Vanem, Vincent Bronner, Alexander Krasnostavsky, Chris Gaukroger,
|
||||
G<EFBFBD>nter Knauf, Marty Kuhrt, Kjetil Jacobsen, Steven Bazyl, Seshubabu Pasam,
|
||||
Luca Alteas, Jean-Louis Lemaire, David Byron, David Cohen, Rob Stanzel,
|
||||
Niels van Tongeren, Andr<64>s Garc<72>a, Toby Peterson, Casey O'Donnell, Brian
|
||||
Akins, Bertrand Demiddelaer, Joel Chen, Dylan Salisbury, Enrico Scholz,
|
||||
Alexis Carvalho
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
12
TODO-RELEASE
12
TODO-RELEASE
@@ -1,13 +1,9 @@
|
||||
Issues not sorted in any particular order.
|
||||
#[num] refers to bug report numbers.
|
||||
UNASSIGNED means that no person has publicly stated to work on the issue.
|
||||
DELETE means the issue is subject for dismissal
|
||||
|
||||
To get fixed in 7.12.0 (planned release: June 2004)
|
||||
To get fixed in 7.12.2 (planned release: December 2004)
|
||||
======================
|
||||
|
||||
To get fixed in 7.12.1 (planned release: August 2004)
|
||||
======================
|
||||
|
||||
* FTP 3rd party transfers
|
||||
36. Fix HTTP Negotiate authentication so that no bogus user name needs to be
|
||||
provided to activate it.
|
||||
|
||||
Bugfixes reported until late November
|
||||
|
23
acinclude.m4
23
acinclude.m4
@@ -423,13 +423,18 @@ main () {
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
GLIBC_STRERROR_R="1"
|
||||
AC_DEFINE(HAVE_GLIBC_STRERROR_R, 1, [we have a glibc-style strerror_r()])
|
||||
AC_MSG_RESULT([yes]),
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_RESULT([no]),
|
||||
dnl cross-compiling!
|
||||
AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually!])
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([for a POSIX strerror_r API])
|
||||
AC_TRY_RUN([
|
||||
if test -z "$GLIBC_STRERROR_R"; then
|
||||
|
||||
AC_MSG_CHECKING([for a POSIX strerror_r API])
|
||||
AC_TRY_RUN([
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
int
|
||||
@@ -444,12 +449,16 @@ main () {
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
AC_DEFINE(HAVE_POSIX_STRERROR_R, 1, [we have a POSIX-style strerror_r()])
|
||||
AC_MSG_RESULT([yes]),
|
||||
AC_MSG_RESULT([no])
|
||||
AC_DEFINE(HAVE_POSIX_STRERROR_R, 1, [we have a POSIX-style strerror_r()])
|
||||
AC_MSG_RESULT([yes]),
|
||||
AC_MSG_RESULT([no]) ,
|
||||
dnl cross-compiling!
|
||||
AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually!])
|
||||
)
|
||||
|
||||
fi
|
||||
fi dnl if not using glibc API
|
||||
|
||||
fi dnl we have a strerror_r
|
||||
|
||||
])
|
||||
|
||||
|
73
ares/CHANGES
73
ares/CHANGES
@@ -1,5 +1,78 @@
|
||||
Changelog for the c-ares project
|
||||
|
||||
* July 24
|
||||
|
||||
- Made the lib get built static only if --enable-debug is used.
|
||||
|
||||
- Gisle Vanem fixed:
|
||||
|
||||
Basically in loops like handle_errors(), 'query->next' was assigned a local
|
||||
variable and then query was referenced after the memory was freed by
|
||||
next_server(). I've changed that so next_server() and end_query() returns
|
||||
the next query. So callers should use this ret-value.
|
||||
|
||||
The next problem was that 'server->tcp_buffer_pos' had a random value at
|
||||
entry to 1st recv() (luckily causing Winsock to return ENOBUFS).
|
||||
|
||||
I've also added a ares_writev() for Windows to streamline the code a bit
|
||||
more.
|
||||
|
||||
* July 20
|
||||
- Fixed a few variable return types for some system calls. Made configure
|
||||
check for ssize_t to make it possible to use that when receiving the send()
|
||||
error code. This is necessary to prevent compiler warnings on some systems.
|
||||
|
||||
- Made configure create config.h, and all source files now include setup.h that
|
||||
might include the proper config.h (or a handicrafted alternative).
|
||||
|
||||
- Switched to 'ares_socket_t' type for sockets in ares, since Windows don't
|
||||
use 'int' for that.
|
||||
|
||||
- automake-ified and libool-ified c-ares. Now it builds libcares as a shared
|
||||
lib on most platforms if wanted. (This bloated the size of the release
|
||||
archive with another 200K!)
|
||||
|
||||
- Makefile.am now uses Makefile.inc for the c sources, h headers and man
|
||||
pages, to make it easier for other makefiles to use the exact same set of
|
||||
files.
|
||||
|
||||
- Adjusted 'maketgz' to use the new automake magic when building distribution
|
||||
archives.
|
||||
|
||||
- Anyone desires HTML and/or PDF versions of the man pages in the release
|
||||
archives?
|
||||
|
||||
* July 3
|
||||
- G<>nter Knauf made c-ares build and run on Novell Netware.
|
||||
|
||||
* July 1
|
||||
- Gisle Vanem provided Makefile.dj to build with djgpp, added a few more djgpp
|
||||
fixes and made ares not use 'errno' to provide further info on Windows.
|
||||
|
||||
* June 30
|
||||
- Gisle Vanem made it build with djgpp and run fine with the Watt-32 stack.
|
||||
|
||||
* June 10
|
||||
- Gisle Vanem's init patch for Windows:
|
||||
|
||||
The init_by_resolv_conf() function fetches the DNS-server(s)
|
||||
from a series of registry branches.
|
||||
|
||||
This can be wrong in the case where DHCP has assigned nameservers, but the
|
||||
user has overridden these servers with other prefered settings. Then it's
|
||||
wrong to use the DHCPNAMESERVER setting in registry.
|
||||
|
||||
In the case of no global DHCP-assigned or fixed servers, but DNS server(s)
|
||||
per adapter, one has to query the adapter branches. But how can c-ares know
|
||||
which adapter is valid for use? AFAICS it can't. There could be one adapter
|
||||
that is down (e.g. a VPN adapter).
|
||||
|
||||
So it's better to leave this to the IP Helper API (iphlapi) available in
|
||||
Win-98/2000 and later. My patch falls-back to the old way if not available.
|
||||
|
||||
* June 8
|
||||
- James Bursa fixed an init issue for RISC OS.
|
||||
|
||||
* May 11
|
||||
- Nico Stappenbelt reported that when processing domain and search lines in
|
||||
the resolv.conf file, the first entry encountered is processed and used as
|
||||
|
@@ -10,6 +10,9 @@ maketgz
|
||||
aclocal.m4
|
||||
acinclude.m4
|
||||
Makefile.in
|
||||
Makefile.dj
|
||||
Makefile.m32
|
||||
Makefile.netware
|
||||
install-sh
|
||||
mkinstalldirs
|
||||
configure
|
||||
|
57
ares/Makefile.am
Normal file
57
ares/Makefile.am
Normal file
@@ -0,0 +1,57 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
lib_LTLIBRARIES = libcares.la
|
||||
|
||||
man_MANS = $(MANPAGES)
|
||||
|
||||
MSVCFILES = vc/adig/adig.dep vc/adig/adig.dsp vc/adig/adig.mak \
|
||||
vc/adig/adig.plg vc/vc.dsw vc/ahost/ahost.dep vc/ahost/ahost.dsp \
|
||||
vc/ahost/ahost.mak vc/ahost/ahost.plg vc/areslib/areslib.dep \
|
||||
vc/areslib/areslib.dsp vc/areslib/areslib.mak vc/areslib/areslib.plg
|
||||
|
||||
# adig and ahost are just sample programs and thus not mentioned with the
|
||||
# regular sources and headers
|
||||
EXTRA_DIST = CHANGES README.cares Makefile.inc adig.c ahost.c $(man_MANS) \
|
||||
$(MSVCFILES)
|
||||
|
||||
|
||||
VER=-version-info 0: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+1:a)
|
||||
#
|
||||
# 4.If any interfaces have been added, removed, or changed since the last
|
||||
# update, increment current, and set revision to 0. (c+1:r=0:a)
|
||||
#
|
||||
# 5.If any interfaces have been added since the last public release, then
|
||||
# increment age. (c:r:a+1)
|
||||
#
|
||||
# 6.If any interfaces have been removed since the last public release, then
|
||||
# set age to 0. (c:r:a=0)
|
||||
#
|
||||
|
||||
libcares_la_LDFLAGS = $(VER)
|
||||
|
||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||
include Makefile.inc
|
||||
|
||||
libcares_la_SOURCES = $(CSOURCES) $(HHEADERS)
|
||||
|
||||
# where to install the c-ares headers
|
||||
libcares_ladir = $(includedir)
|
||||
# what headers to install on 'make install':
|
||||
libcares_la_HEADERS = ares.h ares_version.h
|
56
ares/Makefile.dj
Normal file
56
ares/Makefile.dj
Normal file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# c-ares Makefile for djgpp/gcc/Watt-32
|
||||
# By Gisle Vanem <giva@bgnett.no> 2004.
|
||||
#
|
||||
.SUFFIXES: .exe
|
||||
|
||||
WATT32_ROOT = $(subst \,/,$(WATT_ROOT))
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -O2 -Wall -DWATT32 -Dselect=select_s -I$(WATT32_ROOT)/inc
|
||||
LDFLAGS = -s
|
||||
EX_LIBS = $(WATT32_ROOT)/lib/libwatt.a
|
||||
|
||||
SOURCE = ares_cancel.c ares_destroy.c ares_expand_name.c ares_expand_string.c ares_fds.c \
|
||||
ares_free_hostent.c ares_free_string.c ares_gethostbyaddr.c ares_gethostbyname.c \
|
||||
ares_init.c ares_mkquery.c ares_parse_a_reply.c ares_parse_ptr_reply.c \
|
||||
ares_process.c ares_query.c ares_search.c ares_send.c ares_strerror.c \
|
||||
ares_timeout.c ares__close_sockets.c ares__get_hostent.c ares__read_line.c \
|
||||
ares_version.c
|
||||
|
||||
OBJ_DIR = djgpp
|
||||
|
||||
OBJECTS = $(addprefix $(OBJ_DIR)/, $(SOURCE:.c=.o))
|
||||
|
||||
|
||||
all: $(OBJ_DIR) libcares.a ahost.exe adig.exe
|
||||
@echo Welcome to c-ares.
|
||||
|
||||
$(OBJ_DIR):
|
||||
- mkdir $(OBJ_DIR)
|
||||
|
||||
libcares.a: $(OBJECTS)
|
||||
ar rs $@ $?
|
||||
|
||||
ahost.exe: ahost.c libcares.a
|
||||
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
|
||||
|
||||
adig.exe: adig.c libcares.a
|
||||
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) libcares.a
|
||||
|
||||
vclean realclean: clean
|
||||
rm -f ahost.exe adig.exe depend.dj
|
||||
- rmdir $(OBJ_DIR)
|
||||
|
||||
$(OBJ_DIR)/%.o: %.c
|
||||
$(CC) $(CFLAGS) -o $@ -c $<
|
||||
@echo
|
||||
|
||||
depend:
|
||||
$(CC) -MM $(CFLAGS) $(SOURCE) | \
|
||||
sed -e 's/^\([a-zA-Z0-9_-]*\.o:\)/$$(OBJ_DIR)\/\1/' > depend.dj
|
||||
|
||||
-include depend.dj
|
@@ -1,79 +0,0 @@
|
||||
# $Id$
|
||||
|
||||
SHELL=/bin/sh
|
||||
INSTALL=@INSTALL@
|
||||
RANLIB=@RANLIB@
|
||||
VPATH=@srcdir@
|
||||
srcdir=@srcdir@
|
||||
top_srcdir=@top_srcdir@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
mandir=@mandir@
|
||||
|
||||
LIB=libcares.a
|
||||
CC=@CC@
|
||||
CPPFLAGS=@CPPFLAGS@
|
||||
CFLAGS=@CFLAGS@ ${WARN_CFLAGS} ${ERROR_CFLAGS}
|
||||
DEFS=@DEFS@
|
||||
LDFLAGS=@LDFLAGS@
|
||||
LIBS=@LIBS@
|
||||
ALL_CFLAGS=${CPPFLAGS} ${CFLAGS} ${DEFS}
|
||||
OBJS= ares__close_sockets.o ares__get_hostent.o ares__read_line.o \
|
||||
ares_destroy.o ares_expand_name.o ares_fds.o \
|
||||
ares_free_hostent.o ares_free_string.o ares_gethostbyaddr.o \
|
||||
ares_gethostbyname.o ares_init.o ares_mkquery.o ares_parse_a_reply.o \
|
||||
ares_parse_ptr_reply.o ares_process.o ares_query.o ares_search.o \
|
||||
ares_send.o ares_strerror.o ares_timeout.o ares_version.o \
|
||||
ares_expand_string.o ares_cancel.o
|
||||
|
||||
MANPAGES= ares_destroy.3 ares_expand_name.3 ares_expand_string.3 ares_fds.3 \
|
||||
ares_free_hostent.3 ares_free_string.3 ares_gethostbyaddr.3 \
|
||||
ares_gethostbyname.3 ares_init.3 ares_init_options.3 ares_mkquery.3 \
|
||||
ares_parse_a_reply.3 ares_parse_ptr_reply.3 ares_process.3 \
|
||||
ares_query.3 ares_search.3 ares_send.3 ares_strerror.3 ares_timeout.3 \
|
||||
ares_version.3 ares_cancel.3
|
||||
|
||||
$(LIB): ${OBJS}
|
||||
ar cru $@ ${OBJS}
|
||||
${RANLIB} $@
|
||||
|
||||
all: $(LIB) demos
|
||||
|
||||
demos: adig ahost
|
||||
|
||||
tags:
|
||||
etags *.[ch]
|
||||
|
||||
adig: adig.o $(LIB)
|
||||
${CC} ${LDFLAGS} -o $@ adig.o $(LIB) ${LIBS}
|
||||
|
||||
ahost: ahost.o $(LIB)
|
||||
${CC} ${LDFLAGS} -o $@ ahost.o $(LIB) ${LIBS}
|
||||
|
||||
${OBJS}: ares.h ares_dns.h ares_private.h
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${ALL_CFLAGS} $<
|
||||
|
||||
check:
|
||||
|
||||
install:
|
||||
${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
|
||||
${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}
|
||||
${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3
|
||||
${INSTALL} -m 644 $(LIB) ${DESTDIR}${libdir}
|
||||
${RANLIB} ${DESTDIR}${libdir}/$(LIB)
|
||||
chmod u-w ${DESTDIR}${libdir}/$(LIB)
|
||||
${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir}
|
||||
${INSTALL} -m 444 ${srcdir}/ares_version.h ${DESTDIR}${includedir}
|
||||
(for man in $(MANPAGES); do \
|
||||
${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
|
||||
done)
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} $(LIB) adig.o adig ahost.o ahost
|
||||
|
||||
distclean: clean
|
||||
rm -f config.cache config.log config.status Makefile
|
15
ares/Makefile.inc
Normal file
15
ares/Makefile.inc
Normal file
@@ -0,0 +1,15 @@
|
||||
CSOURCES = ares_fds.c ares_process.c ares_free_hostent.c ares_query.c \
|
||||
ares__close_sockets.c ares_free_string.c ares_search.c ares__get_hostent.c \
|
||||
ares_gethostbyaddr.c ares_send.c ares__read_line.c ares_gethostbyname.c \
|
||||
ares_strerror.c ares_cancel.c ares_init.c ares_timeout.c ares_destroy.c \
|
||||
ares_mkquery.c ares_version.c ares_expand_name.c ares_parse_a_reply.c \
|
||||
windows_port.c ares_expand_string.c ares_parse_ptr_reply.c
|
||||
|
||||
HHEADERS = ares.h ares_private.h setup.h ares_dns.h ares_version.h nameser.h
|
||||
|
||||
MANPAGES= ares_destroy.3 ares_expand_name.3 ares_expand_string.3 ares_fds.3 \
|
||||
ares_free_hostent.3 ares_free_string.3 ares_gethostbyaddr.3 \
|
||||
ares_gethostbyname.3 ares_init.3 ares_init_options.3 ares_mkquery.3 \
|
||||
ares_parse_a_reply.3 ares_parse_ptr_reply.3 ares_process.3 \
|
||||
ares_query.3 ares_search.3 ares_send.3 ares_strerror.3 ares_timeout.3 \
|
||||
ares_version.3 ares_cancel.3
|
75
ares/Makefile.m32
Normal file
75
ares/Makefile.m32
Normal file
@@ -0,0 +1,75 @@
|
||||
#############################################################
|
||||
# $Id$
|
||||
#
|
||||
## Makefile for building libcares.a with MingW32 (GCC-3.2)
|
||||
## Use: make -f Makefile.m32 [demos]
|
||||
##
|
||||
## Quick hack by Guenter; comments to: /dev/nul
|
||||
|
||||
CC = gcc
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
STRIP = strip -g
|
||||
#RM = rm -f
|
||||
|
||||
########################################################
|
||||
## Nothing more to do below this line!
|
||||
|
||||
LIB=libcares.a
|
||||
CC=gcc
|
||||
#CPPFLAGS=@CPPFLAGS@
|
||||
WARN_FLAGS=-Wall
|
||||
CFLAGS=-O2
|
||||
CFLAGS+=${WARN_CFLAGS} ${ERROR_CFLAGS}
|
||||
DEFS=-DMINGW32
|
||||
LDFLAGS=-s
|
||||
LIBS=-lwsock32
|
||||
ALL_CFLAGS=${CPPFLAGS} ${CFLAGS} ${DEFS}
|
||||
|
||||
MANPAGES := $(patsubst %.c,%.o,$(wildcard ares_*.3))
|
||||
|
||||
OBJS := $(patsubst %.c,%.o,$(wildcard ares_*.c))
|
||||
OBJS += windows_port.o
|
||||
|
||||
$(LIB): ${OBJS}
|
||||
ar cru $@ ${OBJS}
|
||||
${RANLIB} $@
|
||||
|
||||
all: $(LIB) demos
|
||||
|
||||
demos: adig.exe ahost.exe
|
||||
|
||||
tags:
|
||||
etags *.[ch]
|
||||
|
||||
adig.exe: adig.o $(LIB)
|
||||
${CC} ${LDFLAGS} -o $@ adig.o $(LIB) ${LIBS}
|
||||
|
||||
ahost.exe: ahost.o $(LIB)
|
||||
${CC} ${LDFLAGS} -o $@ ahost.o $(LIB) ${LIBS}
|
||||
|
||||
${OBJS}: ares.h ares_dns.h ares_private.h
|
||||
|
||||
.c.o:
|
||||
${CC} -c ${ALL_CFLAGS} $<
|
||||
|
||||
check:
|
||||
|
||||
install:
|
||||
${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
|
||||
${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}
|
||||
${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3
|
||||
${INSTALL} -m 644 $(LIB) ${DESTDIR}${libdir}
|
||||
${RANLIB} ${DESTDIR}${libdir}/$(LIB)
|
||||
chmod u-w ${DESTDIR}${libdir}/$(LIB)
|
||||
${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir}
|
||||
${INSTALL} -m 444 ${srcdir}/ares_version.h ${DESTDIR}${includedir}
|
||||
(for man in $(MANPAGES); do \
|
||||
${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
|
||||
done)
|
||||
|
||||
clean:
|
||||
rm -f ${OBJS} $(LIB) adig.o adig.exe ahost.o ahost.exe
|
||||
|
||||
distclean: clean
|
||||
rm -f config.cache config.log config.status Makefile
|
317
ares/Makefile.netware
Normal file
317
ares/Makefile.netware
Normal file
@@ -0,0 +1,317 @@
|
||||
#################################################################
|
||||
#
|
||||
## Makefile for building libares.lib (NetWare version - gnu make)
|
||||
## Use: make -f Makefile.netware
|
||||
##
|
||||
## Comments to: Guenter Knauf <eflash@gmx.net>
|
||||
#
|
||||
#################################################################
|
||||
|
||||
# Edit the path below to point to the base of your Novell NDK.
|
||||
ifndef NDKBASE
|
||||
NDKBASE = c:/novell
|
||||
endif
|
||||
|
||||
ifndef INSTDIR
|
||||
INSTDIR = ../curl-$(LIBCURL_VERSION_STR)-bin-nw
|
||||
endif
|
||||
|
||||
# Edit the vars below to change NLM target settings.
|
||||
TARGETS = adig.nlm ahost.nlm
|
||||
LTARGET = libcares.lib
|
||||
VERSION = $(LIBCARES_VERSION)
|
||||
COPYR = Copyright (c) 1996 - 2004, Daniel Stenberg, <daniel@haxx.se>
|
||||
DESCR = cURL $(subst .def,,$(notdir $@)) $(LIBCARES_VERSION_STR) - http://curl.haxx.se
|
||||
MTSAFE = YES
|
||||
STACK = 64000
|
||||
SCREEN = none
|
||||
#EXPORTS =
|
||||
# Comment the line below if you dont want to load protected automatically.
|
||||
#LDRING = 3
|
||||
|
||||
# Edit the var below to point to your lib architecture.
|
||||
ifndef LIBARCH
|
||||
LIBARCH = LIBC
|
||||
endif
|
||||
|
||||
# must be equal to DEBUG or NDEBUG
|
||||
DB = NDEBUG
|
||||
# DB = DEBUG
|
||||
# DB = CURLDEBUG
|
||||
# Optimization: -O<n> or debugging: -g
|
||||
ifeq ($(DB),NDEBUG)
|
||||
OPT = -O2
|
||||
OBJDIR = release
|
||||
else
|
||||
OPT = -g
|
||||
OBJDIR = debug
|
||||
endif
|
||||
|
||||
# Include the version info retrieved from curlver.h
|
||||
-include $(OBJDIR)/version.inc
|
||||
|
||||
# The following line defines your compiler.
|
||||
ifdef METROWERKS
|
||||
CC = mwccnlm
|
||||
else
|
||||
CC = gcc
|
||||
endif
|
||||
YACC = bison -y
|
||||
CP = cp -afv
|
||||
# RM = rm -f
|
||||
# if you want to mark the target as MTSAFE you will need a tool for
|
||||
# generating the xdc data for the linker; here's a minimal tool:
|
||||
# http://www.gknw.com/development/prgtools/mkxdc.zip
|
||||
MPKXDC = mkxdc
|
||||
|
||||
# Global flags for all compilers
|
||||
CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
|
||||
|
||||
ifeq ($(CC),mwccnlm)
|
||||
LD = mwldnlm
|
||||
LDFLAGS = -nostdlib $(PRELUDE) $(OBJS) $(<:.def=.o) -o $@ -commandfile
|
||||
AR = mwldnlm
|
||||
ARFLAGS = -type library -w nocmdline $(OBJDIR)/*.o -o
|
||||
CFLAGS += -msgstyle gcc -gccinc -inline off -opt nointrinsics -proc 586
|
||||
CFLAGS += -relax_pointers
|
||||
#CFLAGS += -w on
|
||||
ifeq ($(LIBARCH),LIBC)
|
||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.o
|
||||
CFLAGS += -align 4
|
||||
else
|
||||
PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
|
||||
# CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
|
||||
CFLAGS += -align 1
|
||||
endif
|
||||
else
|
||||
LD = nlmconv
|
||||
LDFLAGS = -T
|
||||
AR = ar
|
||||
ARFLAGS = -cq
|
||||
CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return
|
||||
CFLAGS += -Wall -Wno-format # -pedantic
|
||||
ifeq ($(LIBARCH),LIBC)
|
||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
||||
else
|
||||
PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
|
||||
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
|
||||
endif
|
||||
endif
|
||||
|
||||
NDK_ROOT = $(NDKBASE)/ndk
|
||||
SDK_CLIB = $(NDK_ROOT)/nwsdk
|
||||
SDK_LIBC = $(NDK_ROOT)/libc
|
||||
|
||||
ifeq ($(LIBARCH),LIBC)
|
||||
INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
|
||||
INCLUDES += -I$(SDK_LIBC)/include/winsock
|
||||
CFLAGS += -D_POSIX_SOURCE
|
||||
# CFLAGS += -D__ANSIC__
|
||||
else
|
||||
INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
|
||||
# INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
|
||||
CFLAGS += -DNETDB_USE_INTERNET
|
||||
endif
|
||||
CFLAGS += -I. $(INCLUDES)
|
||||
|
||||
ifeq ($(MTSAFE),YES)
|
||||
XDCOPT = -n
|
||||
endif
|
||||
ifeq ($(MTSAFE),NO)
|
||||
XDCOPT = -u
|
||||
endif
|
||||
|
||||
ifeq ($(findstring linux,$(OSTYPE)),linux)
|
||||
DL = '
|
||||
#-include $(NDKBASE)/nlmconv/ncpfs.inc
|
||||
endif
|
||||
|
||||
OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(wildcard ares_*.c))
|
||||
|
||||
.PHONY: lib nlm prebuild dist install clean
|
||||
|
||||
lib: prebuild $(LTARGET)
|
||||
|
||||
nlm: prebuild $(TARGETS)
|
||||
|
||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h arpa/nameser.h
|
||||
|
||||
dist: all
|
||||
-$(RM) $(OBJS) $(OBJDIR)/*.map $(OBJDIR)/*.ncv
|
||||
-$(RM) $(OBJDIR)/*.def $(OBJDIR)/*.xdc $(OBJDIR)/version.inc
|
||||
|
||||
install: $(INSTDIR) all
|
||||
@$(CP) *.nlm $(INSTDIR)
|
||||
@$(CP) ../CHANGES $(INSTDIR)
|
||||
@$(CP) ../COPYING $(INSTDIR)
|
||||
@$(CP) ../README $(INSTDIR)
|
||||
@$(CP) ../RELEASE-NOTES $(INSTDIR)
|
||||
|
||||
clean:
|
||||
-$(RM) $(LTARGET) $(TARGETS) config.h
|
||||
-$(RM) -r $(OBJDIR)
|
||||
-$(RM) -r arpa
|
||||
|
||||
%.lib: $(OBJS)
|
||||
@echo Creating $@
|
||||
@-$(RM) $@
|
||||
@$(AR) $(ARFLAGS) $@ $^
|
||||
|
||||
%.nlm: $(OBJDIR)/%.def $(OBJDIR)/%.o $(OBJDIR)/%.xdc $(OBJS)
|
||||
@echo Linking $@
|
||||
@-$(RM) $@
|
||||
@$(LD) $(LDFLAGS) $<
|
||||
|
||||
$(INSTDIR):
|
||||
@mkdir $(INSTDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
@mkdir $(OBJDIR)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
# @echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/version.inc: ares_version.h $(OBJDIR)
|
||||
@echo Creating $@
|
||||
@awk -f ../packages/NetWare/get_ver.awk $< > $@
|
||||
|
||||
$(OBJDIR)/%.xdc: Makefile.netware
|
||||
@echo Creating $@
|
||||
@$(MPKXDC) $(XDCOPT) $@
|
||||
|
||||
$(OBJDIR)/%.def: Makefile.netware
|
||||
@echo Creating $@
|
||||
@echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
|
||||
@echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
|
||||
@echo $(DL)# All your changes will be lost!!$(DL) >> $@
|
||||
@echo $(DL)#$(DL) >> $@
|
||||
@echo $(DL)copyright "$(COPYR)"$(DL) >> $@
|
||||
@echo $(DL)description "$(DESCR)"$(DL) >> $@
|
||||
@echo $(DL)version $(VERSION)$(DL) >> $@
|
||||
ifdef NLMTYPE
|
||||
@echo $(DL)type $(NLMTYPE)$(DL) >> $@
|
||||
endif
|
||||
ifdef STACK
|
||||
@echo $(DL)stack $(STACK)$(DL) >> $@
|
||||
endif
|
||||
ifdef SCREEN
|
||||
@echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
|
||||
else
|
||||
@echo $(DL)screenname "DEFAULT"$(DL) >> $@
|
||||
endif
|
||||
ifeq ($(DB),DEBUG)
|
||||
@echo $(DL)debug$(DL) >> $@
|
||||
endif
|
||||
@echo $(DL)threadname "$^"$(DL) >> $@
|
||||
ifdef XDCOPT
|
||||
@echo $(DL)xdcdata $(@:.def=.xdc)$(DL) >> $@
|
||||
endif
|
||||
ifeq ($(LDRING),0)
|
||||
@echo $(DL)flag_on 16$(DL) >> $@
|
||||
endif
|
||||
ifeq ($(LDRING),3)
|
||||
@echo $(DL)flag_on 512$(DL) >> $@
|
||||
endif
|
||||
ifeq ($(LIBARCH),CLIB)
|
||||
@echo $(DL)start _Prelude$(DL) >> $@
|
||||
@echo $(DL)exit _Stop$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_CLIB)/imports/clib.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_CLIB)/imports/threads.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_CLIB)/imports/socklib.imp$(DL) >> $@
|
||||
@echo $(DL)module clib$(DL) >> $@
|
||||
else
|
||||
@echo $(DL)flag_on 64$(DL) >> $@
|
||||
@echo $(DL)pseudopreemption$(DL) >> $@
|
||||
@echo $(DL)start _LibCPrelude$(DL) >> $@
|
||||
@echo $(DL)exit _LibCPostlude$(DL) >> $@
|
||||
@echo $(DL)check _LibCCheckUnload$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_LIBC)/imports/libc.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_LIBC)/imports/netware.imp$(DL) >> $@
|
||||
@echo $(DL)module libc$(DL) >> $@
|
||||
endif
|
||||
ifdef MODULES
|
||||
@echo $(DL)module $(MODULES)$(DL) >> $@
|
||||
endif
|
||||
ifdef EXPORTS
|
||||
@echo $(DL)export $(EXPORTS)$(DL) >> $@
|
||||
endif
|
||||
ifdef IMPORTS
|
||||
@echo $(DL)import $(IMPORTS)$(DL) >> $@
|
||||
endif
|
||||
ifeq ($(LD),nlmconv)
|
||||
@echo $(DL)input $(OBJS)$(DL) >> $@
|
||||
@echo $(DL)input $(PRELUDE)$(DL) >> $@
|
||||
@echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
|
||||
endif
|
||||
|
||||
config.h: Makefile.netware
|
||||
@echo Creating $@
|
||||
@echo $(DL)/* $@ for NetWare target.$(DL) > $@
|
||||
@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
|
||||
@echo $(DL)** All your changes will be lost!!$(DL) >> $@
|
||||
@echo $(DL)*/$(DL) >> $@
|
||||
@echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
|
||||
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
|
||||
@echo $(DL)#define PACKAGE_BUGREPORT "curl-bug@haxx.se"$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
||||
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
||||
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
||||
ifdef NW_WINSOCK
|
||||
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
|
||||
else
|
||||
@echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_SOCKET_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_SOCKIO_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_NETDB_H 1$(DL) >> $@
|
||||
endif
|
||||
ifdef OLD_NOVELLSDK
|
||||
@echo $(DL)#define socklen_t int$(DL) >> $@
|
||||
endif
|
||||
|
||||
arpa/nameser.h: nameser.h
|
||||
@echo Fix missing header $@
|
||||
@-mkdir arpa
|
||||
@$(CP) $< arpa
|
||||
|
||||
|
@@ -1,3 +1,6 @@
|
||||
Major changes since:
|
||||
* see the CHANGES file
|
||||
|
||||
Major changes in release 1.1.1:
|
||||
* ares should now compile as C++ code (no longer uses reserved word
|
||||
"class").
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef _AIX
|
||||
#if defined(_AIX) || defined(NETWARE)
|
||||
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
|
||||
libc5-based Linux systems. Only include it on system that are known to
|
||||
require it! */
|
||||
|
@@ -13,6 +13,8 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef WIN32
|
||||
#else
|
||||
@@ -42,14 +44,14 @@ void ares__close_sockets(struct server_state *server)
|
||||
server->tcp_lenbuf_pos = 0;
|
||||
|
||||
/* Close the TCP and UDP sockets. */
|
||||
if (server->tcp_socket != -1)
|
||||
if (server->tcp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
closesocket(server->tcp_socket);
|
||||
server->tcp_socket = -1;
|
||||
server->tcp_socket = ARES_SOCKET_BAD;
|
||||
}
|
||||
if (server->udp_socket != -1)
|
||||
if (server->udp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
closesocket(server->udp_socket);
|
||||
server->udp_socket = -1;
|
||||
server->udp_socket = ARES_SOCKET_BAD;
|
||||
}
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@@ -1,18 +1,17 @@
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
/* Copyright (C) 2004 by Daniel Stenberg et al
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
* that the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. M.I.T. makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -37,13 +38,13 @@ int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
{
|
||||
server = &channel->servers[i];
|
||||
if (server->udp_socket != -1)
|
||||
if (server->udp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
FD_SET(server->udp_socket, read_fds);
|
||||
if (server->udp_socket >= nfds)
|
||||
nfds = server->udp_socket + 1;
|
||||
}
|
||||
if (server->tcp_socket != -1)
|
||||
if (server->tcp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
FD_SET(server->tcp_socket, read_fds);
|
||||
if (server->qhead)
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -151,6 +152,12 @@ static int file_lookup(struct in_addr *addr, struct hostent **host)
|
||||
strcat(PATH_HOSTS, PATH_HOSTS_9X);
|
||||
}
|
||||
|
||||
#elif defined(WATT32)
|
||||
extern const char *_w32_GetHostsFile (void);
|
||||
const char *PATH_HOSTS = _w32_GetHostsFile();
|
||||
|
||||
if (!PATH_HOSTS)
|
||||
return ARES_ENOTFOUND;
|
||||
#endif
|
||||
|
||||
fp = fopen(PATH_HOSTS, "r");
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -224,6 +225,12 @@ static int file_lookup(const char *name, struct hostent **host)
|
||||
strcat(PATH_HOSTS, PATH_HOSTS_9X);
|
||||
}
|
||||
|
||||
#elif defined(WATT32)
|
||||
extern const char *_w32_GetHostsFile (void);
|
||||
const char *PATH_HOSTS = _w32_GetHostsFile();
|
||||
|
||||
if (!PATH_HOSTS)
|
||||
return ARES_ENOTFOUND;
|
||||
#endif
|
||||
|
||||
fp = fopen(PATH_HOSTS, "r");
|
||||
|
168
ares/ares_init.c
168
ares/ares_init.c
@@ -13,10 +13,13 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include "nameser.h"
|
||||
#include <iphlpapi.h>
|
||||
#include <malloc.h>
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
@@ -125,8 +128,8 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
{
|
||||
server = &channel->servers[i];
|
||||
server->udp_socket = -1;
|
||||
server->tcp_socket = -1;
|
||||
server->udp_socket = ARES_SOCKET_BAD;
|
||||
server->tcp_socket = ARES_SOCKET_BAD;
|
||||
server->tcp_lenbuf_pos = 0;
|
||||
server->tcp_buffer = NULL;
|
||||
server->qhead = NULL;
|
||||
@@ -231,24 +234,24 @@ static int init_by_environment(ares_channel channel)
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
#ifdef WIN32
|
||||
static int get_res_size_nt(HKEY hKey, char *subkey, int *size)
|
||||
{
|
||||
return RegQueryValueEx(hKey, subkey, 0, NULL, NULL, size);
|
||||
}
|
||||
|
||||
/* Warning: returns a dynamically allocated buffer, the user MUST
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* Warning: returns a dynamically allocated buffer, the user MUST
|
||||
* use free() if the function returns 1
|
||||
*/
|
||||
static int get_res_nt(HKEY hKey, char *subkey, char **obuf)
|
||||
static int get_res_nt(HKEY hKey, const char *subkey, char **obuf)
|
||||
{
|
||||
/* Test for the size we need */
|
||||
int size = 0;
|
||||
DWORD size = 0;
|
||||
int result;
|
||||
|
||||
result = RegQueryValueEx(hKey, subkey, 0, NULL, NULL, &size);
|
||||
if ((result != ERROR_SUCCESS && result != ERROR_MORE_DATA) || !size)
|
||||
return 0;
|
||||
*obuf = malloc(size+1);
|
||||
if (!*obuf)
|
||||
return 0;
|
||||
|
||||
if (RegQueryValueEx(hKey, subkey, 0, NULL, *obuf, &size) != ERROR_SUCCESS)
|
||||
{
|
||||
@@ -263,29 +266,99 @@ static int get_res_nt(HKEY hKey, char *subkey, char **obuf)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int get_res_interfaces_nt(HKEY hKey, char *subkey, char **obuf)
|
||||
static int get_res_interfaces_nt(HKEY hKey, const char *subkey, char **obuf)
|
||||
{
|
||||
char enumbuf[39]; /* GUIDs are 38 chars + 1 for NULL */
|
||||
int enum_size = 39;
|
||||
DWORD enum_size = 39;
|
||||
int idx = 0;
|
||||
HKEY hVal;
|
||||
|
||||
while (RegEnumKeyEx(hKey, idx++, enumbuf, &enum_size, 0,
|
||||
NULL, NULL, NULL) != ERROR_NO_MORE_ITEMS)
|
||||
{
|
||||
int rc;
|
||||
|
||||
enum_size = 39;
|
||||
if (RegOpenKeyEx(hKey, enumbuf, 0, KEY_QUERY_VALUE, &hVal) !=
|
||||
ERROR_SUCCESS)
|
||||
continue;
|
||||
if (!get_res_nt(hVal, subkey, obuf))
|
||||
RegCloseKey(hVal);
|
||||
else
|
||||
{
|
||||
rc = get_res_nt(hVal, subkey, obuf);
|
||||
RegCloseKey(hVal);
|
||||
if (rc)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
|
||||
{
|
||||
FIXED_INFO *fi = alloca (sizeof(*fi));
|
||||
DWORD size = sizeof (*fi);
|
||||
DWORD WINAPI (*GetNetworkParams) (FIXED_INFO*, DWORD*); /* available only on Win-98/2000+ */
|
||||
HMODULE handle;
|
||||
IP_ADDR_STRING *ipAddr;
|
||||
int i, count = 0;
|
||||
int debug = 0;
|
||||
size_t ip_size = sizeof("255.255.255.255,")-1;
|
||||
size_t left = ret_size;
|
||||
char *ret = ret_buf;
|
||||
|
||||
if (!fi)
|
||||
return (0);
|
||||
|
||||
handle = LoadLibrary ("iphlpapi.dll");
|
||||
if (!handle)
|
||||
return (0);
|
||||
|
||||
(void*)GetNetworkParams = GetProcAddress (handle, "GetNetworkParams");
|
||||
if (!GetNetworkParams)
|
||||
goto quit;
|
||||
|
||||
if ((*GetNetworkParams) (fi, &size) != ERROR_BUFFER_OVERFLOW)
|
||||
goto quit;
|
||||
|
||||
fi = alloca (size);
|
||||
if (!fi || (*GetNetworkParams) (fi, &size) != ERROR_SUCCESS)
|
||||
goto quit;
|
||||
|
||||
if (debug)
|
||||
{
|
||||
printf ("Host Name: %s\n", fi->HostName);
|
||||
printf ("Domain Name: %s\n", fi->DomainName);
|
||||
printf ("DNS Servers:\n"
|
||||
" %s (primary)\n", fi->DnsServerList.IpAddress.String);
|
||||
}
|
||||
if (inet_addr(fi->DnsServerList.IpAddress.String) != INADDR_NONE &&
|
||||
left > ip_size)
|
||||
{
|
||||
ret += sprintf (ret, "%s,", fi->DnsServerList.IpAddress.String);
|
||||
left -= ret - ret_buf;
|
||||
count++;
|
||||
}
|
||||
|
||||
for (i = 0, ipAddr = fi->DnsServerList.Next; ipAddr && left > ip_size;
|
||||
ipAddr = ipAddr->Next, i++)
|
||||
{
|
||||
if (inet_addr(ipAddr->IpAddress.String) != INADDR_NONE)
|
||||
{
|
||||
ret += sprintf (ret, "%s,", ipAddr->IpAddress.String);
|
||||
left -= ret - ret_buf;
|
||||
count++;
|
||||
}
|
||||
if (debug)
|
||||
printf (" %s (secondary %d)\n", ipAddr->IpAddress.String, i+1);
|
||||
}
|
||||
|
||||
quit:
|
||||
if (handle)
|
||||
FreeLibrary (handle);
|
||||
|
||||
if (debug && left <= ip_size)
|
||||
printf ("Too many nameservers. Truncating to %d addressess", count);
|
||||
if (ret > ret_buf)
|
||||
ret[-1] = '\0';
|
||||
return (count);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int init_by_resolv_conf(ares_channel channel)
|
||||
@@ -298,6 +371,11 @@ static int init_by_resolv_conf(ares_channel channel)
|
||||
#ifdef WIN32
|
||||
|
||||
/*
|
||||
NameServer info via IPHLPAPI (IP helper API):
|
||||
GetNetworkParams() should be the trusted source for this.
|
||||
Available in Win-98/2000 and later. If that fail, fall-back to
|
||||
registry information.
|
||||
|
||||
NameServer Registry:
|
||||
|
||||
On Windows 9X, the DNS server can be found in:
|
||||
@@ -320,11 +398,19 @@ DhcpNameServer
|
||||
DWORD data_type;
|
||||
DWORD bytes;
|
||||
DWORD result;
|
||||
DWORD keysize = MAX_PATH;
|
||||
char buf[256];
|
||||
|
||||
status = ARES_EFILE;
|
||||
if (channel->nservers > -1) /* don't override ARES_OPT_SERVER */
|
||||
return ARES_SUCCESS;
|
||||
|
||||
if (IsNT)
|
||||
if (get_iphlpapi_dns_info(buf,sizeof(buf)) > 0)
|
||||
{
|
||||
status = config_nameserver(&servers, &nservers, buf);
|
||||
if (status == ARES_SUCCESS)
|
||||
goto okay;
|
||||
}
|
||||
|
||||
if (IsNT)
|
||||
{
|
||||
if (RegOpenKeyEx(
|
||||
HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0,
|
||||
@@ -368,7 +454,7 @@ DhcpNameServer
|
||||
if ((result = RegQueryValueEx(
|
||||
mykey, NAMESERVER, NULL, &data_type,
|
||||
NULL, &bytes
|
||||
)
|
||||
)
|
||||
) == ERROR_SUCCESS ||
|
||||
result == ERROR_MORE_DATA)
|
||||
{
|
||||
@@ -384,19 +470,12 @@ DhcpNameServer
|
||||
free(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
RegCloseKey(mykey);
|
||||
}
|
||||
|
||||
if (status != ARES_EFILE)
|
||||
{
|
||||
/*
|
||||
if (!channel->lookups) {
|
||||
status = config_lookup(channel, "file bind");
|
||||
}
|
||||
*/
|
||||
|
||||
if (status == ARES_SUCCESS)
|
||||
status = ARES_EOF;
|
||||
}
|
||||
|
||||
#elif defined(riscos)
|
||||
|
||||
@@ -404,7 +483,7 @@ DhcpNameServer
|
||||
system variable Inet$Resolvers, space separated. */
|
||||
|
||||
line = getenv("Inet$Resolvers");
|
||||
status = ARES_EFILE;
|
||||
status = ARES_EOF;
|
||||
if (line) {
|
||||
char *resolvers = strdup(line), *pos, *space;
|
||||
|
||||
@@ -424,16 +503,34 @@ DhcpNameServer
|
||||
|
||||
if (status == ARES_SUCCESS)
|
||||
status = ARES_EOF;
|
||||
|
||||
|
||||
free(resolvers);
|
||||
}
|
||||
|
||||
#elif defined(WATT32)
|
||||
int i;
|
||||
|
||||
sock_init();
|
||||
for (i = 0; def_nameservers[i]; i++)
|
||||
;
|
||||
if (i == 0)
|
||||
return ARES_SUCCESS; /* use localhost DNS server */
|
||||
|
||||
nservers = i;
|
||||
servers = calloc(sizeof(*servers), i);
|
||||
if (!servers)
|
||||
return ARES_ENOMEM;
|
||||
|
||||
for (i = 0; def_nameservers[i]; i++)
|
||||
servers[i].addr.s_addr = htonl(def_nameservers[i]);
|
||||
status = ARES_EOF;
|
||||
|
||||
#else
|
||||
{
|
||||
char *p;
|
||||
FILE *fp;
|
||||
int linesize;
|
||||
|
||||
|
||||
fp = fopen(PATH_RESOLV_CONF, "r");
|
||||
if (!fp)
|
||||
return (errno == ENOENT) ? ARES_SUCCESS : ARES_EFILE;
|
||||
@@ -474,6 +571,9 @@ DhcpNameServer
|
||||
}
|
||||
|
||||
/* If we got any name server entries, fill them in. */
|
||||
#ifdef WIN32
|
||||
okay:
|
||||
#endif
|
||||
if (servers)
|
||||
{
|
||||
channel->servers = servers;
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -27,6 +27,14 @@
|
||||
#define closesocket(x) close(x)
|
||||
#endif
|
||||
|
||||
#ifdef WATT32
|
||||
#include <tcp.h>
|
||||
#include <sys/ioctl.h>
|
||||
#undef closesocket
|
||||
#define closesocket(s) close_s(s)
|
||||
#define writev(s,v,c) writev_s(s,v,c)
|
||||
#endif
|
||||
|
||||
#define DEFAULT_TIMEOUT 5
|
||||
#define DEFAULT_TRIES 4
|
||||
#ifndef INADDR_NONE
|
||||
@@ -42,7 +50,16 @@
|
||||
#define DHCPNAMESERVER "DhcpNameServer"
|
||||
#define PATH_HOSTS_NT "\\drivers\\etc\\hosts"
|
||||
#define PATH_HOSTS_9X "\\hosts"
|
||||
|
||||
|
||||
#elif defined(WATT32)
|
||||
|
||||
#define PATH_RESOLV_CONF "/dev/ENV/etc/resolv.conf"
|
||||
|
||||
#elif defined(NETWARE)
|
||||
|
||||
#define PATH_RESOLV_CONF "sys:/etc/resolv.cfg"
|
||||
#define PATH_HOSTS "sys:/etc/hosts"
|
||||
|
||||
#else
|
||||
|
||||
#define PATH_RESOLV_CONF "/etc/resolv.conf"
|
||||
@@ -65,8 +82,8 @@ struct send_request {
|
||||
|
||||
struct server_state {
|
||||
struct in_addr addr;
|
||||
int udp_socket;
|
||||
int tcp_socket;
|
||||
ares_socket_t udp_socket;
|
||||
ares_socket_t tcp_socket;
|
||||
|
||||
/* Mini-buffer for reading the length word */
|
||||
unsigned char tcp_lenbuf[2];
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -35,6 +36,12 @@
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#define GET_ERRNO() WSAGetLastError()
|
||||
#else
|
||||
#define GET_ERRNO() errno
|
||||
#endif
|
||||
|
||||
static void write_tcp_data(ares_channel channel, fd_set *write_fds,
|
||||
time_t now);
|
||||
static void read_tcp_data(ares_channel channel, fd_set *read_fds, time_t now);
|
||||
@@ -44,12 +51,12 @@ static void process_timeouts(ares_channel channel, time_t now);
|
||||
static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||
int alen, int whichserver, int tcp, int now);
|
||||
static void handle_error(ares_channel channel, int whichserver, time_t now);
|
||||
static void next_server(ares_channel channel, struct query *query, time_t now);
|
||||
static struct query *next_server(ares_channel channel, struct query *query, time_t now);
|
||||
static int open_tcp_socket(ares_channel channel, struct server_state *server);
|
||||
static int open_udp_socket(ares_channel channel, struct server_state *server);
|
||||
static int same_questions(const unsigned char *qbuf, int qlen,
|
||||
const unsigned char *abuf, int alen);
|
||||
static void end_query(ares_channel channel, struct query *query, int status,
|
||||
static struct query *end_query(ares_channel channel, struct query *query, int status,
|
||||
unsigned char *abuf, int alen);
|
||||
|
||||
/* Something interesting happened on the wire, or there was a timeout.
|
||||
@@ -74,13 +81,16 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
|
||||
struct server_state *server;
|
||||
struct send_request *sendreq;
|
||||
struct iovec *vec;
|
||||
int i, n, count;
|
||||
int i;
|
||||
ssize_t scount;
|
||||
int wcount;
|
||||
size_t n;
|
||||
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
{
|
||||
/* Make sure server has data to send and is selected in write_fds. */
|
||||
server = &channel->servers[i];
|
||||
if (!server->qhead || server->tcp_socket == -1
|
||||
if (!server->qhead || server->tcp_socket == ARES_SOCKET_BAD
|
||||
|| !FD_ISSET(server->tcp_socket, write_fds))
|
||||
continue;
|
||||
|
||||
@@ -89,16 +99,10 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
|
||||
for (sendreq = server->qhead; sendreq; sendreq = sendreq->next)
|
||||
n++;
|
||||
|
||||
#ifdef WIN32
|
||||
vec = NULL;
|
||||
#else
|
||||
/* Allocate iovecs so we can send all our data at once. */
|
||||
vec = malloc(n * sizeof(struct iovec));
|
||||
#endif
|
||||
if (vec)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#else
|
||||
/* Fill in the iovecs and send. */
|
||||
n = 0;
|
||||
for (sendreq = server->qhead; sendreq; sendreq = sendreq->next)
|
||||
@@ -107,21 +111,21 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
|
||||
vec[n].iov_len = sendreq->len;
|
||||
n++;
|
||||
}
|
||||
count = writev(server->tcp_socket, vec, n);
|
||||
wcount = writev(server->tcp_socket, vec, n);
|
||||
free(vec);
|
||||
if (count < 0)
|
||||
if (wcount < 0)
|
||||
{
|
||||
handle_error(channel, i, now);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Advance the send queue by as many bytes as we sent. */
|
||||
while (count)
|
||||
while (wcount)
|
||||
{
|
||||
sendreq = server->qhead;
|
||||
if ((size_t)count >= sendreq->len)
|
||||
if ((size_t)wcount >= sendreq->len)
|
||||
{
|
||||
count -= sendreq->len;
|
||||
wcount -= sendreq->len;
|
||||
server->qhead = sendreq->next;
|
||||
if (server->qhead == NULL)
|
||||
server->qtail = NULL;
|
||||
@@ -129,28 +133,27 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
|
||||
}
|
||||
else
|
||||
{
|
||||
sendreq->data += count;
|
||||
sendreq->len -= count;
|
||||
sendreq->data += wcount;
|
||||
sendreq->len -= wcount;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Can't allocate iovecs; just send the first request. */
|
||||
sendreq = server->qhead;
|
||||
|
||||
count = send(server->tcp_socket, sendreq->data, sendreq->len, 0);
|
||||
scount = send(server->tcp_socket, sendreq->data, sendreq->len, 0);
|
||||
|
||||
if (count < 0)
|
||||
if (scount < 0)
|
||||
{
|
||||
handle_error(channel, i, now);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Advance the send queue by as many bytes as we sent. */
|
||||
if ((size_t)count == sendreq->len)
|
||||
if ((size_t)scount == sendreq->len)
|
||||
{
|
||||
server->qhead = sendreq->next;
|
||||
if (server->qhead == NULL)
|
||||
@@ -159,8 +162,8 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
|
||||
}
|
||||
else
|
||||
{
|
||||
sendreq->data += count;
|
||||
sendreq->len -= count;
|
||||
sendreq->data += scount;
|
||||
sendreq->len -= scount;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,7 +182,8 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds, time_t now)
|
||||
{
|
||||
/* Make sure the server has a socket and is selected in read_fds. */
|
||||
server = &channel->servers[i];
|
||||
if (server->tcp_socket == -1 || !FD_ISSET(server->tcp_socket, read_fds))
|
||||
if (server->tcp_socket == ARES_SOCKET_BAD ||
|
||||
!FD_ISSET(server->tcp_socket, read_fds))
|
||||
continue;
|
||||
|
||||
if (server->tcp_lenbuf_pos != 2)
|
||||
@@ -251,7 +255,8 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||
/* Make sure the server has a socket and is selected in read_fds. */
|
||||
server = &channel->servers[i];
|
||||
|
||||
if (server->udp_socket == -1 || !FD_ISSET(server->udp_socket, read_fds))
|
||||
if (server->udp_socket == ARES_SOCKET_BAD ||
|
||||
!FD_ISSET(server->udp_socket, read_fds))
|
||||
continue;
|
||||
|
||||
count = recv(server->udp_socket, buf, sizeof(buf), 0);
|
||||
@@ -273,7 +278,7 @@ static void process_timeouts(ares_channel channel, time_t now)
|
||||
if (query->timeout != 0 && now >= query->timeout)
|
||||
{
|
||||
query->error_status = ARES_ETIMEOUT;
|
||||
next_server(channel, query, now);
|
||||
next = next_server(channel, query, now);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -349,7 +354,7 @@ static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||
|
||||
static void handle_error(ares_channel channel, int whichserver, time_t now)
|
||||
{
|
||||
struct query *query;
|
||||
struct query *query, *next;
|
||||
|
||||
/* Reset communications with this server. */
|
||||
ares__close_sockets(&channel->servers[whichserver]);
|
||||
@@ -357,17 +362,19 @@ static void handle_error(ares_channel channel, int whichserver, time_t now)
|
||||
/* Tell all queries talking to this server to move on and not try
|
||||
* this server again.
|
||||
*/
|
||||
for (query = channel->queries; query; query = query->next)
|
||||
|
||||
for (query = channel->queries; query; query = next)
|
||||
{
|
||||
next = query->next;
|
||||
if (query->server == whichserver)
|
||||
{
|
||||
query->skip_server[whichserver] = 1;
|
||||
next_server(channel, query, now);
|
||||
next = next_server(channel, query, now);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void next_server(ares_channel channel, struct query *query, time_t now)
|
||||
static struct query *next_server(ares_channel channel, struct query *query, time_t now)
|
||||
{
|
||||
/* Advance to the next server or try. */
|
||||
query->server++;
|
||||
@@ -378,7 +385,7 @@ static void next_server(ares_channel channel, struct query *query, time_t now)
|
||||
if (!query->skip_server[query->server])
|
||||
{
|
||||
ares__send_query(channel, query, now);
|
||||
return;
|
||||
return (query->next);
|
||||
}
|
||||
}
|
||||
query->server = 0;
|
||||
@@ -387,7 +394,7 @@ static void next_server(ares_channel channel, struct query *query, time_t now)
|
||||
if (query->using_tcp)
|
||||
break;
|
||||
}
|
||||
end_query(channel, query, query->error_status, NULL, 0);
|
||||
return end_query(channel, query, query->error_status, NULL, 0);
|
||||
}
|
||||
|
||||
void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
||||
@@ -401,7 +408,7 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
||||
/* Make sure the TCP socket for this server is set up and queue
|
||||
* a send request.
|
||||
*/
|
||||
if (server->tcp_socket == -1)
|
||||
if (server->tcp_socket == ARES_SOCKET_BAD)
|
||||
{
|
||||
if (open_tcp_socket(channel, server) == -1)
|
||||
{
|
||||
@@ -410,9 +417,12 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
||||
return;
|
||||
}
|
||||
}
|
||||
sendreq = malloc(sizeof(struct send_request));
|
||||
sendreq = calloc(sizeof(struct send_request), 1);
|
||||
if (!sendreq)
|
||||
{
|
||||
end_query(channel, query, ARES_ENOMEM, NULL, 0);
|
||||
return;
|
||||
}
|
||||
sendreq->data = query->tcpbuf;
|
||||
sendreq->len = query->tcplen;
|
||||
sendreq->next = NULL;
|
||||
@@ -425,7 +435,7 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (server->udp_socket == -1)
|
||||
if (server->udp_socket == ARES_SOCKET_BAD)
|
||||
{
|
||||
if (open_udp_socket(channel, server) == -1)
|
||||
{
|
||||
@@ -448,17 +458,18 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
||||
|
||||
static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
{
|
||||
int s, flags;
|
||||
ares_socket_t s;
|
||||
int flags;
|
||||
struct sockaddr_in sockin;
|
||||
|
||||
/* Acquire a socket. */
|
||||
s = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (s == -1)
|
||||
if (s == ARES_SOCKET_BAD)
|
||||
return -1;
|
||||
|
||||
/* Set the socket non-blocking. */
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32) || defined(WATT32)
|
||||
flags = 1;
|
||||
ioctlsocket(s, FIONBIO, &flags);
|
||||
#else
|
||||
@@ -466,41 +477,44 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
|
||||
if (flags == -1)
|
||||
{
|
||||
close(s);
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
flags |= O_NONBLOCK;
|
||||
if (fcntl(s, F_SETFL, flags) == -1)
|
||||
{
|
||||
close(s);
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Connect to the server. */
|
||||
memset(&sockin, 0, sizeof(sockin));
|
||||
sockin.sin_family = AF_INET;
|
||||
sockin.sin_addr = server->addr;
|
||||
sockin.sin_port = channel->tcp_port;
|
||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1
|
||||
&& errno != EINPROGRESS)
|
||||
{
|
||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1) {
|
||||
int err = GET_ERRNO();
|
||||
|
||||
if (err != EINPROGRESS && err != EWOULDBLOCK) {
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
server->tcp_buffer_pos = 0;
|
||||
server->tcp_socket = s;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int open_udp_socket(ares_channel channel, struct server_state *server)
|
||||
{
|
||||
int s;
|
||||
ares_socket_t s;
|
||||
struct sockaddr_in sockin;
|
||||
|
||||
/* Acquire a socket. */
|
||||
s = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (s == -1)
|
||||
if (s == ARES_SOCKET_BAD)
|
||||
return -1;
|
||||
|
||||
/* Connect to the server. */
|
||||
@@ -597,10 +611,10 @@ static int same_questions(const unsigned char *qbuf, int qlen,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void end_query(ares_channel channel, struct query *query, int status,
|
||||
static struct query *end_query (ares_channel channel, struct query *query, int status,
|
||||
unsigned char *abuf, int alen)
|
||||
{
|
||||
struct query **q;
|
||||
struct query **q, *next;
|
||||
int i;
|
||||
|
||||
query->callback(query->arg, status, abuf, alen);
|
||||
@@ -610,6 +624,10 @@ static void end_query(ares_channel channel, struct query *query, int status,
|
||||
break;
|
||||
}
|
||||
*q = query->next;
|
||||
if (*q)
|
||||
next = (*q)->next;
|
||||
else
|
||||
next = NULL;
|
||||
free(query->tcpbuf);
|
||||
free(query->skip_server);
|
||||
free(query);
|
||||
@@ -622,4 +640,5 @@ static void end_query(ares_channel channel, struct query *query, int status,
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
ares__close_sockets(&channel->servers[i]);
|
||||
}
|
||||
return (next);
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <assert.h>
|
||||
#include "ares.h"
|
||||
|
||||
|
@@ -13,6 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_version.h"
|
||||
|
||||
const char *ares_version(int *version)
|
||||
|
@@ -1,4 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
libtoolize --copy --automake --force
|
||||
aclocal
|
||||
autoheader
|
||||
autoconf
|
||||
automake --add-missing
|
||||
|
1388
ares/config.guess
vendored
1388
ares/config.guess
vendored
File diff suppressed because it is too large
Load Diff
1489
ares/config.sub
vendored
1489
ares/config.sub
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,22 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(ares_init.c)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_MAINTAINER_MODE
|
||||
AM_INIT_AUTOMAKE(c-ares, CVS)
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
case $host_os in
|
||||
solaris*)
|
||||
AC_DEFINE(ETC_INET)
|
||||
AC_DEFINE(ETC_INET, 1, [if a /etc/inet dir is being used])
|
||||
;;
|
||||
esac
|
||||
|
||||
# check for ssize_t
|
||||
AC_CHECK_TYPE(ssize_t, ,
|
||||
AC_DEFINE(ssize_t, int, [the signed version of size_t]))
|
||||
|
||||
AC_SEARCH_LIBS(gethostbyname, nsl)
|
||||
AC_SEARCH_LIBS(socket, socket)
|
||||
|
||||
@@ -30,6 +35,9 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
|
||||
dnl when doing the debug stuff, use static library only
|
||||
AC_DISABLE_SHARED
|
||||
|
||||
dnl Checks for standard header files, to make memdebug.h inclusions bettter
|
||||
AC_HEADER_STDC
|
||||
|
||||
@@ -45,12 +53,14 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
dnl check for a few basic system headers we need
|
||||
dnl AC_CHECK_HEADERS(
|
||||
dnl sys/types.h \
|
||||
dnl sys/time.h \
|
||||
dnl sys/select.h \
|
||||
dnl sys/socket.h \
|
||||
dnl )
|
||||
AC_CHECK_HEADERS(
|
||||
sys/types.h \
|
||||
sys/time.h \
|
||||
sys/select.h \
|
||||
sys/socket.h \
|
||||
)
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
|
93
ares/maketgz
93
ares/maketgz
@@ -2,8 +2,6 @@
|
||||
|
||||
$version = $ARGV[0];
|
||||
|
||||
$name="c-ares";
|
||||
|
||||
if($version eq "") {
|
||||
print "Enter version number!\n";
|
||||
exit;
|
||||
@@ -15,86 +13,25 @@ if(!-f "ares.h") {
|
||||
}
|
||||
|
||||
if(!-f "configure") {
|
||||
`autoconf`;
|
||||
print "running buildconf\n";
|
||||
`./buildconf`;
|
||||
}
|
||||
print "adding $version in the configure.ac file\n";
|
||||
`sed -e 's/AM_INIT_AUTOMAKE(c-ares, CVS)/AM_INIT_AUTOMAKE(c-ares, $version)/' < configure.ac > configure.ac-rel`;
|
||||
|
||||
@files=`find . -name FILES`;
|
||||
# now make a new configure script with this
|
||||
print "makes a new configure script\n";
|
||||
`autoconf configure.ac-rel >configure`;
|
||||
|
||||
my @entries;
|
||||
# now run this new configure to get a fine makefile
|
||||
print "running configure\n";
|
||||
`./configure`;
|
||||
|
||||
sub dirpart {
|
||||
my ($file)=@_;
|
||||
my @p=split("/", $file);
|
||||
$p[$#p]=""; # blank the last one
|
||||
my $dir=join("/", @p);
|
||||
# now make the actual tarball
|
||||
print "running make dist\n";
|
||||
`make dist`;
|
||||
|
||||
$dir =~ s/^\.\///; # cut off ./ beginnings
|
||||
|
||||
$dir =~ s/\/$//; # off / trailers
|
||||
|
||||
if(!$dir) {
|
||||
$dir = ".";
|
||||
}
|
||||
|
||||
return $dir;
|
||||
}
|
||||
|
||||
sub add {
|
||||
my ($file)=@_;
|
||||
|
||||
my $dir=dirpart($file);
|
||||
|
||||
open(FILE, "<$file");
|
||||
while(<FILE>) {
|
||||
if($_ =~ /^ *\#/) {
|
||||
next;
|
||||
}
|
||||
chomp;
|
||||
push @entries, "$dir/$_";
|
||||
}
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
for(@files) {
|
||||
chomp;
|
||||
add($_);
|
||||
}
|
||||
|
||||
sub mkalldir {
|
||||
my ($dir) = @_;
|
||||
|
||||
my @parts = split("/", $dir);
|
||||
|
||||
#print "IN: $dir\n";
|
||||
|
||||
my $sub="";
|
||||
for(@parts) {
|
||||
#print "PART: $_\n";
|
||||
|
||||
$sub .= "$_";
|
||||
if($_ eq "") {
|
||||
next;
|
||||
}
|
||||
mkdir($sub, 0777);
|
||||
#print "make $sub\n";
|
||||
$sub .= "/";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(@entries) {
|
||||
my $dir = dirpart("$name-$version/$_");
|
||||
# print "Create $dir\n";
|
||||
mkalldir($dir);
|
||||
# print "Copy $_ to $dir\n";
|
||||
`cp -p $_ $dir`;
|
||||
}
|
||||
|
||||
# make a tarball
|
||||
`tar -cf $name-$version.tar $name-$version`;
|
||||
# gzip the tarball
|
||||
`gzip -9 $name-$version.tar`;
|
||||
# remove the dir
|
||||
`rm -rf $name-$version`;
|
||||
print "removing temporary configure.ac file\n";
|
||||
`rm configure.ac-rel`;
|
||||
|
||||
print "NOTE: now cvs tag this release!\n";
|
||||
|
@@ -4,13 +4,18 @@
|
||||
/* Windows-only header file provided by liren@vivisimo.com to make his Windows
|
||||
port build */
|
||||
|
||||
#ifndef NETWARE
|
||||
#include <windows.h>
|
||||
#include <process.h> /* for the _getpid() proto */
|
||||
#endif /* !NETWARE */
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef NETWARE
|
||||
|
||||
#define MAXHOSTNAMELEN 256
|
||||
|
||||
#define EINPROGRESS WSAEINPROGRESS
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
|
||||
/* Structure for scatter/gather I/O. */
|
||||
struct iovec
|
||||
@@ -21,11 +26,16 @@ struct iovec
|
||||
|
||||
#define getpid() _getpid()
|
||||
|
||||
int ares_writev (SOCKET s, const struct iovec *vector, size_t count);
|
||||
#define writev(s,vect,count) ares_writev(s,vect,count)
|
||||
|
||||
struct timezone { int dummy; };
|
||||
|
||||
int ares_gettimeofday(struct timeval *tv, struct timezone *tz);
|
||||
#define gettimeofday(tv,tz) ares_gettimeofday(tv,tz)
|
||||
|
||||
#endif /* !NETWARE */
|
||||
|
||||
#define NS_CMPRSFLGS 0xc0
|
||||
|
||||
|
||||
@@ -211,7 +221,7 @@ typedef enum __ns_rcode {
|
||||
#define T_MAILA ns_t_maila
|
||||
#define T_ANY ns_t_any
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#if !(defined(__MINGW32__) || defined(NETWARE))
|
||||
/* protos for the functions we provide in windows_port.c */
|
||||
int ares_strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
int ares_strcasecmp(const char *s1, const char *s2);
|
||||
|
45
ares/setup.h
Normal file
45
ares/setup.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef ARES_SETUP_H
|
||||
#define ARES_SETUP_H
|
||||
|
||||
/* Copyright (C) 2004 by Daniel Stenberg et al
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
* that the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. M.I.T. makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#else
|
||||
/* simple work-around for now, for systems without configure support */
|
||||
#define ssize_t int
|
||||
#endif
|
||||
|
||||
/* Recent autoconf versions define these symbols in config.h. We don't want
|
||||
them (since they collide with the libcurl ones when we build
|
||||
--enable-debug) so we undef them again here. */
|
||||
#undef PACKAGE_STRING
|
||||
#undef PACKAGE_TARNAME
|
||||
#undef PACKAGE_VERSION
|
||||
#undef PACKAGE_BUGREPORT
|
||||
#undef PACKAGE_NAME
|
||||
#undef VERSION
|
||||
#undef PACKAGE
|
||||
|
||||
/* now typedef our socket type */
|
||||
#ifdef WIN32
|
||||
#include <winsock.h>
|
||||
typedef SOCKET ares_socket_t;
|
||||
#define ARES_SOCKET_BAD INVALID_SOCKET
|
||||
#else
|
||||
typedef int ares_socket_t;
|
||||
#define ARES_SOCKET_BAD -1
|
||||
#endif
|
||||
|
||||
#endif /* ARES_SETUP_H */
|
@@ -1,7 +1,12 @@
|
||||
#include "setup.h"
|
||||
|
||||
#ifdef WIN32 /* only do the following on windows */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include "nameser.h"
|
||||
|
||||
@@ -26,8 +31,8 @@ ares_strcasecmp(const char *a, const char *b)
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
ares_gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
int
|
||||
ares_gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
{
|
||||
FILETIME ft;
|
||||
LARGE_INTEGER li;
|
||||
@@ -40,24 +45,47 @@ ares_gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
li.LowPart = ft.dwLowDateTime;
|
||||
li.HighPart = ft.dwHighDateTime;
|
||||
t = li.QuadPart; /* In 100-nanosecond intervals */
|
||||
//t -= EPOCHFILETIME; /* Offset to the Epoch time */
|
||||
#if 0
|
||||
t -= EPOCHFILETIME; /* Offset to the Epoch time */
|
||||
#endif
|
||||
t /= 10; /* In microseconds */
|
||||
tv->tv_sec = (long)(t / 1000000);
|
||||
tv->tv_usec = (long)(t % 1000000);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (tz)
|
||||
{
|
||||
if (!tzflag)
|
||||
{
|
||||
_tzset();
|
||||
tzflag++;
|
||||
}
|
||||
tz->tz_minuteswest = _timezone / 60;
|
||||
tz->tz_dsttime = _daylight;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ares_writev (SOCKET s, const struct iovec *vector, size_t count)
|
||||
{
|
||||
char *buffer, *bp;
|
||||
size_t i, bytes = 0;
|
||||
|
||||
/* Find the total number of bytes to write
|
||||
*/
|
||||
for (i = 0; i < count; i++)
|
||||
bytes += vector[i].iov_len;
|
||||
|
||||
if (bytes == 0) /* not an error */
|
||||
return (0);
|
||||
|
||||
/* Allocate a temporary buffer to hold the data
|
||||
*/
|
||||
buffer = bp = (char*) alloca (bytes);
|
||||
if (!buffer)
|
||||
{
|
||||
errno = ENOMEM;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Copy the data into buffer.
|
||||
*/
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
memcpy (bp, vector[i].iov_base, vector[i].iov_len);
|
||||
bp += vector[i].iov_len;
|
||||
}
|
||||
return send (s, (const void*)buffer, bytes, 0);
|
||||
}
|
||||
#endif /* WIN32 builds only */
|
||||
|
35
configure.ac
35
configure.ac
@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ(2.57)
|
||||
|
||||
dnl We don't know the version number "staticly" so we use a dash here
|
||||
AC_INIT(curl, [-], [curl-bug@haxx.se])
|
||||
AC_INIT(curl, [-], [a suitable curl mailing list => http://curl.haxx.se/mail/])
|
||||
|
||||
dnl configure script copyright
|
||||
AC_COPYRIGHT([Copyright (c) 1998 - 2004 Daniel Stenberg, <daniel@haxx.se>
|
||||
@@ -87,7 +87,7 @@ dnl check for cygwin stuff
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
|
||||
dnl libtool setup
|
||||
AM_PROG_LIBTOOL
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
AC_MSG_CHECKING([if we need -no-undefined])
|
||||
case $host in
|
||||
@@ -560,7 +560,7 @@ then
|
||||
AC_CHECK_HEADERS(krb.h)
|
||||
|
||||
dnl we found the required libraries, add to LIBS
|
||||
LIBS="-lkrb -ldes $LIBS"
|
||||
LIBS="-lkrb -lcom_err -ldes $LIBS"
|
||||
|
||||
dnl Check for function krb_get_our_ip_for_realm
|
||||
dnl this is needed for NAT networks
|
||||
@@ -1014,7 +1014,7 @@ else
|
||||
CURL_CHECK_GETHOSTBYNAME_R()
|
||||
|
||||
dnl dig around for gethostbyaddr_r()
|
||||
CURL_CHECK_GETHOSTBYADDR_R()
|
||||
dnl CURL_CHECK_GETHOSTBYADDR_R()
|
||||
fi
|
||||
|
||||
dnl poke around for inet_ntoa_r()
|
||||
@@ -1201,6 +1201,31 @@ if test "$ac_cv_func_sigsetjmp" != "yes"; then
|
||||
)
|
||||
fi
|
||||
|
||||
dnl poll() might be badly emulated, as in Mac OS X 10.3 (and other BSDs?) and
|
||||
dnl to find out we make an extra check here!
|
||||
if test "$ac_cv_func_poll" = "yes"; then
|
||||
AC_MSG_CHECKING([if poll works with NULL inputs])
|
||||
AC_RUN_IFELSE([
|
||||
#ifdef HAVE_SYS_POLL_H
|
||||
#include <sys/poll.h>
|
||||
#endif
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* make this return 0 == timeout since there's nothing to read from */
|
||||
return poll((void *)0, 0, 10 /*ms*/);
|
||||
}
|
||||
],
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll]),
|
||||
AC_MSG_RESULT(no),
|
||||
AC_MSG_RESULT(cross-compiling assumes yes)
|
||||
AC_DEFINE(HAVE_POLL_FINE, 1, [If you have a fine poll])
|
||||
) dnl end of AC_RUN_IFELSE
|
||||
fi
|
||||
|
||||
|
||||
|
||||
AC_PATH_PROG( PERL, perl, ,
|
||||
$PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
|
||||
AC_SUBST(PERL)
|
||||
@@ -1365,6 +1390,8 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
|
||||
|
||||
AC_CONFIG_FILES([Makefile \
|
||||
docs/Makefile \
|
||||
docs/examples/Makefile \
|
||||
|
@@ -28,7 +28,7 @@
|
||||
(setq tab-width 8
|
||||
indent-tabs-mode nil ; Use spaces. Not tabs.
|
||||
comment-column 40
|
||||
c-font-lock-extra-types (append '("bool" "CURL" "CURLcode" "ssize_t" "size_t" "socklen_t" "fd_set" "time_t" "curl_off_t" "curl_socket_t" "in_addr_t" "CURLSHcode" "CURLMcode"))
|
||||
c-font-lock-extra-types (append '("bool" "CURL" "CURLcode" "ssize_t" "size_t" "socklen_t" "fd_set" "time_t" "curl_off_t" "curl_socket_t" "in_addr_t" "CURLSHcode" "CURLMcode" "Curl_addrinfo"))
|
||||
)
|
||||
;; keybindings for C, C++, and Objective-C. We can put these in
|
||||
;; c-mode-base-map because of inheritance ...
|
||||
|
90
docs/FAQ
90
docs/FAQ
@@ -1,4 +1,4 @@
|
||||
Updated: March 16, 2004 (http://curl.haxx.se/docs/faq.html)
|
||||
Updated: August 10, 2004 (http://curl.haxx.se/docs/faq.html)
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
@@ -19,8 +19,8 @@ FAQ
|
||||
|
||||
2. Install Related Problems
|
||||
2.1 configure doesn't find OpenSSL even when it is installed
|
||||
2.1.1. native linker doesn't find OpenSSL
|
||||
2.1.2. only the libssl lib is missing
|
||||
2.1.1 native linker doesn't find OpenSSL
|
||||
2.1.2 only the libssl lib is missing
|
||||
2.2 Does curl work/build with other SSL libraries?
|
||||
2.3 Where can I find a copy of LIBEAY32.DLL?
|
||||
2.4 Does cURL support Socks (RFC 1928) ?
|
||||
@@ -70,6 +70,7 @@ FAQ
|
||||
5.5 Does CURLOPT_WRITEDATA and CURLOPT_READDATA work on win32 ?
|
||||
5.6 What about Keep-Alive or persistent connections?
|
||||
5.7 Link errors when building libcurl on Windows!
|
||||
5.8 libcurl.so.3: open failed: No such file or directory
|
||||
|
||||
6. License Issues
|
||||
6.1 I have a GPL program, can I use the libcurl library?
|
||||
@@ -223,11 +224,11 @@ FAQ
|
||||
|
||||
2. Install Related Problems
|
||||
|
||||
2.1. configure doesn't find OpenSSL even when it is installed
|
||||
2.1 configure doesn't find OpenSSL even when it is installed
|
||||
|
||||
This may be because of several reasons.
|
||||
|
||||
2.1.1. native linker doesn't find openssl
|
||||
2.1.1 native linker doesn't find openssl
|
||||
|
||||
Affected platforms:
|
||||
Solaris (native cc compiler)
|
||||
@@ -249,7 +250,7 @@ FAQ
|
||||
|
||||
Solution submitted by: Bob Allison <allisonb@users.sourceforge.net>
|
||||
|
||||
2.1.2. only the libssl lib is missing
|
||||
2.1.2 only the libssl lib is missing
|
||||
|
||||
If all include files and the libcrypto lib is present, with only the
|
||||
libssl being missing according to configure, this is mostly likely because
|
||||
@@ -262,14 +263,14 @@ FAQ
|
||||
configure. Make sure that you remove the config.cache file before you
|
||||
rerun configure with the new flags.
|
||||
|
||||
2.2. Does curl work/build with other SSL libraries?
|
||||
2.2 Does curl work/build with other SSL libraries?
|
||||
|
||||
Curl has been written to use OpenSSL, although there should not be much
|
||||
problems using a different library. If anyone does "port" curl to use a
|
||||
different SSL library, we are of course very interested in getting the
|
||||
patch!
|
||||
|
||||
2.3. Where can I find a copy of LIBEAY32.DLL?
|
||||
2.3 Where can I find a copy of LIBEAY32.DLL?
|
||||
|
||||
That is an OpenSSL binary built for Windows.
|
||||
|
||||
@@ -278,14 +279,14 @@ FAQ
|
||||
accurate and up-to-date pointers to recent OpenSSL DLLs and other binary
|
||||
packages.
|
||||
|
||||
2.4. Does cURL support Socks (RFC 1928) ?
|
||||
2.4 Does cURL support Socks (RFC 1928) ?
|
||||
|
||||
Yes, SOCKS5 is supported when curl is built with IPv6 support disabled.
|
||||
Yes, SOCKS5 is supported.
|
||||
|
||||
|
||||
3. Usage problems
|
||||
|
||||
3.1. curl: (1) SSL is disabled, https: not supported
|
||||
3.1 curl: (1) SSL is disabled, https: not supported
|
||||
|
||||
If you get this output when trying to get anything from a https:// server,
|
||||
it means that the configure script couldn't find all libs and include files
|
||||
@@ -300,13 +301,13 @@ FAQ
|
||||
Also, check out the other paragraph in this FAQ labeled "configure doesn't
|
||||
find OpenSSL even when it is installed".
|
||||
|
||||
3.2. How do I tell curl to resume a transfer?
|
||||
3.2 How do I tell curl to resume a transfer?
|
||||
|
||||
Curl supports resumed transfers both ways on both FTP and HTTP.
|
||||
|
||||
Try the -C option.
|
||||
|
||||
3.3. Why doesn't my posting using -F work?
|
||||
3.3 Why doesn't my posting using -F work?
|
||||
|
||||
You can't simply use -F or -d at your choice. The web server that will
|
||||
receive your post assumes one of the formats. If the form you're trying to
|
||||
@@ -320,7 +321,7 @@ FAQ
|
||||
through the mailing list archives for old postings and questions regarding
|
||||
this.
|
||||
|
||||
3.4. How do I tell curl to run custom FTP commands?
|
||||
3.4 How do I tell curl to run custom FTP commands?
|
||||
|
||||
You can tell curl to perform optional commands both before and/or after a
|
||||
file transfer. Study the -Q/--quote option.
|
||||
@@ -329,13 +330,13 @@ FAQ
|
||||
FTP commands without transferring anything. Therefore you must always specify
|
||||
a URL to transfer to/from even when doing custom FTP commands.
|
||||
|
||||
3.5. How can I disable the Pragma: nocache header?
|
||||
3.5 How can I disable the Pragma: nocache header?
|
||||
|
||||
You can change all internally generated headers by adding a replacement with
|
||||
the -H/--header option. By adding a header with empty contents you safely
|
||||
disable that one. Use -H "Pragma:" to disable that specific header.
|
||||
|
||||
3.6. Does curl support ASP, XML, XHTML or HTML version Y?
|
||||
3.6 Does curl support ASP, XML, XHTML or HTML version Y?
|
||||
|
||||
To curl, all contents are alike. It doesn't matter how the page was
|
||||
generated. It may be ASP, PHP, Perl, shell-script, SSI or plain
|
||||
@@ -344,7 +345,7 @@ FAQ
|
||||
|
||||
See also item 3.14 regarding javascript.
|
||||
|
||||
3.7. Can I use curl to delete/rename a file through FTP?
|
||||
3.7 Can I use curl to delete/rename a file through FTP?
|
||||
|
||||
Yes. You specify custom FTP commands with -Q/--quote.
|
||||
|
||||
@@ -456,15 +457,16 @@ FAQ
|
||||
3.15 Can I do recursive fetches with curl?
|
||||
|
||||
No. curl itself has no code that performs recursive operations, such as
|
||||
those performed by wget.
|
||||
those performed by wget and similar tools.
|
||||
|
||||
There exist wrapper scripts with that functionality (for example the
|
||||
curlmirror perl script), and you can write programs based on libcurl to do
|
||||
it, but the command line tool curl itself cannot.
|
||||
|
||||
|
||||
4. Running Problems
|
||||
|
||||
4.1. Problems connecting to SSL servers.
|
||||
4.1 Problems connecting to SSL servers.
|
||||
|
||||
It took a very long time before we could sort out why curl had problems to
|
||||
connect to certain SSL servers when using SSLeay or OpenSSL v0.9+. The
|
||||
@@ -479,7 +481,7 @@ FAQ
|
||||
There have also been examples where the remote server didn't like the SSLv2
|
||||
request and instead you had to force curl to use SSLv3 with -3/--sslv3.
|
||||
|
||||
4.2. Why do I get problems when I use & or % 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
|
||||
runs the specified command in the background. To safely send the & as a part
|
||||
@@ -497,7 +499,7 @@ FAQ
|
||||
pass in a POST using -d/--data you must encode it as '%25' (which then also
|
||||
needs the %-letter doubled on Windows machines).
|
||||
|
||||
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
|
||||
a URL specified to curl you must quote them.
|
||||
@@ -511,7 +513,7 @@ FAQ
|
||||
|
||||
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
|
||||
at the server, the HTTP protocol defines how the server should respond and
|
||||
@@ -562,14 +564,14 @@ FAQ
|
||||
slash. Try the same operation again _with_ the trailing URL, or use the
|
||||
-L/--location option to follow the redirection.
|
||||
|
||||
4.6. Can you tell me what error code 142 means?
|
||||
4.6 Can you tell me what error code 142 means?
|
||||
|
||||
All error codes that are larger than the highest documented error code means
|
||||
that curl has exited due to a crash. This is a serious error, and we
|
||||
appreciate a detailed bug report from you that describes how we could go
|
||||
ahead and repeat this!
|
||||
|
||||
4.7. How do I keep user names and passwords secret in Curl command lines?
|
||||
4.7 How do I keep user names and passwords secret in Curl command lines?
|
||||
|
||||
This problem has two sides:
|
||||
|
||||
@@ -603,7 +605,7 @@ FAQ
|
||||
If there is a bug, read the BUGS document first. Then report it as described
|
||||
in there.
|
||||
|
||||
4.9. Curl can't authenticate to the server that requires NTLM?
|
||||
4.9 Curl can't authenticate to the server that requires NTLM?
|
||||
|
||||
This is supported in curl 7.10.6 or later. No earlier curl version knows
|
||||
of this magic.
|
||||
@@ -651,9 +653,10 @@ FAQ
|
||||
Details are also in the SSLCERTS file in the release archives, found online
|
||||
here: http://curl.haxx.se/docs/sslcerts.html
|
||||
|
||||
|
||||
5. libcurl Issues
|
||||
|
||||
5.1. Is libcurl thread-safe?
|
||||
5.1 Is libcurl thread-safe?
|
||||
|
||||
Yes.
|
||||
|
||||
@@ -687,7 +690,7 @@ FAQ
|
||||
size_t
|
||||
WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
register int realsize = size * nmemb;
|
||||
size_t realsize = size * nmemb;
|
||||
struct MemoryStruct *mem = (struct MemoryStruct *)data;
|
||||
|
||||
mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1);
|
||||
@@ -743,6 +746,27 @@ FAQ
|
||||
|
||||
(Provided by Andrew Francis)
|
||||
|
||||
5.8 libcurl.so.3: open failed: No such file or directory
|
||||
|
||||
This is an error message you might get when you try to run a program linked
|
||||
with a shared version of libcurl and your run-time linker (ld.so) couldn't
|
||||
find the shared library named libcurl.so.3.
|
||||
|
||||
You need to make sure that ld.so finds libcurl.so.3. You can do that
|
||||
multiple ways, and it differs somewhat between different operating systems,
|
||||
but they are usually:
|
||||
|
||||
* Add an option to the linker command line that specify the hard-coded path
|
||||
the run-time linker should check for the lib (usually -R)
|
||||
|
||||
* Set an environment variable (LD_LIBRARY_PATH for example) where ld.so
|
||||
should check for libs
|
||||
|
||||
* Adjust the system's config to check for libs in the directory where you've
|
||||
put the dir (like Linux's /etc/ld.so.conf)
|
||||
|
||||
'man ld.so' and 'man ld' will tell you more details
|
||||
|
||||
|
||||
6. License Issues
|
||||
|
||||
@@ -751,32 +775,32 @@ FAQ
|
||||
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?
|
||||
|
||||
Yes!
|
||||
|
||||
Since libcurl may be distributed under the MIT/X derivate license, it can be
|
||||
used together with GPL in any software.
|
||||
|
||||
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 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 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!
|
||||
|
||||
The LGPL license doesn't clash with other licenses.
|
||||
|
||||
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?
|
||||
|
||||
Yes!
|
||||
|
||||
@@ -784,7 +808,7 @@ FAQ
|
||||
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.
|
||||
|
||||
|
13
docs/HISTORY
13
docs/HISTORY
@@ -126,3 +126,16 @@ visitors to the curl.haxx.se site. Five official web mirrors.
|
||||
December 2003, full-fledged SSL for FTP is supported.
|
||||
|
||||
January 2004: curl 7.11.0 introduced large file support.
|
||||
|
||||
June 2004: curl 7.12.0 introduced IDN support. 10 official web mirrors.
|
||||
|
||||
August 2004:
|
||||
Curl and libcurl 7.12.1
|
||||
|
||||
Public curl release number: 82
|
||||
Releases counted from the very beginning: 109
|
||||
Available command line options: 96
|
||||
Available curl_easy_setopt() options: 120
|
||||
Number of public functions in libcurl: 36
|
||||
Amount of public web site mirrors: 12
|
||||
Number of known libcurl bindings: 26
|
||||
|
95
docs/INSTALL
95
docs/INSTALL
@@ -189,28 +189,33 @@ Win32
|
||||
Microsoft command line style
|
||||
----------------------------
|
||||
|
||||
Run the 'vcvars32.bat' file to get a proper environment. The
|
||||
vcvars32.bat file is part of the Microsoft development environment and
|
||||
you may find it in 'C:\Program Files\Microsoft Visual Studio\vc98\bin'
|
||||
provided that you installed Visual C/C++ 6 in the default directory.
|
||||
|
||||
Then run 'nmake vc' in curl's root directory.
|
||||
|
||||
If you want to compile with zlib support, you will need to build
|
||||
zlib (http://www.gzip.org/zlib/) as well. Please read the zlib
|
||||
documentation on how to compile zlib. Define the ZLIB_PATH environment
|
||||
variable to the location of zlib.h and zlib.lib, for example:
|
||||
|
||||
set ZLIB_PATH=c:\zlib-1.2.1
|
||||
|
||||
Then run 'nmake vc-zlib' in curl's root directory.
|
||||
|
||||
If you want to compile with SSL support you need the OpenSSL package.
|
||||
Please read the OpenSSL documentation on how to compile and install
|
||||
the OpenSSL libraries. The build process of OpenSSL generates the
|
||||
libeay32.dll and ssleay32.dll files in the out32dll subdirectory in
|
||||
the OpenSSL home directory. OpenSSL static libraries (libeay32.lib,
|
||||
ssleay32.lib, RSAglue.lib) are created in the out32 subdirectory.
|
||||
|
||||
Run the 'vcvars32.bat' file to get a proper environment. The
|
||||
vcvars32.bat file is part of the Microsoft development environment and
|
||||
you may find it in 'C:\Program Files\Microsoft Visual Studio\vc98\bin'
|
||||
provided that you installed Visual C/C++ 6 in the default directory.
|
||||
|
||||
Before running nmake define the OPENSSL_PATH environment variable with
|
||||
the root/base directory of OpenSSL, for example:
|
||||
|
||||
set OPENSSL_PATH=c:\openssl-0.9.7a
|
||||
|
||||
lib/Makefile.vc6 depends on zlib (http://www.gzip.org/zlib/) as well.
|
||||
Please read the zlib documentation on how to compile zlib. Define the
|
||||
ZLIB_PATH environment variable to the location of zlib.h and zlib.lib,
|
||||
for example:
|
||||
|
||||
set ZLIB_PATH=c:\zlib-1.1.4
|
||||
set OPENSSL_PATH=c:\openssl-0.9.7d
|
||||
|
||||
Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root
|
||||
directory. 'nmake vc-ssl' will create a libcurl static and dynamic
|
||||
@@ -219,10 +224,11 @@ Win32
|
||||
version is a standalone executable not requiring any DLL at
|
||||
runtime. This make method requires that you have the static OpenSSL
|
||||
libraries available in OpenSSL's out32 subdirectory.
|
||||
'nmake vc-ssl-dll' creates the libcurl dynamic library and
|
||||
links curl.exe against libcurl and OpenSSL dynamically.
|
||||
This executable requires libcurl.dll and the OpenSSL DLLs
|
||||
at runtime.
|
||||
'nmake vc-ssl-dll' creates the libcurl dynamic library and
|
||||
links curl.exe against libcurl and OpenSSL dynamically.
|
||||
This executable requires libcurl.dll and the OpenSSL DLLs
|
||||
at runtime.
|
||||
Run 'nmake vc-ssl-zlib' to build with both ssl and zlib support.
|
||||
|
||||
Microsoft / Borland style
|
||||
-------------------------
|
||||
@@ -361,12 +367,12 @@ VMS
|
||||
the name can be fetched from external or internal message libraries
|
||||
Errorcode - the errodes assigned by the application
|
||||
Sev. - severity: Even = error, off = non error
|
||||
0 = Warning
|
||||
1 = Success
|
||||
2 = Error
|
||||
3 = Information
|
||||
4 = Fatal
|
||||
<5-7> reserved.
|
||||
0 = Warning
|
||||
1 = Success
|
||||
2 = Error
|
||||
3 = Information
|
||||
4 = Fatal
|
||||
<5-7> reserved.
|
||||
|
||||
This all presents itself with:
|
||||
%<FACILITY>-<SeV>-<Errorname>, <Error message>
|
||||
@@ -379,7 +385,7 @@ VMS
|
||||
|
||||
This was all compiled with:
|
||||
|
||||
Compaq C V6.2-003 on OpenVMS Alpha V7.1-1H2
|
||||
Compaq C V6.2-003 on OpenVMS Alpha V7.1-1H2
|
||||
|
||||
So far for porting notes as of:
|
||||
13-jul-2001
|
||||
@@ -472,6 +478,39 @@ AmigaOS
|
||||
you can find a precompiled package at http://amiga.sourceforge.net/OpenSSL/
|
||||
|
||||
|
||||
NetWare
|
||||
=======
|
||||
|
||||
To compile curl.nlm / libcurl.nlm you need:
|
||||
- either any gcc / nlmconv, or CodeWarrior 7 PDK 4 or later.
|
||||
- gnu make and awk running on the platform you compile on;
|
||||
native Win32 versions can be downloaded from:
|
||||
http://www.gknw.com/development/prgtools/
|
||||
- recent Novell LibC SDK availabable from:
|
||||
http://developer.novell.com/ndk/libc.htm
|
||||
- optional zlib sources (at the moment only dynamic linking with zlib.imp);
|
||||
sources with NetWare Makefile can be optained from:
|
||||
http://www.gknw.com/mirror/zlib/
|
||||
|
||||
Set a search path to your compiler, linker and tools; if you want to have
|
||||
zlib support then set the environment var ZLIB_PATH pointing to your zlib
|
||||
sources, on Linux make sure the var OSTYPE contains the string 'linux';
|
||||
and finally type 'make netware' from the top source directory...
|
||||
I found on some Linux systems (RH9) that OS detection didnt work although
|
||||
a 'set | grep OSTYPE' shows the var present and set; I simply overwrote it
|
||||
with 'OSTYPE=linux-rh9-gnu' and the detection in the Makefile worked...;
|
||||
other options are currently not supported, although partly prepared.
|
||||
The Ares lib builds arlready fine, and both test tools work fine at least
|
||||
when build with CodeWarrior...; dont know yet why they fail when build with
|
||||
gcc though; if you want to compile with Ares support then set an env var
|
||||
WITH_ARES=1; I've not tested yet including libcares into curl.
|
||||
Any help in testing appreciated!
|
||||
Buils automatically created 4 times a day from current CVS are here:
|
||||
http://www.gknw.com/mirror/curl/autobuilds/
|
||||
the status of these buids can be viewed at the autobuild table:
|
||||
http://curl.haxx.se/auto/
|
||||
|
||||
|
||||
PORTS
|
||||
=====
|
||||
This is a probably incomplete list of known hardware and operating systems
|
||||
@@ -549,3 +588,11 @@ OpenLDAP
|
||||
|
||||
http://www.openldap.org
|
||||
|
||||
Zlib
|
||||
====
|
||||
|
||||
You'll find Zlib information at:
|
||||
|
||||
http://www.gzip.org/zlib/
|
||||
|
||||
|
||||
|
@@ -3,6 +3,11 @@ join in and help us correct one or more of these! Also be sure to check the
|
||||
changelog of the current development status, as one or more of these problems
|
||||
may have been fixed since this was written!
|
||||
|
||||
* To get HTTP Negotiate authentication to work fine, you need to provide a
|
||||
(fake) user name (this concerns both curl and the lib) because the code
|
||||
wrongly only considers authentication if there's a user name provided.
|
||||
Bug report #1004841.
|
||||
|
||||
* If you use a very large amount of file descriptors (more than FD_SETSIZE)
|
||||
and then use libcurl, it might crash on its use of select() which then
|
||||
stores data out of bounds. Bug report #948950.
|
||||
@@ -41,9 +46,6 @@ may have been fixed since this was written!
|
||||
|
||||
* GOPHER transfers seem broken
|
||||
|
||||
* configure --disable-http is not fully supported. All other protocols seem
|
||||
to work to disable.
|
||||
|
||||
* If a HTTP server responds to a HEAD request and includes a body (thus
|
||||
violating the RFC2616), curl won't wait to read the response but just stop
|
||||
reading and return back. If a second request (let's assume a GET) is then
|
||||
|
20
docs/MANUAL
20
docs/MANUAL
@@ -851,7 +851,7 @@ MAILING LISTS
|
||||
|
||||
For your convenience, we have several open mailing lists to discuss curl,
|
||||
its development and things relevant to this. Get all info at
|
||||
http://curl.haxx.se/mail/. The lists available are:
|
||||
http://curl.haxx.se/mail/. Some of the lists available are:
|
||||
|
||||
curl-users
|
||||
|
||||
@@ -865,24 +865,18 @@ MAILING LISTS
|
||||
|
||||
curl-announce
|
||||
|
||||
Low-traffic. Only announcements of new public versions.
|
||||
Low-traffic. Only receives announcements of new public versions. At worst,
|
||||
that makes something like one or two mails per month, but usually only one
|
||||
mail every second month.
|
||||
|
||||
curl-and-PHP
|
||||
curl-and-php
|
||||
|
||||
Using the curl functions in PHP. Everything curl with a PHP angle. Or PHP
|
||||
with a curl angle.
|
||||
|
||||
curl-commits
|
||||
curl-and-python
|
||||
|
||||
Receives notifications on all CVS commits done to the curl source module.
|
||||
This can become quite a large amount of mails during intense development,
|
||||
be aware. This is for us who like email...
|
||||
|
||||
curl-www-commits
|
||||
|
||||
Receives notifications on all CVS commits done to the curl www module
|
||||
(basicly the web site). This can become quite a large amount of mails
|
||||
during intense changing, be aware. This is for us who like email...
|
||||
Python hackers using curl with or without the python binding pycurl.
|
||||
|
||||
Please direct curl questions, feature requests and trouble reports to one of
|
||||
these mailing lists instead of mailing any individual.
|
||||
|
@@ -17,7 +17,7 @@ CLEANFILES = $(GENHTMLPAGES) $(PDFPAGES)
|
||||
EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
|
||||
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \
|
||||
KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \
|
||||
libcurl-the-guide $(PDFPAGES) LICENSE-MIXING
|
||||
$(PDFPAGES) LICENSE-MIXING README.netware
|
||||
|
||||
MAN2HTML= roffit < $< >$@
|
||||
|
||||
|
27
docs/README.netware
Normal file
27
docs/README.netware
Normal file
@@ -0,0 +1,27 @@
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
README.netware
|
||||
|
||||
Read the README file first.
|
||||
|
||||
Curl has been successfully compiled with gcc / nlmconv on different flavours
|
||||
of Linux as well as with the official Metrowerks CodeWarrior compiler.
|
||||
While not being the main development target, a continously growing share of
|
||||
curl users are NetWare-based, specially also consuming the lib from PHP.
|
||||
|
||||
The unix-style man pages are tricky to read on windows, so therefore are all
|
||||
those pages converted to HTML as well as pdf, and included in the release
|
||||
archives.
|
||||
|
||||
The main curl.1 man page is also "built-in" in the command line tool. Use a
|
||||
command line similar to this in order to extract a separate text file:
|
||||
|
||||
curl -M >manual.txt
|
||||
|
||||
Read the INSTALL file for instructions how to compile curl self.
|
||||
|
||||
|
@@ -1,32 +1,30 @@
|
||||
Peer SSL Certificate Verification
|
||||
=================================
|
||||
|
||||
Since version 7.10, libcurl performs peer SSL certificate verification by
|
||||
default. This is done by installing a default CA cert bundle on 'make install'
|
||||
(or similar), that CA bundle package is used by default on operations against
|
||||
SSL servers.
|
||||
libcurl performs peer SSL certificate verification by default. This is done by
|
||||
installing a default CA cert bundle on 'make install' (or similar), that CA
|
||||
bundle package is used by default on operations against SSL servers.
|
||||
|
||||
Alas, if you communicate with HTTPS servers using certificates that are signed
|
||||
by CAs present in the bundle, you will not notice any changed behavior and you
|
||||
will seamlessly get a higher security level on your SSL connections since you
|
||||
can be sure that the remote server really is the one it claims to be.
|
||||
If you communicate with HTTPS or FTPS servers using certificates that are
|
||||
signed by CAs present in the bundle, you can be sure that the remote server
|
||||
really is the one it claims to be.
|
||||
|
||||
If the remote server uses a self-signed certificate, if you don't install
|
||||
curl's CA cert bundle, if the server uses a certificate signed by a CA that
|
||||
isn't included in the bundle or if the remoste host is an imposter
|
||||
impersonating your favourite site, and you want to transfer files from this
|
||||
isn't included in the bundle or if the remote host is an impostor
|
||||
impersonating your favorite site, and you want to transfer files from this
|
||||
server, do one of the following:
|
||||
|
||||
1. Tell libcurl to *not* verify the peer. With libcurl you disable with with
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
|
||||
With the curl command tool, you disable this with -k/--insecure.
|
||||
With the curl command line tool, you disable this with -k/--insecure.
|
||||
|
||||
2. Get a CA certificate that can verify the remote server and use the proper
|
||||
option to point out this CA cert for verification when connecting. For
|
||||
libcurl hackers: curl_easy_setopt(curl, CURLOPT_CAPATH, capath);
|
||||
|
||||
With the curl command tool: --cacert [file]
|
||||
With the curl command line tool: --cacert [file]
|
||||
|
||||
3. Add the CA cert for your server to the existing default CA cert bundle.
|
||||
The default path of the CA bundle installed with the curl package is:
|
||||
@@ -34,8 +32,27 @@ server, do one of the following:
|
||||
configure with the --with-ca-bundle option pointing out the path of your
|
||||
choice.
|
||||
|
||||
Neglecting to use one of the above menthods when dealing with a server using a
|
||||
certficate that isn't signed by one of the certficates in the installed CA
|
||||
If you're using the curl command line tool, you can specify your own CA
|
||||
cert path by setting the environment variable CURL_CA_BUNDLE to the path
|
||||
of your choice.
|
||||
|
||||
If you're using the curl command line tool on Windows, curl will search
|
||||
for a CA cert file named "curl-ca-bundle.crt" in these directories and in
|
||||
this order:
|
||||
1. application's directory
|
||||
2. current working directory
|
||||
3. Windows System directory (e.g. C:\windows\system32)
|
||||
4. Windows Directory (e.g. C:\windows)
|
||||
5. all directories along %PATH%
|
||||
|
||||
4. Get a better/different/newer CA cert bundle! One option is to extract the
|
||||
one a recent Mozilla browser uses, by following the instruction found
|
||||
here:
|
||||
|
||||
http://curl.haxx.se/docs/caextract.html
|
||||
|
||||
Neglecting to use one of the above methods when dealing with a server using a
|
||||
certificate that isn't signed by one of the certificates in the installed CA
|
||||
cert bundle, will cause SSL to report an error ("certificate verify failed")
|
||||
during the handshake and SSL will then refuse further communication with that
|
||||
server.
|
||||
@@ -45,4 +62,3 @@ trouble for some users, since it adds security to a majority of the SSL
|
||||
connections that previously weren't really secure. It turned out many people
|
||||
were using previous versions of curl/libcurl without realizing the need for
|
||||
the CA cert options to get truly secure SSL connections.
|
||||
|
||||
|
23
docs/TODO
23
docs/TODO
@@ -36,10 +36,6 @@ TODO
|
||||
* Option to set the SO_KEEPALIVE socket option to make libcurl notice and
|
||||
disconnect very long time idle connections.
|
||||
|
||||
* When posting multipart forms, we should _not_ create the whole data chunk
|
||||
in memory before the upload starts but do it in a "streaming" manner to
|
||||
allow uploads that are way larger than the amount of system memory.
|
||||
|
||||
LIBCURL - multi interface
|
||||
|
||||
* Add curl_multi_timeout() to make libcurl's ares-functionality better.
|
||||
@@ -61,6 +57,10 @@ TODO
|
||||
|
||||
FTP
|
||||
|
||||
* Support GSS/Kerberos 5 for ftp file transfer. This will allow user
|
||||
authentication and file encryption. Possible libraries and example clients
|
||||
are available from MIT or Heimdal. Requsted by Markus Moeller.
|
||||
|
||||
* Optimize the way libcurl uses CWD on each new request over a persistent
|
||||
connection (on FTP) even if it doesn't have to.
|
||||
|
||||
@@ -89,9 +89,6 @@ TODO
|
||||
|
||||
HTTP
|
||||
|
||||
* GSS-Negotiate support for HTTP proxies. They only work on direct
|
||||
connections to the server.
|
||||
|
||||
* Pipelining. Sending multiple requests before the previous one(s) are done.
|
||||
This could possibly be implemented using the multi interface to queue
|
||||
requests and the response data.
|
||||
@@ -182,14 +179,14 @@ TODO
|
||||
http://curl.haxx.se/mail/archive-2003-11/0091.html (Kevin Roth suggested)
|
||||
|
||||
* Provide a way to make options bound to a specific URL among several on the
|
||||
command line. Possibly by adding a new option that separates options
|
||||
between URLs, similar to this:
|
||||
command line. Possibly by letting ':' separate options between URLs,
|
||||
similar to this:
|
||||
|
||||
curl --data foo --url url.com --optionseparator
|
||||
--url url2.com --optionseparator \
|
||||
curl --data foo --url url.com :
|
||||
--url url2.com : \
|
||||
--url url3.com --data foo3
|
||||
|
||||
(--optionseparator used to show my point, it would need a better name)
|
||||
(More details: http://curl.haxx.se/mail/archive-2004-07/0133.html)
|
||||
|
||||
The example would do a POST-GET-POST combination on a single command line.
|
||||
|
||||
@@ -222,6 +219,8 @@ TODO
|
||||
|
||||
* remove obsolete defines from curl/curl.h
|
||||
|
||||
* make several functions use size_t instead of int in their APIs
|
||||
|
||||
* remove the following functions from the public API:
|
||||
curl_getenv
|
||||
curl_mprintf (and variations)
|
||||
|
@@ -370,11 +370,11 @@ Version: 0.6
|
||||
|
||||
In the HTTPS world, you use certificates to validate that you are the one
|
||||
you you claim to be, as an addition to normal passwords. Curl supports
|
||||
client-side certificates. All certificates are locked with a PIN-code, why
|
||||
you need to enter the unlock-code before the certificate can be used by
|
||||
curl. The PIN-code can be specified on the command line or if not, entered
|
||||
interactively when curl queries for it. Use a certificate with curl on a
|
||||
HTTPS server like:
|
||||
client-side certificates. All certificates are locked with a pass phrase,
|
||||
which you need to enter before the certificate can be used by curl. The pass
|
||||
phrase can be specified on the command line or if not, entered interactively
|
||||
when curl queries for it. Use a certificate with curl on a HTTPS server
|
||||
like:
|
||||
|
||||
curl -E mycert.pem https://that.secure.server.com
|
||||
|
||||
|
13
docs/curl.1
13
docs/curl.1
@@ -662,13 +662,12 @@ instead of PORT by using \fI--disable-eprt\fP. EPRT is really PORT++.
|
||||
If used as the first parameter on the command line, the \fI$HOME/.curlrc\fP
|
||||
file will not be read and used as a config file.
|
||||
.IP "-Q/--quote <comand>"
|
||||
(FTP) Send an arbitrary command to the remote FTP server, by using the QUOTE
|
||||
command of the server. Not all servers support this command, and the set of
|
||||
QUOTE commands are server specific! Quote commands are sent BEFORE the
|
||||
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
|
||||
to be run before and after the transfer. If the server returns failure for one
|
||||
of the commands, the entire operation will be aborted.
|
||||
(FTP) Send an arbitrary command to the remote FTP server. Quote commands are
|
||||
sent BEFORE the 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 to be run before and after the transfer. If the server returns
|
||||
failure for one of the commands, the entire operation will be aborted. You
|
||||
must send syntactically correct FTP commands as RFC959 defines.
|
||||
|
||||
This option can be used multiple times.
|
||||
.IP "--random-file <file>"
|
||||
|
@@ -9,7 +9,7 @@ EXTRA_DIST = README curlgtk.c sepheaders.c simple.c postit2.c \
|
||||
ftpupload.c httpput.c simplessl.c ftpgetresp.c http-post.c \
|
||||
post-callback.c multi-app.c multi-double.c multi-single.c \
|
||||
multi-post.c fopen.c simplepost.c makefile.dj curlx.c https.c \
|
||||
multi-debugcallback.c fileupload.c
|
||||
multi-debugcallback.c fileupload.c getinfo.c ftp3rdparty.c
|
||||
|
||||
all:
|
||||
@echo "done"
|
||||
|
104
docs/examples/ftp3rdparty.c
Normal file
104
docs/examples/ftp3rdparty.c
Normal file
@@ -0,0 +1,104 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <curl/types.h>
|
||||
#include <curl/easy.h>
|
||||
|
||||
/*
|
||||
* This is an example showing how to transfer a file between two remote hosts.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
char sourceFileName[] = "/tmp/file";
|
||||
char targetFileName[] = "/tmp/curlTargetTest.dat";
|
||||
char sourceHost[] = "source";
|
||||
char targetHost[] = "target";
|
||||
char sourceUserPass[] = "user:pass";
|
||||
char targetUserPass[] = "user:pass";
|
||||
char url[100];
|
||||
|
||||
struct curl_slist *source_pre_cmd = NULL;
|
||||
struct curl_slist *target_pre_cmd = NULL;
|
||||
struct curl_slist *source_post_cmd = NULL;
|
||||
struct curl_slist *target_post_cmd = NULL;
|
||||
char cmd[] = "PWD"; /* just to test */
|
||||
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
|
||||
curl = curl_easy_init();
|
||||
if (curl) {
|
||||
sprintf(url, "ftp://%s@%s/%s", targetUserPass, targetHost, targetFileName);
|
||||
printf("%s\n", url);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
|
||||
/* Set a proxy host */
|
||||
curl_easy_setopt(curl, CURLOPT_SOURCE_HOST, sourceHost);
|
||||
|
||||
/* Set a proxy user and password */
|
||||
curl_easy_setopt(curl, CURLOPT_SOURCE_USERPWD, sourceUserPass);
|
||||
|
||||
/* Set a proxy full file name */
|
||||
curl_easy_setopt(curl, CURLOPT_SOURCE_PATH, sourceFileName);
|
||||
|
||||
/* Set a proxy passive host */
|
||||
curl_easy_setopt(curl, CURLOPT_PASV_HOST, 0); /* optional */
|
||||
|
||||
/* build a list of commands to pass to libcurl */
|
||||
source_pre_cmd = curl_slist_append(source_pre_cmd, cmd);
|
||||
/* Set a proxy pre-quote command */
|
||||
curl_easy_setopt(curl, CURLOPT_SOURCE_PREQUOTE, source_pre_cmd);
|
||||
|
||||
/* build a list of commands to pass to libcurl */
|
||||
target_pre_cmd = curl_slist_append(target_pre_cmd, cmd);
|
||||
/* Set a pre-quote command */
|
||||
curl_easy_setopt(curl, CURLOPT_PREQUOTE, target_pre_cmd);
|
||||
|
||||
/* build a list of commands to pass to libcurl */
|
||||
source_post_cmd = curl_slist_append(source_post_cmd, cmd);
|
||||
/* Set a proxy post-quote command */
|
||||
curl_easy_setopt(curl, CURLOPT_SOURCE_POSTQUOTE, source_post_cmd);
|
||||
|
||||
/* build a list of commands to pass to libcurl */
|
||||
target_post_cmd = curl_slist_append(target_post_cmd, cmd);
|
||||
/* Set a post-quote command */
|
||||
curl_easy_setopt(curl, CURLOPT_POSTQUOTE, target_post_cmd);
|
||||
|
||||
/* Switch on full protocol/debug output */
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
/* clean up the FTP commands list */
|
||||
curl_slist_free_all(source_pre_cmd);
|
||||
curl_slist_free_all(target_pre_cmd);
|
||||
curl_slist_free_all(source_post_cmd);
|
||||
curl_slist_free_all(target_post_cmd);
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
if(CURLE_OK != res) {
|
||||
/* we failed */
|
||||
fprintf(stderr, "curl told us %d\n", res);
|
||||
}
|
||||
}
|
||||
|
||||
curl_global_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
37
docs/examples/getinfo.c
Normal file
37
docs/examples/getinfo.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(CURLE_OK == res) {
|
||||
char *ct;
|
||||
/* ask for the content-type */
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);
|
||||
|
||||
if((CURLE_OK == res) && ct)
|
||||
printf("We received Content-Type: %s\n", ct);
|
||||
}
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
return 0;
|
||||
}
|
@@ -5,7 +5,7 @@
|
||||
|
||||
include ../../packages/DOS/common.dj
|
||||
|
||||
CFLAGS += -I../../include
|
||||
CFLAGS += -I../../include -DFALSE=0 -DTRUE=1
|
||||
|
||||
LIBS = ../../lib/libcurl.a
|
||||
|
||||
@@ -15,14 +15,16 @@ endif
|
||||
|
||||
LIBS += $(WATT32_ROOT)/lib/libwatt.a $(ZLIB_ROOT)/libz.a
|
||||
|
||||
PROGRAMS = fopen.exe ftpget.exe ftpgetre.exe ftpuploa.exe getinmem.exe \
|
||||
http-pos.exe httpput.exe multi-ap.exe multi-do.exe \
|
||||
multi-po.exe multi-si.exe persista.exe post-cal.exe \
|
||||
postit2.exe sepheade.exe simple.exe simpless.exe
|
||||
PROGRAMS = fopen.exe ftpget.exe ftpgetresp.exe ftpupload.exe \
|
||||
getinmemory.exe http-post.exe httpput.exe multi-app.exe \
|
||||
multi-double.exe multi-post.exe multi-single.exe \
|
||||
persistant.exe post-callback.exe postit2.exe \
|
||||
sepheaders.exe simple.exe simplessl.exe https.exe \
|
||||
ftp3rdparty.exe getinfo.exe
|
||||
|
||||
all: $(PROGRAMS)
|
||||
|
||||
.c.exe:
|
||||
%.exe: %.c
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
|
||||
@echo
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,8 @@ man_MANS = curl_easy_cleanup.3 curl_easy_getinfo.3 curl_easy_init.3 \
|
||||
curl_multi_perform.3 curl_multi_remove_handle.3 curl_share_cleanup.3 \
|
||||
curl_share_init.3 curl_share_setopt.3 libcurl.3 libcurl-easy.3 \
|
||||
libcurl-multi.3 libcurl-share.3 libcurl-errors.3 curl_easy_strerror.3 \
|
||||
curl_multi_strerror.3 curl_share_strerror.3 curl_global_init_mem.3
|
||||
curl_multi_strerror.3 curl_share_strerror.3 curl_global_init_mem.3 \
|
||||
libcurl-tutorial.3 curl_easy_reset.3
|
||||
|
||||
HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \
|
||||
curl_easy_init.html curl_easy_perform.html curl_easy_setopt.html \
|
||||
@@ -30,7 +31,8 @@ HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \
|
||||
curl_share_cleanup.html curl_share_init.html curl_share_setopt.html \
|
||||
libcurl.html libcurl-multi.html libcurl-easy.html libcurl-share.html \
|
||||
libcurl-errors.html curl_easy_strerror.html curl_multi_strerror.html \
|
||||
curl_share_strerror.html curl_global_init_mem.html
|
||||
curl_share_strerror.html curl_global_init_mem.html \
|
||||
libcurl-tutorial.html curl_easy_reset.html
|
||||
|
||||
PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf \
|
||||
curl_easy_init.pdf curl_easy_perform.pdf curl_easy_setopt.pdf \
|
||||
@@ -45,7 +47,8 @@ PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf \
|
||||
curl_share_init.pdf curl_share_setopt.pdf libcurl.pdf \
|
||||
libcurl-multi.pdf libcurl-easy.pdf libcurl-share.pdf \
|
||||
libcurl-errors.pdf curl_easy_strerror.pdf curl_multi_strerror.pdf \
|
||||
curl_share_strerror.pdf curl_global_init_mem.pdf
|
||||
curl_share_strerror.pdf curl_global_init_mem.pdf libcurl-tutorial.pdf \
|
||||
curl_easy_reset.pdf
|
||||
|
||||
CLEANFILES = $(HTMLPAGES) $(PDFPAGES)
|
||||
|
||||
|
24
docs/libcurl/curl_easy_reset.3
Normal file
24
docs/libcurl/curl_easy_reset.3
Normal file
@@ -0,0 +1,24 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_easy_reset 3 "31 July 2004" "libcurl 7.12.1" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_reset - reset all options of a libcurl session handle
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
|
||||
.BI "void curl_easy_reset(CURL *"handle ");"
|
||||
|
||||
.SH DESCRIPTION
|
||||
Re-initializes all options previously set on a specified CURL handle to the
|
||||
default values. This puts back the handle to the same state as it was in when
|
||||
it was just created with \fIcurl_easy_init(3)\fP.
|
||||
|
||||
It does not change the following information kept in the handle: live
|
||||
connections, the Session ID cache, the DNS cache, the cookies and shares.
|
||||
|
||||
This function was added in libcurl 7.12.1.
|
||||
.SH RETURN VALUE
|
||||
Nothing
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_easy_init "(3)," curl_easy_cleanup "(3)," curl_easy_setopt "(3)
|
||||
|
@@ -119,6 +119,15 @@ filled with at most \fIsize\fP multiplied with \fInmemb\fP number of
|
||||
bytes. Your function must return the actual number of bytes that you stored in
|
||||
that memory area. Returning 0 will signal end-of-file to the library and cause
|
||||
it to stop the current transfer.
|
||||
|
||||
If you stop the current transfer by returning 0 "pre-maturely" (i.e before the
|
||||
server expected it, like when you've told you will upload N bytes and you
|
||||
upload less than N bytes), you may experience that the server "hangs" waiting
|
||||
for the rest of the data that won't come.
|
||||
|
||||
In libcurl 7.12.1 and later, the read callback may return
|
||||
\fICURL_READFUNC_ABORT\fP to stop the current operation at once, with a
|
||||
\fICURLE_ABORTED_BY_CALLBACK\fP error code from the transfer.
|
||||
.IP CURLOPT_READDATA
|
||||
Data pointer to pass to the file read function. Note that if you specify the
|
||||
\fICURLOPT_READFUNCTION\fP, this is the pointer you'll get as input. If you
|
||||
@@ -456,6 +465,9 @@ redirections have been followed, the next redirect will cause an error
|
||||
.IP CURLOPT_PUT
|
||||
A non-zero parameter tells the library to use HTTP PUT to transfer data. The
|
||||
data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
|
||||
|
||||
This option is deprecated and starting with version 7.12.1 you should instead
|
||||
use \fICURLOPT_UPLOAD\fP.
|
||||
.IP CURLOPT_POST
|
||||
A non-zero parameter tells the library to do a regular HTTP post. This is a
|
||||
normal application/x-www-form-urlencoded kind, which is the most commonly used
|
||||
@@ -522,6 +534,8 @@ The first line in a request (usually containing a GET or POST) is not a header
|
||||
and cannot be replaced using this option. Only the lines following the
|
||||
request-line are headers.
|
||||
|
||||
Pass a NULL to this to reset back to no custom headers.
|
||||
|
||||
\fBNOTE:\fP The most commonly replaced headers have "shortcuts" in the options
|
||||
\fICURLOPT_COOKIE\fP, \fICURLOPT_USERAGENT\fP and \fICURLOPT_REFERER\fP.
|
||||
.IP CURLOPT_HTTP200ALIASES
|
||||
@@ -692,10 +706,11 @@ want. It should be in the format "X-Y", where X or Y may be left out. HTTP
|
||||
transfers also support several intervals, separated with commas as in
|
||||
\fI"X-Y,N-M"\fP. Using this kind of multiple intervals will cause the HTTP
|
||||
server to send the response document in pieces (using standard MIME separation
|
||||
techniques).
|
||||
techniques). Pass a NULL to this option to disable the use of ranges.
|
||||
.IP CURLOPT_RESUME_FROM
|
||||
Pass a long as parameter. It contains the offset in number of bytes that you
|
||||
want the transfer to start from.
|
||||
want the transfer to start from. Set this option to 0 to make the transfer
|
||||
start from the beginning (effectively disabling resume).
|
||||
.IP CURLOPT_RESUME_FROM_LARGE
|
||||
Pass an curl_off_t as parameter. It contains the offset in number of bytes
|
||||
that you want the transfer to start from. (Added in 7.11.0)
|
||||
@@ -706,6 +721,8 @@ when doing an ftp directory listing. This is useful for doing DELETE or other
|
||||
more or less obscure HTTP requests. Don't do this at will, make sure your
|
||||
server supports the command first.
|
||||
|
||||
Restore to the internal default by setting this to NULL.
|
||||
|
||||
\fBNOTE:\fP Many people have wrongly used this option to replace the entire
|
||||
request with their own, including multiple headers and POST contents. While
|
||||
that might work in many cases, it will cause libcurl to send invalid requests
|
||||
@@ -734,7 +751,8 @@ as a curl_off_t. (Added in 7.11.0)
|
||||
.IP CURLOPT_UPLOAD
|
||||
A non-zero parameter tells the library to prepare for an upload. The
|
||||
\fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE_LARGE\fP are also interesting
|
||||
for uploads.
|
||||
for uploads. If the protocol is HTTP, uploading means using the PUT request
|
||||
unless you tell libcurl otherwise.
|
||||
.IP CURLOPT_MAXFILESIZE
|
||||
Pass a long as parameter. This allows you to specify the maximum size (in
|
||||
bytes) of a file to download. If the file requested is larger than this value,
|
||||
@@ -960,5 +978,9 @@ standard for details.
|
||||
CURLE_OK (zero) means that the option was set properly, non-zero means an
|
||||
error occurred as \fI<curl/curl.h>\fP defines. See the \fIlibcurl-errors(3)\fP
|
||||
man page for the full list with descriptions.
|
||||
|
||||
If you try to set an option that libcurl doesn't know about, perhaps because
|
||||
the library is too old to support it or the option was removed in a recent
|
||||
version, this function will return \fICURLE_FAILED_INIT\fP.
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_easy_init "(3), " curl_easy_cleanup "(3), "
|
||||
|
@@ -205,5 +205,4 @@ defines.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_easy_setopt "(3), "
|
||||
.BR curl_formparse "(3) [deprecated], "
|
||||
.BR curl_formfree "(3)"
|
||||
|
@@ -16,7 +16,7 @@
|
||||
<br><a href="libcurl-multi.html">libcurl-multi</a>
|
||||
<br><a href="libcurl-share.html">libcurl-share</a>
|
||||
<br><a href="libcurl-errors.html">libcurl-errors</a>
|
||||
<br><a href="../libcurl-the-guide">libcurl-the-guide</a> (plain text)
|
||||
<br><a href="libcurl-tutorial.html">libcurl-tutorial</a>
|
||||
|
||||
<H2>Library Functions (A-Z)</H2>
|
||||
<a href="curl_easy_cleanup.html">curl_easy_cleanup</A>
|
||||
@@ -24,6 +24,7 @@
|
||||
<br><a href="curl_easy_getinfo.html">curl_easy_getinfo</A>
|
||||
<br><a href="curl_easy_init.html">curl_easy_init</A>
|
||||
<br><a href="curl_easy_perform.html">curl_easy_perform</A>
|
||||
<br><a href="curl_easy_reset.html">curl_easy_reset</A>
|
||||
<br><a href="curl_easy_setopt.html">curl_easy_setopt</A>
|
||||
<br><a href="curl_easy_strerror.html">curl_easy_strerror</A>
|
||||
<br><a href="curl_escape.html">curl_escape</A>
|
||||
@@ -34,6 +35,7 @@
|
||||
<br><a href="curl_getenv.html">curl_getenv</A>
|
||||
<br><a href="curl_global_cleanup.html">curl_global_cleanup</A>
|
||||
<br><a href="curl_global_init.html">curl_global_init</A>
|
||||
<br><a href="curl_global_init_mem.html">curl_global_init_mem</A>
|
||||
<br><a href="curl_mprintf.html">curl_mprintf</A>
|
||||
<br><a href="curl_multi_add_handle.html">curl_multi_add_handle</a>
|
||||
<br><a href="curl_multi_cleanup.html">curl_multi_cleanup</a>
|
||||
|
@@ -8,16 +8,11 @@ libcurl-multi \- how to use the multi interface
|
||||
.SH DESCRIPTION
|
||||
This is an overview on how to use the libcurl multi interface in your C
|
||||
programs. There are specific man pages for each function mentioned in
|
||||
here. There's also the libcurl-the-guide document for a complete tutorial to
|
||||
programming with libcurl and the \fIlibcurl(3)\fP man page for an overview of
|
||||
the libcurl easy interface.
|
||||
here. There's also the \fIlibcurl-tutorial(3)\fP man page for a complete
|
||||
tutorial to programming with libcurl and the \fIlibcurl-easy(3)\fP man page
|
||||
for an overview of the libcurl easy interface.
|
||||
|
||||
All functions in the multi interface are prefixed with curl_multi.
|
||||
.SH "PLEASE NOTICE"
|
||||
The multi interface is a rather new member of the libcurl family. It has not
|
||||
yet been very widely used. It may still be a few more bugs lurking in there
|
||||
than we are used to. That said, it might also just work in every aspect you
|
||||
try it. Please report all bugs and oddities you see.
|
||||
.SH "OBJECTIVES"
|
||||
The multi interface introduces several new abilities that the easy interface
|
||||
refuses to offer. They are mainly:
|
||||
|
1170
docs/libcurl/libcurl-tutorial.3
Normal file
1170
docs/libcurl/libcurl-tutorial.3
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,19 +1,17 @@
|
||||
.\" You can view this file with:
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH libcurl 3 "19 March 2002" "libcurl 7.9.6" "libcurl overview"
|
||||
.SH NAME
|
||||
libcurl \- client-side URL transfers
|
||||
.SH DESCRIPTION
|
||||
This is an overview on how to use libcurl in your C programs. There are
|
||||
This is an short overview on how to use libcurl in your C programs. There are
|
||||
specific man pages for each function mentioned in here. There are also the
|
||||
\fIlibcurl-easy(3)\fP man page, the \fIlibcurl-multi(3)\fP man page, the
|
||||
\fIlibcurl-share(3)\fP man page and the \fIlibcurl-the-guide\fP document for
|
||||
further reading on how to do programming with libcurl.
|
||||
\fIlibcurl-share(3)\fP man page and the \fIlibcurl-tutorial(3)\fP man page for
|
||||
in-depth understanding on how to program with libcurl.
|
||||
|
||||
There exist more than a dozen custom bindings that bring libcurl access to
|
||||
your favourite language. Look elsewhere for documentation on those.
|
||||
There are more than a twenty custom bindings available that bring libcurl
|
||||
access to your favourite language. Look elsewhere for documentation on those.
|
||||
|
||||
All applications that use libcurl should call \fIcurl_global_init(3)\fP
|
||||
exactly once before any libcurl function can be used. After all usage of
|
||||
|
@@ -52,11 +52,11 @@ extern "C" {
|
||||
* platforms. We also provide a CURL_FORMAT_OFF_T define to use in *printf
|
||||
* format strings when outputting a variable of type curl_off_t.
|
||||
*/
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) || defined(__LCC__)
|
||||
/* MSVC */
|
||||
typedef signed __int64 curl_off_t;
|
||||
#define CURL_FORMAT_OFF_T "%I64d"
|
||||
#else /* MSC_VER */
|
||||
#else /* _MSC_VER || __LCC__ */
|
||||
#if (defined(__GNUC__) && defined(WIN32)) || defined(__WATCOMC__)
|
||||
/* gcc on windows or Watcom */
|
||||
typedef long long curl_off_t;
|
||||
@@ -88,7 +88,7 @@ extern "C" {
|
||||
#define CURL_FORMAT_OFF_T "%ld"
|
||||
#endif
|
||||
#endif /* GCC or Watcom on Windows */
|
||||
#endif /* MSC_VER */
|
||||
#endif /* _MSC_VER || __LCC__ */
|
||||
|
||||
#ifdef UNDEF_FILE_OFFSET_BITS
|
||||
/* this was defined above for our checks, undefine it again */
|
||||
@@ -143,6 +143,9 @@ typedef size_t (*curl_write_callback)(char *buffer,
|
||||
size_t nitems,
|
||||
void *outstream);
|
||||
|
||||
/* This is a brand new return code for the read callback that will signal
|
||||
the caller to immediately abort the current transfer. */
|
||||
#define CURL_READFUNC_ABORT 0x10000000
|
||||
typedef size_t (*curl_read_callback)(char *buffer,
|
||||
size_t size,
|
||||
size_t nitems,
|
||||
@@ -173,6 +176,8 @@ typedef enum {
|
||||
CURLINFO_HEADER_OUT, /* 2 */
|
||||
CURLINFO_DATA_IN, /* 3 */
|
||||
CURLINFO_DATA_OUT, /* 4 */
|
||||
CURLINFO_SSL_DATA_IN, /* 5 */
|
||||
CURLINFO_SSL_DATA_OUT, /* 6 */
|
||||
CURLINFO_END
|
||||
} curl_infotype;
|
||||
|
||||
@@ -327,7 +332,7 @@ typedef enum {
|
||||
* platforms.
|
||||
*/
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
|
||||
defined(__HP_aCC) || defined(__BORLANDC__)
|
||||
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__)
|
||||
/* This compiler is believed to have an ISO compatible preprocessor */
|
||||
#define CURL_ISOCPP
|
||||
#else
|
||||
@@ -518,7 +523,7 @@ typedef enum {
|
||||
CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
|
||||
|
||||
CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
|
||||
CINIT(PUT, LONG, 54), /* PUT the input file */
|
||||
CINIT(PUT, LONG, 54), /* HTTP PUT */
|
||||
|
||||
/* 55 = OBSOLETE */
|
||||
|
||||
@@ -564,9 +569,9 @@ typedef enum {
|
||||
/* Maximum number of http redirects to follow */
|
||||
CINIT(MAXREDIRS, LONG, 68),
|
||||
|
||||
/* Pass a pointer to a time_t to get a possible date of the requested
|
||||
document! Pass a NULL to shut it off. */
|
||||
CINIT(FILETIME, OBJECTPOINT, 69),
|
||||
/* Pass a long set to 1 to get the date of the requested document (if
|
||||
possible)! Pass a zero to shut it off. */
|
||||
CINIT(FILETIME, LONG, 69),
|
||||
|
||||
/* This points to a linked list of telnet options */
|
||||
CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
|
||||
@@ -780,6 +785,34 @@ typedef enum {
|
||||
/* Enable/disable the TCP Nagle algorithm */
|
||||
CINIT(TCP_NODELAY, LONG, 121),
|
||||
|
||||
/* When doing 3rd party transfer, set the source host name with this */
|
||||
CINIT(SOURCE_HOST, OBJECTPOINT, 122),
|
||||
|
||||
/* When doing 3rd party transfer, set the source user and password with
|
||||
this */
|
||||
CINIT(SOURCE_USERPWD, OBJECTPOINT, 123),
|
||||
|
||||
/* When doing 3rd party transfer, set the source file path with this */
|
||||
CINIT(SOURCE_PATH, OBJECTPOINT, 124),
|
||||
|
||||
/* When doing 3rd party transfer, set the source server's port number
|
||||
with this */
|
||||
CINIT(SOURCE_PORT, LONG, 125),
|
||||
|
||||
/* When doing 3rd party transfer, decide which server that should get the
|
||||
PASV command (and the other gets the PORT).
|
||||
0 (default) - The target host issues PASV.
|
||||
1 - The source host issues PASV */
|
||||
CINIT(PASV_HOST, LONG, 126),
|
||||
|
||||
/* When doing 3rd party transfer, set the source pre-quote linked list
|
||||
of commands with this */
|
||||
CINIT(SOURCE_PREQUOTE, OBJECTPOINT, 127),
|
||||
|
||||
/* When doing 3rd party transfer, set the source post-quote linked list
|
||||
of commands with this */
|
||||
CINIT(SOURCE_POSTQUOTE, OBJECTPOINT, 128),
|
||||
|
||||
CURLOPT_LASTENTRY /* the last unused */
|
||||
} CURLoption;
|
||||
|
||||
@@ -937,6 +970,7 @@ typedef enum {
|
||||
CURL_FORMADD_UNKNOWN_OPTION,
|
||||
CURL_FORMADD_INCOMPLETE,
|
||||
CURL_FORMADD_ILLEGAL_ARRAY,
|
||||
CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
|
||||
|
||||
CURL_FORMADD_LAST /* last */
|
||||
} CURLFORMcode;
|
||||
|
@@ -1,10 +1,10 @@
|
||||
#ifndef __CURL_CURLVER_H
|
||||
#define __CURL_CURLVER_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
@@ -12,7 +12,7 @@
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.12.0-CVS"
|
||||
#define LIBCURL_VERSION "7.12.1-CVS"
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
@@ -44,12 +44,12 @@
|
||||
always a greater number in a more recent release. It makes comparisons with
|
||||
greater than and less than work.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x070c00
|
||||
#define LIBCURL_VERSION_NUM 0x070c01
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 12
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
#define LIBCURL_VERSION_PATCH 1
|
||||
|
||||
#endif /* __CURL_CURLVER_H */
|
||||
|
@@ -1,10 +1,10 @@
|
||||
#ifndef __CURL_EASY_H
|
||||
#define __CURL_EASY_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
@@ -12,7 +12,7 @@
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
@@ -61,6 +61,19 @@ CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
|
||||
*/
|
||||
CURL* curl_easy_duphandle(CURL *curl);
|
||||
|
||||
/*
|
||||
* NAME curl_easy_reset()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Re-initializes a CURL handle to the default values. This puts back the
|
||||
* handle to the same state as it was in when it was just created.
|
||||
*
|
||||
* It does keep: live connections, the Session ID cache, the DNS cache and the
|
||||
* cookies.
|
||||
*/
|
||||
void curl_easy_reset(CURL *curl);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -24,16 +24,16 @@ AUTOMAKE_OPTIONS = foreign nostdinc
|
||||
|
||||
DSP = curllib.dsp
|
||||
|
||||
EXTRA_DIST = getdate.y Makefile.b32 Makefile.b32.resp Makefile.m32 \
|
||||
EXTRA_DIST = getdate.y Makefile.b32 Makefile.m32 \
|
||||
Makefile.vc6 Makefile.riscos libcurl.def $(DSP) curllib.dsw \
|
||||
config-vms.h config-win32.h config-riscos.h config-mac.h config.h.in \
|
||||
ca-bundle.crt README.encoding README.memoryleak README.ares \
|
||||
README.curlx makefile.dj config.dj libcurl.framework.make \
|
||||
libcurl.plist libcurl.rc config-amigaos.h amigaos.c amigaos.h \
|
||||
makefile.amiga config-netware.h Makefile.netware nwlib.c libcurl.imp \
|
||||
makefile.amiga Makefile.netware nwlib.c libcurl.imp \
|
||||
msvcproj.head msvcproj.foot
|
||||
|
||||
CLEANFILES = $(DSP)
|
||||
CLEANFILES = $(DSP) getdate.c
|
||||
|
||||
lib_LTLIBRARIES = libcurl.la
|
||||
|
||||
@@ -85,28 +85,12 @@ endif
|
||||
|
||||
libcurl_la_LDFLAGS = $(UNDEF) $(VERSION) $(MIMPURE)
|
||||
|
||||
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h base64.h hostip.h \
|
||||
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
|
||||
if2ip.h speedcheck.h urldata.h getdate.h ldap.h ssluse.h escape.h \
|
||||
telnet.h getinfo.h strequal.h security.h krb4.h memdebug.h \
|
||||
inet_ntoa_r.h http_chunks.h strtok.h connect.h llist.h hash.h \
|
||||
content_encoding.h share.h md5.h http_digest.h http_negotiate.h \
|
||||
http_ntlm.h ca-bundle.h inet_pton.h strtoofft.h strerror.h \
|
||||
inet_ntop.h curlx.h memory.h setup.h transfer.h
|
||||
|
||||
CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
|
||||
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \
|
||||
getdate.c ldap.c ssluse.c version.c getenv.c escape.c mprintf.c \
|
||||
telnet.c netrc.c getinfo.c transfer.c strequal.c easy.c security.c \
|
||||
krb4.c memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c \
|
||||
multi.c content_encoding.c share.c http_digest.c md5.c \
|
||||
http_negotiate.c http_ntlm.c inet_pton.c strtoofft.c strerror.c \
|
||||
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c \
|
||||
inet_ntop.c
|
||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||
include Makefile.inc
|
||||
|
||||
libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
|
||||
|
||||
WIN32SOURCES = $(CSOURCES)
|
||||
WIN32SOURCES = $(CSOURCES) libcurl.def
|
||||
WIN32HEADERS = $(HHEADERS) config-win32.h
|
||||
|
||||
BUILT_SOURCES = $(srcdir)/getdate.c $(top_builddir)/lib/ca-bundle.h
|
||||
|
181
lib/Makefile.b32
181
lib/Makefile.b32
@@ -1,90 +1,91 @@
|
||||
############################################################
|
||||
# $Id$
|
||||
#
|
||||
# Makefile.b32 - Borland's C++ Compiler 5.X
|
||||
#
|
||||
# 'lib' directory
|
||||
#
|
||||
# Requires 'Makefile.b32.resp'
|
||||
#
|
||||
# Written by Jaepil Kim, pit@paradise.net.nz
|
||||
############################################################
|
||||
|
||||
# Setup environment
|
||||
CXX = bcc32
|
||||
RM = del
|
||||
LIB = tlib
|
||||
TOPDIR = ..
|
||||
CURNTDIR = .
|
||||
CXXFLAGS = -5 -O2 -w-aus -w-ccc -w-csu -w-par -w-pia -w-rch -w-inl -w-ngu \
|
||||
-w-pro -tWM
|
||||
|
||||
# If you build without SSL support, remove "-DUSE_SSLEAY" from the line below.
|
||||
DEFINES = -DLIBCURL_BIGENDIAN=0 -DNDEBUG -DWIN32 -DCONSOLE -DMBCS \
|
||||
-DUSE_SSLEAY
|
||||
INCDIRS = -I$(CURNTDIR);$(TOPDIR)\include\
|
||||
|
||||
# 'BCCDIR' has to be set up in your c:\autoexec.bat
|
||||
# i.e. SET BCCDIR = c:\Borland\BCC55
|
||||
# where c:\Borland\BCC55 is the compiler is installed
|
||||
LINKLIB = $(BCCDIR)\lib\psdk\ws2_32.lib
|
||||
LIBCURLLIB = libcurl.lib
|
||||
|
||||
.SUFFIXES: .c
|
||||
|
||||
SOURCES = \
|
||||
base64.c \
|
||||
md5.c \
|
||||
cookie.c \
|
||||
transfer.c \
|
||||
escape.c \
|
||||
formdata.c \
|
||||
ftp.c \
|
||||
http.c \
|
||||
http_chunks.c \
|
||||
http_digest.c \
|
||||
http_ntlm.c \
|
||||
ldap.c \
|
||||
dict.c \
|
||||
telnet.c \
|
||||
getdate.c \
|
||||
getenv.c \
|
||||
hostip.c \
|
||||
if2ip.c \
|
||||
mprintf.c \
|
||||
netrc.c \
|
||||
progress.c \
|
||||
sendf.c \
|
||||
inet_pton.c \
|
||||
speedcheck.c \
|
||||
ssluse.c \
|
||||
timeval.c \
|
||||
url.c \
|
||||
file.c \
|
||||
getinfo.c \
|
||||
version.c \
|
||||
easy.c \
|
||||
strequal.c \
|
||||
strtok.c \
|
||||
strtoofft.c \
|
||||
connect.c \
|
||||
hash.c \
|
||||
share.c \
|
||||
llist.c \
|
||||
multi.c \
|
||||
content_encoding.c
|
||||
|
||||
OBJECTS = $(SOURCES:.c=.obj)
|
||||
|
||||
.c.obj:
|
||||
$(CXX) -c $(INCDIRS) $(CXXFLAGS) $(DEFINES) $<
|
||||
|
||||
all: $(LIBCURLLIB)
|
||||
|
||||
clean:
|
||||
-$(RM) $(LIBCURLLIB)
|
||||
-$(RM) *.obj
|
||||
|
||||
$(LIBCURLLIB): $(LINKLIB) $(OBJECTS) Makefile.b32.resp
|
||||
-$(RM) $(LIBCURLLIB)
|
||||
$(LIB) $(LIBCURLLIB) @Makefile.b32.resp
|
||||
############################################################
|
||||
# $Id$
|
||||
#
|
||||
# Makefile.b32 - Borland's C++ Compiler 5.X
|
||||
#
|
||||
# 'lib' directory
|
||||
#
|
||||
# 'BCCDIR' has to be set up to point to the base directory
|
||||
# of the compiler, i.e. SET BCCDIR = c:\Borland\BCC55
|
||||
# where c:\Borland\BCC55 is the compiler is installed
|
||||
#
|
||||
# Written by Jaepil Kim, pit@paradise.net.nz
|
||||
############################################################
|
||||
|
||||
# Edit the path below to point to the base of your Zlib sources.
|
||||
!ifndef ZLIB_PATH
|
||||
ZLIB_PATH = ../../zlib-1.2.1
|
||||
!endif
|
||||
|
||||
# Edit the path below to point to the base of your OpenSSL package.
|
||||
!ifndef OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../openssl-0.9.7d
|
||||
!endif
|
||||
|
||||
# Set libcurl's name
|
||||
LIBCURLLIB = libcurl.lib
|
||||
LIBCURLDLL = libcurl.dll
|
||||
|
||||
# Setup environment
|
||||
CXX = bcc32
|
||||
LD = bcc32
|
||||
CP = copy
|
||||
RM = del
|
||||
LIB = tlib
|
||||
TOPDIR = ..
|
||||
CURNTDIR = .
|
||||
|
||||
CXXFLAGS = -q -5 -O2 -w-aus -w-ccc -w-csu -w-par -w-pia -w-rch -w-inl -w-ngu -w-pro -tWM
|
||||
LIBFLAGS = /C /P32
|
||||
LDFLAGS = -q -lq -laa -tWD
|
||||
|
||||
INCDIRS = -I$(CURNTDIR);$(TOPDIR)/include
|
||||
LINKLIB = $(BCCDIR)/lib/cw32mt.lib
|
||||
|
||||
# If you build with SSL support, set WITH_SSL=1
|
||||
DEFINES = -DLIBCURL_BIGENDIAN=0 -DNDEBUG -DWIN32 -D_CONSOLE -D_MBCS
|
||||
!ifdef WITH_ZLIB
|
||||
DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H
|
||||
INCDIRS = $(INCDIRS);$(ZLIB_PATH)
|
||||
# LINKLIB = $(LINKLIB) $(ZLIB_PATH)/zlib.lib
|
||||
!endif
|
||||
!ifdef WITH_SSL
|
||||
DEFINES = $(DEFINES) -DUSE_SSLEAY
|
||||
INCDIRS = $(INCDIRS);$(OPENSSL_PATH)/inc32;$(OPENSSL_PATH)/inc32/openssl
|
||||
# LINKLIB = $(LINKLIB) $(OPENSSL_PATH)/out32/ssleay32.lib $(OPENSSL_PATH)/out32/libeay32.lib
|
||||
!endif
|
||||
|
||||
.autodepend
|
||||
|
||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||
!include Makefile.inc
|
||||
|
||||
OBJECTS = $(CSOURCES:.c=.obj)
|
||||
|
||||
.c.obj:
|
||||
$(CXX) -c $(INCDIRS) $(CXXFLAGS) $(DEFINES) $<
|
||||
|
||||
all: $(LIBCURLLIB)
|
||||
|
||||
clean:
|
||||
-$(RM) $(LIBCURLLIB)
|
||||
-$(RM) *.obj
|
||||
-$(RM) getdate.c
|
||||
|
||||
$(LIBCURLLIB): $(OBJECTS)
|
||||
@-$(RM) $@
|
||||
$(LIB) $(LIBFLAGS) $@ @&&!
|
||||
+$(**: = &^
|
||||
+)
|
||||
!
|
||||
|
||||
$(LIBCURLDLL): $(OBJECTS) $(LINKLIB)
|
||||
@-$(RM) $@
|
||||
$(LD) $(LDFLAGS) -e$@ $**
|
||||
|
||||
getdate.c: getdate.c.cvs
|
||||
@echo Creating $@
|
||||
@-$(RM) getdate.y
|
||||
@$(CP) $** $@
|
||||
|
||||
|
||||
|
@@ -1,39 +0,0 @@
|
||||
+base64.obj &
|
||||
+md5.obj &
|
||||
+cookie.obj &
|
||||
+transfer.obj &
|
||||
+escape.obj &
|
||||
+formdata.obj &
|
||||
+ftp.obj &
|
||||
+http.obj &
|
||||
+http_chunks.obj &
|
||||
+http_digest.obj &
|
||||
+ldap.obj &
|
||||
+dict.obj &
|
||||
+telnet.obj &
|
||||
+getdate.obj &
|
||||
+getenv.obj &
|
||||
+getpass.obj &
|
||||
+hostip.obj &
|
||||
+if2ip.obj &
|
||||
+mprintf.obj &
|
||||
+netrc.obj &
|
||||
+progress.obj &
|
||||
+sendf.obj &
|
||||
+speedcheck.obj &
|
||||
+ssluse.obj &
|
||||
+timeval.obj &
|
||||
+url.obj &
|
||||
+file.obj &
|
||||
+getinfo.obj &
|
||||
+version.obj &
|
||||
+easy.obj &
|
||||
+strequal.obj &
|
||||
+strtok.obj &
|
||||
+strtoofft.obj &
|
||||
+connect.obj &
|
||||
+hash.obj &
|
||||
+share.obj &
|
||||
+llist.obj &
|
||||
+multi.obj &
|
||||
+content_encoding.obj
|
22
lib/Makefile.inc
Normal file
22
lib/Makefile.inc
Normal file
@@ -0,0 +1,22 @@
|
||||
# ./lib/Makefile.inc
|
||||
|
||||
CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
|
||||
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \
|
||||
getdate.c ldap.c ssluse.c version.c getenv.c escape.c mprintf.c \
|
||||
telnet.c netrc.c getinfo.c transfer.c strequal.c easy.c security.c \
|
||||
krb4.c memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c \
|
||||
multi.c content_encoding.c share.c http_digest.c md5.c \
|
||||
http_negotiate.c http_ntlm.c inet_pton.c strtoofft.c strerror.c \
|
||||
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c \
|
||||
inet_ntop.c
|
||||
|
||||
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h base64.h hostip.h \
|
||||
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
|
||||
if2ip.h speedcheck.h urldata.h getdate.h ldap.h ssluse.h escape.h \
|
||||
telnet.h getinfo.h strequal.h security.h krb4.h memdebug.h \
|
||||
inet_ntoa_r.h http_chunks.h strtok.h connect.h llist.h hash.h \
|
||||
content_encoding.h share.h md5.h http_digest.h http_negotiate.h \
|
||||
http_ntlm.h ca-bundle.h inet_pton.h strtoofft.h strerror.h \
|
||||
inet_ntop.h curlx.h memory.h setup.h transfer.h
|
||||
|
||||
|
@@ -1,19 +1,26 @@
|
||||
#############################################################
|
||||
# $Id$
|
||||
#
|
||||
## Makefile for building libcurl.a with MingW32 (GCC-3.2) and
|
||||
## optionally OpenSSL (0.9.7)
|
||||
##
|
||||
## Use: make -f Makefile.m32
|
||||
##
|
||||
## Comments to: Troy Engel <tengel@sonic.net> or
|
||||
## Joern Hartroth <hartroth@acm.org>
|
||||
|
||||
ifndef OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../openssl-0.9.7d
|
||||
endif
|
||||
ifndef ZLIB_PATH
|
||||
ZLIB_PATH = ../../zlib-1.2.1
|
||||
endif
|
||||
|
||||
CC = gcc
|
||||
AR = ar
|
||||
RM = rm -f
|
||||
RANLIB = ranlib
|
||||
STRIP = strip -g
|
||||
OPENSSL_PATH = ../../openssl-0.9.7d
|
||||
ZLIB_PATH = ../../zlib-1.2.1
|
||||
|
||||
########################################################
|
||||
## Nothing more to do below this line!
|
||||
@@ -32,36 +39,13 @@ ifdef ZLIB
|
||||
endif
|
||||
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
|
||||
|
||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||
include Makefile.inc
|
||||
|
||||
libcurl_a_OBJECTS := $(patsubst %.c,%.o,$(strip $(CSOURCES)))
|
||||
|
||||
libcurl_a_LIBRARIES = libcurl.a
|
||||
|
||||
libcurl_a_SOURCES = arpa_telnet.h file.c 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 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 \
|
||||
netrc.c telnet.h getinfo.c strequal.c strequal.h easy.c \
|
||||
security.h security.c krb4.h krb4.c memdebug.h memdebug.c \
|
||||
inet_ntoa_r.h http_chunks.h http_chunks.c \
|
||||
strtok.c connect.c hash.c llist.c multi.c share.c share.h \
|
||||
content_encoding.h content_encoding.c http_digest.h http_digest.c \
|
||||
http_negotiate.c http_negotiate.h http_ntlm.c http_ntlm.h md5.h \
|
||||
md5.c strtoofft.c inet_pton.c
|
||||
|
||||
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 \
|
||||
speedcheck.o getdate.o transfer.o ldap.o ssluse.o version.o \
|
||||
getenv.o escape.o mprintf.o telnet.o netrc.o getinfo.o \
|
||||
strequal.o easy.o security.o krb4.o memdebug.o http_chunks.o \
|
||||
strtok.o connect.o hash.o llist.o multi.o share.o \
|
||||
content_encoding.o http_digest.o http_negotiate.o http_ntlm.o md5.o \
|
||||
strtoofft.o inet_pton.o
|
||||
|
||||
LIBRARIES = $(libcurl_a_LIBRARIES)
|
||||
SOURCES = $(libcurl_a_SOURCES)
|
||||
OBJECTS = $(libcurl_a_OBJECTS)
|
||||
|
||||
libcurl_a_DEPENDENCIES = $(strip $(CSOURCES) $(HHEADERS))
|
||||
|
||||
all: libcurl.a libcurl.dll libcurldll.a
|
||||
|
||||
|
@@ -8,11 +8,21 @@
|
||||
#################################################################
|
||||
|
||||
# Edit the path below to point to the base of your Novell NDK.
|
||||
BASE = c:/novell
|
||||
INSTDIR = s:/libcurl
|
||||
ifndef NDKBASE
|
||||
NDKBASE = c:/novell
|
||||
endif
|
||||
|
||||
# Edit the path below to point to the base of your Zlib sources.
|
||||
ZLIB_PATH = ../../../cw/zlib-src-1.1.4
|
||||
#ZLIB_PATH = ../../zlib-1.2.1
|
||||
|
||||
# Edit the path below to point to the base of your OpenSSL package.
|
||||
ifndef OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../openssl-0.9.7d
|
||||
endif
|
||||
|
||||
ifndef INSTDIR
|
||||
INSTDIR = ../curl-$(LIBCURL_VERSION_STR)-bin-nw
|
||||
endif
|
||||
|
||||
# Edit the vars below to change NLM target settings.
|
||||
TARGET = libcurl
|
||||
@@ -22,7 +32,6 @@ DESCR = cURL libcurl $(LIBCURL_VERSION_STR) - http://curl.haxx.se
|
||||
MTSAFE = YES
|
||||
STACK = 64000
|
||||
SCREEN = none
|
||||
#MODULES = libz.nlm
|
||||
EXPORTS = @libcurl.imp
|
||||
|
||||
# Edit the var below to point to your lib architecture.
|
||||
@@ -33,6 +42,7 @@ endif
|
||||
# must be equal to DEBUG or NDEBUG
|
||||
DB = NDEBUG
|
||||
# DB = DEBUG
|
||||
# DB = CURLDEBUG
|
||||
# Optimization: -O<n> or debugging: -g
|
||||
ifeq ($(DB),NDEBUG)
|
||||
OPT = -O2
|
||||
@@ -42,7 +52,7 @@ else
|
||||
OBJDIR = debug
|
||||
endif
|
||||
|
||||
# Include the version info retrieved from jk_version.h
|
||||
# Include the version info retrieved from curlver.h
|
||||
-include $(OBJDIR)/version.inc
|
||||
|
||||
# The following line defines your compiler.
|
||||
@@ -51,156 +61,154 @@ ifdef METROWERKS
|
||||
else
|
||||
CC = gcc
|
||||
endif
|
||||
YACC = bison -y
|
||||
CP = cp -afv
|
||||
# RM = rm -f
|
||||
# CP = cp -fv
|
||||
# if you want to mark the target as MTSAFE you will need a tool for
|
||||
# generating the xdc data for the linker; here's a minimal tool:
|
||||
# http://www.gknw.de/development/prgtools/mkxdc.zip
|
||||
# http://www.gknw.com/development/prgtools/mkxdc.zip
|
||||
MPKXDC = mkxdc
|
||||
|
||||
# Global flags for all compilers
|
||||
CFLAGS = $(OPT) -D$(DB) -DNETWARE -nostdinc
|
||||
#CFLAGS += -DHAVE_LIBZ
|
||||
CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
|
||||
|
||||
ifeq ($(CC),mwccnlm)
|
||||
LD = mwldnlm
|
||||
LDFLAGS = -nostdlib $(PRELUDE) $(OBJDIR)/*.o -o $(OBJDIR)/$(TARGET).nlm -commandfile
|
||||
CFLAGS += -gccinc -inline off -opt nointrinsics
|
||||
LDFLAGS = -nostdlib $(PRELUDE) $(OBJL) -o $(TARGET).nlm -commandfile
|
||||
AR = mwldnlm
|
||||
ARFLAGS = -type library -w nocmdline $(OBJS) -o
|
||||
CFLAGS += -msgstyle gcc -gccinc -inline off -opt nointrinsics -proc 586
|
||||
CFLAGS += -relax_pointers
|
||||
#CFLAGS += -w on
|
||||
ifeq ($(LIBARCH),LIBC)
|
||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.o
|
||||
CFLAGS += -align 4 -inst mmx -proc 686
|
||||
CFLAGS += -D_POSIX_SOURCE
|
||||
# CFLAGS += -D__ANSIC__
|
||||
CFLAGS += -align 4
|
||||
else
|
||||
PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
|
||||
# CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
|
||||
CFLAGS += -align 1 -proc 586
|
||||
CFLAGS += -align 1
|
||||
endif
|
||||
else
|
||||
LD = nlmconv
|
||||
LDFLAGS = -T
|
||||
AR = ar
|
||||
ARFLAGS = -cq
|
||||
CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return
|
||||
CFLAGS += -Wall # -pedantic
|
||||
ifeq ($(LIBARCH),LIBC)
|
||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
||||
CFLAGS += -D_POSIX_SOURCE
|
||||
# CFLAGS += -D__ANSIC__
|
||||
else
|
||||
PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
|
||||
CFLAGS += -include $(BASE)/nlmconv/genlm.h
|
||||
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
|
||||
endif
|
||||
endif
|
||||
|
||||
LDLIBS =
|
||||
|
||||
NDK_ROOT = $(BASE)/ndk
|
||||
NDK_ROOT = $(NDKBASE)/ndk
|
||||
SDK_CLIB = $(NDK_ROOT)/nwsdk
|
||||
SDK_LIBC = $(NDK_ROOT)/libc
|
||||
SDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
|
||||
CURL_INC = ../include
|
||||
|
||||
INCLUDES = -I$(CURL_INC)
|
||||
INCLUDES += -I$(ZLIB_PATH)
|
||||
INCLUDES = -I. -I../include
|
||||
|
||||
ifdef WITH_ARES
|
||||
INCLUDES += -I../ares
|
||||
LIBCARES = ../ares/libcares.lib
|
||||
endif
|
||||
ifdef ZLIB_PATH
|
||||
INCLUDES += -I$(ZLIB_PATH)
|
||||
IMPORTS = @$(ZLIB_PATH)/nw/zlib.imp
|
||||
MODULES = libz.nlm
|
||||
endif
|
||||
ifdef SSL
|
||||
INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_libc -I$(OPENSSL_PATH)/outinc_nw_libc/openssl
|
||||
LIBSSL = $(OPENSSL_PATH)/out_nw_libc/crypto.lib $(OPENSSL_PATH)/out_nw_libc/ssl.lib
|
||||
endif
|
||||
|
||||
ifeq ($(LIBARCH),LIBC)
|
||||
INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
|
||||
INCLUDES += -I$(SDK_LIBC)/include/winsock
|
||||
INCLUDES += -I$(SDK_LDAP)/libc/inc
|
||||
# INCLUDES += -I$(SDK_LDAP)/libc/inc
|
||||
CFLAGS += -D_POSIX_SOURCE
|
||||
# CFLAGS += -D__ANSIC__
|
||||
else
|
||||
INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
|
||||
# INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
|
||||
INCLUDES += -I$(SDK_LDAP)/clib/inc
|
||||
# INCLUDES += -I$(SDK_LDAP)/clib/inc
|
||||
CFLAGS += -DNETDB_USE_INTERNET
|
||||
endif
|
||||
CFLAGS += $(INCLUDES)
|
||||
|
||||
ifeq ($(MTSAFE),YES)
|
||||
XDCOPT = -n
|
||||
endif
|
||||
ifeq ($(MTSAFE),NO)
|
||||
XDCOPT = -u
|
||||
endif
|
||||
ifdef XDCOPT
|
||||
XDCDATA = $(OBJDIR)/$(TARGET).xdc
|
||||
endif
|
||||
|
||||
ifeq ($(OSTYPE),linux)
|
||||
ifeq ($(findstring linux,$(OSTYPE)),linux)
|
||||
DL = '
|
||||
-include $(BASE)/nlmconv/ncpfs.inc
|
||||
#-include $(NDKBASE)/nlmconv/ncpfs.inc
|
||||
endif
|
||||
|
||||
OBJS = \
|
||||
$(OBJDIR)/file.o \
|
||||
$(OBJDIR)/timeval.o \
|
||||
$(OBJDIR)/base64.o \
|
||||
$(OBJDIR)/hostip.o \
|
||||
$(OBJDIR)/progress.o \
|
||||
$(OBJDIR)/formdata.o \
|
||||
$(OBJDIR)/cookie.o \
|
||||
$(OBJDIR)/http.o \
|
||||
$(OBJDIR)/sendf.o \
|
||||
$(OBJDIR)/ftp.o \
|
||||
$(OBJDIR)/url.o \
|
||||
$(OBJDIR)/dict.o \
|
||||
$(OBJDIR)/if2ip.o \
|
||||
$(OBJDIR)/speedcheck.o \
|
||||
$(OBJDIR)/getdate.o \
|
||||
$(OBJDIR)/transfer.o \
|
||||
$(OBJDIR)/ldap.o \
|
||||
$(OBJDIR)/ssluse.o \
|
||||
$(OBJDIR)/version.o \
|
||||
$(OBJDIR)/getenv.o \
|
||||
$(OBJDIR)/escape.o \
|
||||
$(OBJDIR)/mprintf.o \
|
||||
$(OBJDIR)/telnet.o \
|
||||
$(OBJDIR)/netrc.o \
|
||||
$(OBJDIR)/getinfo.o \
|
||||
$(OBJDIR)/strequal.o \
|
||||
$(OBJDIR)/easy.o \
|
||||
$(OBJDIR)/security.o \
|
||||
$(OBJDIR)/krb4.o \
|
||||
$(OBJDIR)/memdebug.o \
|
||||
$(OBJDIR)/http_chunks.o \
|
||||
$(OBJDIR)/strtok.o \
|
||||
$(OBJDIR)/connect.o \
|
||||
$(OBJDIR)/hash.o \
|
||||
$(OBJDIR)/llist.o \
|
||||
$(OBJDIR)/multi.o \
|
||||
$(OBJDIR)/share.o \
|
||||
$(OBJDIR)/content_encoding.o \
|
||||
$(OBJDIR)/http_digest.o \
|
||||
$(OBJDIR)/http_negotiate.o \
|
||||
$(OBJDIR)/http_ntlm.o \
|
||||
$(OBJDIR)/md5.o \
|
||||
$(OBJDIR)/strtoofft.o \
|
||||
$(OBJDIR)/nwlib.o
|
||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||
include Makefile.inc
|
||||
|
||||
OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CSOURCES))) $(LIBCARES) $(LIBSSL)
|
||||
|
||||
all: $(OBJDIR) $(OBJDIR)/version.inc $(OBJDIR)/$(TARGET).nlm
|
||||
OBJL = $(OBJS) $(OBJDIR)/nwlib.o
|
||||
|
||||
all: lib nlm
|
||||
|
||||
nlm: prebuild $(TARGET).nlm
|
||||
|
||||
lib: prebuild $(TARGET).lib
|
||||
|
||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h ca-bundle.h getdate.c
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@echo Compiling $<
|
||||
@$(CC) $(CFLAGS) -c $< -o $@
|
||||
# @echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/version.inc: $(CURL_INC)/curl/curl.h $(OBJDIR)
|
||||
$(OBJDIR)/version.inc: ../include/curl/curlver.h $(OBJDIR)
|
||||
@echo Creating $@
|
||||
@awk -f ../packages/netware/get_ver.awk $< > $@
|
||||
@awk -f ../packages/NetWare/get_ver.awk $< > $@
|
||||
|
||||
dist: all
|
||||
-$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv
|
||||
-$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA)
|
||||
# -$(CP) ../changes.txt $(OBJDIR)/
|
||||
|
||||
install: all
|
||||
@[ -d $(INSTDIR) ] || mkdir $(INSTDIR)
|
||||
install: $(INSTDIR) all
|
||||
@$(CP) $(TARGET).nlm $(INSTDIR)
|
||||
@$(CP) $(TARGET).lib $(INSTDIR)
|
||||
@$(CP) ../CHANGES $(INSTDIR)
|
||||
@$(CP) ../COPYING $(INSTDIR)
|
||||
@$(CP) ../README $(INSTDIR)
|
||||
@$(CP) ../RELEASE-NOTES $(INSTDIR)
|
||||
|
||||
clean:
|
||||
-$(RM) config.h ca-bundle.h y.tab.c getdate.c
|
||||
-$(RM) -r $(OBJDIR)
|
||||
|
||||
$(INSTDIR):
|
||||
@mkdir $(INSTDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
@mkdir $(OBJDIR)
|
||||
|
||||
$(OBJDIR)/$(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
|
||||
$(TARGET).lib: $(OBJS)
|
||||
@echo Creating $@
|
||||
@-$(RM) $@
|
||||
@$(AR) $(ARFLAGS) $@ $^
|
||||
|
||||
$(TARGET).nlm: $(OBJDIR)/$(TARGET).def $(OBJL) $(XDCDATA)
|
||||
@echo Linking $@
|
||||
@-$(RM) $@
|
||||
@$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
|
||||
@$(LD) $(LDFLAGS) $<
|
||||
|
||||
$(OBJDIR)/%.xdc: Makefile.netware
|
||||
@echo Creating $@
|
||||
@@ -239,25 +247,21 @@ ifeq ($(LIBARCH),CLIB)
|
||||
@echo $(DL)import @$(SDK_CLIB)/imports/threads.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_CLIB)/imports/socklib.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
|
||||
# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
|
||||
# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
|
||||
# @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
|
||||
@echo $(DL)module clib$(DL) >> $@
|
||||
else
|
||||
ifeq ($(LD),nlmconv)
|
||||
@echo $(DL)flag_on 64$(DL) >> $@
|
||||
else
|
||||
@echo $(DL)autounload$(DL) >> $@
|
||||
endif
|
||||
@echo $(DL)pseudopreemption$(DL) >> $@
|
||||
@echo $(DL)start _LibCPrelude$(DL) >> $@
|
||||
@echo $(DL)exit _LibCPostlude$(DL) >> $@
|
||||
@echo $(DL)check _LibCCheckUnload$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_LIBC)/imports/libc.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_LIBC)/imports/netware.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
|
||||
@echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
|
||||
# @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
|
||||
# @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
|
||||
# @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
|
||||
@echo $(DL)module libc$(DL) >> $@
|
||||
endif
|
||||
ifdef MODULES
|
||||
@@ -270,8 +274,115 @@ ifdef IMPORTS
|
||||
@echo $(DL)import $(IMPORTS)$(DL) >> $@
|
||||
endif
|
||||
ifeq ($(LD),nlmconv)
|
||||
@echo $(DL)input $(OBJS)$(DL) >> $@
|
||||
ifdef WITH_ARES
|
||||
@echo $(DL)input $(LIBCARES)$(DL) >> $@
|
||||
endif
|
||||
ifdef SSL
|
||||
@echo $(DL)input $(LIBSSL)$(DL) >> $@
|
||||
endif
|
||||
@echo $(DL)input $(OBJL)$(DL) >> $@
|
||||
@echo $(DL)input $(PRELUDE)$(DL) >> $@
|
||||
@echo $(DL)output $(TARGET).nlm$(DL) >> $@
|
||||
endif
|
||||
|
||||
config.h: Makefile.netware
|
||||
@echo Creating $@
|
||||
@echo $(DL)/* $@ for NetWare target.$(DL) > $@
|
||||
@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
|
||||
@echo $(DL)** All your changes will be lost!!$(DL) >> $@
|
||||
@echo $(DL)*/$(DL) >> $@
|
||||
@echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
|
||||
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
|
||||
@echo $(DL)#define PACKAGE_BUGREPORT "curl-bug@haxx.se"$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
||||
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
||||
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
||||
ifdef NW_WINSOCK
|
||||
@echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
|
||||
else
|
||||
@echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_SOCKET_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SYS_SOCKIO_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_NETDB_H 1$(DL) >> $@
|
||||
endif
|
||||
ifdef WITH_ARES
|
||||
@echo $(DL)#define USE_ARES 1$(DL) >> $@
|
||||
endif
|
||||
ifdef ZLIB_PATH
|
||||
@echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@
|
||||
endif
|
||||
ifdef SSL
|
||||
@echo $(DL)#define USE_SSLEAY 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_OPENSSL_X509_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_OPENSSL_SSL_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_OPENSSL_RSA_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_OPENSSL_PEM_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_OPENSSL_ERR_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_OPENSSL_CRYPTO_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_OPENSSL_ENGINE_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LIBSSL 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LIBCRYPTO 1$(DL) >> $@
|
||||
@echo $(DL)#define OPENSSL_NO_KRB5 1$(DL) >> $@
|
||||
endif
|
||||
ifdef OLD_NOVELLSDK
|
||||
@echo $(DL)#define socklen_t int$(DL) >> $@
|
||||
endif
|
||||
|
||||
ca-bundle.h: Makefile.netware
|
||||
@echo Creating $@
|
||||
@echo $(DL)/* Do not edit this file - it is created by make!$(DL) > $@
|
||||
@echo $(DL)** All your changes will be lost!!$(DL) >> $@
|
||||
@echo $(DL)*/$(DL) >> $@
|
||||
@echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@
|
||||
|
||||
getdate.c:
|
||||
@echo Creating $@
|
||||
@-$(RM) getdate.y
|
||||
@$(CP) getdate.c.cvs $@
|
||||
|
||||
url.c: ca-bundle.h
|
||||
|
||||
$(LIBCARES):
|
||||
$(MAKE) -C ../ares -f Makefile.netware lib
|
||||
|
||||
|
||||
|
@@ -25,11 +25,11 @@
|
||||
LIB_NAME = libcurl
|
||||
LIB_NAME_DEBUG = libcurld
|
||||
!IFNDEF OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../openssl-0.9.7a
|
||||
OPENSSL_PATH = ../../openssl-0.9.7d
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF ZLIB_PATH
|
||||
ZLIB_PATH = ../../zlib-1.1.4
|
||||
ZLIB_PATH = ../../zlib-1.2.1
|
||||
!ENDIF
|
||||
|
||||
# Use the high resolution time by default. Comment this out to use low
|
||||
@@ -39,23 +39,23 @@ USEMM_LIBS = YES
|
||||
#############################################################
|
||||
## Nothing more to do below this line!
|
||||
|
||||
CCNODBG = cl.exe /MD /O2 /D "NDEBUG"
|
||||
CCDEBUG = cl.exe /MDd /Od /Gm /Zi /D "_DEBUG" /GZ
|
||||
CFLAGSSSL = /D "USE_SSLEAY" /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl"
|
||||
CCNODBG = cl.exe /MD /O2 /D "NDEBUG"
|
||||
CCDEBUG = cl.exe /MDd /Od /Gm /Zi /D "_DEBUG" /GZ
|
||||
CFLAGSSSL = /D "USE_SSLEAY" /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl"
|
||||
CFLAGSZLIB = /D "HAVE_ZLIB_H" /D "HAVE_ZLIB" /D "HAVE_LIBZ" /I "$(ZLIB_PATH)"
|
||||
CFLAGS = /I "." /I "../include" /nologo /W3 /GX /D "WIN32" /D "VC6" /D "_MBCS" /D "_LIB" /YX /FD /c /D "MSDOS"
|
||||
LNKDLL = link.exe /DLL /def:libcurl.def
|
||||
LNKLIB = link.exe /lib
|
||||
LFLAGS = /nologo
|
||||
SSLLIBS = libeay32.lib ssleay32.lib
|
||||
CFLAGS = /I "." /I "../include" /nologo /W3 /GX /D "WIN32" /D "VC6" /D "_MBCS" /D "_LIB" /YX /FD /c /D "MSDOS"
|
||||
LNKDLL = link.exe /DLL /def:libcurl.def
|
||||
LNKLIB = link.exe /lib
|
||||
LFLAGS = /nologo
|
||||
SSLLIBS = libeay32.lib ssleay32.lib
|
||||
!IFDEF USEMM_LIBS
|
||||
WINLIBS = wsock32.lib winmm.lib
|
||||
WINLIBS = wsock32.lib winmm.lib
|
||||
!ELSE
|
||||
WINLIBS = wsock32.lib
|
||||
CFLAGS = $(CFLAGS) /D "WITHOUT_MM_LIB"
|
||||
WINLIBS = wsock32.lib
|
||||
CFLAGS = $(CFLAGS) /D "WITHOUT_MM_LIB"
|
||||
!ENDIF
|
||||
# RSAglue.lib was formerly needed in the SSLLIBS
|
||||
CFGSET = FALSE
|
||||
CFGSET = FALSE
|
||||
|
||||
######################
|
||||
# release
|
||||
|
24
lib/base64.c
24
lib/base64.c
@@ -160,22 +160,22 @@ size_t Curl_base64_encode(const char *inp, size_t insize, char **outptr)
|
||||
|
||||
switch(inputparts) {
|
||||
case 1: /* only one byte read */
|
||||
sprintf(output, "%c%c==",
|
||||
table64[obuf[0]],
|
||||
table64[obuf[1]]);
|
||||
snprintf(output, 5, "%c%c==",
|
||||
table64[obuf[0]],
|
||||
table64[obuf[1]]);
|
||||
break;
|
||||
case 2: /* two bytes read */
|
||||
sprintf(output, "%c%c%c=",
|
||||
table64[obuf[0]],
|
||||
table64[obuf[1]],
|
||||
table64[obuf[2]]);
|
||||
snprintf(output, 5, "%c%c%c=",
|
||||
table64[obuf[0]],
|
||||
table64[obuf[1]],
|
||||
table64[obuf[2]]);
|
||||
break;
|
||||
default:
|
||||
sprintf(output, "%c%c%c%c",
|
||||
table64[obuf[0]],
|
||||
table64[obuf[1]],
|
||||
table64[obuf[2]],
|
||||
table64[obuf[3]] );
|
||||
snprintf(output, 5, "%c%c%c%c",
|
||||
table64[obuf[0]],
|
||||
table64[obuf[1]],
|
||||
table64[obuf[2]],
|
||||
table64[obuf[3]] );
|
||||
break;
|
||||
}
|
||||
output += 4;
|
||||
|
@@ -1,485 +0,0 @@
|
||||
/* lib/config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* to disable DICT */
|
||||
#undef CURL_DISABLE_DICT
|
||||
|
||||
/* to disable FILE */
|
||||
#undef CURL_DISABLE_FILE
|
||||
|
||||
/* to disable FTP */
|
||||
#undef CURL_DISABLE_FTP
|
||||
|
||||
/* to disable GOPHER */
|
||||
#undef CURL_DISABLE_GOPHER
|
||||
|
||||
/* to disable HTTP */
|
||||
#undef CURL_DISABLE_HTTP
|
||||
|
||||
/* to disable LDAP */
|
||||
#undef CURL_DISABLE_LDAP
|
||||
|
||||
/* to disable TELNET */
|
||||
#undef CURL_DISABLE_TELNET
|
||||
|
||||
/* Set to explicitly specify we don't want to use thread-safe functions */
|
||||
#undef DISABLED_THREADSAFE
|
||||
|
||||
/* your Entropy Gathering Daemon socket pathname */
|
||||
#undef EGD_SOCKET
|
||||
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#undef ENABLE_IPV6
|
||||
|
||||
/* Define to 1 if you have the <alloca.h> header file. */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <assert.h> header file. */
|
||||
#define HAVE_ASSERT_H 1
|
||||
|
||||
/* Define to 1 if you have the `closesocket' function. */
|
||||
#undef HAVE_CLOSESOCKET
|
||||
|
||||
/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
|
||||
#undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA
|
||||
|
||||
/* Define to 1 if you have the <crypto.h> header file. */
|
||||
#undef HAVE_CRYPTO_H
|
||||
|
||||
/* Define to 1 if you have the <des.h> header file. */
|
||||
#undef HAVE_DES_H
|
||||
|
||||
/* disabled non-blocking sockets */
|
||||
#undef HAVE_DISABLED_NONBLOCKING
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
/* XXX: #undef HAVE_DLFCN_H */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the `dlopen' function. */
|
||||
#define HAVE_DLOPEN 1
|
||||
|
||||
/* Define to 1 if you have the <err.h> header file. */
|
||||
#define HAVE_ERR_H 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* use FIONBIO for non-blocking sockets */
|
||||
/* XXX: #undef HAVE_FIONBIO */
|
||||
#define HAVE_FIONBIO 1
|
||||
|
||||
/* Define if getaddrinfo exists and works */
|
||||
#undef HAVE_GETADDRINFO
|
||||
|
||||
/* Define to 1 if you have the `geteuid' function. */
|
||||
#undef HAVE_GETEUID
|
||||
|
||||
/* Define to 1 if you have the `gethostbyaddr' function. */
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
|
||||
/* Define to 1 if you have the `gethostbyaddr_r' function. */
|
||||
#undef HAVE_GETHOSTBYADDR_R
|
||||
|
||||
/* gethostbyaddr_r() takes 5 args */
|
||||
#undef HAVE_GETHOSTBYADDR_R_5
|
||||
|
||||
/* gethostbyaddr_r() takes 7 args */
|
||||
#undef HAVE_GETHOSTBYADDR_R_7
|
||||
|
||||
/* gethostbyaddr_r() takes 8 args */
|
||||
#undef HAVE_GETHOSTBYADDR_R_8
|
||||
|
||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
||||
#undef HAVE_GETHOSTBYNAME_R
|
||||
|
||||
/* gethostbyname_r() takes 3 args */
|
||||
#undef HAVE_GETHOSTBYNAME_R_3
|
||||
|
||||
/* gethostbyname_r() takes 5 args */
|
||||
#undef HAVE_GETHOSTBYNAME_R_5
|
||||
|
||||
/* gethostbyname_r() takes 6 args */
|
||||
#undef HAVE_GETHOSTBYNAME_R_6
|
||||
|
||||
/* Define to 1 if you have the `getpass_r' function. */
|
||||
#undef HAVE_GETPASS_R
|
||||
|
||||
/* Define to 1 if you have the `getpwuid' function. */
|
||||
#undef HAVE_GETPWUID
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the `gmtime_r' function. */
|
||||
#undef HAVE_GMTIME_R
|
||||
|
||||
/* if you have the gssapi libraries */
|
||||
#undef HAVE_GSSAPI
|
||||
|
||||
/* if you have the Heimdal gssapi libraries */
|
||||
#undef HAVE_GSSHEIMDAL
|
||||
|
||||
/* if you have the MIT gssapi libraries */
|
||||
#undef HAVE_GSSMIT
|
||||
|
||||
/* Define to 1 if you have the `inet_addr' function. */
|
||||
#define HAVE_INET_ADDR 1
|
||||
|
||||
/* Define to 1 if you have the `inet_ntoa' function. */
|
||||
#define HAVE_INET_NTOA 1
|
||||
|
||||
/* Define to 1 if you have the `inet_ntoa_r' function. */
|
||||
#undef HAVE_INET_NTOA_R
|
||||
|
||||
/* inet_ntoa_r() is declared */
|
||||
#undef HAVE_INET_NTOA_R_DECL
|
||||
|
||||
/* Define to 1 if you have the `inet_pton' function. */
|
||||
#define HAVE_INET_PTON 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* use ioctlsocket() for non-blocking sockets */
|
||||
#undef HAVE_IOCTLSOCKET
|
||||
|
||||
/* use Ioctlsocket() for non-blocking sockets */
|
||||
#undef HAVE_IOCTLSOCKET_CASE
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
#undef HAVE_IO_H
|
||||
|
||||
/* if you have the Kerberos4 libraries (including -ldes) */
|
||||
#undef HAVE_KRB4
|
||||
|
||||
/* Define to 1 if you have the `krb_get_our_ip_for_realm' function. */
|
||||
#undef HAVE_KRB_GET_OUR_IP_FOR_REALM
|
||||
|
||||
/* Define to 1 if you have the <krb.h> header file. */
|
||||
#undef HAVE_KRB_H
|
||||
|
||||
/* Define to 1 if you have the `crypto' library (-lcrypto). */
|
||||
#undef HAVE_LIBCRYPTO
|
||||
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
/* Define to 1 if you have the `nsl' library (-lnsl). */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
/* Define to 1 if you have the `resolv' library (-lresolv). */
|
||||
#undef HAVE_LIBRESOLV
|
||||
|
||||
/* Define to 1 if you have the `resolve' library (-lresolve). */
|
||||
#undef HAVE_LIBRESOLVE
|
||||
|
||||
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||
#undef HAVE_LIBSOCKET
|
||||
|
||||
/* Define to 1 if you have the `ssl' library (-lssl). */
|
||||
#undef HAVE_LIBSSL
|
||||
|
||||
/* If zlib is available */
|
||||
#undef HAVE_LIBZ
|
||||
//#define HAVE_LIBZ 1
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */
|
||||
#undef HAVE_LOCALTIME_R
|
||||
|
||||
/* if your compiler supports 'long long' */
|
||||
#define HAVE_LONGLONG 1
|
||||
|
||||
/* Define to 1 if you have the <malloc.h> header file. */
|
||||
#define HAVE_MALLOC_H 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <netdb.h> header file. */
|
||||
#define HAVE_NETDB_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define to 1 if you have the <net/if.h> header file. */
|
||||
#undef HAVE_NET_IF_H
|
||||
|
||||
/* Define to 1 if you have the <openssl/crypto.h> header file. */
|
||||
#undef HAVE_OPENSSL_CRYPTO_H
|
||||
|
||||
/* Define to 1 if you have the <openssl/engine.h> header file. */
|
||||
#undef HAVE_OPENSSL_ENGINE_H
|
||||
|
||||
/* Define to 1 if you have the <openssl/err.h> header file. */
|
||||
#undef HAVE_OPENSSL_ERR_H
|
||||
|
||||
/* Define to 1 if you have the <openssl/pem.h> header file. */
|
||||
#undef HAVE_OPENSSL_PEM_H
|
||||
|
||||
/* Define to 1 if you have the <openssl/rsa.h> header file. */
|
||||
#undef HAVE_OPENSSL_RSA_H
|
||||
|
||||
/* Define to 1 if you have the <openssl/ssl.h> header file. */
|
||||
#undef HAVE_OPENSSL_SSL_H
|
||||
|
||||
/* Define to 1 if you have the <openssl/x509.h> header file. */
|
||||
#undef HAVE_OPENSSL_X509_H
|
||||
|
||||
/* use O_NONBLOCK for non-blocking sockets */
|
||||
#undef HAVE_O_NONBLOCK
|
||||
|
||||
/* Define to 1 if you have the <pem.h> header file. */
|
||||
#undef HAVE_PEM_H
|
||||
|
||||
/* Define to 1 if you have the `perror' function. */
|
||||
#undef HAVE_PERROR
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#undef HAVE_POLL
|
||||
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
#undef HAVE_PWD_H
|
||||
|
||||
/* Define to 1 if you have the `RAND_egd' function. */
|
||||
#undef HAVE_RAND_EGD
|
||||
|
||||
/* Define to 1 if you have the `RAND_screen' function. */
|
||||
#undef HAVE_RAND_SCREEN
|
||||
|
||||
/* Define to 1 if you have the `RAND_status' function. */
|
||||
#undef HAVE_RAND_STATUS
|
||||
|
||||
/* Define to 1 if you have the <rsa.h> header file. */
|
||||
#undef HAVE_RSA_H
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the <setjmp.h> header file. */
|
||||
#define HAVE_SETJMP_H 1
|
||||
|
||||
/* Define to 1 if you have the <sgtty.h> header file. */
|
||||
#undef HAVE_SGTTY_H
|
||||
|
||||
/* Define to 1 if you have the `sigaction' function. */
|
||||
#undef HAVE_SIGACTION
|
||||
|
||||
/* Define to 1 if you have the `siginterrupt' function. */
|
||||
#undef HAVE_SIGINTERRUPT
|
||||
|
||||
/* Define to 1 if you have the `signal' function. */
|
||||
#define HAVE_SIGNAL 1
|
||||
|
||||
/* If you have sigsetjmp */
|
||||
#undef HAVE_SIGSETJMP
|
||||
|
||||
/* Define to 1 if you have the `socket' function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* use SO_NONBLOCK for non-blocking sockets */
|
||||
#undef HAVE_SO_NONBLOCK
|
||||
|
||||
/* Define this if you have the SPNEGO library fbopenssl */
|
||||
#undef HAVE_SPNEGO
|
||||
|
||||
/* Define to 1 if you have the <ssl.h> header file. */
|
||||
#undef HAVE_SSL_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the `strcasecmp' function. */
|
||||
#define HAVE_STRCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the `strcmpi' function. */
|
||||
#undef HAVE_STRCMPI
|
||||
|
||||
/* Define to 1 if you have the `strdup' function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define to 1 if you have the `strftime' function. */
|
||||
#define HAVE_STRFTIME 1
|
||||
|
||||
/* Define to 1 if you have the `stricmp' function. */
|
||||
#undef HAVE_STRICMP
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strlcat' function. */
|
||||
#define HAVE_STRLCAT 1
|
||||
|
||||
/* Define to 1 if you have the `strlcpy' function. */
|
||||
#define HAVE_STRLCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strstr' function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define to 1 if you have the `strtok_r' function. */
|
||||
#undef HAVE_STRTOK_R
|
||||
|
||||
/* Define to 1 if you have the `strtoll' function. */
|
||||
#undef HAVE_STRTOLL
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/poll.h> header file. */
|
||||
#undef HAVE_SYS_POLL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/sockio.h> header file. */
|
||||
#define HAVE_SYS_SOCKIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
#undef HAVE_SYS_UTIME_H
|
||||
|
||||
/* Define to 1 if you have the `tcgetattr' function. */
|
||||
#undef HAVE_TCGETATTR
|
||||
|
||||
/* Define to 1 if you have the `tcsetattr' function. */
|
||||
#undef HAVE_TCSETATTR
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H
|
||||
|
||||
/* Define to 1 if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the `uname' function. */
|
||||
#define HAVE_UNAME 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the `utime' function. */
|
||||
#undef HAVE_UTIME
|
||||
|
||||
/* Define to 1 if you have the <utime.h> header file. */
|
||||
#undef HAVE_UTIME_H
|
||||
|
||||
/* Define to 1 if you have the <winsock.h> header file. */
|
||||
#undef HAVE_WINSOCK_H
|
||||
|
||||
/* Define this symbol if your OS supports changing the contents of argv */
|
||||
#undef HAVE_WRITABLE_ARGV
|
||||
|
||||
/* Define to 1 if you have the <x509.h> header file. */
|
||||
#undef HAVE_X509_H
|
||||
|
||||
/* if you have the zlib.h header file */
|
||||
#define HAVE_ZLIB_H 1
|
||||
|
||||
/* need REENTRANT defined */
|
||||
#undef NEED_REENTRANT
|
||||
|
||||
/* cpu-machine-OS */
|
||||
#define OS "i386-pc-NetWare"
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* a suitable file to read random data from */
|
||||
#undef RANDOM_FILE
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to the type of arg 1 for `select'. */
|
||||
#undef SELECT_TYPE_ARG1
|
||||
|
||||
/* Define to the type of args 2, 3 and 4 for `select'. */
|
||||
#undef SELECT_TYPE_ARG234
|
||||
|
||||
/* Define to the type of arg 5 for `select'. */
|
||||
#undef SELECT_TYPE_ARG5
|
||||
|
||||
/* The size of a `curl_off_t', as computed by sizeof. */
|
||||
#define SIZEOF_CURL_OFF_T 4
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
/* XXX: #undef STDC_HEADERS */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define if you want to enable ares support */
|
||||
#undef USE_ARES
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to 1 if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* type to use in place of in_addr_t if not defined */
|
||||
#undef in_addr_t
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* type to use in place of socklen_t if not defined */
|
||||
#define socklen_t int
|
||||
|
||||
/* the signed version of size_t */
|
||||
#undef ssize_t
|
||||
|
||||
|
@@ -1,6 +1,9 @@
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
#ifndef __CONFIG_WIN32_H
|
||||
#define __CONFIG_WIN32_H
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
@@ -36,7 +39,12 @@
|
||||
#undef SIZEOF_CURL_OFF_T
|
||||
#endif
|
||||
|
||||
/* Borland lacks _lseeki64(), so we don't support >2GB files */
|
||||
#ifdef __BORLANDC__
|
||||
#define SIZEOF_CURL_OFF_T 4
|
||||
#else
|
||||
#define SIZEOF_CURL_OFF_T 8
|
||||
#endif
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
@@ -223,9 +231,14 @@
|
||||
/*************************************************
|
||||
* This section is for compiler specific defines.*
|
||||
*************************************************/
|
||||
#if defined(MINGW32) || defined(__WATCOMC__) /* Borland and MS don't have this */
|
||||
/* Borland and MS don't have this */
|
||||
#if defined(MINGW32) || defined(__WATCOMC__) || defined(__LCC__)
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#define HAVE_IO_H 1
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
#define HAVE_INET_PTON 1
|
||||
#define HAVE_INET_NTOP 1
|
||||
#define HAVE_LONGLONG 1
|
||||
#define HAVE_MALLOC_H 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
@@ -89,7 +90,7 @@
|
||||
#define OPENSSL_NO_KRB5 1
|
||||
#endif
|
||||
|
||||
/* Because djgpp < 2.03 doesn't have snprintf() etc.
|
||||
/* Because djgpp <= 2.03 doesn't have snprintf() etc.
|
||||
*/
|
||||
#if (DJGPP_MINOR < 4)
|
||||
#define _MPRINTF_REPLACE
|
||||
|
424
lib/connect.c
424
lib/connect.c
@@ -1,8 +1,8 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
@@ -10,7 +10,7 @@
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
@@ -103,6 +103,12 @@
|
||||
|
||||
static bool verifyconnect(curl_socket_t sockfd, int *error);
|
||||
|
||||
static curl_socket_t
|
||||
singleipconnect(struct connectdata *conn,
|
||||
Curl_addrinfo *ai, /* start connecting to this */
|
||||
long timeout_ms,
|
||||
bool *connected);
|
||||
|
||||
/*
|
||||
* Curl_ourerrno() returns the errno (or equivalent) on this platform to
|
||||
* hide platform specific for the function that calls this.
|
||||
@@ -213,7 +219,7 @@ int waitconnect(curl_socket_t sockfd, /* socket */
|
||||
FD_ZERO(&errfd);
|
||||
FD_SET(sockfd, &errfd);
|
||||
|
||||
interval.tv_sec = timeout_msec/1000;
|
||||
interval.tv_sec = (int)(timeout_msec/1000);
|
||||
timeout_msec -= interval.tv_sec*1000;
|
||||
|
||||
interval.tv_usec = timeout_msec*1000;
|
||||
@@ -222,7 +228,7 @@ int waitconnect(curl_socket_t sockfd, /* socket */
|
||||
if(-1 == rc)
|
||||
/* error, no connect here, try next */
|
||||
return WAITCONN_SELECT_ERROR;
|
||||
|
||||
|
||||
else if(0 == rc)
|
||||
/* timeout, no connect today */
|
||||
return WAITCONN_TIMEOUT;
|
||||
@@ -255,7 +261,7 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
|
||||
/* First check if the given name is an IP address */
|
||||
in=inet_addr(data->set.device);
|
||||
|
||||
|
||||
if((in == CURL_INADDR_NONE) &&
|
||||
Curl_if2ip(data->set.device, myhost, sizeof(myhost))) {
|
||||
/*
|
||||
@@ -330,13 +336,16 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
Curl_resolv_unlock(data, h);
|
||||
/* we don't need it anymore after this function has returned */
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
if( bind(sockfd, addr->ai_addr, addr->ai_addrlen) >= 0) {
|
||||
if( bind(sockfd, addr->ai_addr, (socklen_t)addr->ai_addrlen) >= 0) {
|
||||
/* we succeeded to bind */
|
||||
#ifdef ENABLE_IPV6
|
||||
struct sockaddr_in6 add;
|
||||
#else
|
||||
struct sockaddr_in add;
|
||||
#endif
|
||||
|
||||
bindworked = TRUE;
|
||||
|
||||
|
||||
size = sizeof(add);
|
||||
if(getsockname(sockfd, (struct sockaddr *) &add,
|
||||
(socklen_t *)&size)<0) {
|
||||
@@ -344,36 +353,12 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
return CURLE_HTTP_PORT_FAILED;
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
struct sockaddr_in sa;
|
||||
|
||||
memset((char *)&sa, 0, sizeof(sa));
|
||||
memcpy((char *)&sa.sin_addr, addr->h_addr, addr->h_length);
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_addr.s_addr = in;
|
||||
sa.sin_port = 0; /* get any port */
|
||||
|
||||
if( bind(sockfd, (struct sockaddr *)&sa, sizeof(sa)) >= 0) {
|
||||
/* we succeeded to bind */
|
||||
struct sockaddr_in add;
|
||||
|
||||
bindworked = TRUE;
|
||||
|
||||
size = sizeof(add);
|
||||
if(getsockname(sockfd, (struct sockaddr *) &add,
|
||||
(socklen_t *)&size)<0) {
|
||||
failf(data, "getsockname() failed");
|
||||
return CURLE_HTTP_PORT_FAILED;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if(!bindworked) {
|
||||
failf(data, "%s", Curl_strerror(conn, Curl_ourerrno()));
|
||||
return CURLE_HTTP_PORT_FAILED;
|
||||
}
|
||||
|
||||
|
||||
} /* end of if h */
|
||||
else {
|
||||
failf(data,"could't find my own IP address (%s)", myhost);
|
||||
@@ -443,43 +428,75 @@ static bool verifyconnect(curl_socket_t sockfd, int *error)
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Used within the multi interface. Try next IP address, return TRUE if no
|
||||
more address exists */
|
||||
static bool trynextip(struct connectdata *conn,
|
||||
int sockindex,
|
||||
bool *connected)
|
||||
{
|
||||
curl_socket_t sockfd;
|
||||
Curl_addrinfo *ai;
|
||||
|
||||
if(sockindex != FIRSTSOCKET)
|
||||
return TRUE; /* no next */
|
||||
|
||||
/* try the next address */
|
||||
ai = conn->ip_addr->ai_next;
|
||||
|
||||
while (ai) {
|
||||
sockfd = singleipconnect(conn, ai, 0L, connected);
|
||||
if(sockfd != CURL_SOCKET_BAD) {
|
||||
/* store the new socket descriptor */
|
||||
conn->sock[sockindex] = sockfd;
|
||||
conn->ip_addr = ai;
|
||||
return FALSE;
|
||||
}
|
||||
ai = ai->ai_next;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_is_connected() is used from the multi interface to check if the
|
||||
* firstsocket has connected.
|
||||
*/
|
||||
|
||||
CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
curl_socket_t sockfd,
|
||||
int sockindex,
|
||||
bool *connected)
|
||||
{
|
||||
int rc;
|
||||
struct SessionHandle *data = conn->data;
|
||||
CURLcode code = CURLE_OK;
|
||||
curl_socket_t sockfd = conn->sock[sockindex];
|
||||
long allow = DEFAULT_CONNECT_TIMEOUT;
|
||||
long has_passed;
|
||||
|
||||
curlassert(sockindex >= FIRSTSOCKET && sockindex <= SECONDARYSOCKET);
|
||||
|
||||
*connected = FALSE; /* a very negative world view is best */
|
||||
|
||||
if(data->set.timeout || data->set.connecttimeout) {
|
||||
/* there is a timeout set */
|
||||
/* Evaluate in milliseconds how much time that has passed */
|
||||
has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.start);
|
||||
|
||||
/* Evaluate in milliseconds how much time that has passed */
|
||||
long has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.start);
|
||||
|
||||
/* subtract the most strict timeout of the ones */
|
||||
if(data->set.timeout && data->set.connecttimeout) {
|
||||
if (data->set.timeout < data->set.connecttimeout)
|
||||
has_passed -= data->set.timeout*1000;
|
||||
else
|
||||
has_passed -= data->set.connecttimeout*1000;
|
||||
}
|
||||
else if(data->set.timeout)
|
||||
has_passed -= data->set.timeout*1000;
|
||||
/* subtract the most strict timeout of the ones */
|
||||
if(data->set.timeout && data->set.connecttimeout) {
|
||||
if (data->set.timeout < data->set.connecttimeout)
|
||||
allow = data->set.timeout*1000;
|
||||
else
|
||||
has_passed -= data->set.connecttimeout*1000;
|
||||
allow = data->set.connecttimeout*1000;
|
||||
}
|
||||
else if(data->set.timeout) {
|
||||
allow = data->set.timeout*1000;
|
||||
}
|
||||
else if(data->set.connecttimeout) {
|
||||
allow = data->set.connecttimeout*1000;
|
||||
}
|
||||
|
||||
if(has_passed > 0 ) {
|
||||
/* time-out, bail out, go home */
|
||||
failf(data, "Connection time-out");
|
||||
return CURLE_OPERATION_TIMEOUTED;
|
||||
}
|
||||
if(has_passed > allow ) {
|
||||
/* time-out, bail out, go home */
|
||||
failf(data, "Connection time-out after %ld ms", has_passed);
|
||||
return CURLE_OPERATION_TIMEOUTED;
|
||||
}
|
||||
if(conn->bits.tcpconnect) {
|
||||
/* we are connected already! */
|
||||
@@ -490,35 +507,38 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
/* check for connect without timeout as we want to return immediately */
|
||||
rc = waitconnect(sockfd, 0);
|
||||
|
||||
if(0 == rc) {
|
||||
if (verifyconnect(sockfd,NULL)) {
|
||||
if(WAITCONN_CONNECTED == rc) {
|
||||
if (verifyconnect(sockfd, NULL)) {
|
||||
/* we are connected, awesome! */
|
||||
*connected = TRUE;
|
||||
return CURLE_OK;
|
||||
}
|
||||
/* nope, not connected for real */
|
||||
failf(data, "Connection failed");
|
||||
return CURLE_COULDNT_CONNECT;
|
||||
infof(data, "Connection failed\n");
|
||||
if(trynextip(conn, sockindex, connected)) {
|
||||
code = CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
}
|
||||
else if(1 != rc) {
|
||||
int error = Curl_ourerrno();
|
||||
failf(data, "Failed connect to %s:%d; %s",
|
||||
conn->host.name, conn->port, Curl_strerror(conn,error));
|
||||
return CURLE_COULDNT_CONNECT;
|
||||
else if(WAITCONN_TIMEOUT != rc) {
|
||||
/* nope, not connected */
|
||||
infof(data, "Connection failed\n");
|
||||
if(trynextip(conn, sockindex, connected)) {
|
||||
int error = Curl_ourerrno();
|
||||
failf(data, "Failed connect to %s:%d; %s",
|
||||
conn->host.name, conn->port, Curl_strerror(conn,error));
|
||||
code = CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* If the connection phase is "done" here, we should attempt to connect
|
||||
* to the "next address" in the Curl_hostaddr structure that we resolved
|
||||
* before. But we don't have that struct around anymore and we can't just
|
||||
* keep a pointer since the cache might in fact have gotten pruned by the
|
||||
* time we want to read this... Alas, we don't do this yet.
|
||||
* If the connection failed here, we should attempt to connect to the "next
|
||||
* address" for the given host.
|
||||
*/
|
||||
|
||||
return CURLE_OK;
|
||||
return code;
|
||||
}
|
||||
|
||||
static void Curl_setNoDelay(struct connectdata *conn,
|
||||
curl_socket_t sockfd)
|
||||
static void tcpnodelay(struct connectdata *conn,
|
||||
curl_socket_t sockfd)
|
||||
{
|
||||
#ifdef TCP_NODELAY
|
||||
struct SessionHandle *data= conn->data;
|
||||
@@ -535,6 +555,95 @@ static void Curl_setNoDelay(struct connectdata *conn,
|
||||
#endif
|
||||
}
|
||||
|
||||
/* singleipconnect() connects to the given IP only, and it may return without
|
||||
having connected if used from the multi interface. */
|
||||
static curl_socket_t
|
||||
singleipconnect(struct connectdata *conn,
|
||||
Curl_addrinfo *ai,
|
||||
long timeout_ms,
|
||||
bool *connected)
|
||||
{
|
||||
char addr_buf[128];
|
||||
int rc;
|
||||
int error;
|
||||
bool conected;
|
||||
struct SessionHandle *data = conn->data;
|
||||
curl_socket_t sockfd = socket(ai->ai_family, ai->ai_socktype,
|
||||
ai->ai_protocol);
|
||||
if (sockfd == CURL_SOCKET_BAD)
|
||||
return CURL_SOCKET_BAD;
|
||||
|
||||
*connected = FALSE; /* default is not connected */
|
||||
|
||||
Curl_printable_address(ai, addr_buf, sizeof(addr_buf));
|
||||
infof(data, " Trying %s... ", addr_buf);
|
||||
|
||||
if(data->set.tcp_nodelay)
|
||||
tcpnodelay(conn, sockfd);
|
||||
|
||||
if(conn->data->set.device) {
|
||||
/* user selected to bind the outgoing socket to a specified "device"
|
||||
before doing connect */
|
||||
CURLcode res = bindlocal(conn, sockfd);
|
||||
if(res)
|
||||
return res;
|
||||
}
|
||||
|
||||
/* set socket non-blocking */
|
||||
Curl_nonblock(sockfd, TRUE);
|
||||
|
||||
rc = connect(sockfd, ai->ai_addr, ai->ai_addrlen);
|
||||
|
||||
if(-1 == rc) {
|
||||
error = Curl_ourerrno();
|
||||
|
||||
switch (error) {
|
||||
case EINPROGRESS:
|
||||
case EWOULDBLOCK:
|
||||
#if defined(EAGAIN) && EAGAIN != EWOULDBLOCK
|
||||
/* On some platforms EAGAIN and EWOULDBLOCK are the
|
||||
* same value, and on others they are different, hence
|
||||
* the odd #if
|
||||
*/
|
||||
case EAGAIN:
|
||||
#endif
|
||||
rc = waitconnect(sockfd, timeout_ms);
|
||||
break;
|
||||
default:
|
||||
/* unknown error, fallthrough and try another address! */
|
||||
failf(data, "Failed to connect to %s: %s",
|
||||
addr_buf, Curl_strerror(conn,error));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* The 'WAITCONN_TIMEOUT == rc' comes from the waitconnect(), and not from
|
||||
connect(). We can be sure of this since connect() cannot return 1. */
|
||||
if((WAITCONN_TIMEOUT == rc) &&
|
||||
(data->state.used_interface == Curl_if_multi)) {
|
||||
/* Timeout when running the multi interface */
|
||||
return sockfd;
|
||||
}
|
||||
|
||||
conected = verifyconnect(sockfd, &error);
|
||||
|
||||
if(!rc && conected) {
|
||||
/* we are connected, awesome! */
|
||||
*connected = TRUE; /* this is a true connect */
|
||||
infof(data, "connected\n");
|
||||
return sockfd;
|
||||
}
|
||||
else if(WAITCONN_TIMEOUT == rc)
|
||||
infof(data, "Timeout\n");
|
||||
else
|
||||
infof(data, "%s\n", Curl_strerror(conn, error));
|
||||
|
||||
/* connect failed or timed out */
|
||||
sclose(sockfd);
|
||||
|
||||
return CURL_SOCKET_BAD;
|
||||
}
|
||||
|
||||
/*
|
||||
* TCP connect to the given host with timeout, proxy or remote doesn't matter.
|
||||
* There might be more than one IP address to try out. Fill in the passed
|
||||
@@ -543,33 +652,30 @@ static void Curl_setNoDelay(struct connectdata *conn,
|
||||
|
||||
CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
struct Curl_dns_entry *remotehost, /* use this one */
|
||||
int port, /* connect to this */
|
||||
curl_socket_t *sockconn, /* the connected socket */
|
||||
Curl_ipconnect **addr, /* the one we used */
|
||||
Curl_addrinfo **addr, /* the one we used */
|
||||
bool *connected) /* really connected? */
|
||||
{
|
||||
struct SessionHandle *data = conn->data;
|
||||
int rc, error;
|
||||
curl_socket_t sockfd= CURL_SOCKET_BAD;
|
||||
int aliasindex=0;
|
||||
char *hostname;
|
||||
curl_socket_t sockfd = CURL_SOCKET_BAD;
|
||||
int aliasindex;
|
||||
int num_addr;
|
||||
Curl_addrinfo *ai;
|
||||
Curl_addrinfo *curr_addr;
|
||||
|
||||
struct timeval after;
|
||||
struct timeval before = Curl_tvnow();
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
struct addrinfo *ai;
|
||||
#endif
|
||||
|
||||
/*************************************************************
|
||||
* Figure out what maximum time we have left
|
||||
*************************************************************/
|
||||
long timeout_ms=300000; /* milliseconds, default to five minutes */
|
||||
long timeout_ms= DEFAULT_CONNECT_TIMEOUT;
|
||||
long timeout_per_addr;
|
||||
|
||||
*connected = FALSE; /* default to not connected */
|
||||
|
||||
if(data->set.timeout || data->set.connecttimeout) {
|
||||
double has_passed;
|
||||
long has_passed;
|
||||
|
||||
/* Evaluate in milliseconds how much time that has passed */
|
||||
has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.start);
|
||||
@@ -582,7 +688,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
if(data->set.timeout && data->set.connecttimeout) {
|
||||
if (data->set.timeout < data->set.connecttimeout)
|
||||
timeout_ms = data->set.timeout*1000;
|
||||
else
|
||||
else
|
||||
timeout_ms = data->set.connecttimeout*1000;
|
||||
}
|
||||
else if(data->set.timeout)
|
||||
@@ -591,7 +697,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
timeout_ms = data->set.connecttimeout*1000;
|
||||
|
||||
/* subtract the passed time */
|
||||
timeout_ms -= (long)has_passed;
|
||||
timeout_ms -= has_passed;
|
||||
|
||||
if(timeout_ms < 0) {
|
||||
/* a precaution, no need to continue if time already is up */
|
||||
@@ -600,124 +706,31 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
}
|
||||
}
|
||||
|
||||
hostname = data->change.proxy?conn->proxy.name:conn->host.name;
|
||||
infof(data, "About to connect() to %s port %d\n",
|
||||
hostname, port);
|
||||
/* Max time for each address */
|
||||
num_addr = Curl_num_addresses(remotehost->addr);
|
||||
timeout_per_addr = timeout_ms / num_addr;
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
/*
|
||||
* Connecting with a getaddrinfo chain
|
||||
*/
|
||||
for (ai = remotehost->addr; ai; ai = ai->ai_next, aliasindex++) {
|
||||
sockfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
||||
if (sockfd == CURL_SOCKET_BAD)
|
||||
continue;
|
||||
ai = remotehost->addr;
|
||||
|
||||
else if(data->set.tcp_nodelay)
|
||||
Curl_setNoDelay(conn, sockfd);
|
||||
#else
|
||||
/*
|
||||
* Connecting with old style IPv4-only support
|
||||
/* Below is the loop that attempts to connect to all IP-addresses we
|
||||
* know for the given host. One by one until one IP succeeds.
|
||||
*/
|
||||
|
||||
/* This is the loop that attempts to connect to all IP-addresses we
|
||||
know for the given host. One by one. */
|
||||
for(rc=-1, aliasindex=0;
|
||||
rc && (struct in_addr *)remotehost->addr->h_addr_list[aliasindex];
|
||||
aliasindex++) {
|
||||
struct sockaddr_in serv_addr;
|
||||
if(data->state.used_interface == Curl_if_multi)
|
||||
/* don't hang when doing multi */
|
||||
timeout_per_addr = timeout_ms = 0;
|
||||
|
||||
/* create an IPv4 TCP socket */
|
||||
sockfd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if(CURL_SOCKET_BAD == sockfd) {
|
||||
failf(data, "couldn't create socket");
|
||||
return CURLE_COULDNT_CONNECT; /* big time error */
|
||||
}
|
||||
/*
|
||||
* Connecting with a Curl_addrinfo chain
|
||||
*/
|
||||
for (curr_addr = ai, aliasindex=0; curr_addr;
|
||||
curr_addr = curr_addr->ai_next, aliasindex++) {
|
||||
|
||||
else if(data->set.tcp_nodelay)
|
||||
Curl_setNoDelay(conn, sockfd);
|
||||
/* start connecting to the IP curr_addr points to */
|
||||
sockfd = singleipconnect(conn, curr_addr, timeout_per_addr, connected);
|
||||
|
||||
/* nasty address work before connect can be made */
|
||||
memset((char *) &serv_addr, '\0', sizeof(serv_addr));
|
||||
memcpy((char *)&(serv_addr.sin_addr),
|
||||
(struct in_addr *)remotehost->addr->h_addr_list[aliasindex],
|
||||
sizeof(struct in_addr));
|
||||
serv_addr.sin_family = remotehost->addr->h_addrtype;
|
||||
serv_addr.sin_port = htons((unsigned short)port);
|
||||
#endif
|
||||
|
||||
if(conn->data->set.device) {
|
||||
/* user selected to bind the outgoing socket to a specified "device"
|
||||
before doing connect */
|
||||
CURLcode res = bindlocal(conn, sockfd);
|
||||
if(res)
|
||||
return res;
|
||||
}
|
||||
|
||||
/* set socket non-blocking */
|
||||
Curl_nonblock(sockfd, TRUE);
|
||||
|
||||
/* do not use #ifdef within the function arguments below, as connect() is
|
||||
a defined macro on some platforms and some compilers don't like to mix
|
||||
#ifdefs with macro usage! (AmigaOS is one such platform) */
|
||||
#ifdef ENABLE_IPV6
|
||||
rc = connect(sockfd, ai->ai_addr, ai->ai_addrlen);
|
||||
#else
|
||||
rc = connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr));
|
||||
#endif
|
||||
|
||||
if(-1 == rc) {
|
||||
error = Curl_ourerrno();
|
||||
|
||||
switch (error) {
|
||||
case EINPROGRESS:
|
||||
case EWOULDBLOCK:
|
||||
#if defined(EAGAIN) && EAGAIN != EWOULDBLOCK
|
||||
/* On some platforms EAGAIN and EWOULDBLOCK are the
|
||||
* same value, and on others they are different, hence
|
||||
* the odd #if
|
||||
*/
|
||||
case EAGAIN:
|
||||
#endif
|
||||
/* asynchronous connect, wait for connect or timeout */
|
||||
if(data->state.used_interface == Curl_if_multi)
|
||||
/* don't hang when doing multi */
|
||||
timeout_ms = 0;
|
||||
|
||||
rc = waitconnect(sockfd, timeout_ms);
|
||||
break;
|
||||
default:
|
||||
/* unknown error, fallthrough and try another address! */
|
||||
failf(data, "Failed to connect to %s IP number %d: %s",
|
||||
hostname, aliasindex+1, Curl_strerror(conn,error));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* The '1 == rc' comes from the waitconnect(), and not from connect().
|
||||
We can be sure of this since connect() cannot return 1. */
|
||||
if((1 == rc) && (data->state.used_interface == Curl_if_multi)) {
|
||||
/* Timeout when running the multi interface, we return here with a
|
||||
CURLE_OK return code. */
|
||||
rc = 0;
|
||||
if(sockfd != CURL_SOCKET_BAD)
|
||||
break;
|
||||
}
|
||||
|
||||
if(0 == rc) {
|
||||
if (verifyconnect(sockfd,NULL)) {
|
||||
/* we are connected, awesome! */
|
||||
*connected = TRUE; /* this is a true connect */
|
||||
break;
|
||||
}
|
||||
/* nope, not connected for real */
|
||||
rc = -1;
|
||||
}
|
||||
else
|
||||
verifyconnect(sockfd,&error); /* get non-blocking error */
|
||||
|
||||
/* connect failed or timed out */
|
||||
sclose(sockfd);
|
||||
sockfd = CURL_SOCKET_BAD;
|
||||
|
||||
/* get a new timeout for next attempt */
|
||||
after = Curl_tvnow();
|
||||
@@ -727,24 +740,19 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
||||
return CURLE_OPERATION_TIMEOUTED;
|
||||
}
|
||||
before = after;
|
||||
}
|
||||
} /* end of connect-to-each-address loop */
|
||||
|
||||
if (sockfd == CURL_SOCKET_BAD) {
|
||||
/* no good connect was made */
|
||||
*sockconn = -1;
|
||||
failf(data, "Connect failed; %s", Curl_strerror(conn,error));
|
||||
*sockconn = CURL_SOCKET_BAD;
|
||||
return CURLE_COULDNT_CONNECT;
|
||||
}
|
||||
|
||||
/* leave the socket in non-blocking mode */
|
||||
|
||||
/* store the address we use */
|
||||
if(addr) {
|
||||
#ifdef ENABLE_IPV6
|
||||
*addr = ai;
|
||||
#else
|
||||
*addr = (struct in_addr *)remotehost->addr->h_addr_list[aliasindex];
|
||||
#endif
|
||||
}
|
||||
if(addr)
|
||||
*addr = curr_addr;
|
||||
|
||||
/* allow NULL-pointers to get passed in */
|
||||
if(sockconn)
|
||||
|
@@ -1,10 +1,10 @@
|
||||
#ifndef __CONNECT_H
|
||||
#define __CONNECT_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
@@ -12,7 +12,7 @@
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
@@ -27,16 +27,18 @@ int Curl_nonblock(curl_socket_t sockfd, /* operate on this */
|
||||
int nonblock /* TRUE or FALSE */);
|
||||
|
||||
CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
curl_socket_t sockfd,
|
||||
int sockindex,
|
||||
bool *connected);
|
||||
|
||||
CURLcode Curl_connecthost(struct connectdata *conn,
|
||||
struct Curl_dns_entry *host, /* connect to this */
|
||||
int port, /* connect to this port number */
|
||||
curl_socket_t *sockconn, /* not set if error */
|
||||
Curl_ipconnect **addr, /* the one we used */
|
||||
Curl_addrinfo **addr, /* the one we used */
|
||||
bool *connected /* truly connected? */
|
||||
);
|
||||
|
||||
int Curl_ourerrno(void);
|
||||
|
||||
#define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */
|
||||
|
||||
#endif
|
||||
|
@@ -94,7 +94,7 @@ Curl_unencode_deflate_write(struct SessionHandle *data,
|
||||
|
||||
/* Set the compressed input when this function is called */
|
||||
z->next_in = (Bytef *)k->str;
|
||||
z->avail_in = nread;
|
||||
z->avail_in = (uInt)nread;
|
||||
|
||||
/* because the buffer size is fixed, iteratively decompress
|
||||
and transfer to the client via client_write. */
|
||||
@@ -251,7 +251,7 @@ Curl_unencode_gzip_write(struct SessionHandle *data,
|
||||
switch (check_gzip_header((unsigned char *)k->str, nread, &hlen)) {
|
||||
case GZIP_OK:
|
||||
z->next_in = (Bytef *)k->str + hlen;
|
||||
z->avail_in = nread - hlen;
|
||||
z->avail_in = (uInt)(nread - hlen);
|
||||
k->zlib_init = 3; /* Inflating stream state */
|
||||
break;
|
||||
|
||||
@@ -263,7 +263,7 @@ Curl_unencode_gzip_write(struct SessionHandle *data,
|
||||
* the first place, and it's even more unlikely for a transfer to fail
|
||||
* immediately afterwards, it should seldom be a problem.
|
||||
*/
|
||||
z->avail_in = nread;
|
||||
z->avail_in = (uInt)nread;
|
||||
z->next_in = malloc(z->avail_in);
|
||||
if (z->next_in == NULL) {
|
||||
return exit_zlib(z, &k->zlib_init, CURLE_OUT_OF_MEMORY);
|
||||
@@ -299,7 +299,7 @@ Curl_unencode_gzip_write(struct SessionHandle *data,
|
||||
free(z->next_in);
|
||||
/* Don't point into the malloced block since we just freed it */
|
||||
z->next_in = (Bytef *)k->str + hlen + nread - z->avail_in;
|
||||
z->avail_in = z->avail_in - hlen;
|
||||
z->avail_in = (uInt)(z->avail_in - hlen);
|
||||
k->zlib_init = 3; /* Inflating stream state */
|
||||
break;
|
||||
|
||||
@@ -317,7 +317,7 @@ Curl_unencode_gzip_write(struct SessionHandle *data,
|
||||
else {
|
||||
/* Inflating stream state */
|
||||
z->next_in = (Bytef *)k->str;
|
||||
z->avail_in = nread;
|
||||
z->avail_in = (uInt)nread;
|
||||
}
|
||||
|
||||
if (z->avail_in == 0) {
|
||||
|
66
lib/cookie.c
66
lib/cookie.c
@@ -149,7 +149,7 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
unless set */
|
||||
{
|
||||
struct Cookie *clist;
|
||||
char what[MAX_COOKIE_LINE];
|
||||
char *what;
|
||||
char name[MAX_NAME];
|
||||
char *ptr;
|
||||
char *semiptr;
|
||||
@@ -167,6 +167,13 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
if(httpheader) {
|
||||
/* This line was read off a HTTP-header */
|
||||
char *sep;
|
||||
|
||||
what = malloc(MAX_COOKIE_LINE);
|
||||
if(!what) {
|
||||
free(co);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
semiptr=strchr(lineptr, ';'); /* first, find a semicolon */
|
||||
|
||||
while(*lineptr && isspace((int)*lineptr))
|
||||
@@ -216,14 +223,9 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
|
||||
const char *domptr=whatptr;
|
||||
int dotcount=1;
|
||||
unsigned int i;
|
||||
|
||||
static const char *seventhree[]= {
|
||||
"com", "edu", "net", "org", "gov", "mil", "int"
|
||||
};
|
||||
|
||||
/* Count the dots, we need to make sure that there are THREE dots
|
||||
in the normal domains, or TWO in the seventhree-domains. */
|
||||
/* Count the dots, we need to make sure that there are enough
|
||||
of them. */
|
||||
|
||||
if('.' == whatptr[0])
|
||||
/* don't count the initial dot, assume it */
|
||||
@@ -237,13 +239,6 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
}
|
||||
} while(domptr);
|
||||
|
||||
for(i=0;
|
||||
i<sizeof(seventhree)/sizeof(seventhree[0]); i++) {
|
||||
if(tailmatch(seventhree[i], whatptr)) {
|
||||
dotcount++; /* we allow one dot less for these */
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* The original Netscape cookie spec defined that this domain name
|
||||
MUST have three dots (or two if one of the seven holy TLDs),
|
||||
but it seems that these kinds of cookies are in use "out there"
|
||||
@@ -254,7 +249,7 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
/* Received and skipped a cookie with a domain using too few
|
||||
dots. */
|
||||
badcookie=TRUE; /* mark this as a bad cookie */
|
||||
infof(data, "skipped cookie with illegal dotcount domain: %s",
|
||||
infof(data, "skipped cookie with illegal dotcount domain: %s\n",
|
||||
whatptr);
|
||||
}
|
||||
else {
|
||||
@@ -282,7 +277,7 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
is not a domain to which the current host belongs. Mark as
|
||||
bad. */
|
||||
badcookie=TRUE;
|
||||
infof(data, "skipped cookie with bad tailmatch domain: %s",
|
||||
infof(data, "skipped cookie with bad tailmatch domain: %s\n",
|
||||
whatptr);
|
||||
}
|
||||
}
|
||||
@@ -387,6 +382,8 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
}
|
||||
}
|
||||
|
||||
free(what);
|
||||
|
||||
if(badcookie || !co->name) {
|
||||
/* we didn't get a cookie name or a bad one,
|
||||
this is an illegal line, bail out */
|
||||
@@ -629,17 +626,15 @@ struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
|
||||
struct CookieInfo *inc,
|
||||
bool newsession)
|
||||
{
|
||||
char line[MAX_COOKIE_LINE];
|
||||
struct CookieInfo *c;
|
||||
FILE *fp;
|
||||
bool fromfile=TRUE;
|
||||
|
||||
if(NULL == inc) {
|
||||
/* we didn't get a struct, create one */
|
||||
c = (struct CookieInfo *)malloc(sizeof(struct CookieInfo));
|
||||
c = (struct CookieInfo *)calloc(1, sizeof(struct CookieInfo));
|
||||
if(!c)
|
||||
return NULL; /* failed to get memory */
|
||||
memset(c, 0, sizeof(struct CookieInfo));
|
||||
c->filename = strdup(file?file:"none"); /* copy the name just in case */
|
||||
}
|
||||
else {
|
||||
@@ -660,20 +655,25 @@ struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
|
||||
if(fp) {
|
||||
char *lineptr;
|
||||
bool headerline;
|
||||
while(fgets(line, MAX_COOKIE_LINE, fp)) {
|
||||
if(checkprefix("Set-Cookie:", line)) {
|
||||
/* This is a cookie line, get it! */
|
||||
lineptr=&line[11];
|
||||
headerline=TRUE;
|
||||
}
|
||||
else {
|
||||
lineptr=line;
|
||||
headerline=FALSE;
|
||||
}
|
||||
while(*lineptr && isspace((int)*lineptr))
|
||||
lineptr++;
|
||||
|
||||
Curl_cookie_add(data, c, headerline, lineptr, NULL, NULL);
|
||||
char *line = (char *)malloc(MAX_COOKIE_LINE);
|
||||
if(line) {
|
||||
while(fgets(line, MAX_COOKIE_LINE, fp)) {
|
||||
if(checkprefix("Set-Cookie:", line)) {
|
||||
/* This is a cookie line, get it! */
|
||||
lineptr=&line[11];
|
||||
headerline=TRUE;
|
||||
}
|
||||
else {
|
||||
lineptr=line;
|
||||
headerline=FALSE;
|
||||
}
|
||||
while(*lineptr && isspace((int)*lineptr))
|
||||
lineptr++;
|
||||
|
||||
Curl_cookie_add(data, c, headerline, lineptr, NULL, NULL);
|
||||
}
|
||||
free(line); /* free the line buffer */
|
||||
}
|
||||
if(fromfile)
|
||||
fclose(fp);
|
||||
|
31
lib/cookie.h
31
lib/cookie.h
@@ -1,10 +1,10 @@
|
||||
#ifndef __COOKIE_H
|
||||
#define __COOKIE_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
@@ -12,7 +12,7 @@
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
@@ -41,11 +41,11 @@ struct Cookie {
|
||||
long expires; /* expires = <this> */
|
||||
char *expirestr; /* the plain text version */
|
||||
bool tailmatch; /* weather we do tail-matchning of the domain name */
|
||||
|
||||
|
||||
/* RFC 2109 keywords. Version=1 means 2109-compliant cookie sending */
|
||||
char *version; /* Version = <value> */
|
||||
char *maxage; /* Max-Age = <value> */
|
||||
|
||||
|
||||
bool secure; /* whether the 'secure' keyword was used */
|
||||
bool livecookie; /* updated from a server, not a stored file */
|
||||
};
|
||||
@@ -60,13 +60,20 @@ struct CookieInfo {
|
||||
bool newsession; /* new session, discard session cookies on load */
|
||||
};
|
||||
|
||||
/* This is the maximum line length we accept for a cookie line */
|
||||
#define MAX_COOKIE_LINE 2048
|
||||
#define MAX_COOKIE_LINE_TXT "2047"
|
||||
/* This is the maximum line length we accept for a cookie line. RFC 2109
|
||||
section 6.3 says:
|
||||
|
||||
"at least 4096 bytes per cookie (as measured by the size of the characters
|
||||
that comprise the cookie non-terminal in the syntax description of the
|
||||
Set-Cookie header)"
|
||||
|
||||
*/
|
||||
#define MAX_COOKIE_LINE 5000
|
||||
#define MAX_COOKIE_LINE_TXT "4999"
|
||||
|
||||
/* This is the maximum length of a cookie name we deal with: */
|
||||
#define MAX_NAME 256
|
||||
#define MAX_NAME_TXT "255"
|
||||
#define MAX_NAME 1024
|
||||
#define MAX_NAME_TXT "1023"
|
||||
|
||||
struct SessionHandle;
|
||||
/*
|
||||
|
122
lib/easy.c
122
lib/easy.c
@@ -1,8 +1,8 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
@@ -10,7 +10,7 @@
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
@@ -96,36 +96,36 @@ static void win32_cleanup(void)
|
||||
stack to allow networking */
|
||||
static CURLcode win32_init(void)
|
||||
{
|
||||
WORD wVersionRequested;
|
||||
WSADATA wsaData;
|
||||
int err;
|
||||
WORD wVersionRequested;
|
||||
WSADATA wsaData;
|
||||
int err;
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
wVersionRequested = MAKEWORD(2, 0);
|
||||
#else
|
||||
wVersionRequested = MAKEWORD(1, 1);
|
||||
#endif
|
||||
|
||||
err = WSAStartup(wVersionRequested, &wsaData);
|
||||
|
||||
if (err != 0)
|
||||
/* Tell the user that we couldn't find a useable */
|
||||
/* winsock.dll. */
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
/* Confirm that the Windows Sockets DLL supports what we need.*/
|
||||
/* Note that if the DLL supports versions greater */
|
||||
/* than wVersionRequested, it will still return */
|
||||
|
||||
err = WSAStartup(wVersionRequested, &wsaData);
|
||||
|
||||
if (err != 0)
|
||||
/* Tell the user that we couldn't find a useable */
|
||||
/* winsock.dll. */
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
/* Confirm that the Windows Sockets DLL supports what we need.*/
|
||||
/* Note that if the DLL supports versions greater */
|
||||
/* than wVersionRequested, it will still return */
|
||||
/* wVersionRequested in wVersion. wHighVersion contains the */
|
||||
/* highest supported version. */
|
||||
|
||||
if ( LOBYTE( wsaData.wVersion ) != LOBYTE(wVersionRequested) ||
|
||||
HIBYTE( wsaData.wVersion ) != HIBYTE(wVersionRequested) ) {
|
||||
/* Tell the user that we couldn't find a useable */
|
||||
if ( LOBYTE( wsaData.wVersion ) != LOBYTE(wVersionRequested) ||
|
||||
HIBYTE( wsaData.wVersion ) != HIBYTE(wVersionRequested) ) {
|
||||
/* Tell the user that we couldn't find a useable */
|
||||
|
||||
/* winsock.dll. */
|
||||
WSACleanup();
|
||||
return CURLE_FAILED_INIT;
|
||||
/* winsock.dll. */
|
||||
WSACleanup();
|
||||
return CURLE_FAILED_INIT;
|
||||
}
|
||||
/* The Windows Sockets DLL is acceptable. Proceed. */
|
||||
return CURLE_OK;
|
||||
@@ -207,7 +207,7 @@ CURLcode curl_global_init(long flags)
|
||||
|
||||
initialized = 1;
|
||||
init_flags = flags;
|
||||
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ CURL *curl_easy_init(void)
|
||||
return data;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* curl_easy_setopt() is the external interface for setting options on an
|
||||
* easy handle.
|
||||
*/
|
||||
@@ -333,7 +333,8 @@ CURLcode curl_easy_setopt(CURL *curl, CURLoption tag, ...)
|
||||
/* This is a function pointer type */
|
||||
param_func = va_arg(arg, func_T );
|
||||
ret = Curl_setopt(data, tag, param_func);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
/* This is a curl_off_t type */
|
||||
param_offset = va_arg(arg, curl_off_t);
|
||||
ret = Curl_setopt(data, tag, param_offset);
|
||||
@@ -372,9 +373,9 @@ CURLcode curl_easy_perform(CURL *curl)
|
||||
screwed up and we should bail out! */
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return Curl_perform(data);
|
||||
}
|
||||
|
||||
@@ -458,6 +459,7 @@ CURL *curl_easy_duphandle(CURL *incurl)
|
||||
outcurl->progress.flags = data->progress.flags;
|
||||
outcurl->progress.callback = data->progress.callback;
|
||||
|
||||
#ifndef CURL_DISABLE_HTTP
|
||||
if(data->cookies) {
|
||||
/* If cookies are enabled in the parent handle, we enable them
|
||||
in the clone as well! */
|
||||
@@ -469,6 +471,7 @@ CURL *curl_easy_duphandle(CURL *incurl)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif /* CURL_DISABLE_HTTP */
|
||||
|
||||
/* duplicate all values in 'change' */
|
||||
if(data->change.url) {
|
||||
@@ -519,3 +522,62 @@ CURL *curl_easy_duphandle(CURL *incurl)
|
||||
|
||||
return outcurl;
|
||||
}
|
||||
|
||||
/*
|
||||
* curl_easy_reset() is an external interface that allows an app to re-
|
||||
* initialize a session handle to the default values.
|
||||
*/
|
||||
void curl_easy_reset(CURL *curl)
|
||||
{
|
||||
struct SessionHandle *data = (struct SessionHandle *)curl;
|
||||
|
||||
/* zero out UserDefined data: */
|
||||
memset(&data->set, 0, sizeof(struct UserDefined));
|
||||
|
||||
/* zero out Progress data: */
|
||||
memset(&data->progress, 0, sizeof(struct Progress));
|
||||
|
||||
/* The remainder of these calls have been taken from Curl_open() */
|
||||
|
||||
data->set.out = stdout; /* default output to stdout */
|
||||
data->set.in = stdin; /* default input from stdin */
|
||||
data->set.err = stderr; /* default stderr to stderr */
|
||||
|
||||
/* use fwrite as default function to store output */
|
||||
data->set.fwrite = (curl_write_callback)fwrite;
|
||||
|
||||
/* use fread as default function to read input */
|
||||
data->set.fread = (curl_read_callback)fread;
|
||||
|
||||
data->set.infilesize = -1; /* we don't know any size */
|
||||
|
||||
data->state.current_speed = -1; /* init to negative == impossible */
|
||||
|
||||
data->set.httpreq = HTTPREQ_GET; /* Default HTTP request */
|
||||
data->set.ftp_use_epsv = TRUE; /* FTP defaults to EPSV operations */
|
||||
data->set.ftp_use_eprt = TRUE; /* FTP defaults to EPRT operations */
|
||||
|
||||
data->set.dns_cache_timeout = 60; /* Timeout every 60 seconds by default */
|
||||
|
||||
/* make libcurl quiet by default: */
|
||||
data->set.hide_progress = TRUE; /* CURLOPT_NOPROGRESS changes these */
|
||||
|
||||
/* Set the default size of the SSL session ID cache */
|
||||
data->set.ssl.numsessions = 5;
|
||||
|
||||
data->set.proxyport = 1080;
|
||||
data->set.proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */
|
||||
data->set.httpauth = CURLAUTH_BASIC; /* defaults to basic */
|
||||
data->set.proxyauth = CURLAUTH_BASIC; /* defaults to basic */
|
||||
|
||||
/*
|
||||
* libcurl 7.10 introduced SSL verification *by default*! This needs to be
|
||||
* switched off unless wanted.
|
||||
*/
|
||||
data->set.ssl.verifypeer = TRUE;
|
||||
data->set.ssl.verifyhost = 2;
|
||||
#ifdef CURL_CA_BUNDLE
|
||||
/* This is our prefered CA cert bundle since install time */
|
||||
data->set.ssl.CAfile = (char *)CURL_CA_BUNDLE;
|
||||
#endif
|
||||
}
|
||||
|
26
lib/escape.c
26
lib/escape.c
@@ -1,8 +1,8 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
@@ -10,7 +10,7 @@
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
@@ -33,17 +33,21 @@
|
||||
#include <string.h>
|
||||
#include "memory.h"
|
||||
|
||||
#define _MPRINTF_REPLACE /* use our functions only */
|
||||
#include <curl/mprintf.h>
|
||||
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
char *curl_escape(const char *string, int length)
|
||||
char *curl_escape(const char *string, int inlength)
|
||||
{
|
||||
size_t alloc = (length?(size_t)length:strlen(string))+1;
|
||||
size_t alloc = (inlength?(size_t)inlength:strlen(string))+1;
|
||||
char *ns;
|
||||
char *testing_ptr = NULL;
|
||||
unsigned char in;
|
||||
size_t newlen = alloc;
|
||||
int strindex=0;
|
||||
size_t length;
|
||||
|
||||
ns = malloc(alloc);
|
||||
if(!ns)
|
||||
@@ -68,7 +72,7 @@ char *curl_escape(const char *string, int length)
|
||||
ns = testing_ptr;
|
||||
}
|
||||
}
|
||||
sprintf(&ns[strindex], "%%%02X", in);
|
||||
snprintf(&ns[strindex], 4, "%%%02X", in);
|
||||
|
||||
strindex+=3;
|
||||
}
|
||||
@@ -93,10 +97,10 @@ char *curl_unescape(const char *string, int length)
|
||||
unsigned char in;
|
||||
int strindex=0;
|
||||
long hex;
|
||||
|
||||
|
||||
if( !ns )
|
||||
return NULL;
|
||||
|
||||
|
||||
while(--alloc > 0) {
|
||||
in = *string;
|
||||
if(('%' == in) && ishex(string[1]) && ishex(string[2])) {
|
||||
@@ -113,7 +117,7 @@ char *curl_unescape(const char *string, int length)
|
||||
string+=2;
|
||||
alloc-=2;
|
||||
}
|
||||
|
||||
|
||||
ns[strindex++] = in;
|
||||
string++;
|
||||
}
|
||||
|
24
lib/file.c
24
lib/file.c
@@ -175,15 +175,21 @@ CURLcode Curl_file_done(struct connectdata *conn,
|
||||
{
|
||||
struct FILEPROTO *file = conn->proto.file;
|
||||
(void)status; /* not used */
|
||||
Curl_safefree(file->path);
|
||||
Curl_safefree(file->freepath);
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
#define DIRSEP '\\'
|
||||
#else
|
||||
#define DIRSEP '/'
|
||||
#endif
|
||||
|
||||
static CURLcode file_upload(struct connectdata *conn)
|
||||
{
|
||||
struct FILEPROTO *file = conn->proto.file;
|
||||
char *dir = strchr(file->path, '/');
|
||||
char *dir = strchr(file->path, DIRSEP);
|
||||
FILE *fp;
|
||||
CURLcode res=CURLE_OK;
|
||||
struct SessionHandle *data = conn->data;
|
||||
@@ -218,7 +224,12 @@ static CURLcode file_upload(struct connectdata *conn)
|
||||
Curl_pgrsSetUploadSize(data, data->set.infilesize);
|
||||
|
||||
while (res == CURLE_OK) {
|
||||
nread = Curl_fillreadbuffer(conn, BUFSIZE);
|
||||
int readcount;
|
||||
res = Curl_fillreadbuffer(conn, BUFSIZE, &readcount);
|
||||
if(res)
|
||||
return res;
|
||||
|
||||
nread = (size_t)readcount;
|
||||
|
||||
if (nread <= 0)
|
||||
break;
|
||||
@@ -295,13 +306,14 @@ CURLcode Curl_file(struct connectdata *conn)
|
||||
date. */
|
||||
if(conn->bits.no_body && data->set.include_header && fstated) {
|
||||
CURLcode result;
|
||||
sprintf(buf, "Content-Length: %" FORMAT_OFF_T "\r\n", expected_size);
|
||||
snprintf(buf, sizeof(data->state.buffer),
|
||||
"Content-Length: %" FORMAT_OFF_T "\r\n", expected_size);
|
||||
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
sprintf(buf, "Accept-ranges: bytes\r\n");
|
||||
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
|
||||
result = Curl_client_write(data, CLIENTWRITE_BOTH,
|
||||
(char *)"Accept-ranges: bytes\r\n", 0);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
|
321
lib/formdata.c
321
lib/formdata.c
@@ -1,8 +1,8 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
@@ -10,7 +10,7 @@
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
*
|
||||
*
|
||||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
* copies of the Software, and permit persons to whom the Software is
|
||||
* furnished to do so, under the terms of the COPYING file.
|
||||
@@ -100,6 +100,10 @@ Content-Disposition: form-data; name="FILECONTENT"
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include <curl/curl.h>
|
||||
|
||||
/* Length of the random boundary string. */
|
||||
#define BOUNDARY_LENGTH 40
|
||||
|
||||
#ifndef CURL_DISABLE_HTTP
|
||||
|
||||
@@ -108,7 +112,7 @@ Content-Disposition: form-data; name="FILECONTENT"
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include <curl/curl.h>
|
||||
#include <sys/stat.h>
|
||||
#include "formdata.h"
|
||||
#include "strequal.h"
|
||||
#include "memory.h"
|
||||
@@ -119,9 +123,6 @@ Content-Disposition: form-data; name="FILECONTENT"
|
||||
/* The last #include file should be: */
|
||||
#include "memdebug.h"
|
||||
|
||||
/* Length of the random boundary string. */
|
||||
#define BOUNDARY_LENGTH 40
|
||||
|
||||
/* What kind of Content-Type to use on un-specified files with unrecognized
|
||||
extensions. */
|
||||
#define HTTPPOST_CONTENTTYPE_DEFAULT "application/octet-stream"
|
||||
@@ -132,7 +133,7 @@ Content-Disposition: form-data; name="FILECONTENT"
|
||||
/***************************************************************************
|
||||
*
|
||||
* AddHttpPost()
|
||||
*
|
||||
*
|
||||
* Adds a HttpPost structure to the list, if parent_post is given becomes
|
||||
* a subpost of parent_post instead of a direct list element.
|
||||
*
|
||||
@@ -167,13 +168,13 @@ AddHttpPost(char * name, size_t namelength,
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
|
||||
if (parent_post) {
|
||||
/* now, point our 'more' to the original 'more' */
|
||||
post->more = parent_post->more;
|
||||
|
||||
|
||||
/* then move the original 'more' to point to ourselves */
|
||||
parent_post->more = post;
|
||||
parent_post->more = post;
|
||||
}
|
||||
else {
|
||||
/* make the previous point to this */
|
||||
@@ -181,8 +182,8 @@ AddHttpPost(char * name, size_t namelength,
|
||||
(*last_post)->next = post;
|
||||
else
|
||||
(*httppost) = post;
|
||||
|
||||
(*last_post) = post;
|
||||
|
||||
(*last_post) = post;
|
||||
}
|
||||
return post;
|
||||
}
|
||||
@@ -190,7 +191,7 @@ AddHttpPost(char * name, size_t namelength,
|
||||
/***************************************************************************
|
||||
*
|
||||
* AddFormInfo()
|
||||
*
|
||||
*
|
||||
* Adds a FormInfo structure to the list presented by parent_form_info.
|
||||
*
|
||||
* Returns newly allocated FormInfo on success and NULL if malloc failed/
|
||||
@@ -213,11 +214,11 @@ static FormInfo * AddFormInfo(char *value,
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
||||
|
||||
if (parent_form_info) {
|
||||
/* now, point our 'more' to the original 'more' */
|
||||
form_info->more = parent_form_info->more;
|
||||
|
||||
|
||||
/* then move the original 'more' to point to ourselves */
|
||||
parent_form_info->more = form_info;
|
||||
}
|
||||
@@ -230,7 +231,7 @@ static FormInfo * AddFormInfo(char *value,
|
||||
/***************************************************************************
|
||||
*
|
||||
* ContentTypeForFilename()
|
||||
*
|
||||
*
|
||||
* Provides content type for filename if one of the known types (else
|
||||
* (either the prevtype or the default is returned).
|
||||
*
|
||||
@@ -257,7 +258,7 @@ static const char * ContentTypeForFilename (const char *filename,
|
||||
{".txt", "text/plain"},
|
||||
{".html", "text/html"}
|
||||
};
|
||||
|
||||
|
||||
if(prevtype)
|
||||
/* default to the previously set/used! */
|
||||
contenttype = prevtype;
|
||||
@@ -265,7 +266,7 @@ static const char * ContentTypeForFilename (const char *filename,
|
||||
/* It seems RFC1867 defines no Content-Type to default to
|
||||
text/plain so we don't actually need to set this: */
|
||||
contenttype = HTTPPOST_CONTENTTYPE_DEFAULT;
|
||||
|
||||
|
||||
for(i=0; i<sizeof(ctts)/sizeof(ctts[0]); i++) {
|
||||
if(strlen(filename) >= strlen(ctts[i].extension)) {
|
||||
if(strequal(filename +
|
||||
@@ -273,7 +274,7 @@ static const char * ContentTypeForFilename (const char *filename,
|
||||
ctts[i].extension)) {
|
||||
contenttype = ctts[i].type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* we have a contenttype by now */
|
||||
@@ -283,7 +284,7 @@ static const char * ContentTypeForFilename (const char *filename,
|
||||
/***************************************************************************
|
||||
*
|
||||
* memdup()
|
||||
*
|
||||
*
|
||||
* Copies the 'source' data to a newly allocated buffer buffer (that is
|
||||
* returned). Uses buffer_length if not null, else uses strlen to determine
|
||||
* the length of the buffer to be copied
|
||||
@@ -296,7 +297,7 @@ static char *memdup(const char *src, size_t buffer_length)
|
||||
size_t length;
|
||||
bool add = FALSE;
|
||||
char *buffer;
|
||||
|
||||
|
||||
if (buffer_length)
|
||||
length = buffer_length;
|
||||
else {
|
||||
@@ -306,7 +307,7 @@ static char *memdup(const char *src, size_t buffer_length)
|
||||
buffer = (char*)malloc(length+add);
|
||||
if (!buffer)
|
||||
return NULL; /* fail */
|
||||
|
||||
|
||||
memcpy(buffer, src, length);
|
||||
|
||||
/* if length unknown do null termination */
|
||||
@@ -319,7 +320,7 @@ static char *memdup(const char *src, size_t buffer_length)
|
||||
/***************************************************************************
|
||||
*
|
||||
* FormAdd()
|
||||
*
|
||||
*
|
||||
* Stores a formpost parameter and builds the appropriate linked list.
|
||||
*
|
||||
* Has two principal functionalities: using files and byte arrays as
|
||||
@@ -567,7 +568,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case CURLFORM_BUFFERPTR:
|
||||
current_form->flags |= HTTPPOST_PTRBUFFER;
|
||||
if (current_form->buffer)
|
||||
@@ -628,12 +629,12 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
struct curl_slist* list = array_state?
|
||||
(struct curl_slist*)array_value:
|
||||
va_arg(params, struct curl_slist*);
|
||||
|
||||
|
||||
if( current_form->contentheader )
|
||||
return_value = CURL_FORMADD_OPTION_TWICE;
|
||||
else
|
||||
current_form->contentheader = list;
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
case CURLFORM_FILENAME:
|
||||
@@ -659,7 +660,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
if(CURL_FORMADD_OK == return_value) {
|
||||
/* go through the list, check for copleteness and if everything is
|
||||
* alright add the HttpPost item otherwise set return_value accordingly */
|
||||
|
||||
|
||||
post = NULL;
|
||||
for(form = first_form;
|
||||
form != NULL;
|
||||
@@ -704,7 +705,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
form->name_alloc = TRUE;
|
||||
}
|
||||
if ( !(form->flags & HTTPPOST_FILENAME) &&
|
||||
!(form->flags & HTTPPOST_READFILE) &&
|
||||
!(form->flags & HTTPPOST_READFILE) &&
|
||||
!(form->flags & HTTPPOST_PTRCONTENTS) &&
|
||||
!(form->flags & HTTPPOST_PTRBUFFER) ) {
|
||||
/* copy value (without strdup; possibly contains null characters) */
|
||||
@@ -722,7 +723,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
form->contentheader, form->showfilename,
|
||||
post, httppost,
|
||||
last_post);
|
||||
|
||||
|
||||
if(!post) {
|
||||
return_value = CURL_FORMADD_MEMORY;
|
||||
break;
|
||||
@@ -754,7 +755,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
|
||||
form = first_form;
|
||||
while (form != NULL) {
|
||||
FormInfo *delete_form;
|
||||
|
||||
|
||||
delete_form = form;
|
||||
form = form->more;
|
||||
free (delete_form);
|
||||
@@ -785,9 +786,10 @@ CURLFORMcode curl_formadd(struct curl_httppost **httppost,
|
||||
* size is incremented by the chunk length, unless it is NULL
|
||||
*/
|
||||
static CURLcode AddFormData(struct FormData **formp,
|
||||
enum formtype type,
|
||||
const void *line,
|
||||
size_t length,
|
||||
size_t *size)
|
||||
curl_off_t *size)
|
||||
{
|
||||
struct FormData *newform = (struct FormData *)
|
||||
malloc(sizeof(struct FormData));
|
||||
@@ -807,7 +809,8 @@ static CURLcode AddFormData(struct FormData **formp,
|
||||
memcpy(newform->line, line, length);
|
||||
newform->length = length;
|
||||
newform->line[length]=0; /* zero terminate for easier debugging */
|
||||
|
||||
newform->type = type;
|
||||
|
||||
if(*formp) {
|
||||
(*formp)->next = newform;
|
||||
*formp = newform;
|
||||
@@ -815,8 +818,20 @@ static CURLcode AddFormData(struct FormData **formp,
|
||||
else
|
||||
*formp = newform;
|
||||
|
||||
if (size)
|
||||
*size += length;
|
||||
if (size) {
|
||||
if(type == FORM_DATA)
|
||||
*size += length;
|
||||
else {
|
||||
/* Since this is a file to be uploaded here, add the size of the actual
|
||||
file */
|
||||
if(!strequal("-", newform->line)) {
|
||||
struct stat file;
|
||||
if(!stat(newform->line, &file)) {
|
||||
*size += file.st_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
@@ -825,54 +840,22 @@ static CURLcode AddFormData(struct FormData **formp,
|
||||
*/
|
||||
|
||||
static CURLcode AddFormDataf(struct FormData **formp,
|
||||
size_t *size,
|
||||
curl_off_t *size,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
char s[4096];
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
vsprintf(s, fmt, ap);
|
||||
vsnprintf(s, sizeof(s), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
return AddFormData(formp, s, 0, size);
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_FormBoundary() creates a suitable boundary string and returns an
|
||||
* allocated one.
|
||||
*/
|
||||
char *Curl_FormBoundary(void)
|
||||
{
|
||||
char *retstring;
|
||||
static int randomizer=0; /* this is just so that two boundaries within
|
||||
the same form won't be identical */
|
||||
size_t i;
|
||||
|
||||
static char table16[]="abcdef0123456789";
|
||||
|
||||
retstring = (char *)malloc(BOUNDARY_LENGTH+1);
|
||||
|
||||
if(!retstring)
|
||||
return NULL; /* failed */
|
||||
|
||||
srand(time(NULL)+randomizer++); /* seed */
|
||||
|
||||
strcpy(retstring, "----------------------------");
|
||||
|
||||
for(i=strlen(retstring); i<BOUNDARY_LENGTH; i++)
|
||||
retstring[i] = table16[rand()%16];
|
||||
|
||||
/* 28 dashes and 12 hexadecimal digits makes 12^16 (184884258895036416)
|
||||
combinations */
|
||||
retstring[BOUNDARY_LENGTH]=0; /* zero terminate */
|
||||
|
||||
return retstring;
|
||||
return AddFormData(formp, FORM_DATA, s, 0, size);
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_formclean() is used from http.c, this cleans a built FormData linked
|
||||
* list
|
||||
*/
|
||||
*/
|
||||
void Curl_formclean(struct FormData *form)
|
||||
{
|
||||
struct FormData *next;
|
||||
@@ -884,7 +867,7 @@ void Curl_formclean(struct FormData *form)
|
||||
next=form->next; /* the following form line */
|
||||
free(form->line); /* free the line */
|
||||
free(form); /* free the struct */
|
||||
|
||||
|
||||
} while((form=next)); /* continue */
|
||||
}
|
||||
|
||||
@@ -936,7 +919,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
struct curl_httppost *file;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
size_t size =0;
|
||||
curl_off_t size=0; /* support potentially ENORMOUS formposts */
|
||||
char *boundary;
|
||||
char *fileboundary=NULL;
|
||||
struct curl_slist* curList;
|
||||
@@ -949,7 +932,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
boundary = Curl_FormBoundary();
|
||||
if(!boundary)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
|
||||
/* Make the first line of the output */
|
||||
result = AddFormDataf(&form, NULL,
|
||||
"Content-Type: multipart/form-data;"
|
||||
@@ -963,7 +946,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
part of the header! */
|
||||
|
||||
firstform = form;
|
||||
|
||||
|
||||
do {
|
||||
|
||||
if(size) {
|
||||
@@ -977,16 +960,17 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
if (result)
|
||||
break;
|
||||
|
||||
result = AddFormData(&form,
|
||||
"Content-Disposition: form-data; name=\"", 0, &size);
|
||||
result = AddFormDataf(&form, &size,
|
||||
"Content-Disposition: form-data; name=\"");
|
||||
if (result)
|
||||
break;
|
||||
|
||||
result = AddFormData(&form, post->name, post->namelength, &size);
|
||||
result = AddFormData(&form, FORM_DATA, post->name, post->namelength,
|
||||
&size);
|
||||
if (result)
|
||||
break;
|
||||
|
||||
result = AddFormData(&form, "\"", 0, &size);
|
||||
result = AddFormDataf(&form, &size, "\"");
|
||||
if (result)
|
||||
break;
|
||||
|
||||
@@ -1033,7 +1017,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
if (result)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if(file->contenttype) {
|
||||
/* we have a specified type */
|
||||
result = AddFormDataf(&form, &size,
|
||||
@@ -1063,7 +1047,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
* should, I can just as well skip this to the benefit of the users who
|
||||
* are using such confused receivers.
|
||||
*/
|
||||
|
||||
|
||||
if(file->contenttype &&
|
||||
!checkprefix("text/", file->contenttype)) {
|
||||
/* this is not a text content, mention our binary encoding */
|
||||
@@ -1071,7 +1055,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
}
|
||||
#endif
|
||||
|
||||
result = AddFormData(&form, "\r\n\r\n", 0, &size);
|
||||
result = AddFormDataf(&form, &size, "\r\n\r\n");
|
||||
if (result)
|
||||
break;
|
||||
|
||||
@@ -1079,11 +1063,10 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
(post->flags & HTTPPOST_READFILE)) {
|
||||
/* we should include the contents from the specified file */
|
||||
FILE *fileread;
|
||||
char buffer[1024];
|
||||
size_t nread;
|
||||
|
||||
fileread = strequal("-", file->contents)?
|
||||
stdin:fopen(file->contents, "rb"); /* binary read for win32 */
|
||||
|
||||
/*
|
||||
* VMS: This only allows for stream files on VMS. Stream files are
|
||||
* OK, as are FIXED & VAR files WITHOUT implied CC For implied CC,
|
||||
@@ -1091,13 +1074,27 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
*/
|
||||
|
||||
if(fileread) {
|
||||
while((nread = fread(buffer, 1, 1024, fileread))) {
|
||||
result = AddFormData(&form, buffer, nread, &size);
|
||||
if (result)
|
||||
break;
|
||||
}
|
||||
if(fileread != stdin)
|
||||
if(fileread != stdin) {
|
||||
/* close the file again */
|
||||
fclose(fileread);
|
||||
/* add the file name only - for later reading from this */
|
||||
result = AddFormData(&form, FORM_FILE, file->contents, 0, &size);
|
||||
}
|
||||
else {
|
||||
/* When uploading from stdin, we can't know the size of the file,
|
||||
* thus must read the full file as before. We *could* use chunked
|
||||
* transfer-encoding, but that only works for HTTP 1.1 and we
|
||||
* can't be sure we work with such a server.
|
||||
*/
|
||||
size_t nread;
|
||||
char buffer[512];
|
||||
while((nread = fread(buffer, 1, sizeof(buffer), fileread))) {
|
||||
result = AddFormData(&form, FORM_DATA, buffer, nread, &size);
|
||||
if (result)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (result) {
|
||||
Curl_formclean(firstform);
|
||||
free(boundary);
|
||||
@@ -1112,19 +1109,19 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
return CURLE_READ_ERROR;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (post->flags & HTTPPOST_BUFFER) {
|
||||
/* include contents of buffer */
|
||||
result = AddFormData(&form, post->buffer, post->bufferlength,
|
||||
&size);
|
||||
result = AddFormData(&form, FORM_DATA, post->buffer,
|
||||
post->bufferlength, &size);
|
||||
if (result)
|
||||
break;
|
||||
}
|
||||
|
||||
else {
|
||||
/* include the contents we got */
|
||||
result = AddFormData(&form, post->contents, post->contentslength,
|
||||
&size);
|
||||
result = AddFormData(&form, FORM_DATA, post->contents,
|
||||
post->contentslength, &size);
|
||||
if (result)
|
||||
break;
|
||||
}
|
||||
@@ -1140,7 +1137,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
||||
boundary: */
|
||||
result = AddFormDataf(&form, &size,
|
||||
"\r\n--%s--",
|
||||
fileboundary);
|
||||
fileboundary);
|
||||
free(fileboundary);
|
||||
if (result)
|
||||
break;
|
||||
@@ -1183,10 +1180,32 @@ int Curl_FormInit(struct Form *form, struct FormData *formdata )
|
||||
|
||||
form->data = formdata;
|
||||
form->sent = 0;
|
||||
form->fp = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static size_t readfromfile(struct Form *form, char *buffer, size_t size)
|
||||
{
|
||||
size_t nread;
|
||||
if(!form->fp) {
|
||||
/* this file hasn't yet been opened */
|
||||
form->fp = fopen(form->data->line, "rb"); /* b is for binary */
|
||||
if(!form->fp)
|
||||
return -1; /* failure */
|
||||
}
|
||||
nread = fread(buffer, 1, size, form->fp);
|
||||
|
||||
if(nread != size) {
|
||||
/* this is the last chunk form the file, move on */
|
||||
fclose(form->fp);
|
||||
form->fp = NULL;
|
||||
form->data = form->data->next;
|
||||
}
|
||||
|
||||
return nread;
|
||||
}
|
||||
|
||||
/*
|
||||
* Curl_FormReader() is the fread() emulation function that will be used to
|
||||
* deliver the formdata to the transfer loop and then sent away to the peer.
|
||||
@@ -1207,8 +1226,11 @@ size_t Curl_FormReader(char *buffer,
|
||||
if(!form->data)
|
||||
return 0; /* nothing, error, empty */
|
||||
|
||||
if(form->data->type == FORM_FILE)
|
||||
return readfromfile(form, buffer, wantedsize);
|
||||
|
||||
do {
|
||||
|
||||
|
||||
if( (form->data->length - form->sent ) > wantedsize - gotsize) {
|
||||
|
||||
memcpy(buffer + gotsize , form->data->line + form->sent,
|
||||
@@ -1223,12 +1245,12 @@ size_t Curl_FormReader(char *buffer,
|
||||
form->data->line + form->sent,
|
||||
(form->data->length - form->sent) );
|
||||
gotsize += form->data->length - form->sent;
|
||||
|
||||
|
||||
form->sent = 0;
|
||||
|
||||
form->data = form->data->next; /* advance */
|
||||
|
||||
} while(form->data);
|
||||
} while(form->data && (form->data->type == FORM_DATA));
|
||||
/* If we got an empty line and we have more data, we proceed to the next
|
||||
line immediately to avoid returning zero before we've reached the end.
|
||||
This is the bug reported November 22 1999 on curl 6.3. (Daniel) */
|
||||
@@ -1404,58 +1426,53 @@ int main()
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _OLD_FORM_DEBUG
|
||||
|
||||
int main(int argc, char **argv)
|
||||
#else /* CURL_DISABLE_HTTP */
|
||||
CURLFORMcode curl_formadd(struct curl_httppost **httppost,
|
||||
struct curl_httppost **last_post,
|
||||
...)
|
||||
{
|
||||
#if 0
|
||||
char *testargs[]={
|
||||
"name1 = data in number one",
|
||||
"name2 = number two data",
|
||||
"test = @upload"
|
||||
};
|
||||
#endif
|
||||
int i;
|
||||
char *nextarg;
|
||||
struct curl_httppost *httppost=NULL;
|
||||
struct curl_httppost *last_post=NULL;
|
||||
struct curl_httppost *post;
|
||||
int size;
|
||||
int nread;
|
||||
char buffer[4096];
|
||||
|
||||
struct FormData *form;
|
||||
struct Form formread;
|
||||
|
||||
for(i=1; i<argc; i++) {
|
||||
|
||||
if( FormParse( argv[i],
|
||||
&httppost,
|
||||
&last_post)) {
|
||||
fprintf(stderr, "Illegally formatted input field: '%s'!\n",
|
||||
argv[i]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
form=Curl_getFormData(httppost, &size);
|
||||
|
||||
Curl_FormInit(&formread, form);
|
||||
|
||||
do {
|
||||
nread = Curl_FormReader(buffer, 1, sizeof(buffer),
|
||||
(FILE *)&formread);
|
||||
|
||||
if(-1 == nread)
|
||||
break;
|
||||
fwrite(buffer, nread, 1, stderr);
|
||||
} while(1);
|
||||
|
||||
fprintf(stderr, "size: %d\n", size);
|
||||
|
||||
return 0;
|
||||
(void)httppost;
|
||||
(void)last_post;
|
||||
return CURL_FORMADD_DISABLED;
|
||||
}
|
||||
|
||||
#endif
|
||||
void curl_formfree(struct curl_httppost *form)
|
||||
{
|
||||
(void)form;
|
||||
/* does nothing HTTP is disabled */
|
||||
}
|
||||
|
||||
#endif /* CURL_DISABLE_HTTP */
|
||||
#endif /* CURL_DISABLE_HTTP */
|
||||
|
||||
/*
|
||||
* Curl_FormBoundary() creates a suitable boundary string and returns an
|
||||
* allocated one. This is also used by SSL-code so it must be present even
|
||||
* if HTTP is disabled!
|
||||
*/
|
||||
char *Curl_FormBoundary(void)
|
||||
{
|
||||
char *retstring;
|
||||
static int randomizer=0; /* this is just so that two boundaries within
|
||||
the same form won't be identical */
|
||||
size_t i;
|
||||
|
||||
static char table16[]="abcdef0123456789";
|
||||
|
||||
retstring = (char *)malloc(BOUNDARY_LENGTH+1);
|
||||
|
||||
if(!retstring)
|
||||
return NULL; /* failed */
|
||||
|
||||
srand(time(NULL)+randomizer++); /* seed */
|
||||
|
||||
strcpy(retstring, "----------------------------");
|
||||
|
||||
for(i=strlen(retstring); i<BOUNDARY_LENGTH; i++)
|
||||
retstring[i] = table16[rand()%16];
|
||||
|
||||
/* 28 dashes and 12 hexadecimal digits makes 12^16 (184884258895036416)
|
||||
combinations */
|
||||
retstring[BOUNDARY_LENGTH]=0; /* zero terminate */
|
||||
|
||||
return retstring;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user