From 7ab7f93f8dd1711c0f82519cc61d31455c3c84aa Mon Sep 17 00:00:00 2001 From: hniksic Date: Fri, 30 Nov 2001 19:06:41 -0800 Subject: [PATCH] [svn] Make -p work with framed pages. Published in . --- NEWS | 4 ++++ TODO | 2 -- src/ChangeLog | 5 +++++ src/recur.c | 21 +++++++++++++-------- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index a1853afb..777381e8 100644 --- a/NEWS +++ b/NEWS @@ -41,6 +41,10 @@ are now converted correctly. retrieving for inline images, stylesheets, and other documents needed to display the page. +*** Page-requisites (-p) mode now works with frames. In other words, +`wget -p URL-THAT-USES-FRAMES' will now download the frame HTML files, +and all the files that they need to be displayed properly. + ** If a host has more than one IP address, Wget uses the other addresses when accessing the first one fails. diff --git a/TODO b/TODO index 8dea09d6..dd0baa10 100644 --- a/TODO +++ b/TODO @@ -15,8 +15,6 @@ changes. It should connect to the proxy URL, log in as username@target-site, and continue as usual. -* -p should probably go "_two_ more hops" on pages. - * Add a --range parameter allowing you to explicitly specify a range of bytes to get from a file over HTTP (FTP only supports ranges ending at the end of the file, though forcibly disconnecting from the server at the desired endpoint diff --git a/src/ChangeLog b/src/ChangeLog index c2592d13..9d1bc81b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-12-01 Hrvoje Niksic + + * recur.c (retrieve_tree): Allow -p retrievals to exceed maximum + depth by more than one. + 2001-11-30 Hrvoje Niksic * retr.c (retrieve_url): Don't allow more than 20 redirections. diff --git a/src/recur.c b/src/recur.c index 6b8c41b0..091df379 100644 --- a/src/recur.c +++ b/src/recur.c @@ -255,17 +255,22 @@ retrieve_tree (const char *start_url) if (descend && depth >= opt.reclevel && opt.reclevel != INFINITE_RECURSION) { - if (opt.page_requisites && depth == opt.reclevel) - /* When -p is specified, we can do one more partial - recursion from the "leaf nodes" on the HTML document - tree. The recursion is partial in that we won't - traverse any or tags, nor any tags - except for . */ - dash_p_leaf_HTML = TRUE; + if (opt.page_requisites + && (depth == opt.reclevel || depth == opt.reclevel + 1)) + { + /* When -p is specified, we are allowed to exceed the + maximum depth, but only for the "inline" links, + i.e. those that are needed to display the page. + Originally this could exceed the depth at most by + one, but we allow one more level so that the leaf + pages that contain frames can be loaded + correctly. */ + dash_p_leaf_HTML = TRUE; + } else { /* Either -p wasn't specified or it was and we've - already gone the one extra (pseudo-)level that it + already spent the two extra (pseudo-)levels that it affords us, so we need to bail out. */ DEBUGP (("Not descending further; at depth %d, max. %d.\n", depth, opt.reclevel)); -- 2.39.2