Commit Graph

991 Commits

Author SHA1 Message Date
Daniel Stenberg e911945c55 #505514, as correctly pointed out by Antonio (anton@concord.ru), trying to
post a non-existing file should include nothing, not an error text!
2002-01-19 11:08:05 +00:00
Daniel Stenberg 0b177cb165 newly generated 2002-01-18 15:14:35 +00:00
Daniel Stenberg f925979b2f satisfy gcc -Wundef 2002-01-18 13:10:41 +00:00
Daniel Stenberg 49f7fa82b9 #if [undefined] => #ifdef [undefined] 2002-01-18 13:04:48 +00:00
Daniel Stenberg e74b20926d prevents gcc -Wcast-align from complaining 2002-01-18 12:59:33 +00:00
Daniel Stenberg a312127c91 made gcc -Wcast-align happy 2002-01-18 12:56:10 +00:00
Daniel Stenberg 1dc5bf4f73 #ifndef and #define magic to prevent compiler warnings when doing #if BLA
where BLA is undefined
2002-01-18 12:53:05 +00:00
Daniel Stenberg fd307bfe29 cut off a big piece of comment and added a pointer to the Trio web page
should anyone ever want a good printf() clone
2002-01-18 10:45:03 +00:00
Daniel Stenberg 7bfe853af3 I wish I could type. Anyway, this proved it is a good habit to put the NULL
on the left side of comparisons...
2002-01-18 10:36:25 +00:00
Daniel Stenberg cbaecca8e9 added typecast for a malloc() return, and added check for NULL 2002-01-18 10:30:51 +00:00
Daniel Stenberg 8edfb370a8 Added #include <errno.h> 2002-01-18 09:25:58 +00:00
Daniel Stenberg 4c08c8f7db Andrés García patched. It now checks for EWOULDBLOCK properly on windows
boxes.
2002-01-18 08:03:54 +00:00
Daniel Stenberg c174680a03 patched by Andrés García 2002-01-18 08:03:12 +00:00
Daniel Stenberg eba8035e12 Richard Archer made it compile and build with OpenSSL versions prior to
0.9.5
2002-01-17 10:40:13 +00:00
Daniel Stenberg edcbf4350b include our own sprintf() prototype to make it return sensible data on
all platforms, I also edited a few data types slightly to prevent my
compiler from warning on comparisions between signed and unsigned values
2002-01-17 08:03:48 +00:00
Sterling Hughes 9289ea471f Get this working, still need to check for leaks and such, but should be
fine..
2002-01-17 07:38:25 +00:00
Sterling Hughes 7d06185aa6 Make the keys for hostcache entries be in the format::
host:port, so accessing curl.haxx.se on port 80 would yield a key value
of ::
curl.haxx.se:80
2002-01-17 06:55:37 +00:00
Daniel Stenberg e177f14595 SSL writes passed back a silly length... 2002-01-16 23:28:58 +00:00
Daniel Stenberg 5c6eddcadd fixed time-out returned without error text set 2002-01-16 22:26:01 +00:00
Daniel Stenberg b3b4786990 Kevin Roth's SSLeay() patch, slight edited by me. Works with OpenSSL 0.9.5
now.
2002-01-16 17:45:08 +00:00
Daniel Stenberg 8d97792dbc - shrunk the BUFSIZE define from 50K to 20K
- made a separate buffer for uploads (due to the non-blocking stuff)
- added two connectdata struct fields for non-blocking uploads
2002-01-16 14:53:19 +00:00
Daniel Stenberg 8d07c87be7 modified to deal with the new non-blocking versions of Curl_read() and
Curl_write().
2002-01-16 14:50:53 +00:00
Daniel Stenberg ed21701df3 Curl_write's 5th argument now is signed 2002-01-16 14:49:51 +00:00
Daniel Stenberg df01507582 Curl_read() and Curl_write() are both now adjusted to return properly in
cases where EWOULDBLOCK or equivalent is returned. We must not block.
2002-01-16 14:49:08 +00:00
Daniel Stenberg f2bda5fd5b Curl_write() now takes a different 5th argument 2002-01-16 14:47:50 +00:00
Daniel Stenberg cba9838e8f Somewhat ugly fix to deal with non-blocking sockets. We just loop and try
again. THIS IS NOT A NICE FIX.
2002-01-16 14:47:00 +00:00
Daniel Stenberg b6dba9f5dd Somewhat ugly fix to deal with non-blocking sockets. We just loop and try
again. THIS IS NOT A NICE FIX. We should/must make a select() then and only
retry when we can write to the socket again.
2002-01-16 14:46:00 +00:00
Daniel Stenberg 4931fbce49 Curl_read() now returns a negative return code if EWOULDBLOCK or similar 2002-01-14 23:14:59 +00:00
Daniel Stenberg fefc7ea600 a memory leak when name lookup failed is now removed 2002-01-14 23:14:24 +00:00
Sterling Hughes a1f910c159 Remove erreaneous include, setup.h is included one line above 2002-01-14 05:36:28 +00:00
Daniel Stenberg d84a0c51e0 Cris Bailiff found out that when the SSL session cache was filled, libcurl
would crash. This corrects the problem.
2002-01-09 09:38:37 +00:00
Daniel Stenberg d57e09889a added a missing failf() before returning an error code 2002-01-08 23:23:24 +00:00
Daniel Stenberg eecb86bfb0 this seems to correct the SSL reading problem introduced when switching
over to non-blocking sockets, but this loops very nastily. We should return
back to the select() and wait there until more data arrives, not just blindly
attempt again and again...
2002-01-08 23:19:32 +00:00
Daniel Stenberg 75bba0da92 added two typecasts to prevent compiler (gcc3) warnings 2002-01-08 07:06:07 +00:00
Sterling Hughes c0bfe7be15 1) the dns_cache_timeout should be an integer, not a bool
2) in the curl_dns_cache_entry structure, timestamp should be
a time_t instead of an integer (although I doubt it matters).
2002-01-08 04:30:59 +00:00
Sterling Hughes 22ac08e06d Add support for DNS cache timeouts via the CURLOPT_DNS_CACHE_TIMEOUT option.
The default cache timeout for this is 60 seconds, which is arbitrary and
completely subject to change :)
2002-01-08 04:26:47 +00:00
Daniel Stenberg 87037136ef As identified in bug report #495290, the last "name=value" pair in a
Set-Cookie: line was ignored if they didn't end with a trailing
semicolon. This is indeed wrong syntax, but there are high-profile web sites
out there sending cookies like that so we must make a best-effort to parse
them.
2002-01-07 23:05:36 +00:00
Daniel Stenberg 2182e37433 the bool typedef is now made unsigned, to make sure it stays that on all
platforms, unrelated to what they might prefer by default
2002-01-07 22:47:21 +00:00
Daniel Stenberg 1de82b220d removed silly check for >=0 of a supposedly unsigned value! 2002-01-07 22:46:38 +00:00
Sterling Hughes bd878756fc Probably not necessary, but good practice. 2002-01-07 20:55:35 +00:00
Sterling Hughes 8d7f402efb Make cach'ing work with threads now, there are now three cases:
- Use a global dns cache (via setting the tentatively named,
    CURLOPT_DNS_USE_GLOBAL_CACHE option to true)
    - Use a per-handle dns cache, by default
    - Use a pooled dns cache when in the "multi" interface
2002-01-07 20:52:32 +00:00
Daniel Stenberg d3299beec7 Modified to use non-blocking sockets all the time. 2002-01-07 18:38:01 +00:00
Daniel Stenberg c69c0c0446 added proper breaks in the switch() 2002-01-07 15:24:52 +00:00
Daniel Stenberg e31a306a38 HTTP response 204 should be treated similar to 304, that is we must not
expect (nor read) any response-body
2002-01-07 14:57:18 +00:00
Daniel Stenberg d9a7773011 added precautions to not go insane when two matching cookies end up in the
cookie list, even though they're not supposed to do that...
2002-01-07 14:56:15 +00:00
sm 2b14916813 Add hash and llist to VC dsp file 2002-01-04 23:48:28 +00:00
sm 1d1530e14c Add hash and llist to VC makefile 2002-01-04 23:47:07 +00:00
Daniel Stenberg 5a0f0023cf replaced printf() => Curl_sendf() 2002-01-04 09:53:39 +00:00
Daniel Stenberg 6dcdb8b821 removed a commented line 2002-01-04 09:53:10 +00:00
Daniel Stenberg 781f52a287 fixed an inet_ntoa() occurance to use inet_ntoa_r() if it is available.
I also replaced all printf() calls with calls to Curl_failf()
2002-01-04 09:52:44 +00:00
Daniel Stenberg f75ff58b4b an unconditional occurance of inet_ntoa() now uses inet_ntoa_r() on all
platforms that have such a function.
This affects multi-thread running libcurls on IPv4 systems that have VERBOSE
switched on. The previous version was risking that another thread overwrote
the data before it was read out in this thread. There could possibly also
be a slight risk that the data isn't zero terminated for a short while and
thus could cause the thread to crash...
2002-01-04 09:38:52 +00:00
Daniel Stenberg ae9bf16dee #include the local "inet_ntoa_r.h" file if no proto was found in the global
header directory but the function *is* present!
2002-01-04 09:35:23 +00:00
Daniel Stenberg 17a8bf212f The buffer in ftp_pasv_verbose(), used for gethostbyaddr_r(), is now defined
to become properly 8-byte aligned on 64-bit archs. Philip Gladstone reported.
2002-01-04 09:17:52 +00:00
Daniel Stenberg 4fc76afef4 The FTP response lines are now passed to the function callback registered for
headers.
2002-01-04 09:03:11 +00:00
Daniel Stenberg 8b6314ccfb merged the multi-dev branch back into MAIN again 2002-01-03 15:01:22 +00:00
Daniel Stenberg 6de7dc5879 Sterling Hughes' provided initial DNS cache source code. 2002-01-03 10:22:59 +00:00
Daniel Stenberg 6aaee5f23b minor changes 2002-01-03 09:43:17 +00:00
Daniel Stenberg 0077b9c0a2 pass an 'int' as the third argument to bind() 2002-01-03 00:51:33 +00:00
Daniel Stenberg fe37fb5921 Philip Gladstone's 64-bit sparc native compiler compatibility issues fixed. 2002-01-02 10:06:47 +00:00
Daniel Stenberg 8a9098a36c *cool* fix by Björn Stenberg, makes proxy transfers work better...! :-) 2001-12-20 15:58:22 +00:00
Daniel Stenberg 28027c2aa2 If nobody is set we won't download any FTP file. If include_header is set,
we return a set of headers not more. This enables FTP operations that don't
transfer any data, only perform FTP commands.
2001-12-20 11:22:01 +00:00
Daniel Stenberg af6c394785 Götz Babin-Ebell's OpenSSL ENGINE patch 2001-12-17 23:01:39 +00:00
Daniel Stenberg 2eb355733f Marcus Webster's newly added CURLFORM_CONTENTHEADER 2001-12-14 12:59:16 +00:00
Daniel Stenberg e66cdacb93 minor changes 2001-12-13 07:16:27 +00:00
Daniel Stenberg c67f2da283 solaris 2.5.1 needs the sys/types.h file before the sys/socket.h 2001-12-11 15:08:27 +00:00
Daniel Stenberg e192261788 failf() calls should not have newlines in the message string! 2001-12-11 13:13:01 +00:00
Daniel Stenberg 47e67eab26 corrected the comment above gmtime_r 2001-12-07 15:56:57 +00:00
Daniel Stenberg 650b95045d added gmtime_r check 2001-12-07 15:51:59 +00:00
Daniel Stenberg 7b832e1745 Jon Travis suggested fix. when CURLOPT_HTTPGET is used we must assign
set.upload to FALSE or else we might still get an upload if the previous
operation was an upload!
2001-12-05 06:47:01 +00:00
Daniel Stenberg 436d147925 Eric's #include fixes for better macos compiles 2001-12-04 13:03:08 +00:00
Daniel Stenberg 7ee6a9dc25 i'm soooo funny 2001-12-04 09:14:41 +00:00
Daniel Stenberg d52c0b6f05 more comments 2001-12-04 07:47:21 +00:00
Daniel Stenberg 779043f7a3 As Eric Lavigne pointed out, the ftp response reader MUST cache data that
is not dealt with when we find an end-of-response line, as there might be
important stuff even after the correct line. So on subsequent invokes, the
cached data must be used!
2001-12-03 13:48:59 +00:00
Daniel Stenberg 7493db2338 Eric nailed a but in strnequal() for macintosh 2001-12-03 12:57:45 +00:00
Daniel Stenberg c16c017f8b more careful re-use of connections when SSL is used over proxies 2001-12-02 14:16:34 +00:00
Daniel Stenberg 2f03ef39d1 SM renamed the debug DLL 2001-12-02 12:09:00 +00:00
Daniel Stenberg 533c24a471 disabling EPSV is now possible 2001-11-29 12:49:10 +00:00
Daniel Stenberg 6a9697387a stdin is file descriptor 0 2001-11-29 12:48:08 +00:00
Daniel Stenberg 332eb7651a CURLOPT_FTP_USE_EPSV can now be set to FALSE to prevent libcurl from
attempting to use EPSV before the standard PASV.
2001-11-28 23:20:14 +00:00
Daniel Stenberg cfdcf5c933 fill memory with junk on malloc() 2001-11-28 23:19:17 +00:00
Daniel Stenberg a32cd520bd more more more MORE 2001-11-28 16:00:18 +00:00
Daniel Stenberg b93a60daf9 the perform "state machine" is more explained now 2001-11-28 15:46:25 +00:00
Daniel Stenberg e2844f5e04 mods 2001-11-28 15:25:01 +00:00
Daniel Stenberg f0d3fccd4b Added EPSV which is now unconditionally always tried before PASV, which
makes it work reaaaaly nicely on IPv6-enabled hosts!
Added SIZE before RETR is made, always done on downloads. It makes us know
the size prior to download much more frequently.
Unfortunately, this breaks all the FTP test cases. *fixfixfix*
2001-11-28 13:05:39 +00:00
Daniel Stenberg aff19f64b5 use in_addr_t for inet_addr() return code. Now, now portable is this *REALLY*?
We should add some configure tests for this!
2001-11-28 12:16:52 +00:00
Daniel Stenberg 15a56b42d6 used in the new multi interface, not yet actually part of libcurl but
added to CVS to make them available to others
2001-11-28 11:09:18 +00:00
Daniel Stenberg dccc77a325 Eric Lavigne updates 2001-11-27 07:27:32 +00:00
Daniel Stenberg bbf80d0f93 commented out the EPSV support 2001-11-27 00:50:52 +00:00
Daniel Stenberg 6003f24f78 initial code added to support EPSV (IPv6-style PASV) 2001-11-27 00:48:45 +00:00
Daniel Stenberg f0ee7115d3 Andrés García's minor fix to make it compile on win32 2001-11-23 09:04:56 +00:00
Daniel Stenberg 0e7203be89 this fix seems to make the connect fail properly even on IPv4-only Linux
machines!
2001-11-22 13:57:00 +00:00
Daniel Stenberg 1c8da21083 Eric fixed a wild write 2001-11-22 09:40:34 +00:00
Daniel Stenberg 8f304d8167 Eric found a missing comma!! 2001-11-22 09:39:03 +00:00
sm 30a0bd9cf5 Fixed release-ssl build 2001-11-22 00:12:48 +00:00
Daniel Stenberg d1ea596f88 SM added connect.obj 2001-11-21 23:10:55 +00:00
Daniel Stenberg 17b18bca3c added error text for a failed connect case 2001-11-21 22:57:42 +00:00
Daniel Stenberg ca0fd33d2d Georg Horn's STARTTRANSFER_TIME patch 2001-11-20 15:00:50 +00:00
Daniel Stenberg b0130e6b3b use the ws2_32.lib now (Miklos Nemeth reporteD) 2001-11-19 20:09:02 +00:00
Daniel Stenberg d0c1f3e25b long port => int port, as the c source uses! (Miklos Nemeth found this) 2001-11-19 20:08:01 +00:00
Daniel Stenberg b244710ddb Miklos Nemeth pointed out the missing connect.obj 2001-11-19 20:06:29 +00:00
Daniel Stenberg e6dd4a6456 Klevtsov Vadim's time condition fix 2001-11-16 11:21:50 +00:00
Sterling Hughes 8d62e21072 looks better on one line (testing the cvs diffing via mail, but I also think
this looks a bit better ;)
2001-11-15 14:16:13 +00:00
Daniel Stenberg b8ff21124a Samuel Listopad's fix to allow global_init => global_cleanup => global_init
for ssl
2001-11-14 07:11:39 +00:00
Daniel Stenberg 6aafc2dfd2 corrected the ftp_getsize() usage, as the HPUX compiler warned on them 2001-11-13 12:46:29 +00:00
Daniel Stenberg 65b22480f4 uninitialized variable 2001-11-13 12:09:05 +00:00
Daniel Stenberg c2479ccb7a my proxytunnel fix accidentally ruined the normal https connects 2001-11-13 08:34:24 +00:00
Daniel Stenberg c7cdb0f266 make sure to "read out" the server reply even if we didn't get any data from
the server when that's the only error
2001-11-12 22:27:05 +00:00
Daniel Stenberg 92aedf850e made Curl_tvdiff round the diff better and make the subtraction before
the multiply to not wrap-around
2001-11-12 22:10:09 +00:00
Daniel Stenberg 05f3ca880f made CURLOPT_HTTPPROXYTUNNEL work for plain HTTP as well 2001-11-12 14:08:41 +00:00
Daniel Stenberg a18d41a463 include setup.h 2001-11-12 10:19:36 +00:00
Daniel Stenberg 1affbff8f9 new Curl_ConnectHTTPProxyTunnel() function, needs a **lot** of testing!!! 2001-11-12 09:47:09 +00:00
Daniel Stenberg c55d0bb804 We need at least one millisecond to calculate current speed with! I also
made the getinfo() stuff divide with 1000.0 now to enforce floating point
since Paul Harrington claims the 7.9.1 still uses even second resolution
in the timers there
2001-11-12 08:50:59 +00:00
Daniel Stenberg 0ffec712e1 Marcus Webster reported and fixed this read-one-byte-too-many problem... 2001-11-08 15:06:58 +00:00
Daniel Stenberg fe3a78ab19 we use signal() to ignore signals only as long as we have to, and we now
restore the previous (if any) signal handler properly on return.
2001-11-07 14:13:29 +00:00
Daniel Stenberg 1a984ea847 get the previous struct keep_sigact 2001-11-07 12:56:13 +00:00
Daniel Stenberg 2a0cde3041 adjusted after Ramana Mokkapati's comments 2001-11-07 09:39:49 +00:00
Daniel Stenberg 2e32d415c0 myalarm() is history, we now use HAVE_ALARM and we now do our very best to
1 - restore the previous sigaction struct as soon as we are about to shut
off our timeout
2 - restore the previous alarm() timeout, in case an application or similar
had it running before we "borrowed" it for a while.

No, this does not fix the multi-thread problem you get with alarm(). This
patch should correct bug report #478780:
//sourceforge.net/tracker/?func=detail&atid=100976&aid=478780&group_id=976

If not, please post details!
2001-11-06 19:33:13 +00:00
Daniel Stenberg 2f77b0a4c6 we can now tell ssl to use TLSv1 protocol, and we now use defines instead
of real integers for versions, the defines are added to curl.h
2001-11-05 14:06:42 +00:00
Daniel Stenberg 08ad385e0e Ramana Mokkapati did some good bug hunting, and we these fixes ldap transfers
should work a lot better!
2001-11-05 14:04:57 +00:00
Daniel Stenberg 5623e0bb0e corrected the Curl_tvnow prototype (-Wstrict-prototypes found it) 2001-11-05 12:37:22 +00:00
Daniel Stenberg 3d438d8d64 Curl_ftpsendf() had wrong return type 2001-11-05 12:24:21 +00:00
Daniel Stenberg f5ba174f4d John Lask's new makefile 2001-11-05 11:56:26 +00:00
Daniel Stenberg 4163b86cd2 failf() now only overwrites the error buffer the first time it gets called
for each *_perform(). It makes things a lot easier, as the first one that
detects the error get to write the final error reason...
2001-11-02 22:30:34 +00:00
Daniel Stenberg dc82f9e6df Replaced read() and write() with recv() and send() for socket operations
even under normal unixes.
2001-11-02 13:04:23 +00:00
Daniel Stenberg c6caa9fd60 Added connect.c. I really need someone to better maintain this makefile... 2001-11-02 08:32:38 +00:00
Daniel Stenberg c84ad40ccd Jörn added connect.c 2001-11-02 08:32:13 +00:00
Daniel Stenberg 9b6545c479 ConnectionExists() now returns FALSE immediately if it finds a connection
that is dead, because it can only find one entry anyway and if that is dead
there won't be any other entry that matches
2001-11-01 13:54:32 +00:00
Daniel Stenberg 96fb118251 added comments and function headers 2001-11-01 12:47:22 +00:00
Daniel Stenberg 617d6eb7ce Update the byte counters in the loop so that aborted transfers have the
information as well. Improves debug outputs etc.
2001-11-01 12:18:53 +00:00
Daniel Stenberg 99888388dc Use Curl_tvdiff to compare times 2001-11-01 12:17:51 +00:00
Daniel Stenberg 027fc719cc fixed FTPSENDF for ipv6 compiles 2001-10-31 20:59:24 +00:00
Daniel Stenberg c4f1a9f690 Removed the SocketIsDead() stuff for SSL again as it doesn't work. We must
rely on the new go-ahead-and-try mechanism that I just added to Transfer()
2001-10-31 15:14:52 +00:00
Daniel Stenberg 542055074b If Curl_do() fails with CURLE_WRITE_ERROR on a re-used connection, this
new logic can retry the same operation on a new connection!
2001-10-31 15:13:19 +00:00
Daniel Stenberg 7b93348aae Curl_sendf now returns a CURLcode 2001-10-31 15:08:16 +00:00
Daniel Stenberg eaf475b538 return type cleanup 2001-10-31 15:07:45 +00:00
Daniel Stenberg 4118c68df1 check Curl_ftpsendf return codes 2001-10-31 15:06:38 +00:00
Daniel Stenberg 69d5d88259 Added better checking of return codes when we send data to sockets/connections 2001-10-31 14:57:00 +00:00
Daniel Stenberg 7e6a36ea7b major commit, now we check the return code on every invoke of Curl_ftpsendf
- which now is made using a macro named FTPSENDF. I turned it all caps just
to make it more visible that it is in fact a macro.
2001-10-31 14:56:12 +00:00
Daniel Stenberg 6878c0b88f check return code when issuing the request 2001-10-31 14:48:10 +00:00
Daniel Stenberg bbdc9f15e7 added typecasts to make the timers calculate with doubles, not longs as they
accidentally did after the Curl_tvdiff() interface change
2001-10-31 14:45:47 +00:00
Daniel Stenberg b07e2a08f9 nonblock => Curl_nonblock, remade the check for a live SSL connection (again) 2001-10-31 08:44:11 +00:00
Daniel Stenberg dbd32278f8 Added an additional SSL check for a dead socket before we re-use an SSL
connection. The simple socket-check is not enough in these cases.
2001-10-30 15:21:45 +00:00
Daniel Stenberg 6d35984286 prevent strdup()ing NULL -- Paul Harrington's report 2001-10-30 12:08:17 +00:00
Daniel Stenberg c9954d1941 added curl_formadd 2001-10-29 13:28:44 +00:00
Daniel Stenberg e165332211 minor fix to support multiple files in one formadd() call 2001-10-29 13:21:25 +00:00
Daniel Stenberg 42a9d96fae fixed conn->name error on connection re-use and enlarged the 'gname' array
to hold 512 bytes (for user+password+hostname)
2001-10-29 10:10:21 +00:00
Daniel Stenberg 3edd9b4dfc SM's waitconnect return code fix! 2001-10-29 07:49:57 +00:00
Daniel Stenberg babb985f1a made 'timespent' a double, which makes more accurate calculations for quick
downloads
2001-10-26 11:25:03 +00:00
Daniel Stenberg d733061873 bug report #474568 -
We need to set "no further data to download" before the Curl_ldap() function
returns, as otherwise it'll hang on that assumed transfer.
2001-10-25 08:28:29 +00:00
Daniel Stenberg c6822f5a7f T. Bharath found this memory leak. It occurs when we replace an internally
already existing cookie with a new one.
2001-10-24 11:36:55 +00:00