1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
Commit Graph

5259 Commits

Author SHA1 Message Date
Yang Tse
992ceae386 build: fix libssh2_scp_send64() availability 2010-08-05 16:27:39 +02:00
Yang Tse
364fd2f1ad build: remove unneeded cast to (void *) 2010-08-04 19:05:09 +02:00
Daniel Stenberg
f8cf037ecf SCP: send large files properly with new enough libssh2
libssh2 1.2.6 and later handle >32bit file sizes properly even on 32bit
architectures and we make sure to use that ability.

Reported by: Mikael Johansson
Bug: http://curl.haxx.se/mail/lib-2010-08/0052.html
2010-08-04 18:29:13 +02:00
Yang Tse
6028fdb305 build: add missing new files to non-configure target build files 2010-08-03 13:09:39 +02:00
Yang Tse
45456135d5 md4: replace bcopy usage with memcpy 2010-08-03 12:00:32 +02:00
Daniel Stenberg
a1a5ba3d0a Curl_connected_proxy: skip the bits.tcpconnect check
Simply because the TCP might be connected already we cannot skip the
proxy connect procedure. We need to be careful to not overload more
meaning to the bits.tcpconnect field like this.

With this fix, SOCKS proxies work again when the multi interface is
used. I believe this regression was added with commit 4b351d018e,
released as 7.20.1.

Left todo: add a test case that verifies this functionality that
prevents us from breaking it again in the future!

Reported by: Robin Cornelius
Bug: http://curl.haxx.se/bug/view.cgi?id=3033966
2010-08-02 23:17:30 +02:00
Daniel Stenberg
40253e32fe build: add typecast to avoid warning
There is an implicit conversion from "unsigned long" to "long";
rounding, sign extension, or loss of accuracy may result.
2010-08-02 18:53:34 +02:00
Guenter Knauf
3cf658fc24 Removed ugly dependency lists since wmake knows the .autodepend directive. 2010-08-02 05:51:17 +02:00
Guenter Knauf
6f3dc2a726 Removed wlink from DLL loader list because it doesnt work with Watcom < 1.8. 2010-08-02 01:30:37 +02:00
Guenter Knauf
b01fb30f9c Moved the LDAP API defines from Makefile.Watcom to config-win32.h.
These defines are only needed for older Watcom versions (< 1280).
2010-08-02 01:28:46 +02:00
Daniel Stenberg
811fcccfc9 multi: fix FTPS connecting the data connection with OpenSSL
Commit 496002ea1c (released in 7.20.1) broke FTPS when using the
multi interface and OpenSSL was used. The condition for the non-blocking
connect was incorrect.

Reported by: Georg Lippitsch
Bug: http://curl.haxx.se/mail/lib-2010-07/0270.html
2010-08-01 23:50:46 +02:00
Guenter Knauf
b552ca223e Fixed curlbuild.h rule. 2010-08-01 04:48:29 +02:00
Guenter Knauf
a93522f68d Added rule to create curlbuild.h if not present (for builds from git). 2010-08-01 02:39:03 +02:00
Guenter Knauf
fbee86a9e2 Fixed curl.exe static linking. 2010-07-31 11:52:05 +02:00
Daniel Stenberg
2f0c118577 warning: silence a win64 compiler warning
conversion from 'size_t' to 'curl_socklen_t', possible loss of data

Reported by: Adam Light
2010-07-30 23:19:47 +02:00
Daniel Stenberg
314117cbf1 smtp_connect: always provide host name buffer
Previously the host name buffer was only used if gethostname() exists,
but since we converted that into a curl private function that function
always exists and will be used so the buffer needs to exist for all
cases/systems.
2010-07-30 22:36:31 +02:00
Kamil Dudka
b5c3feda17 NTLM tests: boost coverage by forcing the hostname
A shared library tests/libtest/.libs/lihostname.so is preloaded in NTLM
test-cases to override the system implementation of gethostname().  It
makes it possible to test the NTLM authentication for exact match, and
this way test the implementation of MD4 and DES.

If LD_PRELOAD doesn't work, a debug build willl also workk as debug
builds are now made to prefer a specific environment variable and will
then return that content as host name instead of the actual one.

Kamil wrote the bulk of this, Daniel Stenberg polished it.
2010-07-30 00:51:24 +02:00
Guenter Knauf
01c309e186 Added a comment with an alternate idea to avoid the backslash line contination character. 2010-07-29 09:06:55 +02:00
Guenter Knauf
d873c820bd Changed comparison to match size_t var type. 2010-07-29 05:33:04 +02:00
Guenter Knauf
41cf1f4090 Removed unused vars to avoid compiler warnings. 2010-07-29 05:20:43 +02:00
Guenter Knauf
6ad0acb608 Make Watcom makefiles use Makefile.inc to reduce future maintainance.
lib/Makefile.Watcom works fine already, for src/Makefile.Watcom we
need first to tweak src/Makefile.inc a bit - therefore the handtweaked
list still exists for now.
2010-07-29 03:50:09 +02:00
Guenter Knauf
cfbb351e22 Watcom makefiles overhaul.
- make both libcurl and curl makefiles use register calling convention
  (previously libcurl had stack calling convention).
- added include paths to the Watcom headers so its no longer required
  to set the environment vars for this.
- added -wcd=201 to supress compiler warning about unreachable code.
- use macros for all tools, and removed dependency on GNU tools like rm.
- make ipv6 and debug builds controlable via env vars and so make them
  optional instead of default.
- commented WINLDAPAPI and WINBERAPI since they broke with OW 1.8, and
  it seems they're not needed (anymore?).
- added rule for hugehelp.c.cvs so that it will be created when not
  already exist - this is required for building from a release tarball
  since there we have no hugehelp.c.cvs, thus compilation broke.
- removed C_ARG creation from lib/Makefile.Watcom and use CFLAGS
  directly as done too in src/Makefile.Watcom - this has the benefit
  that we will see all active cflags and defines during compile.
- added LINK-ARG to src/Makefile.Watcom in order to better control
  linker input.
- a couple of other minor makefile tweaks here and there ...
- added largefile support for Watcom builds to config-win32.h. Not yet
  tested if it really works, but should since Win32 supports it.
- added loaddll stuff to speed up builds if supported.
2010-07-29 03:18:40 +02:00
Guenter Knauf
11f53b9a18 some cosmetic changes. 2010-07-28 08:05:00 +02:00
Dan Fandrich
eb33f5d1f8 Added md4.c to the Watcom makefile 2010-07-26 16:41:27 -07:00
Daniel Stenberg
6d2ccfed48 add_buffer_send: fix compiler warning
Win64's 32 bit long but 64 bit size_t caused a warning that we avoid
with a typecast. A small whitespace indent fix was also applied.

Reported by: Adam Light
2010-07-24 22:52:35 +02:00
Guenter Knauf
7738b15977 Updated library versions. 2010-07-22 04:34:54 +02:00
Guenter Knauf
0fa4b41c2b Fixed script version which was still based on CVS Revision tag. 2010-07-22 04:29:54 +02:00
Ben Greear
affff47b3d ssh: Fix compile error on 64-bit systems.
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-07-21 21:31:37 +02:00
Ben Greear
d6981cb508 build: Enable configure --enable-werror
This passes -Werror to gcc when building curl and libcurl,
  allowing easy dection of compile warnings.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-07-21 21:29:47 +02:00
Ben Greear
40ecd6c9b8 pingpong: Fix indentation (whitespace change only)
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-07-21 21:27:33 +02:00
Jan Van Boghout
181b08babb CUSTOMREQUEST: shouldn't be disabled when HTTP is disabled
... since FTP is using it as well, and potentially other protocols!

Also, an #endif CURL_DISABLE_HTTP was incorrectly marked, as it seems to
end the proxy block instead.
2010-07-18 20:23:08 +02:00
Jan Van Boghout
7abf3b97fe pingpong: response_time is milliseconds
Fixed the comment/document for the response_time struct member.
2010-07-18 00:49:29 +02:00
Jan Van Boghout
4a1384a8b4 ftp: response timeout bug in "quote" sending
The FTP implementation was missing a timestamp reset point, making the
waiting for responses after sending a post-transfer "QUOTE" command not
working as supposedly. This bug was introduced in 7.20.0
2010-07-18 00:44:25 +02:00
Constantine Sapuntzakis
d4e6404135 multi: fix condition that remove timers before trigger
curl_multi perform has two phases: run through every easy handle calling
multi_runsingle and remove expired timers (timer removal).

If a small timer (e.g. 1-10ms) is set during multi_runsingle, then it's
possible that the timer has passed by when the timer removal runs. The
timer which was just added is then removed. This will potentially cause
the timer list to be empty and cause the next call to curl_multi_timeout
to return -1. Ideally, curl_multi_timeout should return 0 in this case.

One way to fix this is to move the struct timeval now = Curl_tvnow(); to
the top of curl_multi_perform. The change does that.
2010-07-12 19:19:31 +02:00
Constantine Sapuntzakis
3992309285 threaded resolver: fix timeout issue
Reset old timer first so we can set a new one further in the future.
2010-07-12 19:03:51 +02:00
Daniel Stenberg
e01cc7737c http: don't enable chunked during authentication negotiations
As mentioned in bug report #2956968, the HTTP code wouldn't send the
first empty chunk during the auth negotiation phase of the HTTP request
sending, so the server would wait for data to come and libcurl would
wait for data to arrive... I've made the code not enable chunked
encoding until the auth negotiation is done and thus this scenario
doesn't occur anymore.

Reported by: Sidney San Martn
Bug: http://curl.haxx.se/bug/view.cgi?id=2956968
2010-07-06 22:50:21 +02:00
Daniel Stenberg
9be951a415 multi: CURLINFO_LASTSOCKET doesn't work after remove_handle
When curl_multi_remove_handle() is called and an easy handle is returned
to the connection cache held in the multi handle, then we cannot allow
CURLINFO_LASTSOCKET to extract it since that will more or less encourage
that the user uses the socket while it can get used by libcurl again.

Without this fix, we'd get a segfault in Curl_getconnectinfo() trying to
dereference the NULL pointer in 'data->state.connc'.

Bug: http://curl.haxx.se/bug/view.cgi?id=3023840
2010-07-01 23:32:20 +02:00
Pierre Joye
7239538d9a build: add enable IPV6 option for the VC makefiles 2010-06-30 19:42:37 +02:00
Kamil Dudka
f3b77e5611 http_ntlm: add support for NSS
When configured with '--without-ssl --with-nss', NTLM authentication
now uses NSS crypto library for MD5 and DES.  For MD4 we have a local
implementation in that case.  More details are available at
https://bugzilla.redhat.com/603783

In order to get it working, curl_global_init() must be called with
CURL_GLOBAL_SSL or CURL_GLOBAL_ALL.  That's necessary because NSS needs
to be initialized globally and we do so only when the NSS library is
actually required by protocol.  The mentioned call of curl_global_init()
is responsible for creating of the initialization mutex.

There was also slightly changed the NSS initialization scenario, in
particular, loading of the NSS PEM module.  It used to be loaded always
right after the NSS library was initialized.  Now the library is
initialized as soon as any SSL or NTLM is required, while the PEM module
is prevented from being loaded until the SSL is actually required.
2010-06-30 13:12:25 +02:00
Pavel Raiskup
f7ae7b3623 ftp wildcard: FTP LIST parser FIX
There was a problem when a UNIX-like server returned information
about directory size (total NNNNNN) at the first line of
response.
2010-06-24 23:45:44 +02:00
Daniel Stenberg
8da56e12c6 multi_socket: re-use of same socket without notifying app
When a hostname resolves to multiple IP addresses and the first one
tried doesn't work, the socket for the second attempt may get dropped on
the floor, causing the request to eventually time out. The issue is that
when using kqueue (as on mac and bsd platforms) instead of select, the
kernel removes the first fd from kqueue when it is closed (in trynextip,
connect.c:503). Trynextip() then goes on to open a new socket, which
gets assigned the same number as the one it just closed. Later in
multi.c, socket_cb is not called because the fd is already in
multi->sockhash, so the new socket is never added to kqueue.

The correct fix is to ensure that socket_cb is called to remove the fd
when trynextip() closes the socket, and again to re-add it after
singleipsocket(). I'm not sure how to cleanly do that, but the attached
patch works around the problem in an admittedly kludgy way by delaying
the close to ensure that the newly-opened socket gets a different fd.

Daniel's added comment: I didn't spot a way to easily do a nicer fix so
I've proceeded with Ben's patch.

Bug: http://curl.haxx.se/bug/view.cgi?id=3017819
Patch by: Ben Darnell
2010-06-24 23:22:24 +02:00
Pavel Raiskup
0a04078916 ftp-wildcard: avoid tight loop when used without any pattern
It was broken for URLs like "ftp://example.com/".
2010-06-24 10:18:17 +02:00
Daniel Stenberg
1b15b31c86 sendrecv: treat all negative values from send/recv as errors
For example the libssh2 based functions return other negative
values than -1 to signal errors and it is important that we catch
them properly. Right before this, various failures from libssh2
were treated as negative download amounts which caused havoc.
2010-06-19 00:18:14 +02:00
Daniel Stenberg
e6d85923c1 multi: prevent NULL pointer dereference
My additional call to Curl_pgrsUpdate() would sometimes get
called even though there's no connection (left) so a NULL pointer
would get passed, causing a segfault.
2010-06-18 23:46:09 +02:00
Daniel Stenberg
614bae813e smtp: fixed a few uses of size_t that seemed to believe it was signed
Reported-by: Steven M. Schweda
2010-06-18 16:20:41 +02:00
Dan Fandrich
bd6a695545 Fixed an OOM memory leak in the FTP wildcard code 2010-06-17 10:56:25 -07:00
Krister Johansen
43edcc4a2e multi: unmark handle as used when no longer head of pipeline 2010-06-17 15:46:27 +02:00
Daniel Stenberg
01c2b397aa multi: call the progress function only once and allow abort
1) no need to call the progress function twice when in the
CURLM_STATE_TOOFAST state.

2) Make sure that the progress callback's return code is
acknowledged when used
2010-06-17 15:19:30 +02:00
Daniel Stenberg
51a757c11b multi: call the progress callback in all states
As long as no error is reported, the progress function can get
called. This may be a little TOO often so we should keep an eye
on this and possibly make this conditional somehow.
2010-06-17 15:10:08 +02:00
Yang Tse
88af6fbf98 remove unused 'tmpdata' and 'backup' ftp_parselist_data struct members 2010-06-10 04:46:30 +02:00
Yang Tse
6b6fe2a4d5 replace isprint() with ISPRINT() 2010-06-10 02:33:45 +02:00
Yang Tse
54aca3c5ec ensure that Curl_wildcard_dtor() leaves WildcardData struct zero initialized 2010-06-10 02:30:23 +02:00
Yang Tse
343c4c7072 code simplification 2010-06-09 16:48:19 +02:00
Yang Tse
6a0d3233ff add Curl_ prefix to conform with cURL naming standards 2010-06-09 15:45:46 +02:00
Yang Tse
d3714b016d Merge branch 'master' of git@github.com:bagder/curl 2010-06-09 01:57:37 +02:00
Yang Tse
da6e992e1d fix compiler warning using curl_socket_t to store socket descriptor 2010-06-09 01:51:46 +02:00
Daniel Stenberg
bb60fe0c1a inet_pton: warnings: use size_t to store pointer deltas 2010-06-08 23:09:42 +02:00
Yang Tse
feecf63a96 avoid redundant work when reusing same connection 2010-06-08 19:29:20 +02:00
Yang Tse
cbdd1cbcde fix function result checking 2010-06-08 16:16:34 +02:00
Daniel Stenberg
b3d7161642 transfer: warning: implicit conversion
There is an implicit conversion from "unsigned long" to "long";
rounding, sign extension, or loss of accuracy may result.

Fixed by an added typecast.
2010-06-08 10:36:06 +02:00
Daniel Stenberg
3b47d231ac TFTP: fix compiler warning
Curl_fillreadbuffer()'s second argument takes an int, so
typecasting to another is a bad idea.
2010-06-08 10:35:06 +02:00
Daniel Stenberg
7977bc3dfa TFTP: fix warning for sendto() usage on non-POSIX systems
Older unixes want an 'int' instead of 'size_t' as the 3rd
argumment so before this change it would cause warnings such as:

There is an implicit conversion from "unsigned long" to "int";
rounding, sign extension, or loss of accuracy may result.
2010-06-08 10:19:39 +02:00
Dan Fandrich
00fdafb0a1 Include Makefile.inc to get the list of source files for Amiga
Signed-off-by: Diego Casorran <dcasorran@gmail.com>
2010-06-07 14:00:16 -07:00
Yang Tse
f737e94164 Curl_updateconninfo() error handling fix 2010-06-07 16:53:31 +02:00
Constantine Sapuntzakis
a0dd9df9ab OpenSSL: fix spurious SSL connection aborts
Was seeing spurious SSL connection aborts using libcurl and
OpenSSL. I tracked it down to uncleared error state on the
OpenSSL error stack - patch attached deals with that.

Rough idea of problem:

Code that uses libcurl calls some library that uses OpenSSL but
don't clear the OpenSSL error stack after an error.

ssluse.c calls SSL_read which eventually gets an EWOULDBLOCK from
the OS. Returns -1 to indicate an error

ssluse.c calls SSL_get_error. First thing, SSL_get_error calls
ERR_get_error to check the OpenSSL error stack, finds an old
error and returns SSL_ERROR_SSL instead of SSL_ERROR_WANT_READ or
SSL_ERROR_WANT_WRITE.

ssluse.c returns an error and aborts the connection

Solution:

Clear the openssl error stack before calling SSL_* operation if
we're going to call SSL_get_error afterwards.

Notes:

This is much more likely to happen with multi because it's easier
to intersperse other calls to the OpenSSL library in the same
thread.
2010-06-05 23:41:58 +02:00
Yang Tse
4724b9d966 replace socklen_t with curl_socklen_t 2010-06-05 15:08:26 +02:00
Frank Meier
8098d9417c getinfo: added *_PRIMARY_PORT, *_LOCAL_IP and *_LOCAL_PORT 2010-06-05 00:31:36 +02:00
Yang Tse
43d20d81a5 Enable OpenLDAP support for cygwin builds.
Enable OpenLDAP support for cygwin builds. This support was disabled back
in 2008 due to incompatibilities between OpenSSL and OpenLDAP headers.
cygwin's OpenSSL 0.9.8l and OpenLDAP 2.3.43 versions on cygwin 1.5.25
allow building an OpenLDAP enabled libcurl supporting back to Windows 95.

Remove non-functional CURL_LDAP_HYBRID code and references.
2010-06-04 15:14:31 +02:00
Kamil Dudka
bc0f3dd15e ftplistparser.c: oops, fix typo in the last commit 2010-06-02 23:55:45 +02:00
Kamil Dudka
475c19c42b ftplistparser.c: avoid some invalid dereferences 2010-06-02 23:50:38 +02:00
Kamil Dudka
c072bd4609 lib: eliminate some dead code 2010-06-02 23:50:38 +02:00
Daniel Stenberg
684830cb2a SSH: corrected the inability to respect the timeout
Jason McDonald posted bug report #3006786 when he found that the
SFTP code didn't timeout properly in several places in the code
even if a timeout was set properly.

Based on his suggested patch, I wrote a different implementation
that I think addressed the issue better and also uses the connect
timeout for the initial part of the SSH/SFTP done during the
"protocol connect" phase.

(http://curl.haxx.se/bug/view.cgi?id=3006786)
2010-06-02 23:33:51 +02:00
Yang Tse
3b24076c3b add missing new files to non-configure target build files 2010-06-02 15:09:39 +02:00
Yang Tse
077125e4a2 include libcurl standard internal headers 2010-06-02 14:13:02 +02:00
Yang Tse
d939e0f410 make setup.h first included file 2010-06-02 13:19:04 +02:00
Yang Tse
69d07feb14 fix spnego memory leak 2010-06-02 12:44:46 +02:00
Yang Tse
1c4538610b openldap header inclusions fix 2010-06-02 11:23:30 +02:00
Daniel Stenberg
2c72732ebf multi_socket: handles timer inaccuracy better for timeouts
Igor Novoseltsev reported a problem with the multi socket API and
using timeouts and timers. It boiled down to a problem with
libcurl's use of GetTickCount() interally to figure out the
current time, while Igor's own application code used another
function call.

It made his app call the socket API timeout function a bit
_before_ libcurl would consider the timeout to trigger, and that
could easily lead to timeouts or stalls in the app. It seems
GetTickCount() in general often has no better resolution than
16ms and switching to the alternative function
QueryPerformanceCounter has its share of problems:
http://www.virtualdub.org/blog/pivot/entry.php?id=106

We address this problem by simply having libcurl treat timers
that already has occured or will occur within 40ms subject for
treatment. I'm confident that there are other implementations and
operating systems with similarly in accurate timer functions so
it makes sense to have applied generically and I don't believe we
sacrifice much by adding a 40ms inaccuracy on these timeouts.
2010-06-01 23:20:16 +02:00
Yang Tse
89da532445 fix ldap related compilation issues 2010-06-01 17:25:03 +02:00
Yang Tse
b38189c7b4 fix compiler warning: enumerated type mixed with another type 2010-06-01 12:25:14 +02:00
Yang Tse
1bb04927f3 fix compiler warning: enumerated type mixed with another type 2010-05-31 19:55:22 +02:00
Patrick Monnerat
3fd01be648 smtp_authenticate: avoid compiler warnings 2010-05-31 17:37:00 +02:00
Yang Tse
0546d448ce fix compiler warning: enumerated type mixed with another type 2010-05-31 17:22:43 +02:00
Yang Tse
b4fa27ae4b fix compiler warning: enumerated type mixed with another type 2010-05-31 17:11:51 +02:00
Yang Tse
a9483b1f4a fix compiler warning: enumerated type mixed with another type 2010-05-31 16:36:05 +02:00
Yang Tse
40f8aaedb7 fix compiler warning: external declaration in primary source file 2010-05-31 16:24:01 +02:00
Yang Tse
374f48675b update year in copyright notice 2010-05-31 13:51:29 +02:00
Kamil Dudka
20ae9d4f71 strtoofft: rename CURL_LLONG_MIN -> CURL_OFF_T_MIN
... and CURL_LLONG_MAX -> CURL_OFF_T_MAX
2010-05-29 21:28:16 +02:00
Kamil Dudka
35955179c6 CURL_LLONG_MAX: avoid constant overflow
... when (CURL_SIZEOF_CURL_OFF_T == 4)
2010-05-29 21:23:18 +02:00
Howard Chu
b1c1b9bb76 LDAPS: list availability depending on SSL's presence 2010-05-28 12:23:28 +02:00
Howard Chu
123f80ae54 LDAP: make it build without SSL if no such support is available
of course it also goes for the case where SSL is explicitly
disabled
2010-05-28 12:22:35 +02:00
Kamil Dudka
233ec511db lib: eliminate 'statement not reached' warnings 2010-05-28 09:45:17 +02:00
Howard Chu
c03cbb38ad openldap: fix compiler warnings 2010-05-27 22:37:38 +02:00
Daniel Stenberg
63661d8e83 indent: some whitespace edits 2010-05-27 22:37:38 +02:00
Kamil Dudka
4a0493f789 wildcard.c: add missing include of "setup.h" 2010-05-27 20:56:01 +02:00
Pavel Raiskup
9190e2876e wildcard.c: add missing include of "curl_memory.h" 2010-05-27 18:41:29 +02:00
Tor Arntsen
b4f0e1291f setup_once: use enum type for 'bool' on non-C99 platforms
An enum will catch non-bool assignments to bool on platforms with
a strict compiler, e.g MIPSPro.

Signed-off-by: Kamil Dudka <kdudka@redhat.com>
2010-05-27 18:15:17 +02:00
Kamil Dudka
dd8568739c url.c: avoid implied cast to bool 2010-05-27 16:35:31 +02:00
Tor Arntsen
97b497a75f curl_fnmatch: remove use of register keyword
Using the 'register' keyword rarely improves anything with modern
compilers and architectures.
2010-05-27 16:34:57 +02:00
Julien Chaffraix
d3c813e726 RTMP: Fix compiler warnings 2010-05-26 00:41:45 +02:00
Julien Chaffraix
9e480973eb OOM fixes in http_negociate.c and lib/splay.c
Fix 2 OOM errors: a missing NULL-check in lib/http_negociate.c
and a potential NULL dereferencing in lib/splay.c
2010-05-26 00:40:26 +02:00
Howard Chu
2e056353b0 LDAP: properly implemented as a curl_handler
makes the LDAP code much cleaner, nicer and in general being a
better libcurl citizen. If a new enough OpenLDAP version is
detect, the new and shiny lib/openldap.c code is then used
instead of the old cruft

Code by Howard, minor cleanups by Daniel.
2010-05-25 00:44:42 +02:00
Tor Arntsen
606b933a4f curl_fnmatch: Use int not bool when function returns int
bool in curl internals is unsigned char and should not be used
to receive return value from functions returning int - this fails
when using IBM VisualAge and Tru64 compilers.
2010-05-21 23:42:55 +02:00
Daniel Stenberg
d17709da31 TFTP: send legal timeout value
Eric Mertens posted bug #3003705: when we made TFTP use the
correct timeout option when sent to the server (fixed May 18th
2010) it became obvious that libcurl used invalid timeout values
(300 by default while the RFC allows nothing above 255). While of
course it is obvious that as TFTP has worked thus far without
being able to set timeout at all, just removing the setting
wouldn't make any difference in behavior. I decided to still keep
it (but fix the problem) as it now actually allows for easier
(future) customization of the timeout.

(http://curl.haxx.se/bug/view.cgi?id=3003705)
2010-05-21 23:29:52 +02:00
Daniel Stenberg
0bb6deda72 TFTP: don't ack if wrong block num is received
If an unexpected block number was received, break out of the
switch loop.
2010-05-21 23:07:59 +02:00
Daniel Stenberg
0a29e2445c TFTP: block id wrap bug fix
In a normal expression, doing [unsigned short] + 1 will not wrap
at 16 bits so the comparisons and outputs were done wrong. I
added a macro do make sure it gets done right.

Douglas Kilpatrick filed bug report #3004787 about it:
http://curl.haxx.se/bug/view.cgi?id=3004787
2010-05-21 23:04:15 +02:00
Ben Greear
700335103e Fix build warnings.
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-05-20 23:16:46 +02:00
Ben Greear
368fd5d27b setopt: Fix setting of set.is_fwrite_set
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-05-20 23:15:34 +02:00
Tanguy Fautre
81239edb89 build: allow curl to build with Microsoft VC10
By undefing a bunch of E* defines that VC10 has started to define
but that we redefine internally to their WSA* alternatives when
building for Windows.
2010-05-20 22:40:48 +02:00
Tor Arntsen
5f53c9d94a lib: Fix AIX build failure 2010-05-19 22:09:35 +02:00
Dan Fandrich
04cfef24a1 Fixed some memory leaks in the POP3 torture tests 2010-05-19 12:18:06 -07:00
Dan Fandrich
1d26151d5f Fixed a memory leak in the SMTP torture tests 2010-05-18 14:44:19 -07:00
Daniel Stenberg
aabd27d9aa TFTP: send timeout option correctly
Eric Mertens posted bug report #3003005 pointing out that the
libcurl TFTP code was not sending the timeout option properly to
the server, and suggested a fix.

(http://curl.haxx.se/bug/view.cgi?id=3003005)
2010-05-18 23:14:00 +02:00
Tor Arntsen
dcc061543a lib: Change some CRLF line endings to LF
An update had added a couple of lines with DOS line endings,
and some compilers will choke on that (e.g. the Tru64 compiler).
2010-05-16 22:34:02 +02:00
Kamil Dudka
2ffe834bff ftp wildcard: a new option CURLOPT_FNMATCH_DATA 2010-05-16 02:52:33 +02:00
Howard Chu
027ceb37a1 RMTP: the version code is now rtmp aware 2010-05-15 22:13:17 +02:00
Howard Chu
510836f80b RTMP: fix wrong #ifdef 2010-05-15 22:02:44 +02:00
Pavel Raiskup
e4af5d6efc ftp wildcard: fix int32_t and size/group mixups 2010-05-15 21:58:50 +02:00
Daniel Stenberg
77cfeadfa6 OpenSSL: multi interface handshake could hang
John-Mark Bell filed bug #3000052 that identified a problem (with
an associated patch) with the OpenSSL handshake state machine
when the multi interface is used:

Performing an https request using a curl multi handle and using
select or epoll to wait for events results in a hang. It appears
that the cause is the fix for bug #2958179, which makes
ossl_connect_common unconditionally return from the step 2 loop
when fetching from a multi handle.

When ossl_connect_step2 has completed, it updates
connssl->connecting_state to ssl_connect_3. ossl_connect_common
will then return to the caller, as a multi handle is in
use. Eventually, the client code will call curl_multi_fdset to
obtain an updated fdset to select or epoll on. For https
requests, curl_multi_fdset will cause https_getsock to be called.
https_getsock will only return a socket handle if the
connecting_state is ssl_connect_2_reading or
ssl_connect_2_writing.  Therefore, the client will never obtain a
valid fdset, and thus not drive the multi handle, resulting in a
hang.

(http://curl.haxx.se/bug/view.cgi?id=3000052)
2010-05-14 22:35:08 +02:00
Daniel Stenberg
7764795c06 follow redirect: ignore response-body on redirect even if compressed
Sebastian V reported bug #3000056 identifying a problem with
redirect following. It showed that when curl followed redirects
it didn't properly ignore the response body of the 30X response
if that response was using compressed Content-Encoding!

(http://curl.haxx.se/bug/view.cgi?id=3000056)
2010-05-14 22:12:07 +02:00
Hoi-Ho Chan
83305cbf9f Remove support for BSD version of PolarSSL
"The BSD version of PolarSSL was made for migratory purposes only and is not
maintained. The GPL version of PolarSSL is actually the only actively
developed version, so I would be very reluctant to use the BSD version." /
Paul Bakker, PolarSSL hacker.

Signed-off-by: Hoi-Ho Chan <hoiho.chan@gmail.com>
2010-05-13 21:50:52 +02:00
Dan Fandrich
76255cfdc9 Added Polar SSL and RTMP files to the non-autoconf build files
I didn't bother with a few that have little hope of running the required
dependent libraries.
2010-05-12 19:05:58 -07:00
Dan Fandrich
ad6bc4d82e Added the new ftp source files to the non-autoconf build files 2010-05-12 17:32:10 -07:00
Daniel Stenberg
a799162bc7 style: minor whitespace change 2010-05-12 23:32:42 +02:00
Pavel Raiskup
0825cd80a6 FTP: WILDCARDMATCH/CHUNKING/FNMATCH added 2010-05-12 23:17:51 +02:00
Howard Chu
04cb15ae9d RTMP: initial support added, powered by librtmp
librtmp is found at http://rtmpdump.mplayerhq.hu/
2010-05-12 23:07:20 +02:00
Howard Chu
bc8fc9803f sendrecv: make them two pairs of send/recv to properly deal with FTPS
FTP(S) use two connections that can be set to different recv and
send functions independently, so by introducing recv+send pairs
in the same manner we already have sockets/connections we can
work with FTPS fine.

This commit fixes the FTPS regression introduced in change d64bd82.
2010-05-11 22:48:38 +02:00
Kamil Dudka
3e759f4fb6 nss: make it possible to read ASCII and DER CRL 2010-05-11 14:39:08 +02:00
Kamil Dudka
2e8b21833a nss: add CRL to cache instead of read-only NSS db 2010-05-11 14:37:43 +02:00
Hacki
d2621445f1 moved vars into conditional since seems that winsock implementation doesnt use them. 2010-05-08 05:38:42 +02:00
Daniel Stenberg
adaf87530d multi interface: missed storing connection time
Dirk Manske reported a regression. When connecting with the multi
interface, there were situations where libcurl wouldn't store
connect time correctly as it used to (and is documented to) do.

Using his fine sample program we could repeat it, and I wrote up
test case 573 using that code. The problem does not easily show
itself using the local test suite though.

The fix, also as suggested by Dirk, is a bit on the ugly side as
it adds yet another call to Curl_verboseconnect() and setting the
TIMER_CONNECT time.  That situation is subject for some closer
inspection in the future.
2010-05-07 23:49:29 +02:00
Daniel Stenberg
8914857092 verboseconnect: so the verbose checking within the function
As the function is used more than once and libcurl can be built
without it, do the conditional check within the verboseconnect()
function itself.
2010-05-07 23:24:47 +02:00
Howard Chu
d64bd82bdc sendrecv: split the I/O handling into private handler
Howard Chu brought the bulk work of this patch that properly
moves out the sending and recving of data to the parts of the
code that are properly responsible for the various ways of doing
so.

Daniel Stenberg assisted with polishing a few bits and fixed some
minor flaws in the original patch.

Another upside of this patch is that we now abuse CURLcodes less
with the "magic" -1 return codes and instead use CURLE_AGAIN more
consistently.
2010-05-07 15:05:34 +02:00
Hoi-Ho Chan
51427e1947 PolarSSL: initial support added
This is Hoi-Ho Chan's patch with some minor fixes by me. There
are some potential issues in this, but none worse than we can
sort out on the list and over time.
2010-05-05 22:30:46 +02:00
Ben Greear
38d2afcefb telnet: Allow programatic use of telnet.
The main change is to allow input from user-specified methods,
when they are specified with CURLOPT_READFUNCTION.
All calls to fflush(stdout) in telnet.c were removed, which makes
using 'curl telnet://foo.com' painful since prompts and other data
are not always returned to the user promptly.  Use
'curl --no-buffer telnet://foo.com' instead.  In general,
the user should have their CURLOPT_WRITEFUNCTION do a fflush
for interactive use.

Also fix assumption that reading from stdin never returns < 0.
Old code could crash in that case.

Call progress functions in telnet main loop.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-04-29 08:55:11 +02:00
Daniel Stenberg
107146676e SSH: init and cleanup libssh2 in global_init/cleanup
The necessary libssh2 functions require libssh2 1.2.5 or later.
2010-04-26 00:36:25 +02:00
Kamil Dudka
82e9b78a38 nss: fix SSL handshake timeout underflow 2010-04-24 23:23:01 +02:00
Guenter Knauf
07f45946b5 encourage users to take latest lib dependencies. 2010-04-24 17:48:09 +02:00
Daniel Stenberg
7fb7f24131 socks5: please static code analyzer
Make sure we don't call memcpy() if the argument is NULL even
though we also passed a zero length then, as the clang analyzer
whined and we want to limit warnings (even false positives) when
they're this easy to fix.

The change of (char) to (unsigned char) will fix long user names
and passwords on systems that have the char type signed by
default.
2010-04-24 12:40:00 +02:00
Daniel Stenberg
5b40c11c2f gzip: Value stored to 'data' is never read 2010-04-24 12:37:11 +02:00
Yang Tse
81512cc02b hmac.c related compilation adjustment 2010-04-20 21:35:31 +02:00
Yang Tse
32236dad5e hmac.c related compilation adjustment 2010-04-20 21:23:53 +02:00
monnerat
b30ce34d84 Add compilation directives for hmac in Watcom,riscos and vc6 platform-specific makefiles. 2010-04-20 19:23:48 +02:00
Ruslan Gazizov
2164b6b463 replaced wsock32.lib usage with ws2_32.lib in MSVC makefiles 2010-04-20 16:30:10 +02:00
monnerat
7af5e3c39e Merge branch 'master' of github.com:bagder/curl 2010-04-19 17:37:51 +02:00
monnerat
42930155ab Remove null-effect leftover code. 2010-04-19 17:30:20 +02:00
Daniel Stenberg
a5b7e3205d Curl_HMAC_MD5: fix the array init to not warn with picky compilers 2010-04-19 16:19:36 +02:00
monnerat
dfce37da23 Fix GnuTLS compilation problem in md5.c 2010-04-19 14:09:45 +02:00
monnerat
14bfcb96f5 Fix compilation problem: declare Curl_HMAC_MD5 as extern in include file. 2010-04-19 12:44:17 +02:00
monnerat
87fbcb4494 Merge branch 'master' of github.com:bagder/curl 2010-04-19 11:17:46 +02:00