]> sjero.net Git - wget/commitdiff
Automated merge.
authorSaint Xavier <wget@sxav.eu>
Thu, 26 Jun 2008 16:10:16 +0000 (18:10 +0200)
committerSaint Xavier <wget@sxav.eu>
Thu, 26 Jun 2008 16:10:16 +0000 (18:10 +0200)
1  2 
src/ChangeLog
src/Makefile.am
src/build_info.c
src/http.c

diff --combined src/ChangeLog
index f8aae8b9230f4d9a2571e79b3dad1a8f48043558,3df8ddaeb848fffa55f20aaba5c3b1f6b8d551c0..9e31b1c44fd89f83f9cef3a22519f9774daefd9e
@@@ -1,60 -1,40 +1,93 @@@
 -      
 +2008-06-26  Xavier Saint  <wget@sxav.eu>
 +
 +      * iri.c, iri.h : New functions locale_to_utf8() and
 +      idn_encode() adding basic capabilities of IRI/IDN.
 +
 +      * 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>
 +
 +      * iri.c, iri.h : New function check_encoding_name() as
 +      a preliminary encoding name check.
 +
 +      * main.c, iri.c : Make use of check_encoding_name().
 +
 +2008-06-19  Xavier Saint  <wget@sxav.eu>
 +
 +      * iri.c : Include missing stringprep.h file and add a
 +      cast.
 +
 +      * init.c : set a default initial value for opt.enable_iri,
 +      opt.locale and opt.encoding_remote.
 +
 +2008-06-19  Xavier Saint  <wget@sxav.eu>
 +
 +      * iri.c, iri.h : Add a new function find_locale() to find
 +      out the local system encoding.
 +
 +      * main.c : Make use of find_locale().
 +
 +2008-06-19  Xavier Saint  <wget@sxav.eu>
 +
 +      * html-url.c : Add "content-type" meta tag parsing for
 +      retrieving page encoding.
 +
 +      * 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.
 +
 +      * Makefile.am : Add files iri.h and conditional iri.c.
 +
 +      * build_info.c : Add compiled feature "iri".
 +
 +      * http.c : include iri.h and parse charset from Content-Type
 +      header.
 +
 +      * init.c, main.c, options.h : if an options isn't supported
 +      at compiled time, don't get rid off it and show a dummy
 +      message instead if they are used.
 +
  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>
  
        default.
  
  2008-05-17  Kenny Parnell  <k.parnell@gmail.com>
--      
++
        (cmd_spec_prefer_family): Initialize prefer_family to prefer_none.
  
  2008-05-17  Micah Cowan  <micah@cowan.name>
--      
++
        * main.c (main): Handle Ctrl-D on command-line.
  
  2008-05-15  Steven Schubiger  <schubiger@gmail.com>
  
        * options.h: Add an according boolean member to the options
        struct.
--      
++
        * sysdep.h: Comment the defines __EXTENSIONS__ and _GNU_SOURCE
        out, because they're now defined independently by config.h.
  
diff --combined src/Makefile.am
index 379a9b8cd791f535957a49bcef28cbb63a51b3e3,56ba6108f8e91d2b4c3d144928aee158b1de3090..6ae5805d5ba6400354079aa871969c107c72f9f0
  # Version: @VERSION@
  #
  
 +if IRI_IS_ENABLED
 +IRI_OBJ = iri.c
 +endif
 +
  # The following line is losing on some versions of make!
  DEFS     = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
  LIBS     = @LIBSSL@ @LIBGNUTLS@ @LIBINTL@ @LIBS@
@@@ -43,10 -39,10 +43,10 @@@ wget_SOURCES = build_info.c cmpt.c conn
               ftp-basic.c ftp-ls.c hash.c host.c html-parse.c html-url.c \
               http.c init.c log.c main.c netrc.c progress.c ptimer.c     \
               recur.c res.c retr.c snprintf.c spider.c url.c             \
 -             utils.c                                    \
 +             utils.c $(IRI_OBJ)                                         \
               connect.h convert.h cookies.h                              \
               ftp.h gen-md5.h hash.h host.h html-parse.h                 \
 -             http.h http-ntlm.h init.h log.h mswindows.h netrc.h        \
 +             http.h http-ntlm.h init.h iri.h log.h mswindows.h netrc.h  \
               options.h progress.h ptimer.h recur.h res.h retr.h         \
               spider.h ssl.h sysdep.h url.h utils.h wget.h
  nodist_wget_SOURCES = version.c
@@@ -59,12 -55,14 +59,14 @@@ version.c:  $(wget_SOURCES) $(LDADD) $(
        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
diff --combined src/build_info.c
index 129bf7264dae6f5d867a32413bc9b6d3d50b4431,e330b653a5e5e740ed69e83f3ba6ee104c99dcc2..00d5122d89fcae0c9d67eac0e3c589dc07e3bec6
@@@ -90,9 -90,9 +90,9 @@@ const char* (compiled_features[]) 
  #endif
  
  #ifdef HAVE_LIBSSL
-   "+ssl",
+   "+openssl",
  #else
-   "-ssl",
+   "-openssl",
  #endif
  
  #ifdef HAVE_GETTEXT
  #else
    "-gettext",
  #endif
 +
 +#ifdef ENABLE_IRI
 +  "+iri",
 +#else
 +  "-iri",
 +#endif
 +
    /* sentinel value */
    NULL
  };
diff --combined src/http.c
index 741ed2c003fb9a29855725c49fec1b86979c2d48,113e096a6705f7036fd41c2cc78ea57485f683c7..a4571ad7019b99180a1b44ffa1ffbd1d055e6d38
@@@ -49,7 -49,6 +49,7 @@@ as that of the covered work.  *
  #include "retr.h"
  #include "connect.h"
  #include "netrc.h"
 +#include "iri.h"
  #ifdef HAVE_SSL
  # include "ssl.h"
  #endif
@@@ -1297,6 -1296,7 +1297,7 @@@ struct http_sta
    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 -1323,7 +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 -1443,7 +1444,7 @@@ gethttp (struct url *u, struct http_sta
    hs->newloc = NULL;
    hs->remote_time = NULL;
    hs->error = NULL;
+   hs->message = NULL;
  
    conn = u;
  
  
            resp = resp_new (head);
            statcode = resp_status (resp, &message);
+           hs->message = xstrdup (message);
            resp_free (resp);
            xfree (head);
            if (statcode != 200)
    /* 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) : "");
@@@ -2041,16 -2045,9 +2046,16 @@@ File %s already there; not retrieving.\
        char *tmp = strchr (type, ';');
        if (tmp)
          {
 +          /* sXXXav: only needed if IRI support is enabled */
 +          char *tmp2 = tmp + 1;
 +
            while (tmp > type && c_isspace (tmp[-1]))
              --tmp;
            *tmp = '\0';
 +
 +          /* Try to get remote encoding if needed */
 +          if (opt.enable_iri && !opt.encoding_remote)
 +            /* xxx = */ parse_charset (tmp2);
          }
      }
    hs->newloc = resp_header_strdup (resp, "Location");
@@@ -2670,19 -2667,20 +2675,20 @@@ The sizes do not match (local %s) -- re
                
                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 -2697,14 +2705,14 @@@ but recursion is disabled -- not retrie
  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;
                      }
                  }
                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 */
          {