Commit Graph

14586 Commits

Author SHA1 Message Date
Rob Ward 7e4daaf908 progress function example: include timed interval
Adds a timer based off of CURLINFO_TOTAL_TIME that is used to perform
certain actions after a minimum amount of time has passed using the
progress function. As a consequence the curl handle is now also passed
into the progress function. Progress example now also includes an
example of how to retreive the TOTAL_TIME and print it out.
2011-12-05 23:13:34 +01:00
Daniel Stenberg 3bbe219be2 RELEASE-NOTES: synced with 347f951c39
8 more bugs, 5 more contributors
2011-12-05 22:58:30 +01:00
Daniel Stenberg 347f951c39 SSH: fix CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
When a 32 digit hex key is given as a hostkey md5 checksum, the code
would still run it against the knownhost check and not properly
acknowledge that the md5 should then be the sole guide for.

The verbose output now includes the evaluated MD5 hostkey checksum.

Some related source code comments were also updated.

Bug: http://curl.haxx.se/bug/view.cgi?id=3451592
Reported by: Reza Arbab
2011-12-05 22:24:28 +01:00
Daniel Stenberg c50dbf670f Curl_resolver_is_resolved: differentiate between host/proxy errors
As there are different return codes for host vs proxy errors, this function
now properly returns the code properly depending on what was attempted to get
resolved.

Bug: http://curl.haxx.se/mail/archive-2011-12/0010.html
Reported by: Jason Liu
2011-12-05 12:44:55 +01:00
Daniel Stenberg 0cf05af744 c-ares: return proxy failure for all proxy types
When making a distinction which return code to return, the code previously
only regarded HTTP proxies to be proxies and thus return host-related errors
for failures on other proxy types than HTTP. Now all proxy types will be
considered proxies...
2011-12-05 12:41:38 +01:00
Daniel Stenberg d5b5f64bce FTP: close callback fix
Keep track of which sockets that are the result of accept() calls and
refuse to call the closesocket callback for those sockets. Test case 596
now verifies that the open socket callback is called the same number of
times as the closed socket callback for active FTP connections.

Bug: http://curl.haxx.se/mail/lib-2011-12/0018.html
Reported by: Gokhan Sengun
2011-12-05 12:34:27 +01:00
Daniel Stenberg 088ba97a24 FTP: call opensocket callback properly
When the new socket is created for an active connection, it is now done
using the open socket callback.

Test case 596 was modified to run fine, although it hides the fact that
the close callback is still called too many times, as it also gets
called for closing sockets that were created with accept().
2011-12-05 11:42:10 +01:00
Daniel Stenberg 9109cdec11 Curl_socket: internal replacement for socket()
Moved out into a separate function to work as a "generic" socket()
replacement.
2011-12-05 10:58:38 +01:00
Daniel Stenberg 5971d401d4 test: verify the opensocket callback for FTP
test 595: for passive FTP
test 596: for active FTP
2011-12-04 23:10:12 +01:00
Jason Glasgow 62d3652b43 CURLOPT_DNS_SERVERS: set name servers if possible (fix)
Ensure that CURLE_OK is returned if setting the name servers is successfull.
2011-12-02 21:54:15 +01:00
Daniel Stenberg d81f5ea3e0 multi interface: only use non-NULL function pointer!
If the socket callback function pointer hasn't been set, we must not
attempt to use it. Commit adc88ca20 made it more likely to occur.
2011-12-02 21:10:28 +01:00
Jason Glasgow adc88ca203 multi: handle timeouts on DNS servers by checking for new sockets
If the first name server is not available, the multi interface does
not invoke the socket_cb when the DNS request to the first name server
timesout.  Ensure that the list of sockets are always updated after
calling Curl_resolver_is_resolved.

This bug can be reproduced if Curl is complied with --enable_ares and
your code uses the multi socket interfaces and the
CURLMOPT_SOCKETFUNCTION option.  To test try:
  iptables -I INPUT \
           -s $(sed -n -e '/name/{s/.* //p;q}' /etc/resolv.conf)/32 \
           -j REJECT
and then run a program which uses the multi-interface.
2011-12-02 10:18:52 +01:00
Daniel Stenberg 83350c9cc4 test 815: verify POP3 dot-first-on-line unescaping 2011-12-01 10:20:42 +01:00
Steve Holme bdb647814e POP3: fixed escaped dot not being striped out
Changed the eob detection to work across the whole of the buffer so that
lines that begin with a dot (which the server will have escaped) are
passed to the client application correctly.
2011-12-01 00:06:47 +01:00
Yang Tse c92234c3bc buildconf: follow-up for commit 7e02f7fd 2011-11-30 21:53:21 +01:00
Yang Tse 7e02f7fdee buildconf: fix libtool 1.5.x warnings triggered with autoconf 2.6x or later
Using libtool 1.5.x (x < 26) with autoconf 2.6x or later generates warnings
due to some libtool variables not following naming convention for variables
that will be cached.

This is addressed renaming a couple of variables to make these follow expected
naming convention.
2011-11-30 19:33:38 +01:00
Daniel Stenberg bd94807003 RELEASE-NOTES: synced with 1038d0aa1
5 bugfixes and 1 new contributor
2011-11-30 16:38:58 +01:00
Yang Tse 1038d0aa16 pop3.c: fix compiler warning 2011-11-29 20:28:49 +01:00
Yang Tse f80a508297 configure: avoid usage of macro PKG_CHECK_MODULES
libidn option adjusted in order to use pkg-config info when available
in a similar way as we already do for other libraries.
2011-11-29 19:11:34 +01:00
Daniel Stenberg af64666434 POP3: detect when LIST returns no mails
By making sure the function can detect an "end of body" sequence
immediately on the first line, test 811 is now enabled.
2011-11-29 13:43:46 +01:00
Daniel Stenberg 2d72489f0f ftpserver: output CRLF in logs
Previously the log function would just filter out all CR and LF
occurances from the log to make it more readable. This had the downside
that it made it very hard to see CR LFs when they actually matters.

Now, they're instead converted to "[CR]" and "[LR]" in the log to become
apparent to readers.
2011-11-29 13:43:12 +01:00
Daniel Stenberg dda815b776 POP3: fix end of body detection
Curl_pop3_write() now has a state machine that scans for the end of a
POP3 body so that the CR LF '.' CR LF sequence can come in everything
from one up to five subsequent packets.

Test case 810 is modified to use SLOWDOWN which makes the server pause
between each single byte and thus makes the POP3 body get sent to curl
basically one byte at a time.
2011-11-29 00:25:21 +01:00
Daniel Stenberg 8d3efb6be0 test: added POP3 test with dot-prefixed line
Test 815 is disabled for now since libcurl currently doesn't unescape
such lines the way it should. See mail:

http://curl.haxx.se/mail/lib-2011-11/0324.html
2011-11-28 23:34:16 +01:00
Daniel Stenberg 11e52ef0a1 configure: fix to make older pkg-config play well
configure.ac:1349: error: possibly undefined macro: PKG_CONFIG_LIBDIR

Obviously this is not a problem with pkg-config 0.26 but older versions
seem to show this.

Fix suggested by: Kamil Dudka
Reported by: Guenter
Bug: http://curl.haxx.se/mail/lib-2011-11/0298.html
2011-11-27 20:00:30 +01:00
Daniel Stenberg 71ce2470dc test 1211: FTP test to repeat bug #3429299
"Active FTP hangs if server does not open data connection"

The server first sends a 150 and then when libcurl waits for the data
transfer, the server sends a 425.
2011-11-25 23:15:58 +01:00
Mark Brand 874855b743 configure: add support for pkg-config detection of libidn 2011-11-25 23:05:37 +01:00
Daniel Stenberg ac54d27d4b FTP tests 1206 - 1209: don't expect QUIT
The protocol parts for these tests do not include QUIT simply because
the error is CURLE_OPERATION_TIMEDOUT (28) which is a generic timeout
error without specificly saying for which connection it concerns, and
for timeouts libcurl marks the control channel as "invalid". As this
test case times out for the data connection it could still use the
control channel.
2011-11-25 22:49:49 +01:00
Yang Tse 2d833852f6 CyaSSL 2.0+ library initialization adjustment 2011-11-25 17:23:36 +01:00
Jonas Schnelli 0604b2fb90 rectify comment 2011-11-25 15:02:43 +01:00
Daniel Stenberg 8f50a5c7e5 SSLSESSION_SHARED: new macro to check if session is shared
Added convenience macro to use to check if a handle is using a shared
SSL session, and fixed so that Curl_ssl_close_all() doesn't lock when
the session isn't shared.
2011-11-25 15:00:37 +01:00
Yang Tse 703fa0a6a8 telnet.c: fix MSVC compiler warning 2011-11-25 14:30:53 +01:00
Yang Tse 97d7a9260e tvdiff_secs(): sub-zero time difference adjustment
Skip a floating point addition operation when integral part of time difference
is zero. This avoids potential floating point addition rounding problems while
preserving decimal part value.
2011-11-25 13:51:55 +01:00
Daniel Stenberg 4a4d04446d telnet: fix macros to allow proper semicolon use
Macros that look like function calls need to be made so that we can use
semicolons properly for indentation and for reducing the risk for
mistakes when using them.
2011-11-25 10:56:18 +01:00
Laurent Rabret b9223a17b8 TELNET: improved treatment of options
1) enables the Window Size option
2) allows the server to enable the echo mode
3) allows an app using libcurl to disable the default binary mode

Signed-off-by: Laurent Rabret
2011-11-25 10:46:49 +01:00
Daniel Stenberg f712ace9d7 RELEASE-NOTES: synced with 2c905fd1f8 2011-11-25 00:09:43 +01:00
Jonas Schnelli 2c905fd1f8 query-part: ignore the URI part for given protocols
By setting PROTOPT_NOURLQUERY in the protocol handler struct, the
protocol will get the "query part" of the URL cut off before the data is
handled by the protocol-specific code. This makes libcurl adhere to
RFC3986 section 2.2.

Test 1220 is added to verify a file:// URL with query-part.
2011-11-24 23:31:19 +01:00
Daniel Stenberg 4403e82f32 symbols.pl: provide LIBCURL_HAS macro for apps
Experience has shown that the symbols-in-versions file is very useful to
applications that want to build with a wide range of libcurl versions.
It is however easy to get it wrong and the source gets a bit messy with
all the fixed numerical comparisions.

The point of this script is to provide an easy-to-use macro for libcurl-
using applications to do preprocessor checks for specific libcurl
defines, and yet make the code clearly show what the macro is used for.
2011-11-24 22:56:39 +01:00
Yang Tse c482e946f7 lib573.c: fix double data type variable comparison with zero 2011-11-24 18:18:42 +01:00
Yang Tse 46bd8b330a getinfo.c: reset app connect time when clearing session-info time variables 2011-11-24 18:13:09 +01:00
Yang Tse 78feaff9d8 Fix unreleased regression when using windows gnutls versions older than 2.8 2011-11-24 12:11:52 +01:00
Mark Brand 28bac99674 gnutls: only translate winsock errors for old versions
Bugfix: https handshake fails using gnutls 3 on windows
http://sourceforge.net/tracker/index.php?func=detail&aid=3441084&group_id=976&atid=100976

New gnutls versions have an error handler that knows about Winsock
errors, which is why gnutls_transport_set_global_errno() was deprecated
and then removed.

This is a correction of commit f5bb370 (blame me) which meant to
reimplement gnutls_transport_set_global_errno(), which is not necessary.
2011-11-23 22:38:11 +01:00
Daniel Stenberg 7248439fec protocol_connect: show verbose connect and set connect time
Regression: commit b998d95b (shipped first in release 7.22.0) made the
condition always equal false that should reset the TIMER_CONNECT timer
and call the Curl_verboseconnect() function.

Reported by: "Captain Basil"
Bug: http://curl.haxx.se/mail/archive-2011-11/0035.html
2011-11-21 23:36:21 +01:00
Daniel Stenberg c532604b13 -J -O: use -O name if no Content-Disposition header comes!
A regression between 7.22.0 and 7.23.0 -- downloading a file with the
flags -O and -J results in the content being written to stdout if and
only if there was no Content-Disposition header in the http response. If
there is a C-D header with a filename attribute, the output is correctly
written.

Reported by: Dave Reisner
Bug: http://curl.haxx.se/mail/archive-2011-11/0030.html
2011-11-20 23:35:49 +01:00
Martin Storsjo 64f328c787 Add support for using nettle instead of gcrypt as gnutls backend 2011-11-19 22:23:14 +01:00
Jonas Schnelli c0db5ff678 test: SFTP quote commands with * prefix
Related to the f64812ca63 commit
2011-11-18 20:30:46 +01:00
Daniel Stenberg 66617b79d7 CURLOPT_QUOTE: SFTP supports the '*'-prefix now 2011-11-18 20:27:07 +01:00
Jonas Schnelli f64812ca63 SFTP: support '*' prefix for quote operations
prefixing a command with '*' means it is allowed to fail without
aborting the chain actions
2011-11-18 16:04:52 +01:00
Daniel Stenberg 10ecdf5078 getsessionid: don't ever return while locked
Also, check for the session sharing bit instead of comparing pointers
2011-11-17 23:57:21 +01:00
Daniel Stenberg bb4eb58996 Curl_ssl_getsessionid: increase the value, not the pointer 2011-11-17 23:46:29 +01:00
Daniel Stenberg fc8809f993 THANKS: one new contributor in 7.23.1 2011-11-17 23:43:38 +01:00