/* evaluates to true if option takes a curl_write_callback argument */
diff -ru curl-7.19.7.orig/lib/http_ntlm.c curl-7.19.7/lib/http_ntlm.c
--- curl-7.19.7.orig/lib/http_ntlm.c 2009-04-23 12:51:08.000000000 +0100
-+++ curl-7.19.7/lib/http_ntlm.c 2009-11-18 15:38:40.000000000 +0000
++++ curl-7.19.7/lib/http_ntlm.c 2009-12-08 10:28:26.000000000 +0000
@@ -483,6 +483,33 @@
const char *password,
unsigned char *ntbuffer /* 21 bytes */)
size_t len = strlen(password);
unsigned char *pw = malloc(len*2);
if(!pw)
+diff -ru curl-7.19.7.orig/lib/transfer.c curl-7.19.7/lib/transfer.c
+--- curl-7.19.7.orig/lib/transfer.c 2009-09-27 22:37:24.000000000 +0100
++++ curl-7.19.7/lib/transfer.c 2010-01-24 21:52:36.000000000 +0000
+@@ -1446,6 +1446,11 @@
+ }
+ while(!*stop_reading && *k->str); /* header line within buffer */
+
++ if (conn->bits.user_passwd && !data->req.newurl)
++ {
++ conn->bits.close = TRUE;
++ }
++
+ /* We might have reached the end of the header part here, but
+ there might be a non-header part left in the end of the read
+ buffer. */
diff -ru curl-7.19.7.orig/lib/url.c curl-7.19.7/lib/url.c
--- curl-7.19.7.orig/lib/url.c 2009-10-17 19:31:50.000000000 +0100
-+++ curl-7.19.7/lib/url.c 2009-11-18 14:02:36.000000000 +0000
++++ curl-7.19.7/lib/url.c 2010-01-24 21:30:35.000000000 +0000
@@ -1666,6 +1666,13 @@
result = setstropt(&data->set.str[STRING_PASSWORD],
va_arg(param, char *));
case CURLOPT_POSTQUOTE:
/*
* List of RAW FTP commands to use after a transfer
+@@ -2729,17 +2736,19 @@
+ continue;
+ }
+ }
++#define EQUALS(x, y) ((x == y) || (x && y && strequal(x, y)))
++
+ if((needle->protocol & PROT_FTP) ||
+ ((needle->protocol & PROT_HTTP) &&
+- (data->state.authhost.want==CURLAUTH_NTLM))) {
+- /* This is FTP or HTTP+NTLM, verify that we're using the same name
+- and password as well */
+- if(!strequal(needle->user, check->user) ||
+- !strequal(needle->passwd, check->passwd)) {
++ check->bits.user_passwd)) {
++ /* This has a user name and password, check that they match */
++ if((!EQUALS(needle->user, check->user)) ||
++ (!EQUALS(needle->passwd, check->passwd))) {
+ /* one of them was different */
+ continue;
+ }
+ }
++
+ match = TRUE;
+ }
+ }
diff -ru curl-7.19.7.orig/lib/urldata.h curl-7.19.7/lib/urldata.h
--- curl-7.19.7.orig/lib/urldata.h 2009-10-29 21:26:30.000000000 +0000
+++ curl-7.19.7/lib/urldata.h 2009-11-18 14:03:02.000000000 +0000