Changelog
Daniel (6 December 2004)
+- Dan Fandrich added the --disable-cookies option to configure to build
+ libcurl without cookie support. This is mainly useful if you want to build a
+ minimalistic libcurl with no cookies support at all. Like for embedded
+ systems or similar.
+
- Richard Atterer fixed libcurl's way of dealing with the EPSV
response. Previously, libcurl would re-resolve the host name with the new
port number and attempt to connect to that, while it should use the IP from
This release includes the following changes:
+ o new configure options: --disable-cookies, --disable-crypto-auth and
+ --disable-verbose
o persistent ftp request improvements
o CURLOPT_IOCTLFUNCTION and CURLOPT_IOCTLDATA added. If your app uses HTTP
Digest, NTLM or Negotiate authentication, you will most likely want to use
AC_MSG_RESULT(yes)
)
+dnl ************************************************************
+dnl disable cookies support
+dnl
+AC_MSG_CHECKING([whether to enable support for cookies])
+AC_ARG_ENABLE(cookies,
+AC_HELP_STRING([--enable-cookies],[Enable cookies support])
+AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
+[ case "$enableval" in
+ no)
+ AC_MSG_RESULT(no)
+ AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
+ AC_SUBST(CURL_DISABLE_COOKIES)
+ ;;
+ *) AC_MSG_RESULT(yes)
+ ;;
+ esac ],
+ AC_MSG_RESULT(yes)
+)
+
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
AC_CONFIG_FILES([Makefile \
#include "setup.h"
-#ifndef CURL_DISABLE_HTTP
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
#include <stdlib.h>
#include <string.h>
return 0;
}
-#endif /* CURL_DISABLE_HTTP */
+#endif /* CURL_DISABLE_HTTP || CURL_DISABLE_COOKIES */
outcurl->progress.flags = data->progress.flags;
outcurl->progress.callback = data->progress.callback;
-#ifndef CURL_DISABLE_HTTP
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
if(data->cookies) {
/* If cookies are enabled in the parent handle, we enable them
in the clone as well! */
ptr = checkheaders(data, "Host:");
if(ptr && (!data->state.this_is_a_follow ||
curl_strequal(data->state.first_host, conn->host.name))) {
+#if !defined(CURL_DISABLE_COOKIES)
/* If we have a given custom Host: header, we extract the host name in
order to possibly use it for cookie reasons later on. We only allow the
custom Host: header if this is NOT a redirect, as setting Host: in the
memcpy(conn->allocptr.cookiehost, start, len);
conn->allocptr.cookiehost[len]=0;
}
+#endif
conn->allocptr.host = NULL;
}
if(result)
return result;
+#if !defined(CURL_DISABLE_COOKIES)
if(data->cookies || addcookies) {
struct Cookie *co=NULL; /* no cookies from start */
int count=0;
if(result)
return result;
}
+#endif
if(data->set.timecondition) {
struct tm *thistime;
}
break;
-#ifndef CURL_DISABLE_HTTP
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
case CURL_LOCK_DATA_COOKIE:
if (!share->cookies) {
share->cookies = Curl_cookie_init(NULL, NULL, NULL, TRUE );
}
break;
-#ifndef CURL_DISABLE_HTTP
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
case CURL_LOCK_DATA_COOKIE:
if (share->cookies) {
Curl_cookie_cleanup(share->cookies);
if(share->hostcache)
Curl_hash_destroy(share->hostcache);
-#ifndef CURL_DISABLE_HTTP
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
if(share->cookies)
Curl_cookie_cleanup(share->cookies);
#endif /* CURL_DISABLE_HTTP */
/* we asked for a resume and we got it */
k->content_range = TRUE;
}
+#if !defined(CURL_DISABLE_COOKIES)
else if(data->cookies &&
checkprefix("Set-Cookie:", k->p)) {
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE,
conn->path);
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
}
+#endif
else if(checkprefix("Last-Modified:", k->p) &&
(data->set.timecondition || data->set.get_filetime) ) {
time_t secs=time(NULL);
data->state.authhost.want = data->set.httpauth;
data->state.authproxy.want = data->set.proxyauth;
-#ifndef CURL_DISABLE_HTTP
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
/* If there was a list of cookie files to read and we haven't done it before,
do it now! */
if(data->change.cookielist) {
Curl_SSL_Close_All(data);
#endif
- if(data->change.cookielist) /* clean up list if any */
- curl_slist_free_all(data->change.cookielist);
-
Curl_safefree(data->state.first_host);
Curl_safefree(data->state.scratch);
Curl_safefree(data->state.headerbuff);
-#ifndef CURL_DISABLE_HTTP
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
+ if(data->change.cookielist) /* clean up list if any */
+ curl_slist_free_all(data->change.cookielist);
+
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
if(data->set.cookiejar) {
/* we have a "destination" for all the cookies to get dumped to */
Curl_cookie_cleanup(data->cookies);
}
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
+#endif
-#ifndef CURL_DISABLE_CRYPTO_AUTH
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH)
Curl_digest_cleanup(data);
-#endif
#endif
/* free the connection cache */
data->set.http200aliases = va_arg(param, struct curl_slist *);
break;
+#if !defined(CURL_DISABLE_COOKIES)
case CURLOPT_COOKIE:
/*
* Cookie string to send to the remote server in the request.
*/
data->set.cookiesession = (bool)va_arg(param, long);
break;
+#endif
case CURLOPT_HTTPGET:
/*
data->hostcache = data->share->hostcache;
}
-#ifndef CURL_DISABLE_HTTP
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
if(data->share->cookies) {
/* use shared cookie list, first free own one if any */
if (data->cookies)
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
}
-#ifndef CURL_DISABLE_HTTP
+#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
/* check cookie list is set */
if(!data->cookies)
data->cookies = Curl_cookie_init(data, NULL, NULL, TRUE );