1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-02 08:35:03 -04:00
Commit Graph

439 Commits

Author SHA1 Message Date
Daniel Stenberg
cfdcae4bc7 Based on a patch by Armel Asselin, the FTP code no longer re-issues the TYPE
command on subsequent requests on a re-used connection unless it has to.
2006-08-19 21:18:36 +00:00
Daniel Stenberg
490cccba3c Andrew Biggs pointed out a "Expect: 100-continue" flaw where libcurl didn't
send the whole request at once, even though the Expect: header was disabled
by the application. An effect of this change is also that small (< 1024
bytes) POSTs are now always sent without Expect: header since we deem it
more costly to bother about that than the risk that we send the data in
vain.
2006-08-18 22:54:57 +00:00
Daniel Stenberg
a4ebf5b507 Fixed a flaw in the "Expect: 100-continue" treatment. If you did two POSTs
on a persistent connection and allowed the first to use that header, you
could not disable it for the second request.
2006-08-08 21:12:49 +00:00
Daniel Stenberg
8a38c72c48 Mark Lentczner fixed how libcurl was not properly doing chunked encoding
if the header "Transfer-Encoding: chunked" was set by the application.
http://curl.haxx.se/bug/view.cgi?id=1531838
2006-08-02 18:18:47 +00:00
Daniel Stenberg
a88deadd6f Yves Lejeune fixed so that replacing Content-Type: when doing multipart
formposts work exactly the way you want it (and the way you'd assume it
works)
2006-07-27 22:35:09 +00:00
Yang Tse
4ac54f8c2c remove variable declaration shadowing previously declared one 2006-07-19 18:32:38 +00:00
Yang Tse
840aacf7dd Remove variable declaration shadowing previously declared one 2006-07-19 18:19:30 +00:00
Daniel Stenberg
8bed45340a Toshiyuki Maezawa fixed a problem where you couldn't override the
Proxy-Connection: header when using a proxy and not doing CONNECT.
2006-07-04 12:01:59 +00:00
Daniel Stenberg
b62c230ca2 Curl_https_getsock() was OpenSSL-specific and really should not be present
like this in this source file. The quickfix for now is to provide a simple
version for GnuTLS builds. The GnuTLS version of libcurl doesn't yet allow
fully non-blocking connects anyway so this function doesn't get used.
2006-05-05 22:14:40 +00:00
Daniel Stenberg
e85e30546c Roland Blom filed bug report #1481217
(http://curl.haxx.se/bug/view.cgi?id=1481217), with follow-ups by Michele Bini
and David Byron. libcurl previously wrongly used GetLastError() on windows to
get error details after socket-related function calls, when it really should
use WSAGetLastError() instead.

When changing to this, the former function Curl_ourerrno() is now instead
called Curl_sockerrno() as it is necessary to only use it to get errno from
socket-related functions as otherwise it won't work as intended on Windows.
2006-05-04 22:39:47 +00:00
Daniel Stenberg
686d90745b First curl_multi_socket() commit. Should primarily be considered as an internal
code rearrange to fit the future better.
2006-04-10 15:00:53 +00:00
Daniel Stenberg
83367f67de Xavier Bouchoux made the SSL connection non-blocking for the multi interface
(when using OpenSSL).
2006-03-21 21:54:44 +00:00
Daniel Stenberg
87bcb6f377 Karl M added the CURLOPT_CONNECT_ONLY and CURLINFO_LASTSOCKET options that
an app can use to let libcurl only connect to a remote host and then extract
the socket from libcurl. libcurl will then not attempt to do any transfer at
all after the connect is done.
2006-02-11 22:35:16 +00:00
Daniel Stenberg
bda1e9aeab Made the copyright year match the latest modification's year. 2006-01-09 13:17:14 +00:00
Daniel Stenberg
f4cc8153ae Mike Jean fixed so that the second CONNECT when doing FTP over a HTTP proxy
actually used a new connection and not sent the second request on the first
socket!
2006-01-07 22:24:16 +00:00
Daniel Stenberg
be9c873a6e Dave Dribin made libcurl understand and handle cases when the server
(wrongly) sends *two* WWW-Authenticate headers for Digest. While this should
never happen in a sane world, libcurl previously got into an infinite loop
when this occurred. Dave added test 273 to verify this.
2005-10-20 20:07:32 +00:00
Daniel Stenberg
c3a826fdce correction for the 407 with response-body case 2005-07-05 22:07:34 +00:00
Daniel Stenberg
20005a83d2 Andrew Bushnell provided enough info for me to tell that we badly needed to
fix the CONNECT authentication code with multi-pass auth methods (such as
NTLM) as it didn't previously properly ignore response-bodies - in fact it
stopped reading after all response headers had been received. This could
lead to libcurl sending the next request and reading the body from the first
request as response to the second request. (I also renamed the function,
which wasn't strictly necessary but...)

The best fix would to once and for all make the CONNECT code use the
ordinary request sending/receiving code, treating it as any ordinary request
instead of the special-purpose function we have now. It should make it
better for multi-interface too. And possibly lead to less code...

Added test case 265 for this. It doesn't work as a _really_ good test case
since the test proxy is too stupid, but the test case helps when running the
debugger to verify.
2005-07-03 22:25:15 +00:00
Daniel Stenberg
5d9fc28fa7 Modified the default HTTP headers used by libcurl:
A) Normal non-proxy HTTP:

 - no more "Pragma: no-cache" (this only makes sense to proxies)

B) Non-CONNECT HTTP request over proxy:

 - "Pragma: no-cache" is used (like before)
 - "Proxy-Connection: Keep-alive" (for older style 1.0-proxies)

C) CONNECT HTTP request over proxy:

 - "Host: [name]:[port]"
 - "Proxy-Connection: Keep-alive"
2005-05-11 09:52:59 +00:00
Daniel Stenberg
01165e08e0 Fred New reported a bug where we used Basic auth and user name and password in
.netrc, and when following a Location: the subsequent requests didn't properly
use the auth as found in the netrc file. Added test case 257 to verify my fix.
2005-04-25 21:39:48 +00:00
Daniel Stenberg
c904b6b5bf Toshiyuki Maezawa reported that when doing a POST with a read callback,
libcurl didn't properly send an Expect: 100-continue header. It does now.
2005-04-18 17:14:58 +00:00
Daniel Stenberg
6e61939382 GnuTLS support added. There's now a "generic" SSL layer that we use all over
internally, with code provided by sslgen.c. All SSL-layer-specific code is
then written in ssluse.c (for OpenSSL) and gtls.c (for GnuTLS).

As far as possible, internals should not need to know what SSL layer that is
in use. Building with GnuTLS currently makes two test cases fail.

TODO.gnutls contains a few known outstanding issues for the GnuTLS support.

GnuTLS support is enabled with configure --with-gnutls
2005-04-07 15:27:13 +00:00
Daniel Stenberg
74816fed6c Hardeep Singh reported a problem doing HTTP POST with Digest. (It was actually
also affecting NTLM and Negotiate.) It turned out that if the server responded
with 100 Continue before the initial 401 response, libcurl didn't take care of
the response properly. Test case 245 and 246 added to verify this.
2005-04-03 22:46:25 +00:00
Daniel Stenberg
158588640a Don't close the connection if we're in a known negotiation mode and we won't
send any data anyway. Probably the bug Tom Moers noticed.
2005-03-29 12:28:25 +00:00
Daniel Stenberg
8a076d1dba Based on Augustus Saunders' comments and findings, the HTTP output auth
function was fixed to use the proper proxy authentication when multiple ones
were added as accepted. test 239 and test 243 were added to repeat the
problems and verify the fixes.
2005-03-28 22:19:31 +00:00
Daniel Stenberg
d1d35ba85f Christopher R. Palmer made it possible to build libcurl with the
USE_WINDOWS_SSPI on Windows, and then libcurl will be built to use the native
way to do NTLM. SSPI also allows libcurl to pass on the current user and its
password in the request.
2005-03-10 23:15:29 +00:00
Daniel Stenberg
5ba188ab2d Ralph Mitchell reported a flaw when you used a proxy with auth, and you
requested data from a host and then followed a redirect to another
host. libcurl then didn't use the proxy-auth properly in the second request,
due to the host-only check for original host name wrongly being extended to
the proxy auth as well. Added test case 233 to verify the flaw and that the
fix removed the problem.
2005-02-18 23:53:07 +00:00
Daniel Stenberg
ac022b2e30 Christopher R. Palmer reported a problem with HTTP-POSTing using "anyauth"
that picks NTLM. Thanks to David Byron letting me test NTLM against his
servers, I could quickly repeat and fix the problem. It turned out to be:

When libcurl POSTs without knowing/using an authentication and it gets back a
list of types from which it picks NTLM, it needs to either continue sending
its data if it keeps the connection alive, or not send the data but close the
connection. Then do the first step in the NTLM auth. libcurl didn't send the
data nor close the connection but simply read the response-body and then sent
the first negotiation step. Which then failed miserably of course. The fixed
version forces a connection if there is more than 2000 bytes left to send.
2005-02-16 14:31:23 +00:00
Daniel Stenberg
e7cefd684b Removed all uses of strftime() since it uses the localised version of the
week day names and month names and servers don't like that.
2005-02-11 00:03:49 +00:00
Daniel Stenberg
6a2e21ec8c FTP code turned into state machine. Not completely yet, but a good start.
The tag 'before_ftp_statemachine' was set just before this commit in case
of future need.
2005-02-09 13:06:40 +00:00
Gisle Vanem
7b23eff9cf Preserve previous status in Curl_http_done(). 2005-02-06 12:43:40 +00:00
Daniel Stenberg
7e42cb61f7 FTP third transfer support overhaul. See CHANGES for details. 2005-01-21 09:32:32 +00:00
Daniel Stenberg
494c40fd98 NULL the fp pointer after it has been fclosed() 2004-12-16 13:55:19 +00:00
Daniel Stenberg
d3b414724b Dinar in bug report #1086121, found a file handle leak when a multipart
formpost (including a file upload part) was aborted before the whole file was
sent.
2004-12-16 09:52:36 +00:00
Daniel Stenberg
c0c885a1f3 don't try the rewind if no http struct is allocated yet 2004-12-10 14:45:35 +00:00
Daniel Stenberg
ac269a8f68 Dan Fandrich added the --disable-cookies option to configure to build
libcurl without cookie support. This is mainly useful if you want to build a
minimalistic libcurl with no cookies support at all. Like for embedded
systems or similar.
2004-12-05 23:59:32 +00:00
Daniel Stenberg
6ac9e67bd7 made the intended one hour default timeout in the CONNECT loop actually work 2004-12-02 23:30:13 +00:00
Daniel Stenberg
8726a6b6ed comment cleanup 2004-12-02 22:52:14 +00:00
Daniel Stenberg
15360e5e51 prevent an initial "(nil)" to get sent in the initial request when doing
CONNECT to a proxy with digest
2004-12-02 17:08:37 +00:00
Daniel Stenberg
3e1caa6185 HTTP "auth done right". See lib/README.httpauth 2004-11-24 16:11:35 +00:00
Daniel Stenberg
1a05a90f1c David Phillips' FD_SETSIZE fix 2004-11-19 08:52:33 +00:00
Daniel Stenberg
94043b1150 Dan Fandrich added the --disable-crypto-auth option to configure to allow
libcurl to build without Digest support. (I figure it should also explicitly
disable Negotiate and NTLM.)
2004-11-12 09:18:14 +00:00
Daniel Stenberg
59c063dfd3 Fix behaviour when passing NULL to CURLOPT_POSTFIELDS and CURLOPT_HTTPPOST. 2004-11-11 23:11:04 +00:00
Daniel Stenberg
6b49fd7483 Tim Sneddon's VMS fix for huge HTTP POSTs 2004-11-05 14:43:35 +00:00
Daniel Stenberg
24d47a6e07 Paul Nolan fix to make libcurl build nicely on Windows CE 2004-11-02 10:12:22 +00:00
Daniel Stenberg
a00e7f0f5e Tomas Pospisek filed bug report #1053287 that proved -C - and --fail on a
file that was already completely downloaded caused an error, while it
doesn't if you don't use --fail! I added test case 194 to verify the fix.
Grrr. CURLOPT_FAILONERROR is now added to the list stuff to remove in
libcurl v8 due to all the kludges needed to support it.
2004-10-25 11:28:40 +00:00
Daniel Stenberg
39af394a1c removed tabs and trailing whitespace from source 2004-10-06 07:50:18 +00:00
Daniel Stenberg
b8b56248bd - Bug report #1025986. When following a Location: with a custom Host: header
replacement, curl only replaced the Host: header on the initial request
  and didn't replace it on the following ones. This resulted in requests with
  two Host: headers.

  Now, curl checks if the location is on the same host as the initial request
  and then continues to replace the Host: header. And when it moves to another
  host, it doesn't replace the Host: header but it also doesn't make the
  second Host: header get used in the request.

  This change is verified by the two new test cases 184 and 185.
2004-09-10 20:58:51 +00:00
Daniel Stenberg
723bfe42e7 Roman Koifman pointed out that libcurl send Expect: 100-continue on POSTs and
PUTs even when told to use HTTP 1.0, which is not correct.
2004-08-23 12:34:55 +00:00
Daniel Stenberg
2646af106b allow a custom "Accept-Encoding:" header override the internally set one
that gets set with CURLOPT_ENCODING
2004-08-16 13:25:30 +00:00
Daniel Stenberg
45197b188e Roland Krikava's cookies over proxy fix. 2004-08-16 07:24:25 +00:00
Daniel Stenberg
a7bed4fc7c Fixes Brian Akins' reported problems with duplicate Host: headers on re-used
connections.
2004-07-28 21:13:29 +00:00
Daniel Stenberg
fcfd4bef2d typecast to prevent picky compiler warning 2004-07-01 07:30:19 +00:00
Daniel Stenberg
e35187741b spellfixed comments 2004-07-01 06:08:06 +00:00
Daniel Stenberg
0031d76f2a use snprintf() to be on the safe side 2004-06-24 10:43:22 +00:00
Daniel Stenberg
cd7a0f829f When doing auth negotiations or authprobing, we only consider HTTP code
<300 to be good.
2004-06-19 10:10:24 +00:00
Daniel Stenberg
d4b577114b 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.
2004-06-18 06:15:26 +00:00
Daniel Stenberg
80a1e972fc Fix the auth code to enable us to i.e set DIGEST and then find out that the
server doesn't require any auth at all and then we just continue nicely. We
now have an extra bit in the connection struct named 'authprobe' that is TRUE
when doing pure "HTTP authentication probing".
2004-06-15 08:45:22 +00:00
Daniel Stenberg
4cd96483f6 moved default: in a switch case to prevent compiler warning that 'request'
might be used uninitialized
2004-06-13 09:08:38 +00:00
Daniel Stenberg
fce9d51122 updated a comment 2004-06-03 14:42:08 +00:00
Daniel Stenberg
ea81dd9e2e Alexander Krasnostavsky's FTP third party transfer (proxy) support 2004-06-03 11:41:05 +00:00
Daniel Stenberg
2c43d64302 Added a new 'bit' in the connect struct named 'tunnel_proxy' that is set
if a connection is tunneled through a proxy. A tunnel is done with CONNECT,
either when using HTTPS or FTPS, or if explicitly enabled by the app.
2004-05-26 08:54:36 +00:00
Daniel Stenberg
59f904d8de Robert D. Young reported that CURLOPT_COOKIEFILE and CURLOPT_COOKIE could
not be used both in one request. Fixed it and added test case 172 to verify.
2004-05-24 07:13:48 +00:00
Daniel Stenberg
d60c22572b Curl_done() and the protocol-specific conn->curl_done() functions now all
take a CURLcode as a second argument, that is non-zero when Curl_done()
is called after an error was returned from Curl_do() (or similar).
2004-05-12 12:06:39 +00:00
Daniel Stenberg
bbafb2eb27 curl_global_init_mem() allows the memory functions to be replaced.
memory.h is included everywhere for this.
2004-05-11 11:30:23 +00:00
Daniel Stenberg
63f97b38eb Moved the fetching of the list of matching cookies to make it easier to free
that list in case something goes wrong in the function and we must bail out.
Courtesy of the torture testing.
2004-05-10 14:22:20 +00:00
Daniel Stenberg
1f798affb9 typo 2004-05-10 10:52:29 +00:00
Daniel Stenberg
71fdc063bd better detection for when add_buffer() returns failure, and return when that
happens
2004-05-10 10:49:35 +00:00
Daniel Stenberg
afc1ed60f7 initiate variables properly to default to no auth for server and proxy 2004-05-05 13:00:03 +00:00
Daniel Stenberg
76ff92b811 bail out when an add_buffer() function returns failure 2004-05-04 14:27:07 +00:00
Daniel Stenberg
08d1da106e check malloc() return code 2004-05-04 13:39:24 +00:00
Daniel Stenberg
fc6eff13b5 General HTTP authentication cleanup and fixes 2004-05-04 07:52:53 +00:00
Daniel Stenberg
59907ebc0e fixed the host/proxy name issue when re-using a connection and made IDN names
work when using proxy by converting the IDN-name to the ACE-encoded version
before the request-URL is passed to the proxy.
2004-04-29 13:41:48 +00:00
Daniel Stenberg
4b9f8e766d Made host name and proxy name get stored in a 'struct hostname' and set
all things up to work with encoded host names internally, as well as keeping
'display names' to show in debug messages. IDN resolves work for me now using
ipv6, ipv4 and ares resolving. Even cookies on IDN sites seem to do right.
2004-04-27 13:56:23 +00:00
Daniel Stenberg
f5042cce34 IDN adjustments and host cleanups by Gisle 2004-04-26 14:03:25 +00:00
Daniel Stenberg
70e2aadc18 Replaced Curl_FormReadOneLine with Curl_formpostheader as that is the only use
for it. It saves one extra copy of the header.

I also added comments for several functions in formdata.c
2004-04-23 10:37:52 +00:00
Daniel Stenberg
550862f41a missing brace 2004-04-22 21:27:32 +00:00
Daniel Stenberg
2ff30d067c - David Byron found and fixed a small bug with the --fail and authentication
stuff added a few weeks ago.  Turns out that if you specify --proxy-ntlm and
  communicate with a proxy that requires basic authentication, the proxy
  properly returns a 407, but the failure detection code doesn't realize it
  should give up, so curl returns with exit code 0. Test case 162 verifies
  this.
2004-04-22 20:07:41 +00:00
Daniel Stenberg
33cb93ad0b Added comments 2004-04-22 12:35:45 +00:00
Daniel Stenberg
b7a7600465 Cleaned up hostname/name/gname and path/ppath confusion. Removed the fixed-
length limit of the hostname part of the URL.
2004-04-20 07:53:24 +00:00
Daniel Stenberg
ee7d1d0701 remove an long time #defined struct member and use the actual "real" name
instead to make it easier to find/read
2004-04-13 07:37:28 +00:00
Daniel Stenberg
72b1144b8c getting only a 100 Continue response and nothing else, when talking HTTP,
is now treated as an error by libcurl
2004-04-07 14:27:54 +00:00
Daniel Stenberg
8ed44e8dfb New authentication code added, particularly noticable when doing POST or PUT
with Digest or NTLM. libcurl will now use HEAD to negotiate the authentication
and when done perform the requested POST.
2004-04-06 15:14:10 +00:00
Daniel Stenberg
7ea837a18c adjusted to the new dns cache function to hide more hostip internals 2004-03-30 13:02:31 +00:00
Daniel Stenberg
76f23acfa1 if 0'ed out a code section that uses __FUNCTION__ etc, used for debugging
the new "fail with auth" code
2004-03-30 08:21:09 +00:00
Daniel Stenberg
8e92600ddd David Byron made CURLOPT_FAILONERROR work with authentications such as NTLM
or Digest.
2004-03-30 06:40:01 +00:00
Daniel Stenberg
f788f988ea fix signed and unsigned warnings 2004-03-14 18:15:04 +00:00
Daniel Stenberg
d04ffd258b postsize is off_t now, so we typecase it to int before doing normal printf
with it (knowing it won't be larger than what fits in an int)
2004-03-13 17:11:42 +00:00
Daniel Stenberg
24cfa7f1bb the postsize is an off_t so use the proper printf format to output the
content-length when doing multipart posts
2004-03-13 17:03:17 +00:00
Daniel Stenberg
94a1d09ac7 more variable type fixing for the huge posts 2004-03-12 14:22:16 +00:00
Daniel Stenberg
4ad68ec305 more variable type fixes for the large POST support 2004-03-12 13:06:01 +00:00
Daniel Stenberg
ef776ab893 Made the 'postsize' variable an off_t type to be able to hold large file
sizes if desired
2004-03-12 12:07:01 +00:00
Daniel Stenberg
0d1fc73f21 Use more curl_off_t variables when doing the progress meter calculations and
argument passing and try to convert to double only when providing data to the
external world.
2004-03-10 16:20:33 +00:00
Daniel Stenberg
7225b14002 curl_socket_t mistakes cleanup 2004-03-10 16:01:47 +00:00
Daniel Stenberg
cf004cbc7e keep the number of bytes read in a size_t variable 2004-03-10 09:44:42 +00:00
Daniel Stenberg
ce5805a955 Use curl_socket_t instead of int for holding sockets. The typedefs and
defines are in setup.h.
2004-03-09 22:52:50 +00:00
Daniel Stenberg
7b2869338d explicit typecast to visualize that we really want the result of the
operation as a size_t
2004-03-09 21:39:50 +00:00
Daniel Stenberg
498666bdc3 issue 12 fix 2004-03-05 12:54:18 +00:00
Daniel Stenberg
353f764119 Yet another curl_off_t printf format attempt, we now exclude the %-letter from
FORMAT_OFF_T to allow additional options to get specified, like with '"%5"
FORMAT_OFF_T'.
2004-03-02 09:31:18 +00:00
Daniel Stenberg
7ab3b5b3bb use FORMAT_OFF_T instead of CURL_FORMAT_OFF_T to reduce the complexity of
having to redef that name
2004-03-02 07:25:39 +00:00
Daniel Stenberg
cb72a80fe0 Use CURL_FORMAT_OFF_T for printf()inf curl_off_t variables. 2004-03-01 16:28:00 +00:00
Daniel Stenberg
d571064b65 Clear up int/long/size_t/ssize_t usage a bit 2004-02-26 13:40:43 +00:00
Daniel Stenberg
e1b5e15431 More size_t cleanups in the base64 functions. 2004-02-23 08:22:43 +00:00
Daniel Stenberg
93e32e6f62 Modified the default HTTP Accept: header to only be Accept: */* 2004-02-09 12:46:41 +00:00
Daniel Stenberg
f56d753507 A custom Host: header is only considered if the request is not made by
following a location. After discussions with Tim Baker.
2004-02-06 08:11:58 +00:00
Daniel Stenberg
cc90a235f4 if an empty 'transfer-encoding:' header is provided, we switch off the
chunky coding of uploads
2004-02-05 15:50:16 +00:00
Daniel Stenberg
b84eaff1d5 set the 'retry' bit to TRUE when the connection is about to be retried,
this allows the HTTP code to *not* return a failure just because no data
has been received from the server
2004-02-02 14:49:54 +00:00
Daniel Stenberg
4d17d6876e Dan Fandrich's cleanup patch to make pedantic compiler options cause less
warnings. Minor edits by me.
2004-01-29 13:56:45 +00:00
Daniel Stenberg
958987c214 Chunked-transfers should have an additional CRLF after the final 0 CRLF
sequence.
2004-01-28 17:07:22 +00:00
Daniel Stenberg
dc932f739a CONNECT response headers are now passed back as "regular" headers 2004-01-27 12:54:22 +00:00
Daniel Stenberg
b791e158f0 use curl_off_t instead of off_t! 2004-01-22 12:45:50 +00:00
Daniel Stenberg
44031f32a1 added one assert and a few comments describing how the auth stuff works 2004-01-09 14:03:06 +00:00
Daniel Stenberg
053f6c85ef updated year in the copyright string 2004-01-07 09:19:33 +00:00
Daniel Stenberg
b60e0fa97e David J Meyer's large file support. 2004-01-05 22:29:29 +00:00
Daniel Stenberg
1d977b7848 When basic is the only auth wanted (which it is by default), the auth phase
is always considered done immediately as Basic needs to extra passes.

This fix corrects bug report #848371.
2003-11-25 09:05:15 +00:00
Daniel Stenberg
45614d54c6 allow the end-of-headers from a proxy response to CONNECT end with a CRCR
as well as a CRLF
2003-11-24 16:17:55 +00:00
Daniel Stenberg
1e98727c55 FTPS support added as RFC2228 and the murray-ftp-auth-ssl draft describe it 2003-11-24 07:15:37 +00:00
Daniel Stenberg
f481b3e1dc bail out properly on a 407 when we can't authenticate basic, bug report
#845247
2003-11-20 09:53:42 +00:00
Daniel Stenberg
a717afc3a7 gmtime() really can't even return NULL, can it? 2003-10-31 21:43:22 +00:00
Daniel Stenberg
7247041e21 Improved checks for bad memory situations and proper behaviour when we
run out of memory.
2003-10-24 12:58:29 +00:00
Daniel Stenberg
d1c08e1d85 conn->user and conn->passwd will now always be set to point to something.
If not user or password is set, they will point to a "" string.
2003-10-21 06:34:15 +00:00
Daniel Stenberg
b83c7ade10 allow no user and password for proxy too, Basic 2003-10-20 20:32:08 +00:00
Daniel Stenberg
7d6584e140 allow no user and no passwd when doing basic auth 2003-10-20 20:30:40 +00:00
Daniel Stenberg
9df8f9a63d builds warning-free with -Wshadow now 2003-10-18 20:35:03 +00:00
Daniel Stenberg
f0089b6291 compiler warning fix 2003-10-18 20:14:21 +00:00
Daniel Stenberg
9935d33b8e make empty names look fine in verbose output 2003-10-17 09:29:30 +00:00
Daniel Stenberg
260c353577 show info text (verbose) about auth type and user name in use 2003-10-17 07:05:26 +00:00
Daniel Stenberg
749f5387c1 Gisle Vanem's IPv6-on-Windows patch applied! 2003-10-14 12:00:45 +00:00
Daniel Stenberg
b61c25af45 make sure that a regular POST using the read callback works 2003-10-07 14:39:32 +00:00
Daniel Stenberg
780652e5b6 Vincent Bronner pointed out that if you set CURLOPT_COOKIE to NULL, it still
sends off the previously set cookie. This also concerns CURLOPT_REFERER.
This fix should stop this.
2003-10-04 15:48:15 +00:00
Daniel Stenberg
09ccfcdcd4 Markus Moeller's SPNEGO patch applied, with my edits, additions and minor
cleanups.
2003-09-19 12:56:22 +00:00
Daniel Stenberg
58b1437cae When we issue a HTTP request, first make sure if the authentication phase
is over or not, as if it isn't we shall not begin any PUT or POST operation.

This cures bug report #805853, and test case 88 verifies it!
2003-09-15 21:11:22 +00:00
Daniel Stenberg
fd42247cac Tim Bartley's patch that makes the GSSNEGOTIATE option work for Microsoft's
"Negotiate" authentication as well.
2003-09-11 22:21:11 +00:00
Daniel Stenberg
f2057eb744 ah, this change broke multiple test cases 2003-09-04 13:07:09 +00:00
Daniel Stenberg
2956fe97a0 Jrg pointed out that I did this fix wrongly, now authwant is cleared
properly if no auth is available
2003-09-04 11:34:09 +00:00
Daniel Stenberg
1f9b0e70ab Based on Joerg Mueller-Tolk's patch, this introduces support for
CURLINFO_HTTPAUTH_AVAIL and CURLINFO_PROXYAUTH_AVAIL
2003-09-04 10:55:20 +00:00
Daniel Stenberg
8fae12b2f1 1. store the httpproxycode in the loop after it is parsed
2. made Curl_http_auth_act() reset 'authavail' unconditionally
2003-09-04 10:18:12 +00:00
Daniel Stenberg
7410210f19 avoid proxy (and other) auth if no user+password is given 2003-09-04 10:08:53 +00:00
Daniel Stenberg
52ceab5e41 Re-arranged code to make the proxy-CONNECT loop able to do some of the
authentication negotiations needed for NTLM, Digest etc.
2003-09-03 21:51:28 +00:00
Daniel Stenberg
a3c1248214 Bugfix from Serge Semashko that fixes a bug introduced when we applied his
NTLM patch. Test case 84 and 85 verify this.
2003-08-12 08:20:16 +00:00
Daniel Stenberg
27619fc450 Added support for CURLINFO_HTTP_CONNECTCODE 2003-08-11 23:15:41 +00:00
Daniel Stenberg
7a19923afa Serge Semashko added CURLOPT_PROXYAUTH support, and now NTLM for proxies
work.
2003-08-11 11:47:45 +00:00
Daniel Stenberg
2dd1518d63 support sending off cookies without contents 2003-08-11 09:55:48 +00:00
Daniel Stenberg
c704d1545c include "share.h" for the cookie sharing 2003-08-06 15:26:24 +00:00
Daniel Stenberg
41ae97e710 Dirk Manske's patch that introduces cookie support to the share interface. 2003-08-04 15:02:42 +00:00
Daniel Stenberg
db9f87f697 When proxy authentication is used in a CONNECT request (as used for all SSL
connects and otherwise enforced tunnel-thru-proxy requests), the same
authentication header is also wrongly sent to the remote host.

The name and password can then be captured by an evil host and possibly get
used for malicious purposes.
2003-08-02 23:36:35 +00:00
Daniel Stenberg
48a580e609 clear http->send_buffer when we have freed the memory it pointed to 2003-07-28 10:21:57 +00:00
Daniel Stenberg
f0278ca114 Removed #include <sys/resource.h>, as pointed out by Henry Bland we don't
need it.
2003-07-25 08:30:58 +00:00
Daniel Stenberg
071c95128e moved the proxyuser and proxypasswd fields from the sessionhandle to the
connectdata to work as expected
2003-07-21 13:16:30 +00:00
Daniel Stenberg
52b631fade Access the user and passwd fields from the connectdata struct now instead
of the sessionhandle struct, as that was not good.
2003-07-19 23:56:33 +00:00
Daniel Stenberg
45fc760985 Peter Sylvester's patch was applied that introduces the following:
CURLOPT_SSL_CTX_FUNCTION to set a callback that gets called with the
   OpenSSL's ssl_ctx pointer passed in and allow a callback to act on it. If
   anything but CURLE_OK is returned, that will also be returned by libcurl
   all the way back. If this function changes the CURLOPT_URL, libcurl will
   detect this and instead go use the new URL.

   CURLOPT_SSL_CTX_DATA is a pointer you set to get passed to the callback set
   with CURLOPT_SSL_CTX_FUNCTION.
2003-07-04 16:29:23 +00:00
Daniel Stenberg
12859e345f major adjustments to the new authentication support 2003-06-26 11:24:55 +00:00
Daniel Stenberg
ecf32c964a CURLHTTP* renamed to CURLAUTH* and NEGOTIATE is now GSSNEGOTIATE as there's
a "plain" Negotiate as well.
2003-06-12 17:34:27 +00:00
Daniel Stenberg
73c5f24fa4 Initial take at NTLM authentication. It doesn't really work at this point
but the infrastructure is there.
2003-06-11 13:38:55 +00:00
Daniel Stenberg
e56ae1426c Daniel Kouril's patch that adds HTTP negotiation support to libcurl was
added.
2003-06-10 12:22:19 +00:00
Daniel Stenberg
8d30d34e0c When doing very big GET requests over HTTPS, we need to add some extra
funky logic in order to make re-tries work fine with OpenSSL. This corrects
the problem David Orrell noticed.
2003-06-06 14:58:26 +00:00
Daniel Stenberg
4e410111db Posting static data using POST and chunked encoded now also appends the
data to the initial request buffer, if the total post data is less than
100K.
2003-05-28 07:54:33 +00:00
Daniel Stenberg
5bd8d60e41 Rudy Koento experienced problems with curl's recent habit of POSTing data in
two separate send() calls, first the headers and then the data. I've now made
a fix that for static and known content that isn't to be chunked-encoded,
everything is now sent in one single system call again. This is also better
for network performance reasons.
2003-05-27 08:33:08 +00:00
Daniel Stenberg
90b0f38316 Another socks5-fix. Make sure that when we use a socks-proxy, it is not the
same as using a httpproxy so we must make sure to better check for http
proxies before we do HTTP proxy stuff. This included authorization and
URI usage in the request etc.
2003-05-27 06:28:25 +00:00
Daniel Stenberg
01108e3a63 warning-free is better 2003-05-22 22:45:38 +00:00
Daniel Stenberg
a39d77227f Better Digest stuff 2003-05-22 22:39:38 +00:00
Daniel Stenberg
334d78cd18 Initial Digest support. At least partly working. 2003-05-22 16:09:54 +00:00
Daniel Stenberg
940707ad66 incoming proxy headers shall be sent to the debug function has HEADERs not
DATA
2003-05-12 12:29:00 +00:00
Daniel Stenberg
1752d80915 If there is a custom Host: header specified, we use that host name to
extract the correct set of cookies to send. This functionality is verified
by test case 62.
2003-05-02 09:13:19 +00:00
Daniel Stenberg
bea02ddebe stop parsing Host: host names at colons too 2003-04-30 17:12:29 +00:00
Daniel Stenberg
7c96c5a39b extract host name from custom Host: headers to use for cookies 2003-04-30 17:04:53 +00:00
Daniel Stenberg
25f611ca42 Guillaume Cottenceau's patch that adds CURLOPT_UNRESTRICTED_AUTH that
disables the host name check in the FOLLOWLOCATION code. With that option
set, libcurl will send user+password to all hosts.
2003-03-31 04:41:05 +00:00
Daniel Stenberg
d349eb3d43 Juan F. Codagnone pointed out a missing thing from the march 2 fix 2003-03-16 16:15:24 +00:00
Daniel Stenberg
17962b3d2e Added typecast to please the MSVC compiler. 2003-03-03 06:45:27 +00:00
Daniel Stenberg
3242ea5f66 Init postdata properly before issuing a request, so that there isn't any
lingering POST-stuff that confuses GET requests. Juan F. Codagnone reported
this problem in bug report #653859.
2003-03-02 17:43:42 +00:00
Daniel Stenberg
a6206a3aef Fixes to bring back the the "Expect: 100-continue" functionality. If the
header is used, we must wait for a 100-code (or timeout), before we send the
data. The timeout is merely 1000 ms at this point. We may have reason to set
a longer timeout in the future.
2003-02-24 16:53:53 +00:00
Daniel Stenberg
a7c72b7abf removed the local variables for emacs and vim, use the new sample.emacs
way for emacs, and vim users should provide a similar non-polluting style
2003-01-29 10:14:20 +00:00
Daniel Stenberg
f26a338a54 copyright year update in the source header 2003-01-16 21:08:12 +00:00
Daniel Stenberg
db6ff224f8 The initial HTTP request can now be sent in multiple parts, as part of the
regular transfer process. This required some new tweaks, like for example
we need to be able to tell the tranfer loop to not chunky-encode uploads
while we're transferring the rest of the request...
2002-12-10 13:10:00 +00:00
Daniel Stenberg
49f75ee8ce A normal POST now provides data to the main transfer loop via the usual
read callback, and thus won't put a lot of stress on the request sending
code (which currently does an ugly loop).
2002-12-09 16:05:57 +00:00
Daniel Stenberg
4bcc866c52 The fread() callback pointer and associated pointer is now stored in the
connectdata struct instead, and is no longer modified within the 'set' struct
as previously (which was a really BAAAD thing).
2002-12-09 15:37:54 +00:00
Daniel Stenberg
bf678a1ca9 only use Content-Length: header if not transfering data chunked 2002-12-01 11:20:41 +00:00
Daniel Stenberg
eef6c83503 Moved the compareheader function into this file and added Curl_ prefix
We now check if the chunked transfer-encoding header has been added "by force"
and if so, we enabled the chunky upload!
2002-11-28 15:45:06 +00:00
Daniel Stenberg
e5e2fb8274 Dan Becker fixed a minor memory leak on persistent connnections using
FOLLOWLOCATION and CURLOPT_USERPWD.
2002-11-26 17:32:15 +00:00
Daniel Stenberg
42acb00c81 moved the bools in the connectdata struct into the substruct named
ConnectBits where the other bools already are
2002-11-11 23:03:03 +00:00
Daniel Stenberg
03c22b4576 Now supports "Transfer-Encoding: chunked" for HTTP PUT operations where the
size of the uploaded file is unknown.
2002-11-11 08:40:37 +00:00
Daniel Stenberg
701509d322 Jeff Lawson fixed a few problems with connection re-use that remained when
you set CURLOPT_PROXY to "".
2002-10-10 08:00:49 +00:00
Daniel Stenberg
969217c9d9 make sure we free rangeline before we re-assign it to a new allocated
memory as otherwise we (might) leak memory
2002-09-25 12:47:38 +00:00
Daniel Stenberg
b466924717 removed use of extra unneeded variable 2002-09-23 12:47:18 +00:00
Daniel Stenberg
c19844a0a3 better deal with HTTP(S) servers that respond with no headers at all, test
case 306 added to verify that we do right
2002-09-13 12:40:36 +00:00
Daniel Stenberg
cac5251a98 Lukasz Czekierda correctly pointed out that curl used a bad Host: header
when talking to a IPv6-server using IPv6 IP address only.
2002-09-11 10:32:37 +00:00
Daniel Stenberg
ba4e69bebc updated source code boilerplate/header 2002-09-03 11:52:59 +00:00
Daniel Stenberg
64bbe9dfaf James Gallagher's Content-Encoding work 2002-09-02 22:31:18 +00:00
Daniel Stenberg
8aa3f14303 SOCKS5 support added (contributed by a still unnamed person). Not properly
working for "IPv6 enabled" libcurls yet, but should be pretty easy for
someone to adjust.
2002-08-30 09:20:11 +00:00
Daniel Stenberg
982c5460f0 Andrew Francis removed the need for/use of MSVC pragmas 2002-08-26 17:20:29 +00:00
Daniel Stenberg
08ef208fb7 added disable-[protocol] support, largely provided by Miklos Nemeth 2002-06-11 11:13:01 +00:00
Daniel Stenberg
fc37ef9e4b make sure data->set.postfields is non-NULL before doing strlen() on the
pointer. Bugs item #566835.
2002-06-11 07:20:21 +00:00
Daniel Stenberg
c0257c6721 T. Bharath made the request size add up as it is documented to do. 2002-06-03 12:47:08 +00:00
Daniel Stenberg
ef436bdbe8 renamed the TIMECOND defines to be CURL_ prefixed 2002-04-22 23:53:15 +00:00
Daniel Stenberg
95f78080ab This makes formposting with a specified file missing fail. curl_easy_perform
will then return CURLE_READ_ERROR.
2002-04-15 11:19:03 +00:00
Daniel Stenberg
93516effe4 the HTTP request is a CURLINFO_HEADER_OUT 2002-04-12 07:53:12 +00:00
Daniel Stenberg
3f6133be27 Jean-Philippe Barrette-LaPierre provided his patch that introduces
CURLOPT_DEBUGFUNCTION and CURLOPT_DEBUGDATA.
2002-04-12 07:21:11 +00:00
Daniel Stenberg
e8109b09b1 error code cleanup, use the new SEND/RECV errors 2002-04-10 13:44:42 +00:00
Daniel Stenberg
974f314f57 copyright string (year) update 2002-03-19 07:54:55 +00:00
Daniel Stenberg
468b787272 if CURLOPT_POSTFIELDS isn't set, but CURLOPT_POST is, we will assume that
we should read the POST-data from the read callback
2002-03-14 14:39:23 +00:00