Compare commits

...

27 Commits

Author SHA1 Message Date
Daniel Stenberg
1e7e53c87e clean up the dir tree hierarchy in *_done() to make persistant connection
FTP use the correct directories!

Reported in bug report #783116
2003-08-05 13:04:10 +00:00
Daniel Stenberg
b9fdf3cc3b added test 146 for a ftp persitency test, as reported on the list 2003-08-05 13:00:00 +00:00
Daniel Stenberg
c462601362 persistant connection test 2003-08-05 12:59:23 +00:00
Daniel Stenberg
859877dcfc auth problems 2003-08-05 12:32:02 +00:00
Daniel Stenberg
c04ce95106 cleaned up after David Byron's comment on the libcurl list, aug 5 2003 2003-08-04 23:13:39 +00:00
Daniel Stenberg
98ee12bc35 Jan Sundin reported a case where curl ignored a cookie that browsers don't,
which turned up to be due to the number of dots in the 'domain'. I've now
  made curl follow the the original netscape cookie spec less strict on that
  part.
2003-08-04 23:05:57 +00:00
Daniel Stenberg
fdda786fa2 added test 73 2003-08-04 22:58:06 +00:00
Daniel Stenberg
831be4f4dd Verifies Jan Sundin's cookie bug, dated aug 4 2003. 2003-08-04 22:57:58 +00:00
Daniel Stenberg
41ae97e710 Dirk Manske's patch that introduces cookie support to the share interface. 2003-08-04 15:02:42 +00:00
Daniel Stenberg
f72ba7f79d Mark Fletcher provided an excellent bug report that identified a problem
with FOLLOWLOCATION and chunked transfer-encoding, as libcurl would not
 properly ignore the body contents of 3XX response that included the
 Location: header.
2003-08-03 22:18:14 +00:00
Daniel Stenberg
296046510b serios info leakage! 2003-08-03 21:33:25 +00:00
Daniel Stenberg
db9f87f697 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.

The name and password can then be captured by an evil host and possibly get
used for malicious purposes.
2003-08-02 23:36:35 +00:00
Daniel Stenberg
3270ea55dd updated as the second proxy-auth header was a proof of a serious info leak
bug!!
2003-08-02 23:35:59 +00:00
Daniel Stenberg
a358ac24f4 Joerg Mueller-Tolk fixed a minor mistake 2003-08-01 14:20:48 +00:00
Daniel Stenberg
8bedd43b28 recent action 2003-08-01 12:33:19 +00:00
Daniel Stenberg
9ea2087ede David Byron's makefile fix to allow 7.10.6 to build fine using VC 2003-08-01 07:53:27 +00:00
Daniel Stenberg
9f7c634133 add a check for 'ar' since the lack of it bit Jared Ingersoll
we might need to check for some other tools too that on Solaris are put
in those weird dirs...
2003-07-30 15:10:26 +00:00
Daniel Stenberg
da20d68a12 removed silly target that only works when building from CVS 2003-07-30 14:26:36 +00:00
Daniel Stenberg
d3e512c738 Jrg Mller-Tolk updated this to build fine with 7.10.6 2003-07-30 14:19:44 +00:00
Daniel Stenberg
339f84fe1f ftp proxy support would be nice 2003-07-30 13:41:59 +00:00
Daniel Stenberg
2d41b735ec updated to match the recent ftp patch that makes it check for resumability 2003-07-30 07:52:02 +00:00
Daniel Stenberg
e3b4dd08ff Daniel Noguerol made the ftp code output "Accept-Ranges: bytes" in similar
style like other faked HTTP headers when NOBODY and HEADER are used.
2003-07-30 07:51:33 +00:00
Daniel Stenberg
6809a906bb Make sure to generate an uncompressed hugehelp.c file for inclusion in
the distribution archive, as it isn't sure zlib is present everywhere. Those
who care much for compressed help should regenerate the file.
2003-07-30 07:33:41 +00:00
Daniel Stenberg
1c35cbcc07 Reverted the 'filetime' struct field back to a 'long' as time_t is sometimes
unsigned and we want this to be able to hold -1 for illegal/unset values.
2003-07-30 07:22:28 +00:00
Daniel Stenberg
5f8989a436 CURLDEBUG not MALLOCDEBUG 2003-07-29 11:07:38 +00:00
Daniel Stenberg
aa7b0648ff Fixes based on Gisle Vanem's input since this script failed due to
possibly crlf newlines.
2003-07-28 23:00:56 +00:00
Daniel Stenberg
2fbe61960f Digest *OR* Basic authorization test 2003-07-28 22:17:37 +00:00
29 changed files with 413 additions and 89 deletions

34
CHANGES
View File

@@ -6,6 +6,40 @@
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)
Daniel (28 July)

View File

@@ -17,9 +17,14 @@ AC_CONFIG_SRCDIR([lib/urldata.h])
AM_CONFIG_HEADER(lib/config.h src/config.h tests/server/config.h )
AM_MAINTAINER_MODE
dnl SED is needed by some of the tools
AC_PATH_PROG( SED, sed, , $PATH:/usr/bin:/usr/local/bin)
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
VERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curl.h`
AM_INIT_AUTOMAKE(curl,$VERSION)

View File

@@ -204,7 +204,14 @@ Win32
Before running nmake define the OPENSSL_PATH environment variable with
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
directory. 'nmake vc-ssl' will create a libcurl static and dynamic

View File

@@ -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
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
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

View File

@@ -243,7 +243,7 @@ POST (HTTP)
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

View File

@@ -69,6 +69,10 @@ TODO
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,
like "blabla:[port]" or possibly even "blabla:[portfirst]-[portsecond]".

View File

@@ -204,6 +204,8 @@ X_OBJS= \
$(DIROBJ)\share.obj \
$(DIROBJ)\multi.obj \
$(DIROBJ)\http_digest.obj \
$(DIROBJ)\http_negotiate.obj \
$(DIROBJ)\http_ntlm.obj \
$(DIROBJ)\md5.obj
all : $(TARGET)
@@ -226,6 +228,3 @@ clean:
-@erase $(DIROBJ)\*.obj
-@erase vc60.idb
-@erase vc60.pch
getdate.c: getdate.c.cvs
copy getdate.c.cvs getdate.c

View File

@@ -234,7 +234,13 @@ Curl_cookie_add(struct CookieInfo *c,
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
dots. */
badcookie=TRUE; /* mark this as a bad cookie */

View File

@@ -76,6 +76,7 @@
#include "url.h"
#include "getinfo.h"
#include "hostip.h"
#include "share.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@@ -233,15 +234,18 @@ CURLcode curl_easy_perform(CURL *curl)
{
struct SessionHandle *data = (struct SessionHandle *)curl;
if (Curl_global_host_cache_use(data) && data->hostcache != Curl_global_host_cache_get()) {
if (data->hostcache) {
if ( ! (data->share && data->share->hostcache) ) {
if (Curl_global_host_cache_use(data) &&
data->hostcache != Curl_global_host_cache_get()) {
if (data->hostcache)
Curl_hash_destroy(data->hostcache);
}
data->hostcache = Curl_global_host_cache_get();
}
if (!data->hostcache) {
if (!data->hostcache)
data->hostcache = Curl_hash_alloc(7, Curl_freednsinfo);
}
return Curl_perform(data);
@@ -250,9 +254,11 @@ CURLcode curl_easy_perform(CURL *curl)
void curl_easy_cleanup(CURL *curl)
{
struct SessionHandle *data = (struct SessionHandle *)curl;
if (!Curl_global_host_cache_use(data)) {
if ( ! (data->share && data->share->hostcache) ) {
if ( !Curl_global_host_cache_use(data)) {
Curl_hash_destroy(data->hostcache);
}
}
Curl_close(data);
}

View File

@@ -105,6 +105,15 @@ static CURLcode ftp_cwd(struct connectdata *conn, char *path);
/* easy-to-use macro: */
#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()
@@ -598,6 +607,14 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
int ftpcode;
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((-1 != data->set.infilesize) &&
(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
size! */
ssize_t filesize;
ssize_t nread;
int ftpcode;
ftp->no_transfer = TRUE; /* this means no actual transfer is made */
@@ -2051,6 +2070,18 @@ CURLcode ftp_perform(struct connectdata *conn,
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
well, we "emulate" a HTTP-style header in our output. */
@@ -2059,9 +2090,9 @@ CURLcode ftp_perform(struct connectdata *conn,
struct tm *tm;
#ifdef HAVE_LOCALTIME_R
struct tm buffer;
tm = (struct tm *)localtime_r(&data->info.filetime, &buffer);
tm = (struct tm *)localtime_r((time_t *)&data->info.filetime, &buffer);
#else
tm = localtime(&data->info.filetime);
tm = localtime((time_t *)&data->info.filetime);
#endif
/* 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",
@@ -2147,7 +2178,8 @@ CURLcode Curl_ftp(struct connectdata *conn)
if (!ftp->dirs[path_part]) { /* run out of memory ... */
failf(data, "no memory");
retcode = CURLE_OUT_OF_MEMORY;
freedirs(ftp);
return CURLE_OUT_OF_MEMORY;
}
}
else {
@@ -2161,17 +2193,10 @@ CURLcode Curl_ftp(struct connectdata *conn)
/* too deep, we need the last entry to be kept NULL at all
times to signal end of list */
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 */
@@ -2179,11 +2204,7 @@ CURLcode Curl_ftp(struct connectdata *conn)
if(*ftp->file) {
ftp->file = curl_unescape(ftp->file, 0);
if(NULL == ftp->file) {
int i;
for (i=0;i<path_part;i++){
free(ftp->dirs[i]);
ftp->dirs[i]=NULL;
}
freedirs(ftp);
failf(data, "no memory");
return CURLE_OUT_OF_MEMORY;
}
@@ -2274,23 +2295,21 @@ CURLcode Curl_ftpsendf(struct connectdata *conn,
CURLcode Curl_ftp_disconnect(struct connectdata *conn)
{
struct FTP *ftp= conn->proto.ftp;
int i;
/* The FTP session may or may not have been allocated/setup at this point! */
if(ftp) {
if(ftp->entrypath)
free(ftp->entrypath);
if(ftp->cache)
if(ftp->cache) {
free(ftp->cache);
if(ftp->file)
free(ftp->file);
for (i=0;ftp->dirs[i];i++){
free(ftp->dirs[i]);
ftp->dirs[i]=NULL;
ftp->cache = NULL;
}
if(ftp->file) {
free(ftp->file);
ftp->file = NULL; /* zero */
}
freedirs(ftp);
}
return CURLE_OK;
}

View File

@@ -91,6 +91,7 @@
#include "http_digest.h"
#include "http_ntlm.h"
#include "http_negotiate.h"
#include "url.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@@ -553,6 +554,12 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn,
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");
return CURLE_OK;
}
@@ -846,10 +853,12 @@ CURLcode Curl_http(struct connectdata *conn)
}
if(data->cookies) {
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
co = Curl_cookie_getlist(data->cookies,
conn->allocptr.cookiehost?
conn->allocptr.cookiehost:host, ppath,
(bool)(conn->protocol&PROT_HTTPS?TRUE:FALSE));
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
}
if (conn->bits.httpproxy &&

View File

@@ -102,8 +102,9 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
size_t length,
size_t *wrote)
{
CURLcode result;
CURLcode result=CURLE_OK;
struct Curl_chunker *ch = &conn->proto.http->chunk;
struct Curl_transfer_keeper *k = &conn->keep;
int piece;
*wrote = 0; /* nothing yet */
@@ -180,6 +181,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
switch (conn->keep.content_encoding) {
case IDENTITY:
#endif
if(!k->ignorebody)
result = Curl_client_write(conn->data, CLIENTWRITE_BODY, datap,
piece);
#ifdef HAVE_LIBZ

View File

@@ -76,6 +76,9 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
break;
case CURL_LOCK_DATA_COOKIE:
if (!share->cookies) {
share->cookies = Curl_cookie_init( NULL, NULL, TRUE );
}
break;
case CURL_LOCK_DATA_SSL_SESSION:
@@ -103,6 +106,10 @@ curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
break;
case CURL_LOCK_DATA_COOKIE:
if (share->cookies) {
Curl_cookie_cleanup(share->cookies);
share->cookies = NULL;
}
break;
case CURL_LOCK_DATA_SSL_SESSION:
@@ -144,6 +151,12 @@ CURLSHcode curl_share_cleanup(CURLSH *sh)
if (share->dirty)
return CURLSHE_IN_USE;
if(share->hostcache)
Curl_hash_destroy(share->hostcache);
if(share->cookies)
Curl_cookie_cleanup(share->cookies);
free (share);
return CURLSHE_OK;
@@ -151,7 +164,8 @@ CURLSHcode curl_share_cleanup(CURLSH *sh)
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;

View File

@@ -26,6 +26,7 @@
#include "setup.h"
#include <curl/curl.h>
#include "cookie.h"
/* this struct is libcurl-private, don't export details */
struct Curl_share {
@@ -37,6 +38,7 @@ struct Curl_share {
void *clientdata;
curl_hash *hostcache;
struct CookieInfo *cookies;
};
CURLSHcode Curl_share_lock (

View File

@@ -707,12 +707,14 @@ CURLcode Curl_readwrite(struct connectdata *conn,
}
else if(data->cookies &&
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,
/* If there is a custom-set Host: name, use it
here, or else use real peer host name. */
conn->allocptr.cookiehost?
conn->allocptr.cookiehost:conn->name,
conn->ppath);
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
}
else if(checkprefix("Last-Modified:", k->p) &&
(data->set.timecondition || data->set.get_filetime) ) {
@@ -1509,12 +1511,14 @@ CURLcode Curl_pretransfer(struct SessionHandle *data)
do it now! */
if(data->change.cookielist) {
struct curl_slist *list = data->change.cookielist;
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
while(list) {
data->cookies = Curl_cookie_init(list->data,
data->cookies,
data->set.cookiesession);
list = list->next;
}
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
curl_slist_free_all(data->change.cookielist); /* clean up list */
data->change.cookielist = NULL; /* don't do this again! */
}

View File

@@ -191,10 +191,6 @@ CURLcode Curl_close(struct SessionHandle *data)
Curl_SSL_Close_All(data);
#endif
/* No longer a dirty share, if it exists */
if (data->share)
data->share->dirty--;
if(data->change.cookielist) /* clean up list if any */
curl_slist_free_all(data->change.cookielist);
@@ -213,13 +209,17 @@ CURLcode Curl_close(struct SessionHandle *data)
Curl_safefree(data->state.headerbuff);
#ifndef CURL_DISABLE_HTTP
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 */
if(Curl_cookie_output(data->cookies, data->set.cookiejar))
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_share_unlock(data, CURL_LOCK_DATA_COOKIE);
#endif
/* free the connection cache */
@@ -229,6 +229,10 @@ CURLcode Curl_close(struct SessionHandle *data)
Curl_digest_cleanup(data);
/* No longer a dirty share, if it exists */
if (data->share)
data->share->dirty--;
free(data);
return CURLE_OK;
}
@@ -1148,34 +1152,56 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
{
struct Curl_share *set;
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);
/* checking the dns cache stuff */
if(data->share->hostcache == data->hostcache)
{
data->hostcache = NULL;
}
if(data->share->cookies == data->cookies)
data->cookies = NULL;
data->share->dirty--;
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
data->share = NULL;
}
/* use new share if it set */
data->share = set;
if(data->share) {
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
data->share->dirty++;
if( data->hostcache )
{
if(data->share->hostcache) {
/* use shared host cache, first free own one if any */
if(data->hostcache)
Curl_hash_destroy(data->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);
}
/* 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;

View File

@@ -548,8 +548,10 @@ struct connectdata {
struct PureInfo {
int httpcode;
int httpversion;
time_t filetime; /* If requested, this is might get set. Set to -1 if
the time was unretrievable */
long filetime; /* If requested, this is might get set. Set to -1 if the time
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 request_size; /* the amount of bytes sent in the request(s) */

View File

@@ -46,4 +46,8 @@ MKHELP=$(top_srcdir)/src/mkhelp.pl
# This generates the hugehelp.c file
hugehelp.c: $(README) $(MANPAGE) mkhelp.pl
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

View File

@@ -24,10 +24,14 @@ LINKR = link.exe /incremental:no /libpath:"../lib"
CCD = cl.exe /MDd /Gm /ZI /Od /D "_DEBUG" /GZ
LINKD = link.exe /incremental:yes /debug /libpath:"../lib"
CFLAGS = /I "../include" /nologo /W3 /GX /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
LFLAGS = /nologo /out:$(PROGRAM_NAME) /subsystem:console /machine:I386
LINKLIBS = ws2_32.lib libcurl.lib winmm.lib
LINKLIBS_DEBUG = ws2_32.lib libcurld.lib winmm.lib
!IFNDEF ZLIB_PATH
ZLIB_PATH = ../../zlib-1.1.4
!ENDIF
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= \
hugehelpr.obj \
@@ -47,16 +51,15 @@ LINK_OBJS= \
urlglob.obj \
main.obj
######################
# release-ssl
!IF "$(CFG)" == "release-ssl"
!IFNDEF OPENSSL_PATH
OPENSSL_PATH = ../../openssl-0.9.6
OPENSSL_PATH = ../../openssl-0.9.7a
!ENDIF
LFLAGSSSL = /LIBPATH:"$(OPENSSL_PATH)/out32"
SSLLIBS = libeay32.lib ssleay32.lib RSAglue.lib gdi32.lib
SSLLIBS = libeay32.lib ssleay32.lib gdi32.lib
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
LFLAGS = $(LFLAGS) $(LFLAGSSSL)
!ENDIF
@@ -100,6 +103,3 @@ clean:
distrib: clean
-@erase $(PROGRAM_NAME)
hugehelp.c: hugehelp.c.cvs
copy hugehelp.c.cvs hugehelp.c

View File

@@ -6,6 +6,12 @@
# THEY DON'T FIT ME :-)
# Get readme file as parameter:
if($ARGV[0] eq "-c") {
$c=1;
shift @ARGV;
}
my $README = $ARGV[0];
if($README eq "") {
@@ -20,6 +26,7 @@ push @out, " / __| | | | |_) | | \n";
push @out, " | (__| |_| | _ <| |___ \n";
push @out, " \\___|\\___/|_| \\_\\_____|\n";
my $olen=0;
while (<STDIN>) {
my $line = $_;
@@ -70,8 +77,8 @@ close(READ);
if($c) {
my @test = `gzip --version 2>&1`;
if($test[0] =~ /gzip/) {
open(GZIP, "|gzip -9 >dumpit.gz") ||
die "can't run gzip, try without -c";
open(GZIP, ">dumpit") ||
die "can't create the dumpit file, try without -c";
binmode GZIP;
for(@out) {
print GZIP $_;
@@ -79,7 +86,10 @@ if($c) {
}
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;
while(<GZIP>) {
push @gzip, $_;

View File

@@ -48,8 +48,8 @@
#endif
#endif
#ifdef MALLOCDEBUG
/* This is an ugly hack for MALLOCDEBUG conditions only. We need to include
#ifdef CURLDEBUG
/* 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
be set BEFORE all normal system headers. */
#include "../lib/setup.h"

View File

@@ -7,19 +7,19 @@ SUBDIRS = data server libtest
PERLFLAGS = -I$(srcdir)
curl:
@(cd ..; make)
@cd $(top_builddir) && $(MAKE)
test: server/sws
test: sws
@cd data && exec $(MAKE) test
srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl
quiet-test: server/sws
quiet-test: sws
@cd data && exec $(MAKE) test
srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl -s -a
full-test: server/sws
full-test: sws
@cd data && exec $(MAKE) test
srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl -a
server/sws:
cd server; make sws
sws:
@cd server && $(MAKE)

View File

@@ -21,4 +21,4 @@ test49 test50 test51 test52 test53 test54 test55 test56 \
test500 test501 test502 test503 test504 test136 test57 test137 test138 \
test58 test139 test140 test141 test59 test60 test61 test142 test143 test62 \
test63 test64 test65 test66 test144 test145 test67 test68 test41 \
test40 test42 test69 test70 test71
test40 test42 test69 test70 test71 test72 test73 test146

View File

@@ -29,5 +29,6 @@ CWD path
MDTM 103
TYPE I
SIZE 103
REST 0
</protocol>
</verify>

View File

@@ -30,6 +30,7 @@ CWD blalbla
MDTM 141
TYPE I
SIZE 141
REST 0
</protocol>
<stdout>
Last-Modified: Wed, 09 Apr 2003 10:26:59 GMT

46
tests/data/test146 Normal file
View 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>

View File

@@ -42,7 +42,6 @@ CONNECT 127.0.0.1:8433 HTTP/1.0
Proxy-authorization: Basic dGVzdDppbmc=
GET /503 HTTP/1.1
Proxy-authorization: Basic dGVzdDppbmc=
Authorization: Basic dGVzdDppbmc=
Host: 127.0.0.1:8433
Pragma: no-cache

76
tests/data/test72 Normal file
View 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
View 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>