Compare commits
27 Commits
curl-7_10_
...
pre-ares
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e7e53c87e | ||
|
|
b9fdf3cc3b | ||
|
|
c462601362 | ||
|
|
859877dcfc | ||
|
|
c04ce95106 | ||
|
|
98ee12bc35 | ||
|
|
fdda786fa2 | ||
|
|
831be4f4dd | ||
|
|
41ae97e710 | ||
|
|
f72ba7f79d | ||
|
|
296046510b | ||
|
|
db9f87f697 | ||
|
|
3270ea55dd | ||
|
|
a358ac24f4 | ||
|
|
8bedd43b28 | ||
|
|
9ea2087ede | ||
|
|
9f7c634133 | ||
|
|
da20d68a12 | ||
|
|
d3e512c738 | ||
|
|
339f84fe1f | ||
|
|
2d41b735ec | ||
|
|
e3b4dd08ff | ||
|
|
6809a906bb | ||
|
|
1c35cbcc07 | ||
|
|
5f8989a436 | ||
|
|
aa7b0648ff | ||
|
|
2fbe61960f |
34
CHANGES
34
CHANGES
@@ -6,6 +6,40 @@
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
Daniel (3 August)
|
||||||
|
- When proxy authentication is used in a CONNECT request (as used for all SSL
|
||||||
|
connects and otherwise enforced tunnel-thru-proxy requests), the same
|
||||||
|
authentication header is also wrongly sent to the remote host.
|
||||||
|
|
||||||
|
This is a rather significant info leak. I've fixed it now and mailed a patch
|
||||||
|
and warning to the mailing lists.
|
||||||
|
|
||||||
|
Daniel (1 August)
|
||||||
|
- David Byron provided a patch to make 7.10.6 build correctly with the
|
||||||
|
compressed hugehelp.c source file.
|
||||||
|
|
||||||
|
Version 7.10.7-pre1 (31 July 2003)
|
||||||
|
|
||||||
|
Daniel (30 July)
|
||||||
|
- J<>rg M<>ller-Tolk updated the VC makefile.
|
||||||
|
|
||||||
|
- Daniel Noguerol made the ftp code output "Accept-Ranges: bytes" in similar
|
||||||
|
style like other faked HTTP headers when NOBODY and HEADER are used. I
|
||||||
|
updated two corresponding test cases too.
|
||||||
|
|
||||||
|
- Marty Kuhrt pointed out a compilation problem on VMS due to my having
|
||||||
|
changed a type from long to time_t, and I'm now changing it back to work
|
||||||
|
more portably...
|
||||||
|
|
||||||
|
He also indicated that distributing the src/hugehelp.c in a compressed state
|
||||||
|
like I acccidentally did may not be the smartest move... I've now fixed the
|
||||||
|
distribute procudere to automaticly generate an uncompressed version when I
|
||||||
|
make release archives.
|
||||||
|
|
||||||
|
Daniel (29 July)
|
||||||
|
- Gisle Vanem brought changes to the mkhelp script for the generation of the
|
||||||
|
compressed help text on some platforms.
|
||||||
|
|
||||||
Version 7.10.6 (28 July 2003)
|
Version 7.10.6 (28 July 2003)
|
||||||
|
|
||||||
Daniel (28 July)
|
Daniel (28 July)
|
||||||
|
|||||||
@@ -17,9 +17,14 @@ AC_CONFIG_SRCDIR([lib/urldata.h])
|
|||||||
AM_CONFIG_HEADER(lib/config.h src/config.h tests/server/config.h )
|
AM_CONFIG_HEADER(lib/config.h src/config.h tests/server/config.h )
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
|
dnl SED is needed by some of the tools
|
||||||
AC_PATH_PROG( SED, sed, , $PATH:/usr/bin:/usr/local/bin)
|
AC_PATH_PROG( SED, sed, , $PATH:/usr/bin:/usr/local/bin)
|
||||||
AC_SUBST(SED)
|
AC_SUBST(SED)
|
||||||
|
|
||||||
|
dnl AR is used by libtool, and try the odd Solaris path too
|
||||||
|
AC_PATH_PROG( AR, ar, , $PATH:/usr/bin:/usr/local/bin:/usr/ccs/bin)
|
||||||
|
AC_SUBST(AR)
|
||||||
|
|
||||||
dnl figure out the libcurl version
|
dnl figure out the libcurl version
|
||||||
VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curl.h`
|
VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curl.h`
|
||||||
AM_INIT_AUTOMAKE(curl,$VERSION)
|
AM_INIT_AUTOMAKE(curl,$VERSION)
|
||||||
|
|||||||
@@ -204,7 +204,14 @@ Win32
|
|||||||
Before running nmake define the OPENSSL_PATH environment variable with
|
Before running nmake define the OPENSSL_PATH environment variable with
|
||||||
the root/base directory of OpenSSL, for example:
|
the root/base directory of OpenSSL, for example:
|
||||||
|
|
||||||
set OPENSSL_PATH=c:\openssl-0.9.6b
|
set OPENSSL_PATH=c:\openssl-0.9.7a
|
||||||
|
|
||||||
|
lib/Makefile.vc6 depends on zlib (http://www.gzip.org/zlib/) as well.
|
||||||
|
Please read the zlib documentation on how to compile zlib. Define the
|
||||||
|
ZLIB_PATH environment variable to the location of zlib.h and zlib.lib,
|
||||||
|
for example:
|
||||||
|
|
||||||
|
set ZLIB_PATH=c:\zlib-1.1.4
|
||||||
|
|
||||||
Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root
|
Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root
|
||||||
directory. 'nmake vc-ssl' will create a libcurl static and dynamic
|
directory. 'nmake vc-ssl' will create a libcurl static and dynamic
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ join in and help us correct one or more of these! Also be sure to check the
|
|||||||
changelog of the current development status, as one or more of these problems
|
changelog of the current development status, as one or more of these problems
|
||||||
may have been fixed since this was written!
|
may have been fixed since this was written!
|
||||||
|
|
||||||
|
* Using CURLOPT_FAILONERROR (-f/--fail) will make authentication to stop
|
||||||
|
working if you use anything but plain Basic auth.
|
||||||
|
|
||||||
* LDAP output is garbled. Hardly anyone seems to care about LDAP functionality
|
* LDAP output is garbled. Hardly anyone seems to care about LDAP functionality
|
||||||
in curl/libcurl why this report has been closed and set to be solved later.
|
in curl/libcurl why this report has been closed and set to be solved later.
|
||||||
If you feel this is something you want fixed, get in touch and we'll start
|
If you feel this is something you want fixed, get in touch and we'll start
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ POST (HTTP)
|
|||||||
|
|
||||||
To post to this, you enter a curl command line like:
|
To post to this, you enter a curl command line like:
|
||||||
|
|
||||||
curl -d "user=foobar&pass=12345&id=blablabla&dig=submit" (continues)
|
curl -d "user=foobar&pass=12345&id=blablabla&ding=submit" (continues)
|
||||||
http://www.formpost.com/getthis/post.cgi
|
http://www.formpost.com/getthis/post.cgi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ TODO
|
|||||||
|
|
||||||
FTP
|
FTP
|
||||||
|
|
||||||
|
* Support the most common FTP proxies, Philip Newton provided a list
|
||||||
|
allegedly from ncftp:
|
||||||
|
http://curl.haxx.se/mail/archive-2003-04/0126.html
|
||||||
|
|
||||||
* Make CURLOPT_FTPPORT support an additional port number on the IP/if/name,
|
* Make CURLOPT_FTPPORT support an additional port number on the IP/if/name,
|
||||||
like "blabla:[port]" or possibly even "blabla:[portfirst]-[portsecond]".
|
like "blabla:[port]" or possibly even "blabla:[portfirst]-[portsecond]".
|
||||||
|
|
||||||
|
|||||||
@@ -204,6 +204,8 @@ X_OBJS= \
|
|||||||
$(DIROBJ)\share.obj \
|
$(DIROBJ)\share.obj \
|
||||||
$(DIROBJ)\multi.obj \
|
$(DIROBJ)\multi.obj \
|
||||||
$(DIROBJ)\http_digest.obj \
|
$(DIROBJ)\http_digest.obj \
|
||||||
|
$(DIROBJ)\http_negotiate.obj \
|
||||||
|
$(DIROBJ)\http_ntlm.obj \
|
||||||
$(DIROBJ)\md5.obj
|
$(DIROBJ)\md5.obj
|
||||||
|
|
||||||
all : $(TARGET)
|
all : $(TARGET)
|
||||||
@@ -226,6 +228,3 @@ clean:
|
|||||||
-@erase $(DIROBJ)\*.obj
|
-@erase $(DIROBJ)\*.obj
|
||||||
-@erase vc60.idb
|
-@erase vc60.idb
|
||||||
-@erase vc60.pch
|
-@erase vc60.pch
|
||||||
|
|
||||||
getdate.c: getdate.c.cvs
|
|
||||||
copy getdate.c.cvs getdate.c
|
|
||||||
|
|||||||
@@ -234,7 +234,13 @@ Curl_cookie_add(struct CookieInfo *c,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(dotcount < 3) {
|
/* The original Netscape cookie spec defined that this domain name
|
||||||
|
MUST have three dots (or two if one of the seven holy TLDs),
|
||||||
|
but it seems that these kinds of cookies are in use "out there"
|
||||||
|
so we cannot be that strict. I've therefore lowered the check
|
||||||
|
to not allow less than two dots. */
|
||||||
|
|
||||||
|
if(dotcount < 2) {
|
||||||
/* Received and skipped a cookie with a domain using too few
|
/* Received and skipped a cookie with a domain using too few
|
||||||
dots. */
|
dots. */
|
||||||
badcookie=TRUE; /* mark this as a bad cookie */
|
badcookie=TRUE; /* mark this as a bad cookie */
|
||||||
|
|||||||
14
lib/easy.c
14
lib/easy.c
@@ -76,6 +76,7 @@
|
|||||||
#include "url.h"
|
#include "url.h"
|
||||||
#include "getinfo.h"
|
#include "getinfo.h"
|
||||||
#include "hostip.h"
|
#include "hostip.h"
|
||||||
|
#include "share.h"
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
@@ -233,15 +234,18 @@ CURLcode curl_easy_perform(CURL *curl)
|
|||||||
{
|
{
|
||||||
struct SessionHandle *data = (struct SessionHandle *)curl;
|
struct SessionHandle *data = (struct SessionHandle *)curl;
|
||||||
|
|
||||||
if (Curl_global_host_cache_use(data) && data->hostcache != Curl_global_host_cache_get()) {
|
if ( ! (data->share && data->share->hostcache) ) {
|
||||||
if (data->hostcache) {
|
|
||||||
|
if (Curl_global_host_cache_use(data) &&
|
||||||
|
data->hostcache != Curl_global_host_cache_get()) {
|
||||||
|
if (data->hostcache)
|
||||||
Curl_hash_destroy(data->hostcache);
|
Curl_hash_destroy(data->hostcache);
|
||||||
}
|
|
||||||
data->hostcache = Curl_global_host_cache_get();
|
data->hostcache = Curl_global_host_cache_get();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data->hostcache) {
|
if (!data->hostcache)
|
||||||
data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
|
data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Curl_perform(data);
|
return Curl_perform(data);
|
||||||
@@ -250,9 +254,11 @@ CURLcode curl_easy_perform(CURL *curl)
|
|||||||
void curl_easy_cleanup(CURL *curl)
|
void curl_easy_cleanup(CURL *curl)
|
||||||
{
|
{
|
||||||
struct SessionHandle *data = (struct SessionHandle *)curl;
|
struct SessionHandle *data = (struct SessionHandle *)curl;
|
||||||
|
if ( ! (data->share && data->share->hostcache) ) {
|
||||||
if ( !Curl_global_host_cache_use(data)) {
|
if ( !Curl_global_host_cache_use(data)) {
|
||||||
Curl_hash_destroy(data->hostcache);
|
Curl_hash_destroy(data->hostcache);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Curl_close(data);
|
Curl_close(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
69
lib/ftp.c
69
lib/ftp.c
@@ -105,6 +105,15 @@ static CURLcode ftp_cwd(struct connectdata *conn, char *path);
|
|||||||
/* easy-to-use macro: */
|
/* easy-to-use macro: */
|
||||||
#define FTPSENDF(x,y,z) if((result = Curl_ftpsendf(x,y,z))) return result
|
#define FTPSENDF(x,y,z) if((result = Curl_ftpsendf(x,y,z))) return result
|
||||||
|
|
||||||
|
static void freedirs(struct FTP *ftp)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i=0; ftp->dirs[i]; i++){
|
||||||
|
free(ftp->dirs[i]);
|
||||||
|
ftp->dirs[i]=NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* AllowServerConnect()
|
* AllowServerConnect()
|
||||||
@@ -598,6 +607,14 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
|
|||||||
int ftpcode;
|
int ftpcode;
|
||||||
CURLcode result=CURLE_OK;
|
CURLcode result=CURLE_OK;
|
||||||
|
|
||||||
|
/* free the dir tree parts */
|
||||||
|
freedirs(ftp);
|
||||||
|
|
||||||
|
if(ftp->file) {
|
||||||
|
free(ftp->file);
|
||||||
|
ftp->file = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if(data->set.upload) {
|
if(data->set.upload) {
|
||||||
if((-1 != data->set.infilesize) &&
|
if((-1 != data->set.infilesize) &&
|
||||||
(data->set.infilesize != *ftp->bytecountp) &&
|
(data->set.infilesize != *ftp->bytecountp) &&
|
||||||
@@ -2032,6 +2049,8 @@ CURLcode ftp_perform(struct connectdata *conn,
|
|||||||
may not support it! It is however the only way we have to get a file's
|
may not support it! It is however the only way we have to get a file's
|
||||||
size! */
|
size! */
|
||||||
ssize_t filesize;
|
ssize_t filesize;
|
||||||
|
ssize_t nread;
|
||||||
|
int ftpcode;
|
||||||
|
|
||||||
ftp->no_transfer = TRUE; /* this means no actual transfer is made */
|
ftp->no_transfer = TRUE; /* this means no actual transfer is made */
|
||||||
|
|
||||||
@@ -2051,6 +2070,18 @@ CURLcode ftp_perform(struct connectdata *conn,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Determine if server can respond to REST command and therefore
|
||||||
|
whether it can do a range */
|
||||||
|
FTPSENDF(conn, "REST 0", NULL);
|
||||||
|
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
|
||||||
|
|
||||||
|
if ((CURLE_OK == result) && (ftpcode == 350)) {
|
||||||
|
result = Curl_client_write(data, CLIENTWRITE_BOTH,
|
||||||
|
(char *)"Accept-ranges: bytes\r\n", 0);
|
||||||
|
if(result)
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/* If we asked for a time of the file and we actually got one as
|
/* If we asked for a time of the file and we actually got one as
|
||||||
well, we "emulate" a HTTP-style header in our output. */
|
well, we "emulate" a HTTP-style header in our output. */
|
||||||
|
|
||||||
@@ -2059,9 +2090,9 @@ CURLcode ftp_perform(struct connectdata *conn,
|
|||||||
struct tm *tm;
|
struct tm *tm;
|
||||||
#ifdef HAVE_LOCALTIME_R
|
#ifdef HAVE_LOCALTIME_R
|
||||||
struct tm buffer;
|
struct tm buffer;
|
||||||
tm = (struct tm *)localtime_r(&data->info.filetime, &buffer);
|
tm = (struct tm *)localtime_r((time_t *)&data->info.filetime, &buffer);
|
||||||
#else
|
#else
|
||||||
tm = localtime(&data->info.filetime);
|
tm = localtime((time_t *)&data->info.filetime);
|
||||||
#endif
|
#endif
|
||||||
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
|
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
|
||||||
strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S GMT\r\n",
|
strftime(buf, BUFSIZE-1, "Last-Modified: %a, %d %b %Y %H:%M:%S GMT\r\n",
|
||||||
@@ -2147,7 +2178,8 @@ CURLcode Curl_ftp(struct connectdata *conn)
|
|||||||
|
|
||||||
if (!ftp->dirs[path_part]) { /* run out of memory ... */
|
if (!ftp->dirs[path_part]) { /* run out of memory ... */
|
||||||
failf(data, "no memory");
|
failf(data, "no memory");
|
||||||
retcode = CURLE_OUT_OF_MEMORY;
|
freedirs(ftp);
|
||||||
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -2161,17 +2193,10 @@ CURLcode Curl_ftp(struct connectdata *conn)
|
|||||||
/* too deep, we need the last entry to be kept NULL at all
|
/* too deep, we need the last entry to be kept NULL at all
|
||||||
times to signal end of list */
|
times to signal end of list */
|
||||||
failf(data, "too deep dir hierarchy");
|
failf(data, "too deep dir hierarchy");
|
||||||
retcode = CURLE_URL_MALFORMAT;
|
freedirs(ftp);
|
||||||
|
return CURLE_URL_MALFORMAT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (retcode) {
|
|
||||||
int i;
|
|
||||||
for (i=0;i<path_part;i++) { /* free previous parts */
|
|
||||||
free(ftp->dirs[i]);
|
|
||||||
ftp->dirs[i]=NULL;
|
|
||||||
}
|
|
||||||
return retcode; /* failure */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ftp->file = cur_pos; /* the rest is the file name */
|
ftp->file = cur_pos; /* the rest is the file name */
|
||||||
@@ -2179,11 +2204,7 @@ CURLcode Curl_ftp(struct connectdata *conn)
|
|||||||
if(*ftp->file) {
|
if(*ftp->file) {
|
||||||
ftp->file = curl_unescape(ftp->file, 0);
|
ftp->file = curl_unescape(ftp->file, 0);
|
||||||
if(NULL == ftp->file) {
|
if(NULL == ftp->file) {
|
||||||
int i;
|
freedirs(ftp);
|
||||||
for (i=0;i<path_part;i++){
|
|
||||||
free(ftp->dirs[i]);
|
|
||||||
ftp->dirs[i]=NULL;
|
|
||||||
}
|
|
||||||
failf(data, "no memory");
|
failf(data, "no memory");
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -2274,23 +2295,21 @@ CURLcode Curl_ftpsendf(struct connectdata *conn,
|
|||||||
CURLcode Curl_ftp_disconnect(struct connectdata *conn)
|
CURLcode Curl_ftp_disconnect(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
struct FTP *ftp= conn->proto.ftp;
|
struct FTP *ftp= conn->proto.ftp;
|
||||||
int i;
|
|
||||||
|
|
||||||
/* The FTP session may or may not have been allocated/setup at this point! */
|
/* The FTP session may or may not have been allocated/setup at this point! */
|
||||||
if(ftp) {
|
if(ftp) {
|
||||||
if(ftp->entrypath)
|
if(ftp->entrypath)
|
||||||
free(ftp->entrypath);
|
free(ftp->entrypath);
|
||||||
if(ftp->cache)
|
if(ftp->cache) {
|
||||||
free(ftp->cache);
|
free(ftp->cache);
|
||||||
if(ftp->file)
|
ftp->cache = NULL;
|
||||||
free(ftp->file);
|
|
||||||
for (i=0;ftp->dirs[i];i++){
|
|
||||||
free(ftp->dirs[i]);
|
|
||||||
ftp->dirs[i]=NULL;
|
|
||||||
}
|
}
|
||||||
|
if(ftp->file) {
|
||||||
|
free(ftp->file);
|
||||||
ftp->file = NULL; /* zero */
|
ftp->file = NULL; /* zero */
|
||||||
}
|
}
|
||||||
|
freedirs(ftp);
|
||||||
|
}
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,7 @@
|
|||||||
#include "http_digest.h"
|
#include "http_digest.h"
|
||||||
#include "http_ntlm.h"
|
#include "http_ntlm.h"
|
||||||
#include "http_negotiate.h"
|
#include "http_negotiate.h"
|
||||||
|
#include "url.h"
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
@@ -553,6 +554,12 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
|
|||||||
return CURLE_RECV_ERROR;
|
return CURLE_RECV_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If a proxy-authorization header was used for the proxy, then we should
|
||||||
|
make sure that it isn't accidentally used for the document request
|
||||||
|
after we've connected. So let's free and clear it here. */
|
||||||
|
Curl_safefree(conn->allocptr.proxyuserpwd);
|
||||||
|
conn->allocptr.proxyuserpwd = NULL;
|
||||||
|
|
||||||
infof (data, "Proxy replied to CONNECT request\n");
|
infof (data, "Proxy replied to CONNECT request\n");
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
@@ -846,10 +853,12 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(data->cookies) {
|
if(data->cookies) {
|
||||||
|
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
|
||||||
co = Curl_cookie_getlist(data->cookies,
|
co = Curl_cookie_getlist(data->cookies,
|
||||||
conn->allocptr.cookiehost?
|
conn->allocptr.cookiehost?
|
||||||
conn->allocptr.cookiehost:host, ppath,
|
conn->allocptr.cookiehost:host, ppath,
|
||||||
(bool)(conn->protocol&PROT_HTTPS?TRUE:FALSE));
|
(bool)(conn->protocol&PROT_HTTPS?TRUE:FALSE));
|
||||||
|
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conn->bits.httpproxy &&
|
if (conn->bits.httpproxy &&
|
||||||
|
|||||||
@@ -102,8 +102,9 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
|
|||||||
size_t length,
|
size_t length,
|
||||||
size_t *wrote)
|
size_t *wrote)
|
||||||
{
|
{
|
||||||
CURLcode result;
|
CURLcode result=CURLE_OK;
|
||||||
struct Curl_chunker *ch = &conn->proto.http->chunk;
|
struct Curl_chunker *ch = &conn->proto.http->chunk;
|
||||||
|
struct Curl_transfer_keeper *k = &conn->keep;
|
||||||
int piece;
|
int piece;
|
||||||
*wrote = 0; /* nothing yet */
|
*wrote = 0; /* nothing yet */
|
||||||
|
|
||||||
@@ -180,6 +181,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
|
|||||||
switch (conn->keep.content_encoding) {
|
switch (conn->keep.content_encoding) {
|
||||||
case IDENTITY:
|
case IDENTITY:
|
||||||
#endif
|
#endif
|
||||||
|
if(!k->ignorebody)
|
||||||
result = Curl_client_write(conn->data, CLIENTWRITE_BODY, datap,
|
result = Curl_client_write(conn->data, CLIENTWRITE_BODY, datap,
|
||||||
piece);
|
piece);
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
|
|||||||
16
lib/share.c
16
lib/share.c
@@ -76,6 +76,9 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CURL_LOCK_DATA_COOKIE:
|
case CURL_LOCK_DATA_COOKIE:
|
||||||
|
if (!share->cookies) {
|
||||||
|
share->cookies = Curl_cookie_init( NULL, NULL, TRUE );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURL_LOCK_DATA_SSL_SESSION:
|
case CURL_LOCK_DATA_SSL_SESSION:
|
||||||
@@ -103,6 +106,10 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CURL_LOCK_DATA_COOKIE:
|
case CURL_LOCK_DATA_COOKIE:
|
||||||
|
if (share->cookies) {
|
||||||
|
Curl_cookie_cleanup(share->cookies);
|
||||||
|
share->cookies = NULL;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURL_LOCK_DATA_SSL_SESSION:
|
case CURL_LOCK_DATA_SSL_SESSION:
|
||||||
@@ -144,6 +151,12 @@ CURLSHcode curl_share_cleanup(CURLSH *sh)
|
|||||||
if (share->dirty)
|
if (share->dirty)
|
||||||
return CURLSHE_IN_USE;
|
return CURLSHE_IN_USE;
|
||||||
|
|
||||||
|
if(share->hostcache)
|
||||||
|
Curl_hash_destroy(share->hostcache);
|
||||||
|
|
||||||
|
if(share->cookies)
|
||||||
|
Curl_cookie_cleanup(share->cookies);
|
||||||
|
|
||||||
free (share);
|
free (share);
|
||||||
|
|
||||||
return CURLSHE_OK;
|
return CURLSHE_OK;
|
||||||
@@ -151,7 +164,8 @@ CURLSHcode curl_share_cleanup(CURLSH *sh)
|
|||||||
|
|
||||||
|
|
||||||
CURLSHcode
|
CURLSHcode
|
||||||
Curl_share_lock(struct SessionHandle *data, curl_lock_data type, curl_lock_access access)
|
Curl_share_lock(struct SessionHandle *data, curl_lock_data type,
|
||||||
|
curl_lock_access access)
|
||||||
{
|
{
|
||||||
struct Curl_share *share = data->share;
|
struct Curl_share *share = data->share;
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
#include "cookie.h"
|
||||||
|
|
||||||
/* this struct is libcurl-private, don't export details */
|
/* this struct is libcurl-private, don't export details */
|
||||||
struct Curl_share {
|
struct Curl_share {
|
||||||
@@ -37,6 +38,7 @@ struct Curl_share {
|
|||||||
void *clientdata;
|
void *clientdata;
|
||||||
|
|
||||||
curl_hash *hostcache;
|
curl_hash *hostcache;
|
||||||
|
struct CookieInfo *cookies;
|
||||||
};
|
};
|
||||||
|
|
||||||
CURLSHcode Curl_share_lock (
|
CURLSHcode Curl_share_lock (
|
||||||
|
|||||||
@@ -707,12 +707,14 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
else if(data->cookies &&
|
else if(data->cookies &&
|
||||||
checkprefix("Set-Cookie:", k->p)) {
|
checkprefix("Set-Cookie:", k->p)) {
|
||||||
|
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
|
||||||
Curl_cookie_add(data->cookies, TRUE, k->p+11,
|
Curl_cookie_add(data->cookies, TRUE, k->p+11,
|
||||||
/* If there is a custom-set Host: name, use it
|
/* If there is a custom-set Host: name, use it
|
||||||
here, or else use real peer host name. */
|
here, or else use real peer host name. */
|
||||||
conn->allocptr.cookiehost?
|
conn->allocptr.cookiehost?
|
||||||
conn->allocptr.cookiehost:conn->name,
|
conn->allocptr.cookiehost:conn->name,
|
||||||
conn->ppath);
|
conn->ppath);
|
||||||
|
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
|
||||||
}
|
}
|
||||||
else if(checkprefix("Last-Modified:", k->p) &&
|
else if(checkprefix("Last-Modified:", k->p) &&
|
||||||
(data->set.timecondition || data->set.get_filetime) ) {
|
(data->set.timecondition || data->set.get_filetime) ) {
|
||||||
@@ -1509,12 +1511,14 @@ CURLcode Curl_pretransfer(struct SessionHandle *data)
|
|||||||
do it now! */
|
do it now! */
|
||||||
if(data->change.cookielist) {
|
if(data->change.cookielist) {
|
||||||
struct curl_slist *list = data->change.cookielist;
|
struct curl_slist *list = data->change.cookielist;
|
||||||
|
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
|
||||||
while(list) {
|
while(list) {
|
||||||
data->cookies = Curl_cookie_init(list->data,
|
data->cookies = Curl_cookie_init(list->data,
|
||||||
data->cookies,
|
data->cookies,
|
||||||
data->set.cookiesession);
|
data->set.cookiesession);
|
||||||
list = list->next;
|
list = list->next;
|
||||||
}
|
}
|
||||||
|
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
|
||||||
curl_slist_free_all(data->change.cookielist); /* clean up list */
|
curl_slist_free_all(data->change.cookielist); /* clean up list */
|
||||||
data->change.cookielist = NULL; /* don't do this again! */
|
data->change.cookielist = NULL; /* don't do this again! */
|
||||||
}
|
}
|
||||||
|
|||||||
46
lib/url.c
46
lib/url.c
@@ -191,10 +191,6 @@ CURLcode Curl_close(struct SessionHandle *data)
|
|||||||
Curl_SSL_Close_All(data);
|
Curl_SSL_Close_All(data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* No longer a dirty share, if it exists */
|
|
||||||
if (data->share)
|
|
||||||
data->share->dirty--;
|
|
||||||
|
|
||||||
if(data->change.cookielist) /* clean up list if any */
|
if(data->change.cookielist) /* clean up list if any */
|
||||||
curl_slist_free_all(data->change.cookielist);
|
curl_slist_free_all(data->change.cookielist);
|
||||||
|
|
||||||
@@ -213,13 +209,17 @@ CURLcode Curl_close(struct SessionHandle *data)
|
|||||||
Curl_safefree(data->state.headerbuff);
|
Curl_safefree(data->state.headerbuff);
|
||||||
|
|
||||||
#ifndef CURL_DISABLE_HTTP
|
#ifndef CURL_DISABLE_HTTP
|
||||||
|
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
|
||||||
if(data->set.cookiejar) {
|
if(data->set.cookiejar) {
|
||||||
/* we have a "destination" for all the cookies to get dumped to */
|
/* we have a "destination" for all the cookies to get dumped to */
|
||||||
if(Curl_cookie_output(data->cookies, data->set.cookiejar))
|
if(Curl_cookie_output(data->cookies, data->set.cookiejar))
|
||||||
infof(data, "WARNING: failed to save cookies in given jar\n");
|
infof(data, "WARNING: failed to save cookies in given jar\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !data->share || (data->cookies != data->share->cookies) ) {
|
||||||
Curl_cookie_cleanup(data->cookies);
|
Curl_cookie_cleanup(data->cookies);
|
||||||
|
}
|
||||||
|
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* free the connection cache */
|
/* free the connection cache */
|
||||||
@@ -229,6 +229,10 @@ CURLcode Curl_close(struct SessionHandle *data)
|
|||||||
|
|
||||||
Curl_digest_cleanup(data);
|
Curl_digest_cleanup(data);
|
||||||
|
|
||||||
|
/* No longer a dirty share, if it exists */
|
||||||
|
if (data->share)
|
||||||
|
data->share->dirty--;
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
@@ -1148,34 +1152,56 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
|
|||||||
{
|
{
|
||||||
struct Curl_share *set;
|
struct Curl_share *set;
|
||||||
set = va_arg(param, struct Curl_share *);
|
set = va_arg(param, struct Curl_share *);
|
||||||
if(data->share)
|
|
||||||
{
|
/* disconnect from old share, if any */
|
||||||
|
if(data->share) {
|
||||||
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
||||||
|
|
||||||
/* checking the dns cache stuff */
|
|
||||||
if(data->share->hostcache == data->hostcache)
|
if(data->share->hostcache == data->hostcache)
|
||||||
{
|
|
||||||
data->hostcache = NULL;
|
data->hostcache = NULL;
|
||||||
}
|
|
||||||
|
if(data->share->cookies == data->cookies)
|
||||||
|
data->cookies = NULL;
|
||||||
|
|
||||||
data->share->dirty--;
|
data->share->dirty--;
|
||||||
|
|
||||||
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
|
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
|
||||||
|
data->share = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* use new share if it set */
|
||||||
data->share = set;
|
data->share = set;
|
||||||
|
if(data->share) {
|
||||||
|
|
||||||
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
||||||
|
|
||||||
data->share->dirty++;
|
data->share->dirty++;
|
||||||
|
|
||||||
|
if(data->share->hostcache) {
|
||||||
|
/* use shared host cache, first free own one if any */
|
||||||
if(data->hostcache)
|
if(data->hostcache)
|
||||||
{
|
|
||||||
Curl_hash_destroy(data->hostcache);
|
Curl_hash_destroy(data->hostcache);
|
||||||
|
|
||||||
data->hostcache = data->share->hostcache;
|
data->hostcache = data->share->hostcache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(data->share->cookies) {
|
||||||
|
/* use shared cookie list, first free own one if any */
|
||||||
|
if (data->cookies)
|
||||||
|
Curl_cookie_cleanup(data->cookies);
|
||||||
|
data->cookies = data->share->cookies;
|
||||||
|
}
|
||||||
|
|
||||||
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
|
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check cookie list is set */
|
||||||
|
if(!data->cookies)
|
||||||
|
data->cookies = Curl_cookie_init( NULL, NULL, TRUE );
|
||||||
|
|
||||||
|
/* check for host cache not needed,
|
||||||
|
* it will be done by curl_easy_perform */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -548,8 +548,10 @@ struct connectdata {
|
|||||||
struct PureInfo {
|
struct PureInfo {
|
||||||
int httpcode;
|
int httpcode;
|
||||||
int httpversion;
|
int httpversion;
|
||||||
time_t filetime; /* If requested, this is might get set. Set to -1 if
|
long filetime; /* If requested, this is might get set. Set to -1 if the time
|
||||||
the time was unretrievable */
|
was unretrievable. We cannot have this of type time_t,
|
||||||
|
since time_t is unsigned on several platforms such as
|
||||||
|
OpenVMS. */
|
||||||
long header_size; /* size of read header(s) in bytes */
|
long header_size; /* size of read header(s) in bytes */
|
||||||
long request_size; /* the amount of bytes sent in the request(s) */
|
long request_size; /* the amount of bytes sent in the request(s) */
|
||||||
|
|
||||||
|
|||||||
@@ -46,4 +46,8 @@ MKHELP=$(top_srcdir)/src/mkhelp.pl
|
|||||||
# This generates the hugehelp.c file
|
# This generates the hugehelp.c file
|
||||||
hugehelp.c: $(README) $(MANPAGE) mkhelp.pl
|
hugehelp.c: $(README) $(MANPAGE) mkhelp.pl
|
||||||
rm -f hugehelp.c
|
rm -f hugehelp.c
|
||||||
$(NROFF) -man $(MANPAGE) | $(PERL) -s $(MKHELP) $(MKHELPOPT) $(README) > hugehelp.c
|
$(NROFF) -man $(MANPAGE) | $(PERL) $(MKHELP) $(MKHELPOPT) $(README) > hugehelp.c
|
||||||
|
|
||||||
|
# for distribution, generate an uncompressed help file!
|
||||||
|
dist-hook:
|
||||||
|
$(NROFF) -man $(MANPAGE) | $(PERL) $(MKHELP) $(README) > $(distdir)/hugehelp.c
|
||||||
|
|||||||
@@ -24,10 +24,14 @@ LINKR = link.exe /incremental:no /libpath:"../lib"
|
|||||||
CCD = cl.exe /MDd /Gm /ZI /Od /D "_DEBUG" /GZ
|
CCD = cl.exe /MDd /Gm /ZI /Od /D "_DEBUG" /GZ
|
||||||
LINKD = link.exe /incremental:yes /debug /libpath:"../lib"
|
LINKD = link.exe /incremental:yes /debug /libpath:"../lib"
|
||||||
|
|
||||||
CFLAGS = /I "../include" /nologo /W3 /GX /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
!IFNDEF ZLIB_PATH
|
||||||
LFLAGS = /nologo /out:$(PROGRAM_NAME) /subsystem:console /machine:I386
|
ZLIB_PATH = ../../zlib-1.1.4
|
||||||
LINKLIBS = ws2_32.lib libcurl.lib winmm.lib
|
!ENDIF
|
||||||
LINKLIBS_DEBUG = ws2_32.lib libcurld.lib winmm.lib
|
|
||||||
|
CFLAGS = /I "../include" /I "$(ZLIB_PATH)" /nologo /W3 /GX /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||||
|
LFLAGS = /nologo /libpath:"$(ZLIB_PATH)" /out:$(PROGRAM_NAME) /subsystem:console /machine:I386
|
||||||
|
LINKLIBS = ws2_32.lib libcurl.lib winmm.lib zlib.lib
|
||||||
|
LINKLIBS_DEBUG = ws2_32.lib libcurld.lib winmm.lib zlib.lib
|
||||||
|
|
||||||
RELEASE_OBJS= \
|
RELEASE_OBJS= \
|
||||||
hugehelpr.obj \
|
hugehelpr.obj \
|
||||||
@@ -47,16 +51,15 @@ LINK_OBJS= \
|
|||||||
urlglob.obj \
|
urlglob.obj \
|
||||||
main.obj
|
main.obj
|
||||||
|
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# release-ssl
|
# release-ssl
|
||||||
|
|
||||||
!IF "$(CFG)" == "release-ssl"
|
!IF "$(CFG)" == "release-ssl"
|
||||||
!IFNDEF OPENSSL_PATH
|
!IFNDEF OPENSSL_PATH
|
||||||
OPENSSL_PATH = ../../openssl-0.9.6
|
OPENSSL_PATH = ../../openssl-0.9.7a
|
||||||
!ENDIF
|
!ENDIF
|
||||||
LFLAGSSSL = /LIBPATH:"$(OPENSSL_PATH)/out32"
|
LFLAGSSSL = /LIBPATH:"$(OPENSSL_PATH)/out32"
|
||||||
SSLLIBS = libeay32.lib ssleay32.lib RSAglue.lib gdi32.lib
|
SSLLIBS = libeay32.lib ssleay32.lib gdi32.lib
|
||||||
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
|
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
|
||||||
LFLAGS = $(LFLAGS) $(LFLAGSSSL)
|
LFLAGS = $(LFLAGS) $(LFLAGSSSL)
|
||||||
!ENDIF
|
!ENDIF
|
||||||
@@ -100,6 +103,3 @@ clean:
|
|||||||
|
|
||||||
distrib: clean
|
distrib: clean
|
||||||
-@erase $(PROGRAM_NAME)
|
-@erase $(PROGRAM_NAME)
|
||||||
|
|
||||||
hugehelp.c: hugehelp.c.cvs
|
|
||||||
copy hugehelp.c.cvs hugehelp.c
|
|
||||||
|
|||||||
@@ -6,6 +6,12 @@
|
|||||||
# THEY DON'T FIT ME :-)
|
# THEY DON'T FIT ME :-)
|
||||||
|
|
||||||
# Get readme file as parameter:
|
# Get readme file as parameter:
|
||||||
|
|
||||||
|
if($ARGV[0] eq "-c") {
|
||||||
|
$c=1;
|
||||||
|
shift @ARGV;
|
||||||
|
}
|
||||||
|
|
||||||
my $README = $ARGV[0];
|
my $README = $ARGV[0];
|
||||||
|
|
||||||
if($README eq "") {
|
if($README eq "") {
|
||||||
@@ -20,6 +26,7 @@ push @out, " / __| | | | |_) | | \n";
|
|||||||
push @out, " | (__| |_| | _ <| |___ \n";
|
push @out, " | (__| |_| | _ <| |___ \n";
|
||||||
push @out, " \\___|\\___/|_| \\_\\_____|\n";
|
push @out, " \\___|\\___/|_| \\_\\_____|\n";
|
||||||
|
|
||||||
|
my $olen=0;
|
||||||
while (<STDIN>) {
|
while (<STDIN>) {
|
||||||
my $line = $_;
|
my $line = $_;
|
||||||
|
|
||||||
@@ -70,8 +77,8 @@ close(READ);
|
|||||||
if($c) {
|
if($c) {
|
||||||
my @test = `gzip --version 2>&1`;
|
my @test = `gzip --version 2>&1`;
|
||||||
if($test[0] =~ /gzip/) {
|
if($test[0] =~ /gzip/) {
|
||||||
open(GZIP, "|gzip -9 >dumpit.gz") ||
|
open(GZIP, ">dumpit") ||
|
||||||
die "can't run gzip, try without -c";
|
die "can't create the dumpit file, try without -c";
|
||||||
binmode GZIP;
|
binmode GZIP;
|
||||||
for(@out) {
|
for(@out) {
|
||||||
print GZIP $_;
|
print GZIP $_;
|
||||||
@@ -79,7 +86,10 @@ if($c) {
|
|||||||
}
|
}
|
||||||
close(GZIP);
|
close(GZIP);
|
||||||
|
|
||||||
open(GZIP, "<dumpit.gz");
|
system("gzip --best --no-name dumpit");
|
||||||
|
|
||||||
|
open(GZIP, "<dumpit.gz") ||
|
||||||
|
die "can't read the dumpit.gz file, try without -c";
|
||||||
binmode GZIP;
|
binmode GZIP;
|
||||||
while(<GZIP>) {
|
while(<GZIP>) {
|
||||||
push @gzip, $_;
|
push @gzip, $_;
|
||||||
|
|||||||
@@ -48,8 +48,8 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MALLOCDEBUG
|
#ifdef CURLDEBUG
|
||||||
/* This is an ugly hack for MALLOCDEBUG conditions only. We need to include
|
/* This is an ugly hack for CURLDEBUG conditions only. We need to include
|
||||||
the file here, since it might set the _FILE_OFFSET_BITS define, which must
|
the file here, since it might set the _FILE_OFFSET_BITS define, which must
|
||||||
be set BEFORE all normal system headers. */
|
be set BEFORE all normal system headers. */
|
||||||
#include "../lib/setup.h"
|
#include "../lib/setup.h"
|
||||||
|
|||||||
@@ -7,19 +7,19 @@ SUBDIRS = data server libtest
|
|||||||
PERLFLAGS = -I$(srcdir)
|
PERLFLAGS = -I$(srcdir)
|
||||||
|
|
||||||
curl:
|
curl:
|
||||||
@(cd ..; make)
|
@cd $(top_builddir) && $(MAKE)
|
||||||
|
|
||||||
test: server/sws
|
test: sws
|
||||||
@cd data && exec $(MAKE) test
|
@cd data && exec $(MAKE) test
|
||||||
srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl
|
srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl
|
||||||
|
|
||||||
quiet-test: server/sws
|
quiet-test: sws
|
||||||
@cd data && exec $(MAKE) test
|
@cd data && exec $(MAKE) test
|
||||||
srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl -s -a
|
srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl -s -a
|
||||||
|
|
||||||
full-test: server/sws
|
full-test: sws
|
||||||
@cd data && exec $(MAKE) test
|
@cd data && exec $(MAKE) test
|
||||||
srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl -a
|
srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl -a
|
||||||
|
|
||||||
server/sws:
|
sws:
|
||||||
cd server; make sws
|
@cd server && $(MAKE)
|
||||||
|
|||||||
@@ -21,4 +21,4 @@ test49 test50 test51 test52 test53 test54 test55 test56 \
|
|||||||
test500 test501 test502 test503 test504 test136 test57 test137 test138 \
|
test500 test501 test502 test503 test504 test136 test57 test137 test138 \
|
||||||
test58 test139 test140 test141 test59 test60 test61 test142 test143 test62 \
|
test58 test139 test140 test141 test59 test60 test61 test142 test143 test62 \
|
||||||
test63 test64 test65 test66 test144 test145 test67 test68 test41 \
|
test63 test64 test65 test66 test144 test145 test67 test68 test41 \
|
||||||
test40 test42 test69 test70 test71
|
test40 test42 test69 test70 test71 test72 test73 test146
|
||||||
|
|||||||
@@ -29,5 +29,6 @@ CWD path
|
|||||||
MDTM 103
|
MDTM 103
|
||||||
TYPE I
|
TYPE I
|
||||||
SIZE 103
|
SIZE 103
|
||||||
|
REST 0
|
||||||
</protocol>
|
</protocol>
|
||||||
</verify>
|
</verify>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ CWD blalbla
|
|||||||
MDTM 141
|
MDTM 141
|
||||||
TYPE I
|
TYPE I
|
||||||
SIZE 141
|
SIZE 141
|
||||||
|
REST 0
|
||||||
</protocol>
|
</protocol>
|
||||||
<stdout>
|
<stdout>
|
||||||
Last-Modified: Wed, 09 Apr 2003 10:26:59 GMT
|
Last-Modified: Wed, 09 Apr 2003 10:26:59 GMT
|
||||||
|
|||||||
46
tests/data/test146
Normal file
46
tests/data/test146
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data>
|
||||||
|
this is file contents
|
||||||
|
</data>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
persistant FTP with different paths
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
ftp://%HOSTIP:%FTPPORT/first/dir/here/146 ftp://%HOSTIP:%FTPPORT/146
|
||||||
|
</command>
|
||||||
|
</test>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
# strip all kinds of PORT, EPRT and LPRT curl can do
|
||||||
|
<strip>
|
||||||
|
^PORT 127,0,0,1,.*
|
||||||
|
^EPRT.*
|
||||||
|
^LPRT.*
|
||||||
|
</strip>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS curl_by_daniel@haxx.se
|
||||||
|
PWD
|
||||||
|
CWD first
|
||||||
|
CWD dir
|
||||||
|
CWD here
|
||||||
|
EPSV
|
||||||
|
TYPE I
|
||||||
|
SIZE 146
|
||||||
|
RETR 146
|
||||||
|
CWD /nowhere/anywhere
|
||||||
|
EPSV
|
||||||
|
TYPE I
|
||||||
|
SIZE 146
|
||||||
|
RETR 146
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
@@ -42,7 +42,6 @@ CONNECT 127.0.0.1:8433 HTTP/1.0
|
|||||||
Proxy-authorization: Basic dGVzdDppbmc=
|
Proxy-authorization: Basic dGVzdDppbmc=
|
||||||
|
|
||||||
GET /503 HTTP/1.1
|
GET /503 HTTP/1.1
|
||||||
Proxy-authorization: Basic dGVzdDppbmc=
|
|
||||||
Authorization: Basic dGVzdDppbmc=
|
Authorization: Basic dGVzdDppbmc=
|
||||||
Host: 127.0.0.1:8433
|
Host: 127.0.0.1:8433
|
||||||
Pragma: no-cache
|
Pragma: no-cache
|
||||||
|
|||||||
76
tests/data/test72
Normal file
76
tests/data/test72
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data>
|
||||||
|
HTTP/1.1 401 Authorization Required
|
||||||
|
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||||
|
WWW-Authenticate: Basic realm="foothis"
|
||||||
|
WWW-Authenticate: Digest realm="testrealm", nonce="1053604199"
|
||||||
|
Content-Type: text/html; charset=iso-8859-1
|
||||||
|
Content-Length: 26
|
||||||
|
|
||||||
|
This is not the real page
|
||||||
|
</data>
|
||||||
|
|
||||||
|
# This is supposed to be returned when the server gets a
|
||||||
|
# Authorization: Digest line passed-in from the client
|
||||||
|
<data1000>
|
||||||
|
HTTP/1.1 200 OK
|
||||||
|
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||||
|
Content-Type: text/html; charset=iso-8859-1
|
||||||
|
Content-Length: 23
|
||||||
|
|
||||||
|
This IS the real page!
|
||||||
|
</data1000>
|
||||||
|
|
||||||
|
<datacheck>
|
||||||
|
HTTP/1.1 401 Authorization Required
|
||||||
|
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||||
|
WWW-Authenticate: Basic realm="foothis"
|
||||||
|
WWW-Authenticate: Digest realm="testrealm", nonce="1053604199"
|
||||||
|
Content-Type: text/html; charset=iso-8859-1
|
||||||
|
Content-Length: 26
|
||||||
|
|
||||||
|
HTTP/1.1 200 OK
|
||||||
|
Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
||||||
|
Content-Type: text/html; charset=iso-8859-1
|
||||||
|
Content-Length: 23
|
||||||
|
|
||||||
|
This IS the real page!
|
||||||
|
</datacheck>
|
||||||
|
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
http
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
HTTP with Digest *OR* Basic authorization
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
http://%HOSTIP:%HOSTPORT/72 -u testuser:testpass --anyauth
|
||||||
|
</command>
|
||||||
|
</test>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<strip>
|
||||||
|
^User-Agent:.*
|
||||||
|
</strip>
|
||||||
|
<protocol>
|
||||||
|
GET /72 HTTP/1.1
|
||||||
|
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
GET /72 HTTP/1.1
|
||||||
|
Authorization: Digest username="testuser", realm="testrealm", nonce="1053604199", uri="/72", response="9fcd1330377365a09bbcb33b2cbb25bd"
|
||||||
|
User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
|
||||||
|
Host: 127.0.0.1:8999
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
45
tests/data/test73
Normal file
45
tests/data/test73
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
<data>
|
||||||
|
HTTP/1.1 200 OK swsclose
|
||||||
|
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
||||||
|
Content-Type: text/html
|
||||||
|
Set-Cookie: IPCZQX01af0fca5c=000010008168c200d25dfc4b; path=/; domain=.NOT_DISCLOSED.se
|
||||||
|
|
||||||
|
boo
|
||||||
|
</data>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
http
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
HTTP, receive cookies when using custom Host:, domain using only two dots
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
http://%HOSTIP:%HOSTPORT/we/want/73 -c log/jar73.txt -H "Host: host.NOT_DISCLOSED.se"
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<strip>
|
||||||
|
^User-Agent:.*
|
||||||
|
</strip>
|
||||||
|
<protocol>
|
||||||
|
GET /we/want/73 HTTP/1.1
|
||||||
|
Pragma: no-cache
|
||||||
|
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
|
||||||
|
Host: host.NOT_DISCLOSED.se
|
||||||
|
|
||||||
|
</protocol>
|
||||||
|
<file name="log/jar73.txt">
|
||||||
|
# Netscape HTTP Cookie File
|
||||||
|
# http://www.netscape.com/newsref/std/cookie_spec.html
|
||||||
|
# This file was generated by libcurl! Edit at your own risk.
|
||||||
|
|
||||||
|
.NOT_DISCLOSED.se TRUE / FALSE 0 IPCZQX01af0fca5c 000010008168c200d25dfc4b
|
||||||
|
</file>
|
||||||
|
</verify>
|
||||||
Reference in New Issue
Block a user