cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Development > Recent Source Code Activity

Recent Activity in the repo

The 100 latest commits in curl's git repository

smtp.c: Fixed an issue with writing postdataSteve Holme

Fixed a problem in smtp_done() when writing out the postdata as Curl_write() would periodically return zero bytes written.

M lib/smtp.c
CURLOPT_MAIL_AUTH: added in 7.25.0Daniel Stenberg

Brought in commit 0cf0ab6f300

M docs/libcurl/symbols-in-versions
pop3 test server: send terminating ".CRLF" onlyDaniel Stenberg

With commit 035ef06bda7 applied, the test pop3 server needs to send ".\r\n" as the body terminating sequence and there needs to be a final CRLF in the actual body in the test data file.

M tests/data/test1319
M tests/data/test800
M tests/ftpserver.pl
pop3.c: Fixed drop of final CRLF in EOB checkingSteve Holme

Curl_pop3_write() would drop the final CRLF of a message as it was considered part of the EOB as opposed to part of the message. Whilst the EOB sequence needs to be searched for by the function only the final 3 characters should be removed as per RFC-1939 section 3.

Reported by: Rich Gray Bug: http://curl.haxx.se/mail/lib-2012-02/0051.html

M lib/pop3.c
smtp.c: Fixed an issue with the EOB checkingSteve Holme

Curl_smtp_escape_eob() would leave off final CRLFs from emails ending in multiple blank lines additionally leaving the smtpc->eob variable with the character count in, which would cause problems for additional emails when sent through multiple calls to curl_easy_perform() after a CURLOPT_CONNECT_ONLY.

M lib/smtp.c
CURLE_FTP_PRET_FAILED: listed twiceDaniel Stenberg

Make sure it is mentioned once and with the correct description

M docs/libcurl/libcurl-errors.3
--mail-auth documentedDaniel Stenberg
M docs/curl.1
SMTP: Code policing and tidy upSteve Holme
M lib/smtp.c
M lib/smtp.h
curl: Added support for --mail-authSteve Holme

Added an extra command-line argument to support the optional AUTH parameter in SMTPs MAIL FROM command.

M src/tool_cfgable.c
M src/tool_cfgable.h
M src/tool_getparam.c
M src/tool_help.c
M src/tool_operate.c
docs: mention that NTLM works with NSS, tooKamil Dudka
M docs/libcurl/curl_easy_setopt.3
DOCS: Added information for CURLOPT_MAIL_AUTH.Steve Holme

Added information relating to the new CURLOPT_MAIL_AUTH parameter and reworked CURLOPT_MAIL_FROM and CURLOPT_MAIL_RCPT to be a clearer.

Fixed inconsistencies of "vocalisation of the abbreviation" versus "vocalisation of the first word" for all abbreviations.

Corrected a typo in CURLOPT_NOPROXY.

M docs/libcurl/curl_easy_setopt.3
smtp.c: Fixed use of angled brackets in AUTH parameter.Steve Holme

Fixed the use of angled brackets "<>" in the optional AUTH parameter as per RFC-2554 section 5. The address should not include them but an empty address should be replaced by them.

M lib/smtp.c
smtp_mail: Added support to MAIL FROM for the optional AUTH parameterSteve Holme

Added a new CURLOPT_MAIL_AUTH option that allows the calling program to set the optional AUTH parameter in the MAIL FROM command.

When this option is specified and an authentication mechanism is used to communicate with the mail server then the AUTH parameter will be included in the MAIL FROM command. This is particularly useful when the calling program is acting as a relay in a trusted environment and performing server to server communication, as it allows the relaying server to specify the address of the mailbox that was used to authenticate and send the original email.

M include/curl/curl.h
M lib/smtp.c
M lib/url.c
M lib/urldata.h
cyassl: update to CyaSSL 2.0.x APItoddouska

Modify configure.ac to test for new CyaSSL Init function and remove default install path to system. Change to CyaSSL OpenSSL header and proper Init in code as well.

Note that this no longer detects or works with CyaSSL before v2

M configure.ac
M docs/INTERNALS
M lib/cyassl.c
M lib/urldata.h
LIBCURL_VERSION_NUM: 0x071900Daniel Stenberg

I accidentally left the lowest bits 01 before

M include/curl/curlver.h
SMTP: Fixed error when using CURLOPT_CONNECT_ONLYSteve Holme

Fixed incorrect behavior in smtp_done() which would cause the end of block data to be sent to the SMTP server if libcurl was operating in connect only mode. This would cause the server to return an error as data would not be expected which in turn caused libcurl to return CURLE_RECV_ERROR.

M lib/smtp.c
s/7.24.1/7.25.0Daniel Stenberg

We will go straight to 7.25.0 due to the new additions

M docs/libcurl/curl_easy_setopt.3
M docs/libcurl/symbols-in-versions
curlver.h: bumped to 7.25.0Daniel Stenberg

and updated the end year in the generic copyright string

M include/curl/curlver.h
RELEASE-NOTES: synced with 2b26eb985Daniel Stenberg

9 bug fixes, 4 changes and numerous contributors

Bumped release version and option counters

M RELEASE-NOTES
configure: add option disable --libcurl outputColin Hogben
M configure.ac
M src/tool_easysrc.c
M src/tool_easysrc.h
M src/tool_getparam.c
M src/tool_help.c
M src/tool_operate.c
M src/tool_setopt.c
M src/tool_setopt.h
curl tool: allow negative numbers as option valuesAlessandro Ghedini

Fix the str2num() function to not check if the input string starts with a digit, since strtol() supports numbers prepended with '-' (and '+') too. This makes the --max-redirs option work as documented.

M src/tool_paramhlp.c
parse_proxy: simply memory handlingDaniel Stenberg

... by making sure that the string is always freed after the invoke as parse_proxy will always copy the data and this way there's a single free() instead of multiple ones.

M lib/url.c
parse_proxy: bail out on zero-length proxy names!Daniel Stenberg

The proxy parser function strips off trailing slashes off the proxy name which could lead to a mistaken zero length proxy name which would be treated as no proxy at all by subsequent functions!

This is now detected and an error is returned. Verified by the new test 1329.

Reported by: Chandrakant Bagul Bug: http://curl.haxx.se/mail/lib-2012-02/0000.html

M lib/url.c
M tests/data/Makefile.am
A tests/data/test1329
nss: add support for the CURLSSLOPT_ALLOW_BEAST optionKamil Dudka

... and fix some typos from the 62d15f1 commit.

M lib/nss.c
M src/tool_getparam.c
M src/tool_help.c
configure: don't modify LD_LIBRARY_PATH for cross compilesRob Ward
M configure.ac
--ssl-allow-beast addedDaniel Stenberg

This new option tells curl to not work around a security flaw in the SSL3 and TLS1.0 protocols. It uses the new libcurl option CURLOPT_SSL_OPTIONS with the CURLSSLOPT_ALLOW_BEAST bit set.

M docs/curl.1
M src/tool_cfgable.h
M src/tool_getparam.c
M src/tool_help.c
M src/tool_operate.c
CURLOPT_SSL_OPTIONS: addedDaniel Stenberg

Allow an appliction to set libcurl specific SSL options. The first and only options supported right now is CURLSSLOPT_ALLOW_BEAST.

It will make libcurl to disable any work-arounds the underlying SSL library may have to address a known security flaw in the SSL3 and TLS1.0 protocol versions.

This is a reaction to us unconditionally removing that behavior after this security advisory:

http://curl.haxx.se/docs/adv_20120124B.html

... it did however cause a lot of programs to fail because of old servers not liking this work-around. Now programs can opt to decrease the security in order to interoperate with old servers better.

M docs/libcurl/curl_easy_setopt.3
M docs/libcurl/symbols-in-versions
M include/curl/curl.h
M lib/ssluse.c
M lib/url.c
M lib/urldata.h
curl: use new library-side TCP_KEEPALIVE optionsDave Reisner

Use the new library CURLOPT_TCP_KEEPALIVE rather than disabling this via the sockopt callback. If --keepalive-time is used, apply the value to CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL.

M docs/curl.1
M src/Makefile.inc
D src/tool_cb_skt.c
D src/tool_cb_skt.h
M src/tool_operate.c
add library support for tuning TCP_KEEPALIVEDave Reisner

This adds three new options to control the behavior of TCP keepalives:

- CURLOPT_TCP_KEEPALIVE: enable/disable probes - CURLOPT_TCP_KEEPIDLE: idle time before sending first probe - CURLOPT_TCP_KEEPINTVL: delay between successive probes

While not all operating systems support the TCP_KEEPIDLE and TCP_KEEPINTVL knobs, the library will still allow these options to be set by clients, silently ignoring the values.

M docs/libcurl/curl_easy_setopt.3
M docs/libcurl/symbols-in-versions
M include/curl/curl.h
M lib/connect.c
M lib/url.c
M lib/urldata.h
curl_easy_reset: reset the referer stringDaniel Stenberg

When CURLOPT_REFERER has been used, curl_easy_reset() did not properly clear it.

Verified with the new test 598

Bug: http://curl.haxx.se/bug/view.cgi?id=3481551 Reported by: Michael Day

M lib/url.c
A tests/data/test598
M tests/libtest/Makefile.inc
A tests/libtest/lib598.c
curl tool: allow glob-loops to abort again upon critical errorsYang Tse

This prevents clobbering of non recoverable error return codes while retaining intended functionality of commit 65103efe

M src/tool_operate.c
curl tool: don't abort glob-loop due to failuresDaniel Stenberg

We want to continue to the next URL to try even on failures returned from libcurl. This makes -f with ranges still get subsequent URLs even if occasional ones return error. This was a regression as it used to work and broke in the 7.23.0 release.

Added test case 1328 to verify the fix.

Bug: http://curl.haxx.se/bug/view.cgi?id=3481223 Reported by: Juan Barreto

M src/tool_operate.c
M tests/data/Makefile.am
A tests/data/test1328
CONNECT: send correct Host: with IPv6 numerical addressDaniel Stenberg

When the target host was given as a IPv6 numerical address, it was not properly put within square brackets for the Host: header in the CONNECT request. The "normal" request did fine.

Reported by: "zooloo" Bug: http://curl.haxx.se/bug/view.cgi?id=3482093

M lib/http_proxy.c
Explicitly link to the nettle/gcrypt librariesMartin Storsjo

When support for nettle was added in 64f328c787ab, I overlooked the fact that AC_CHECK_LIB doesn't add the tested lib to LIBS if the check succeeded, if a custom success code block was present. (The previous version of the check had an empty block for successful checks, adding the lib to LIBS implicitly.)

Therefore, explicitly add either nettle or gcrypt to LIBS, after deciding which one to use. Even if they can be linked in transitively, it is safer to actually link explicitly to them.

This fixes building with gnutls with linkers that don't allow linking transitively, such as for windows.

M configure.ac
more resilient connection times among IP addressesPierre Ynard

When connecting to a domain with multiple IP addresses, allow different, decreasing connection timeout values. This should guarantee some connections attempts with sufficiently long timeouts, while still providing fallback.

M lib/connect.c
remove write-only variablePierre Ynard
M lib/connect.c
Merge branch 'master' of github.com:bagder/curlPierre Joye
- fix IPV6 and IDN optionsPierre Joye
M winbuild/Makefile.vc
M winbuild/MakefileBuild.vc
TODO-RELEASE: added item #308Yang Tse
M TODO-RELEASE
THANKS: imported contributors from 7.24.0 RELEASE-NOTESDaniel Stenberg
M docs/THANKS
test harness: update stunnel.pem Diffie-Hellman parameters from 512 to 1024 bitYang Tse
M tests/stunnel.pem
version: start working on 7.24.1-DEVYang Tse
M RELEASE-NOTES
M include/curl/curlver.h
curl_easy_setopt.3: Fixed SEEKDATA & CLOSESOCKETDATA descriptionsDan Fandrich
M docs/libcurl/curl_easy_setopt.3
RELEASE-NOTES: synced with 70f71bb99f7ed9Daniel Stenberg

Synced and prepared for 7.24.0 release. Two security problems, one bug fix, two more contributors.

M RELEASE-NOTES
gnutls: enforced use of SSLv3Daniel Stenberg

With advice from Nikos Mavrogiannopoulos, changed the priority string to add "actual priorities" and favour ARCFOUR. This makes libcurl work better when enforcing SSLv3 with GnuTLS. Both in the sense that the libmicrohttpd test is now working again but also that it mitigates a weakness in the older SSL/TLS protocols.

Bug: http://curl.haxx.se/mail/lib-2012-01/0225.html Reported by: Christian Grothoff

M lib/gtls.c
tests: test CRLF in URLsDaniel Stenberg

Related to the security vulnerability: CVE-2012-0036

Bug: http://curl.haxx.se/docs/adv_20120124.html

M tests/data/Makefile.am
A tests/data/test1322
A tests/data/test1323
A tests/data/test1324
URL sanitize: reject URLs containing bad dataDaniel Stenberg

Protocols (IMAP, POP3 and SMTP) that use the path part of a URL in a decoded manner now use the new Curl_urldecode() function to reject URLs with embedded control codes (anything that is or decodes to a byte value less than 32).

URLs containing such codes could easily otherwise be used to do harm and allow users to do unintended actions with otherwise innocent tools and applications. Like for example using a URL like pop3://pop3.example.com/1%0d%0aDELE%201 when the app wants a URL to get a mail and instead this would delete one.

This flaw is considered a security vulnerability: CVE-2012-0036

Security advisory at: http://curl.haxx.se/docs/adv_20120124.html

Reported by: Dan Fandrich

M lib/escape.c
M lib/escape.h
M lib/imap.c
M lib/pop3.c
M lib/smtp.c
OpenSSL: don't disable security work-aroundDaniel Stenberg

OpenSSL added a work-around for a SSL 3.0/TLS 1.0 CBC vulnerability (http://www.openssl.org/~bodo/tls-cbc.txt). In 0.9.6e they added a bit to SSL_OP_ALL that _disables_ that work-around despite the fact that SSL_OP_ALL is documented to do "rather harmless" workarounds.

The libcurl code uses the SSL_OP_ALL define and thus logically always disables the OpenSSL fix.

In order to keep the secure work-around workding, the SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS bit must not be set and this change makes sure of this.

Reported by: product-security at Apple

M lib/ssluse.c
RELEASE-NOTES: synced with 6e2fd2c9eaDaniel Stenberg

3 more bugfixes, 3 more contributors

M RELEASE-NOTES
CURLOPT_ACCEPTTIMEOUT_MS: spellfixDaniel Stenberg
M docs/libcurl/curl_easy_setopt.3
examples: updated README with two new example programsDan Fandrich
M docs/examples/README
URL parse: user name with ipv6 numerical addressDaniel Stenberg

Using a URL with embedded user name and password didn't work if the host was given as a numerical IPv6 string, like ftp://user:password@[::1]/

Reported by: Brandon Wang Bug: http://curl.haxx.se/mail/archive-2012-01/0047.html

M lib/url.c
telnet.c: fix OOM triggered segfaultYang Tse
M lib/telnet.c
testtrace.c: fix compiler warningYang Tse
M tests/libtest/testtrace.c
OpenSSL: follow-up for commit a20daf90e3Yang Tse

avoid checking preprocessor definition official value

M lib/ssluse.c
- s, use, enable, for options name, avoiding conflicts with the names used in the makefilePierre Joye
M winbuild/Makefile.vc
curl.1: improve --stderr wordingDaniel Stenberg

As is pointed out in this bug report, there can indeed be situation where --stderr has a point even when the "real" stderr can be redirected. Remove the superfluous and wrong comment.

bug: http://curl.haxx.se/bug/view.cgi?id=3476020

M docs/curl.1
KNOWN_BUGS: can't receive zero bytes file properlyDaniel Stenberg

http://curl.haxx.se/bug/view.cgi?id=3438362

M docs/KNOWN_BUGS
ssl session caching: fix compiler warningsYang Tse
M lib/share.c
M lib/share.h
M lib/sslgen.c
M lib/sslgen.h
M lib/transfer.c
M lib/url.c
M lib/urldata.h
polarssl: show cipher suite name correctly with 1.1.0Daniel Stenberg

Apparently ssl_get_ciphersuite() is needed to get the name of the used cipher suite.

M lib/polarssl.c
polarssl: show error code correctlyDaniel Stenberg

The value was turned negative when it shouldn't have been

M lib/polarssl.c
polarssl: havege_rand is not present in version 1.1.0Daniel Stenberg

... it is now named havege_random!

Reported by: Robert Schumann Bug: http://curl.haxx.se/mail/lib-2012-01/0178.html

M lib/polarssl.c
RELEASE-NOTES: synced with 5d70a61b94604Daniel Stenberg

5 more bug fixes, 1 more contributor

M RELEASE-NOTES
Add two tests for telnet: URLsColin Hogben

Add simple telnet tests which (ab)use the http server. The second test checks for an input file handling bug.

M tests/data/Makefile.am
A tests/data/test1326
A tests/data/test1327
Remove bogus optimisation of telnet upload.Colin Hogben

Remove wrongly implemented optimisation of telnet upload, apparently intended to allow the library to avoid manually polling for input.

M src/tool_operate.c
Use correct file descriptor for telnet upload.Colin Hogben

Fix a bug where input was read from stdin even when a different FILE * had been configured via CURLOPT_READDATA

M lib/telnet.c
OpenLDAP: fix LDAP connection phase memory leakYang Tse

bug: http://curl.haxx.se/bug/view.cgi?id=3474308

M lib/openldap.c
OpenSSL: fix PKCS#12 certificate parsing related memory leakJohannes Bauer

Leak triggered when CURLOPT_SSLCERTTYPE and CURLOPT_SSLKEYTYPE set to P12 and both CURLOPT_SSLCERT and CURLOPT_SSLKEY point to the same PKCS#12 file.

M lib/ssluse.c
OpenSSL: SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option is no longer enabledYang Tse

SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option enabling allowed successfull interoperability with web server Netscape Enterprise Server 2.0.1 released back in 1996 more than 15 years ago.

Due to CVE-2010-4180, option SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG has become ineffective as of OpenSSL 0.9.8q and 1.0.0c. In order to mitigate CVE-2010-4180 when using previous OpenSSL versions we no longer enable this option regardless of OpenSSL version and SSL_OP_ALL definition.

M lib/ssluse.c
tests: enable time tracing on tests 500, 573 and 585Yang Tse
M tests/libtest/Makefile.inc
M tests/libtest/lib500.c
M tests/libtest/lib573.c
tests: testtrace.[ch] provides debug callback for libtest usageYang Tse

Allows tests from the libtest subdir to generate log traces similar to those of curl with --tracetime and --trace-ascii options but with output going to stderr.

A tests/libtest/testtrace.c
A tests/libtest/testtrace.h
sws.c: fix proxy mode secondary connection monitoring conditionYang Tse
M tests/server/sws.c
add LF termination to infof() trace stringYang Tse
M lib/connect.c
M lib/curl_ntlm_msgs.c
M lib/cyassl.c
M lib/dict.c
M lib/ftp.c
M lib/gtls.c
M lib/http_negotiate.c
M lib/transfer.c
M lib/url.c
sws.c: improve proxy mode torture testing support - followup to 18c6c8a5Yang Tse
M tests/server/sws.c
url2file: new simple exampleDaniel Stenberg

Just showing how to download the contents of a given URL into a local file.

Based on a suggestion and example code by Georg Potthast

M docs/examples/.gitignore
M docs/examples/Makefile.inc
A docs/examples/url2file.c
imap.c: a dead simple imap exampleDaniel Stenberg

Just to show that IMAP is used just like other protocols

M docs/examples/.gitignore
M docs/examples/Makefile.inc
A docs/examples/imap.c
sws.c: improve proxy mode torture testing support - followup to c731fc58Yang Tse
M tests/server/sws.c
sws.c: improve proxy mode torture testing support - followup to d4bf87dcYang Tse
M tests/server/sws.c
Curl_proxyCONNECT() trace known bug #39Yang Tse
M lib/http_proxy.c
test: verify HTTP response code 308Daniel Stenberg

This newly speced HTTP status code already works as intended in the new spec: http://greenbytes.de/tech/webdav/draft-reschke-http-status-308-02.html

Test 1325 is added to verify that the method is kept after the redirect

M tests/data/Makefile.am
A tests/data/test1325
http_negotiate_sspi.c: fix compiler warningYang Tse
M lib/http_negotiate_sspi.c
M lib/warnless.c
M lib/warnless.h
ssh.c: fix compiler warningYang Tse
M lib/ssh.c
sws.c: improve proxy mode torture testing supportYang Tse
M tests/server/sws.c
RELEASE-NOTES: synced with 9f20379fe4Daniel Stenberg

5 bug fixes, 3 more contributors

M RELEASE-NOTES
hostip: avoid getaddrinfo when c-ares is usedDaniel Stenberg

Some functions using getaddrinfo and gethostbyname were still mistakingly being used/linked even if c-ares was selected as resolver backend.

Reported by: Arthur Murray Bug: http://curl.haxx.se/mail/lib-2012-01/0160.html

M lib/hostip4.c
M lib/setup.h
M lib/tftp.c
sws.c: replace sleep() usage with wait_ms()Yang Tse
M tests/server/sws.c
FTP: CURLE_PARTIAL_FILE should not cause control connection to be closedgsengun

Test 161 updated accordingly

M lib/ftp.c
M tests/data/test161
sws.c: some compiler warning fixesYang Tse
M tests/server/sws.c
lib/setup.h: portable symbolic names for Winsock shutdown() mode flagsYang Tse
M lib/setup.h
sws.c: 812fa73057 follow-upYang Tse
M tests/server/sws.c
sws.c: some IPv6 proxy mode peparatory adjustmentsYang Tse
M tests/server/Makefile.inc
M tests/server/sws.c
curl.h: provide backwards compatible symbolsDaniel Stenberg

In commit c834213ad52 we re-used some obsolete error codes, and here are two defines that makes sure existing source codes that happen to use any of these deprecated ones will still compile.

As usual, define CURL_NO_OLDIES to avoid getting these "precaution defines".

M include/curl/curl.h
win32-threaded-resolver: stop using a dummy socketDaniel Stenberg

Previously the code would create a dummy socket while resolving just to have curl_multi_fdset() return something but the non-win32 version doesn't do it this way and the creation and use of a socket that isn't made with the common create-socket callback can be confusing to apps using the multi_socket API etc.

This change removes the dummy socket and thus will cause curl_multi_fdset() to return with maxfd == -1 more often.

M lib/asyn-thread.c
OpenSSL: remove reference to openssl internal structPeter Sylvester

With this change, curl compiles with the new OPENSSL_NO_SSL_INTERN cflag. This flag might become the default in some distant future.

M docs/examples/curlx.c
M lib/ssluse.c
test1320 test1321: avoid User-Agent comparisonYang Tse
M tests/data/test1320
M tests/data/test1321
httpserver.pl: reorder sws command line optionsYang Tse

make 'pidfile' and 'logfile' options appear first on command line in order to ensure that processing of other options which write to logfile do this to intended file and not the default one.

M tests/httpserver.pl
sws.c: fix proxy mode segfaultYang Tse
M tests/server/sws.c
tool_formparse.c: fix compiler warning: enumerated type mixed with another typeYang Tse
M src/tool_formparse.c
krb5.c: fix compiler warning: variable set but not usedYang Tse
M lib/krb5.c
KNOWN_BUGS: #77 CURLOPT_FORBID_REUSE kills NTLMDaniel Stenberg
M docs/KNOWN_BUGS

donate! Page updated February 23, 2012.
web site info

File upload with ASP.NET