Daniel Stenberg [Sat, 15 Oct 2011 21:44:28 +0000 (23:44 +0200)]
singleipconnect: don't clobber errno
Save the errno value immediately after a connect() failure so that it
won't get reset to something else before we read it.
Bug: http://curl.haxx.se/mail/lib-2011-10/0066.html
Reported by: Frank Van Uffelen and Fabian Hiernaux
Michal Marek [Thu, 13 Oct 2011 08:51:17 +0000 (10:51 +0200)]
docs: --xattr
Yang Tse [Fri, 14 Oct 2011 16:23:16 +0000 (18:23 +0200)]
file.c: fix compiler warning
Yang Tse [Fri, 14 Oct 2011 15:34:42 +0000 (17:34 +0200)]
url.c: fix endless loop upon transport connection timeout
Jerry Wu detected and provided detailed info about this issue.
Yang Tse [Fri, 14 Oct 2011 15:33:05 +0000 (17:33 +0200)]
sws.c: HTTP and GOPHER test server-side connection closing adjustment
When, for a given test, server is instructed to close connection after
server reply we now wait a very small amount of time (50ms) before doing
so. This is done to allow client to, at least partially, read server
reply before getting an ECONNRESET.
The above is required to make test cases 1070, 1200, 1201 and 1202 pass
with Cygwin 1.5.X on W2K.
GOPHER test server closes connection after _every_ server-reply, as such,
at some point it could require a bigger time or using shutdown() before
a server-side initiated disconnection.
Yang Tse [Thu, 13 Oct 2011 21:00:24 +0000 (23:00 +0200)]
curl_gethostname.c: fix signed/unsigned comparison and avoid a double copy
both introduced in
42be24af
Yang Tse [Thu, 13 Oct 2011 19:09:17 +0000 (21:09 +0200)]
curl_ntlm_msgs.c: fix variable shadowing declaration introduced in
185ed340
Marcin Adamski [Thu, 13 Oct 2011 17:45:36 +0000 (19:45 +0200)]
tftp.c: TFTP timeout and unexpected block adjustments
Set ACK timeout to 5 seconds.
If we are waiting for block X and receive block Y that is the expected one, we
should send ACK and increase X (which is already implemented). Otherwise drop
the packet and don't increase retry counter.
Yang Tse [Thu, 13 Oct 2011 16:04:56 +0000 (18:04 +0200)]
multi.c: OOM handling fixes
Prevent modification of easy handle being added with curl_multi_add_handle()
unless this function actually suceeds.
Run Curl_posttransfer() to allow restoring of SIGPIPE handler when
Curl_connect() fails early in multi_runsingle().
Yang Tse [Wed, 12 Oct 2011 23:52:56 +0000 (01:52 +0200)]
url.c: make line shorter than 80 chars
Yang Tse [Wed, 12 Oct 2011 19:32:10 +0000 (21:32 +0200)]
OOM handling/cleanup slight adjustments
Yang Tse [Tue, 11 Oct 2011 17:41:30 +0000 (19:41 +0200)]
OOM handling/cleanup slight adjustments
Yang Tse [Mon, 10 Oct 2011 10:27:17 +0000 (12:27 +0200)]
lib540.c: OOM handling fixes making test 540 pass torture testing
Dan Fandrich [Sun, 9 Oct 2011 06:12:07 +0000 (23:12 -0700)]
RELEASE-NOTES: Fixed a couple of typos
Yang Tse [Fri, 7 Oct 2011 23:27:03 +0000 (01:27 +0200)]
telnet.c: fix compiler warning
Yang Tse [Fri, 7 Oct 2011 18:50:57 +0000 (20:50 +0200)]
libcurl: some OOM handling fixes
Yang Tse [Thu, 6 Oct 2011 18:30:34 +0000 (20:30 +0200)]
multi.c: OOM handling fixes making torture tests 560 580 581 pass
Yang Tse [Thu, 6 Oct 2011 18:26:42 +0000 (20:26 +0200)]
test harness: non-stunnel https server integration overhaul
Yang Tse [Thu, 6 Oct 2011 15:39:00 +0000 (17:39 +0200)]
curl tool: reviewed code moved to tool_*.[ch] files
Yang Tse [Thu, 6 Oct 2011 10:57:12 +0000 (12:57 +0200)]
buildconf: warn about autoconf 2.67 and 2.68 generating bad/unusable scripts
Yang Tse [Wed, 5 Oct 2011 20:27:29 +0000 (22:27 +0200)]
curl tool: fix compiler warning
Yang Tse [Wed, 5 Oct 2011 20:01:42 +0000 (22:01 +0200)]
curl tool: OOM handling fixes
Yang Tse [Wed, 5 Oct 2011 18:16:16 +0000 (20:16 +0200)]
curl tool: reviewed code moved to tool_*.[ch] files
Yang Tse [Wed, 5 Oct 2011 17:33:46 +0000 (19:33 +0200)]
curl tool: OOM handling fixes
Yang Tse [Wed, 5 Oct 2011 14:41:04 +0000 (16:41 +0200)]
curl tool: OOM handling fixes
Yang Tse [Wed, 5 Oct 2011 13:06:26 +0000 (15:06 +0200)]
curl tool: OOM handling fixes
Yang Tse [Wed, 5 Oct 2011 10:40:30 +0000 (12:40 +0200)]
curl tool: header inclusion adjustment
Yang Tse [Wed, 5 Oct 2011 00:58:18 +0000 (02:58 +0200)]
curl tool: symbol check adjustment
Yang Tse [Tue, 4 Oct 2011 23:19:58 +0000 (01:19 +0200)]
curl tool: header inclusion adjustment
Yang Tse [Tue, 4 Oct 2011 22:03:20 +0000 (00:03 +0200)]
curl tool: code moved to tool_*.[ch] files
Daniel Stenberg [Tue, 4 Oct 2011 14:34:45 +0000 (16:34 +0200)]
curl_share_cleanup: avoid compiler warning
Move the variable declaration to within the #ifdef
Daniel Stenberg [Tue, 4 Oct 2011 14:33:07 +0000 (16:33 +0200)]
struct Curl_share: provide sslsession unconditionally
It makes much nicer and less convuluted code everywhere if this struct
member is always present even when libcurl is built without SSL support.
This reverts parts of commit
15e3e451702396e
Daniel Stenberg [Tue, 4 Oct 2011 14:24:50 +0000 (16:24 +0200)]
ftp: improved the failed PORT host name resolved error message
Daniel Stenberg [Mon, 3 Oct 2011 21:04:32 +0000 (23:04 +0200)]
codepolicing
Daniel Stenberg [Mon, 3 Oct 2011 21:03:59 +0000 (23:03 +0200)]
sspi build fix
define away Curl_ntlm_sspi_cleanup() when no windows SSPI build
Steve Holme [Sat, 1 Oct 2011 13:46:14 +0000 (14:46 +0100)]
smtp: Added support for NTLM authentication
Modified smtp_endofresp() to detect NTLM from the server specified list
of supported authentication mechanisms.
Modified smtp_authenticate() to start the sending of the NTLM data.
Added smtp_auth_ntlm_type1_message() which creates a NTLM type-1
message. This function is used by authenticate() to start the sending
of data and by smtp_state_auth_ntlm_resp() when the AUTH command
doesn't contain the type-1 message as part of the initial response.
This lack of initial response can happen if an OOM error occurs or the
type-1 message is longer than 504 characters. As the main AUTH command
is limited to 512 character the data has to be transmitted in two
parts; one containing the AUTH NTLM and the second containing the
type-1 message.
Added smtp_state_auth_ntlm_type2msg_resp() which handles the incoming
type-2 message and sends an outgoing type-3 message. This type-2
message is sent by the server in response to our type-1 message.
Modified smtp_state_auth_resp() to handle the response to: the AUTH
NTLM without the initial response and the type-2 response.
Modified smtp_disconnect() to cleanup the NTLM SSPI stack.
Steve Holme [Sat, 1 Oct 2011 12:03:40 +0000 (13:03 +0100)]
Curl_ntlm_create_typeX_message: Added the outlen parameter
Added the output message length as a parameter to both
Curl_ntlm_create_type1_message() and Curl_ntlm_create_type3_message()
for use by future functions that require it.
Updated curl_ntlm.c to cater for the extra parameter on these two
functions.
Steve Holme [Sat, 1 Oct 2011 11:35:36 +0000 (12:35 +0100)]
smtp: General tidy up ready for adding NTLM support
Changed the name of variable l, in several functions, which represents
the length of strings being sent to the server, to len which is more
meaningful and consistent with other code in smtp.c and elsewhere.
Reworked smtp_authenticate() to be simpler and easier to follow.
Variables and now initialised in their definitions and if no username
and password are specified the function sets the state to SMTP_STOP and
returns immediately, rather than being part of a huge if statement.
Yang Tse [Mon, 3 Oct 2011 20:59:38 +0000 (22:59 +0200)]
curl tool: reviewed code moved to tool_*.[ch] files
Steve Holme [Fri, 30 Sep 2011 09:11:56 +0000 (10:11 +0100)]
smtp_mail: fixed another memory leak
... introduced in
7f304ab84f560c
Dominique Leuenberger [Mon, 3 Oct 2011 15:53:43 +0000 (17:53 +0200)]
m4: Use x in order to avoid variable 'x' set but not used [-Werror=unused-but-set-variable]
This error could be caused by configure scripts being run with -Werror
-Wall, which would lead to libcurl being detected as unusable.
Daniel Stenberg [Mon, 3 Oct 2011 20:32:36 +0000 (22:32 +0200)]
share: don't use SSL unless enabled
Don't even declare the struct members for disabled features
Introducing the CURLSHE_NOT_BUILT_IN return code for the share interface
when trying to set a sharing option that has been disabled (or not
enabled) in the library.
Daniel Stenberg [Sun, 2 Oct 2011 17:28:39 +0000 (19:28 +0200)]
multi: progress function abort must close connection
When the progress function returns to cancel the request, we must mark
the connection to get closed and it must do to the DONE state.
do_init() must be called as early as possible so that state variables
for new connections are reset early. We could otherwise see that the old
values were still there when a connection was to be disconnected very
early and it would make it behave wrongly.
Bug: http://curl.haxx.se/mail/lib-2011-10/0006.html
Reported by: Vladimir Grishchenko
Daniel Stenberg [Fri, 30 Sep 2011 21:42:47 +0000 (23:42 +0200)]
tutorial: clarify the handle sharing when treaded
Previously there was wording that made people uncertain of the exact
rules.
Feedback by: Julien Royer and Georg Lippitsch
URL: http://curl.haxx.se/mail/lib-2011-09/0357.html
Daniel Stenberg [Fri, 30 Sep 2011 20:59:50 +0000 (22:59 +0200)]
multi_runsingle: change state on callback abort
Reported by: Marcin Adamski
Bug: http://curl.haxx.se/mail/lib-2011-09/0329.html
Yang Tse [Fri, 30 Sep 2011 18:56:56 +0000 (20:56 +0200)]
curl tool: fix some more OOM handling
Yang Tse [Fri, 30 Sep 2011 19:09:59 +0000 (21:09 +0200)]
Fix SSL disabled builds broken with 'SSL session sharing' commit
5793bc37
Daniel Stenberg [Thu, 29 Sep 2011 21:45:36 +0000 (23:45 +0200)]
smtp_mail: fix memory leak
... introduced in
7f304ab84f560c
Steve Holme [Mon, 26 Sep 2011 13:07:54 +0000 (14:07 +0100)]
smtp_mail: Added support to MAIL FROM for the optional SIZE parameter
The size of the email can now be set via CURLOPT_INFILESIZE. This
allows the email to be rejected by the server, if supported, and the
maximum size has been configured on the server.
Daniel Stenberg [Thu, 29 Sep 2011 06:52:47 +0000 (08:52 +0200)]
curlverh.h: next release will be 7.23.0
Daniel Stenberg [Thu, 29 Sep 2011 06:51:52 +0000 (08:51 +0200)]
RELEASE-NOTES: synced with
5898a6a09b211fc7e2
Bumped next release version to become 7.23.0 for the changes
Dan Fandrich [Thu, 29 Sep 2011 04:33:42 +0000 (21:33 -0700)]
curl_easy_setopt: Added scp and sftp to the URL section
Steve Holme [Thu, 22 Sep 2011 18:47:45 +0000 (19:47 +0100)]
curl_easy_setopt: A brief tidy up
Slight rewording of the CURLOPT_URL SMTP sub-section.
Corrected the incorrect use of hyphens on the three uses of
"zero-terminated" with "zero terminated" to match the rest of the
document.
Corrected the use of an out of place hyphen in CURLOPT_NOPROXY section.
Daniel Stenberg [Wed, 28 Sep 2011 21:09:46 +0000 (23:09 +0200)]
configure openssl version check: handle lack of L suffix
It seems some versions of the OpenSSL version defines don't come with L
appended to the number, so let's deal with that nicely.
Alejandro Alvarez [Tue, 20 Sep 2011 15:43:54 +0000 (17:43 +0200)]
SSL session sharing support added
With locking, plus test, plus documentation
Yang Tse [Wed, 28 Sep 2011 17:03:36 +0000 (19:03 +0200)]
curl tool: adjust header callback single call write limit warning
Maximum amount of data a header callback is supposed to get in
a single call from libcurl is limited by the lowest value of
CURL_MAX_WRITE_SIZE and CURL_MAX_HTTP_HEADER.
Daniel Stenberg [Wed, 28 Sep 2011 11:53:59 +0000 (13:53 +0200)]
multi docs: extended the multi_socket API description
Daniel Stenberg [Tue, 27 Sep 2011 20:13:40 +0000 (22:13 +0200)]
tests/README: extended and reformatted
Albert Chin [Tue, 27 Sep 2011 19:59:18 +0000 (21:59 +0200)]
configure - m4: make CURL_CHECK_DEF ignore leading whitespace on symbol def
When using Sun C compiler the preprocessor somehow inserts an extra space
in front of replaced symbol, breaking CURL_CHECK_DEF macro. To workaround
this, macro CURL_CHECK_DEF now ignores all leading whitespace in front of
symbol substitution result.
Guenter Knauf [Tue, 27 Sep 2011 14:01:36 +0000 (16:01 +0200)]
Added SPNEGO to NetWare build.
Yang Tse [Mon, 26 Sep 2011 19:19:41 +0000 (21:19 +0200)]
curl tool: fix a compiler warning
Yang Tse [Mon, 26 Sep 2011 11:44:24 +0000 (13:44 +0200)]
curl tool: fix some OOM handling -
f4853db5 follow-up
Yang Tse [Mon, 26 Sep 2011 11:07:34 +0000 (13:07 +0200)]
curl tool: fix some OOM handling
Yang Tse [Mon, 26 Sep 2011 01:18:51 +0000 (03:18 +0200)]
remove short-lived CURL_WRITEFUNC_OUT_OF_MEMORY
Guenter Knauf [Mon, 26 Sep 2011 10:42:15 +0000 (12:42 +0200)]
Added unsigned char* to _curl_is_debug_cb.
Steve Holme [Sun, 25 Sep 2011 22:01:09 +0000 (00:01 +0200)]
smtp_connect: use defined buffer length for hostname
Steve Holme [Mon, 19 Sep 2011 19:55:56 +0000 (20:55 +0100)]
Curl_ntlm_create_type3_message: Tidied up the use of Curl_gethostname.
Removed the code that striped off the domain name when Curl_gethostname
returned the fully qualified domain name as the function has been
updated to return the un-qualified host name.
Replaced the use of HOSTNAME_MAX as the size of the buffer in the call
to Curl_gethostname with sizeof(host) as this is safer should the buffer
size ever be changed.
Steve Holme [Sun, 25 Sep 2011 21:58:47 +0000 (23:58 +0200)]
HOSTNAME_MAX: Moved to curl_gethostname.h
Moved HOSTNAME_MAX #define into curl_gethostname.h rather than being
locally defined in curl_gethostname.c, curl_ntlm_msgs.c and smtp.c.
Daniel Stenberg [Sun, 25 Sep 2011 21:20:46 +0000 (23:20 +0200)]
RELEASE-NOTES: synced with
d2a47021c0a6
Yang Tse [Sun, 25 Sep 2011 17:08:12 +0000 (19:08 +0200)]
Q&D fix header inclusion order
Yang Tse [Sun, 25 Sep 2011 16:53:29 +0000 (18:53 +0200)]
allow write callbacks to indicate OOM to libcurl
Allow (*curl_write_callback) write callbacks to return
CURL_WRITEFUNC_OUT_OF_MEMORY to properly indicate libcurl of OOM conditions
inside the callback itself.
Guenter Knauf [Sun, 25 Sep 2011 15:42:20 +0000 (17:42 +0200)]
Changed some main makefile targets.
Daniel Stenberg [Sun, 25 Sep 2011 15:34:12 +0000 (17:34 +0200)]
curl_multi_fdset: avoid FD_SET out of bounds
If a socket is larger than FD_SETSIZE, avoid using FD_SET() on the
platforms where this is possible.
Bug: http://curl.haxx.se/bug/view.cgi?id=3413274
Reported by: Tim Starling
Guenter Knauf [Sun, 25 Sep 2011 14:31:31 +0000 (16:31 +0200)]
Fixed MinGW examples makefile.
Guenter Knauf [Sun, 25 Sep 2011 14:29:08 +0000 (16:29 +0200)]
NetWare makefile tweaks to select different builds.
Daniel Stenberg [Sat, 24 Sep 2011 22:02:58 +0000 (00:02 +0200)]
POST: always set postfieldsize
When we use binary posts and regular ones intermixed on a single command
line, we cannot do strlen() etc on the data to figure out the length
(when inserting '&' and more). We must therefore keep track of the post
data length. Then we also end up setting the libcurl option with the
known size, so that we don't risk that libcurl will do strlen() on the
data.
This has the minor side-effect that --libcurl source codes now always
will use CURLOPT_POSTFIELDSIZE but I don't consider that terribly
damaging.
Bug: http://curl.haxx.se/bug/view.cgi?id=3413181
Reported by: Taneli Vähäkangas
Yang Tse [Sat, 24 Sep 2011 16:33:59 +0000 (18:33 +0200)]
curl tool: fix a compiler warning
Yang Tse [Sat, 24 Sep 2011 15:38:16 +0000 (17:38 +0200)]
curl tool: reviewed code moved to tool_*.[ch] files
Guenter Knauf [Sat, 24 Sep 2011 13:06:21 +0000 (15:06 +0200)]
Added header to be included by dist script.
Probably the wrong place, but I dont know better.
Yang Tse [Sat, 24 Sep 2011 03:32:51 +0000 (05:32 +0200)]
curl tool: fix some OOM handling issues
Daniel Stenberg [Fri, 23 Sep 2011 22:05:58 +0000 (00:05 +0200)]
http header: allow Content-Length to be replaced
In some cases Content-Length: couldn't be replaced by an application
Also, indented some code properly
Guenter Knauf [Fri, 23 Sep 2011 01:56:34 +0000 (03:56 +0200)]
MinGW64 has this prototype already.
Guenter Knauf [Fri, 23 Sep 2011 01:21:50 +0000 (03:21 +0200)]
Fixed scanf format for WORD = unsigned short.
Guenter Knauf [Fri, 23 Sep 2011 01:00:32 +0000 (03:00 +0200)]
Added Win32-only samples.
Guenter Knauf [Thu, 22 Sep 2011 23:22:18 +0000 (01:22 +0200)]
Added a workaround for printing size_t.
Daniel Stenberg [Thu, 22 Sep 2011 20:34:54 +0000 (22:34 +0200)]
Curl_pgrsStartNow: keep HEADERS_OUT set
To avoid that the progress meter headers get output between each
transfer, make sure the bits gets kept when (re-)inited.
Reported by: Christopher Stone
Yang Tse [Thu, 22 Sep 2011 19:20:28 +0000 (21:20 +0200)]
curl tool: fix some OOM handling issues
Yang Tse [Thu, 22 Sep 2011 09:16:34 +0000 (11:16 +0200)]
curl tool: reviewed code moved to tool_*.[ch] files
my_setopt and my_setopt_str no longer ignores curl_easy_setopt result.
Fixed some OOM handling issues.
Guenter Knauf [Thu, 22 Sep 2011 12:34:58 +0000 (14:34 +0200)]
Added NetWare examples makefile.
Yang Tse [Wed, 21 Sep 2011 22:24:02 +0000 (00:24 +0200)]
NTLM_WB: fix disabling of NTLM_WB when NTLM is disabled
Daniel Stenberg [Wed, 21 Sep 2011 20:32:27 +0000 (22:32 +0200)]
test 814: smtp without --mail-from
Verifies the fix from commit
322f3d5af7093
Gisle Vanem [Wed, 21 Sep 2011 20:24:45 +0000 (22:24 +0200)]
smtp: without a MAIL_FROM, send blank MAIL FROM
I think curl should ignore this case and smtp.c should test for this.
Since RFC-2821 seems to allow a "null reverse-path". Ref. "MAIL
FROM:<>" in section 3.7, page 25.
Dave Reisner [Wed, 21 Sep 2011 19:19:29 +0000 (21:19 +0200)]
lib/http: add missing whitespace in verbose output
Example:
* upload completely sent off: 35out of 35 bytes
Should be:
* upload completely sent off: 35 out of 35 bytes
Guenter Knauf [Wed, 21 Sep 2011 16:21:05 +0000 (18:21 +0200)]
Another MinGW example makefile tweak.
Guenter Knauf [Wed, 21 Sep 2011 16:09:34 +0000 (18:09 +0200)]
Fixed sample to compile for Windows platform.
Yang Tse [Wed, 21 Sep 2011 02:28:46 +0000 (04:28 +0200)]
curl tool: make my_setopt ignore curl_easy_setopt result again.
Related code not ready yet for this kind of checks.
Guenter Knauf [Wed, 21 Sep 2011 01:25:19 +0000 (03:25 +0200)]
Changed suffix rules to pattern rules.
Suffix rules cannot have any prerequisites of their own.
Guenter Knauf [Wed, 21 Sep 2011 00:13:18 +0000 (02:13 +0200)]
Added dependency so that curlbuild.h is created.
Guenter Knauf [Wed, 21 Sep 2011 00:02:31 +0000 (02:02 +0200)]
Some more MinGW build tweaks.
Added envvars to specify OpenSSL include, libpath and lib.
Added rule to create curlbuild.h from curlbuild.h.dist.
Yang Tse [Tue, 20 Sep 2011 23:54:14 +0000 (01:54 +0200)]
curl tool: reviewed code moved to tool_*.[ch] files
my_setopt and my_setopt_str no longer ignores curl_easy_setopt result.
Fixed some OOM handling issues.