1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Automated merge.

This commit is contained in:
Saint Xavier 2008-06-26 18:10:16 +02:00
commit d3007f1b3a
9 changed files with 144 additions and 19 deletions

View File

@ -6,6 +6,32 @@
* url.c : Convert URLs from locale to UTF-8 allowing a basic
support of IRI/IDN
2008-06-24 Steven Schubiger <stsc@members.fsf.org>
* http.c (http_loop): Replace escnonprint() occurence with
a quotearg_style() call.
2008-06-24 Micah Cowan <micah@cowan.name>
* ftp-ls.c (ftp_index): Don't assume time_t* is compatible with
long*. Fixes crash on Windows, and probably other systems.
2008-06-22 Steven Schubiger <stsc@members.fsf.org>
* http.c: Explicitly initialize and deallocate the message
string used by the -nv --spider functionality.
2008-06-22 Steven Schubiger <schubiger@gmail.com>
* http.c: Make -nv --spider include the file's name when it
exists.
2008-06-22 Micah Cowan <micah@cowan.name>
* Makefile.am (version.c): Fixed version string invocation so it
once again can't result in unterminated strings, made all the
string vars pointers-to-const, and moved line lengths
below 80 (in Makefile.am, not in version.c).
2008-06-19 Xavier Saint <wget@sxav.eu>
@ -37,6 +63,12 @@
* iri.h : Make no-op version of parse_charset() return
NULL.
2008-06-16 Micah Cowan <micah@cowan.name>
* http.c (http_loop): When hstat.len is higher than the
successfully completed content's length, but it's because we
_set_ it that way, don't abort.
2008-06-14 Xavier Saint <wget@sxav.eu>
* iri.c, iri.h : New files.
@ -54,7 +86,8 @@
2008-06-13 Micah Cowan <micah@cowan.name>
* build_info.c: ENABLE_NTLM, not HAVE_NTLM.
* build_info.c: ENABLE_NTLM, not HAVE_NTLM; distinguish OpenSSL
from "ssl".
2008-06-13 Madhusudan Hosaagrahara <com.gmail.hrmadhu>

View File

@ -59,12 +59,14 @@ version.c: $(wget_SOURCES) $(LDADD) $(srcdir)/Makefile.am
echo '/* version.c */' > $@
echo '/* Autogenerated by Makefile - DO NOT EDIT */' >> $@
echo '' >> $@
echo -n 'char* version_string = "@VERSION@ ' >> $@
-hg log -r . --template=' ({node|short})"\n' 2>/dev/null >> $@
echo -n 'const char *version_string = "@VERSION@"' >> $@
-hg log -r . --template='" ({node|short})"\n' 2>/dev/null >> $@
echo ';' >> $@
echo 'char* compilation_string = "'$(COMPILE)'";' | $(ESCAPEQUOTE) >> $@
echo 'char* link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' | $(ESCAPEQUOTE) >> $@
echo 'const char *compilation_string = "'$(COMPILE)'";' \
| $(ESCAPEQUOTE) >> $@
echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \
| $(ESCAPEQUOTE) >> $@
check_LIBRARIES = libunittest.a
libunittest_a_SOURCES = $(wget_SOURCES) test.c test.h

View File

@ -90,9 +90,9 @@ const char* (compiled_features[]) =
#endif
#ifdef HAVE_LIBSSL
"+ssl",
"+openssl",
#else
"-ssl",
"-openssl",
#endif
#ifdef HAVE_GETTEXT

View File

@ -894,7 +894,8 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
struct tm *ptm = localtime ((time_t *)&f->tstamp);
time_t tstamp = f->tstamp;
struct tm *ptm = localtime (&tstamp);
fprintf (fp, "%d %s %02d ", ptm->tm_year + 1900, months[ptm->tm_mon],
ptm->tm_mday);

View File

@ -1297,6 +1297,7 @@ struct http_stat
char *remote_time; /* remote time-stamp string */
char *error; /* textual HTTP error */
int statcode; /* status code */
char *message; /* status message */
wgint rd_size; /* amount of data read from socket */
double dltime; /* time it took to download the data */
const char *referer; /* value of the referer header. */
@ -1323,6 +1324,7 @@ free_hstat (struct http_stat *hs)
xfree_null (hs->rderrmsg);
xfree_null (hs->local_file);
xfree_null (hs->orig_file_name);
xfree_null (hs->message);
/* Guard against being called twice. */
hs->newloc = NULL;
@ -1442,6 +1444,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
hs->newloc = NULL;
hs->remote_time = NULL;
hs->error = NULL;
hs->message = NULL;
conn = u;
@ -1714,6 +1717,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
resp = resp_new (head);
statcode = resp_status (resp, &message);
hs->message = xstrdup (message);
resp_free (resp);
xfree (head);
if (statcode != 200)
@ -1796,6 +1800,7 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
/* Check for status line. */
message = NULL;
statcode = resp_status (resp, &message);
hs->message = xstrdup (message);
if (!opt.server_response)
logprintf (LOG_VERBOSE, "%2d %s\n", statcode,
message ? quotearg_style (escape_quoting_style, message) : "");
@ -2670,19 +2675,20 @@ The sizes do not match (local %s) -- retrieving.\n"),
if (opt.spider)
{
bool finished = true;
if (opt.recursive)
{
if (*dt & TEXTHTML)
{
logputs (LOG_VERBOSE, _("\
Remote file exists and could contain links to other resources -- retrieving.\n\n"));
finished = false;
}
else
{
logprintf (LOG_VERBOSE, _("\
Remote file exists but does not contain any link -- not retrieving.\n\n"));
ret = RETROK; /* RETRUNNEEDED is not for caller. */
goto exit;
}
}
else
@ -2699,6 +2705,14 @@ but recursion is disabled -- not retrieving.\n\n"));
Remote file exists.\n\n"));
}
ret = RETROK; /* RETRUNNEEDED is not for caller. */
}
if (finished)
{
logprintf (LOG_NONVERBOSE,
_("%s URL:%s %2d %s\n"),
tms, u->url, hstat.statcode,
hstat.message ? quotearg_style (escape_quoting_style, hstat.message) : "");
goto exit;
}
}
@ -2808,10 +2822,18 @@ Remote file exists.\n\n"));
printwhat (count, opt.ntry);
continue;
}
else
else if (hstat.len != hstat.restval)
/* Getting here would mean reading more data than
requested with content-length, which we never do. */
abort ();
else
{
/* Getting here probably means that the content-length was
* _less_ than the original, local size. We should probably
* truncate or re-read, or something. FIXME */
ret = RETROK;
goto exit;
}
}
else /* from now on hstat.res can only be -1 */
{

View File

@ -1,3 +1,13 @@
2008-06-22 Micah Cowan <micah@cowan.name>
* Test-proxied-https-auth.px: Shift exit code so it falls in the
lower bits, and actually fails when it should. Use dynamic port,
instead of static port. Only run the test if our Wget was built
with HTTPS support.
* certs/server-cert.pem, certs/server-key.pem: Apparently failed
to add these from 1.11.x repo. Fixed.
2008-06-12 Micah Cowan <micah@cowan.name>
* FTPServer.pm, FTPTest.pm, HTTPServer.pm, HTTPTest.pm,

View File

@ -3,9 +3,22 @@ use warnings;
use strict;
use WgetTest; # For $WGETPATH.
# Have we even built an HTTPS-supporting Wget?
{
my @version_lines = `${WgetTest::WGETPATH} --version`;
unless (grep /\+(openssl|gnutls)/, @version_lines) {
print "Not running test: Wget under test doesn't support HTTPS.\n";
exit 0;
}
}
use HTTP::Daemon;
use HTTP::Request;
use IO::Socket::SSL 'debug4';
use IO::Socket::SSL;
my $SOCKET = HTTP::Daemon->new (LocalAddr => 'localhost',
ReuseAddr => 1) or die "Cannot create server!!!";
sub get_request {
my $conn = shift;
@ -26,9 +39,7 @@ sub get_request {
sub do_server {
my $alrm = alarm 10;
my $s = HTTP::Daemon->new (LocalAddr => 'localhost',
LocalPort => '8080',
ReuseAddr => 1) or die "Cannot create server!!!";
my $s = $SOCKET;
my $conn;
my $rqst;
my $rspn;
@ -68,6 +79,10 @@ sub do_server {
'Content-Type' => 'text/plain',
'Connection' => 'close',
], "foobarbaz\n");
$rspn->protocol('HTTP/1.0');
print "=====\n";
print $rspn->as_string;
print "\n=====\n";
print $conn $rspn->as_string;
}
$conn->close;
@ -94,9 +109,11 @@ my $cmdline = $WgetTest::WGETPATH . " --user=fiddle-dee-dee"
. " --password=Dodgson -e https_proxy=localhost:{{port}}"
. " --no-check-certificate"
. " https://no.such.domain/needs-auth.txt";
$cmdline =~ s/{{port}}/$SOCKET->sockport()/e;
my $code = system($cmdline);
system ('rm -f needs-auth.txt');
warn "Got code: $code\n" if $code;
kill ('TERM', $pid);
exit $code;
exit ($code >> 8);

View File

@ -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LODW3YdQW4hnxxaltuXPAkvNo
6ST/6HVi/iSJsfvqUuEEXw/SGRMB0aZ+YEIOn4hVnu+gE8N07tuyvQ==
-----END RSA PRIVATE KEY-----