~ubuntu-branches/ubuntu/trusty/wget/trusty-proposed

« back to all changes in this revision

Viewing changes to src/http.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-05-17 19:46:25 UTC
  • mfrom: (2.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20110517194625-awyf9lkvyohk71ni
Tags: 1.12-3.1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
  - Keep build dependencies in main:
    + debian/control: remove info2man build-dep
    + debian/patches/series: disable wget-infopod_generated_manpage
  - Depend on libssl-dev 0.9.8k-7ubuntu4 (LP: #503339)
  - Mark wget Multi-Arch: foreign, so packages that aren't of the same arch
    can depend on it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2410
2410
/* The genuine HTTP loop!  This is the part where the retrieval is
2411
2411
   retried, and retried, and retried, and...  */
2412
2412
uerr_t
2413
 
http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
2414
 
           int *dt, struct url *proxy, struct iri *iri)
 
2413
http_loop (struct url *u, struct url *original_url, char **newloc,
 
2414
           char **local_file, const char *referer, int *dt, struct url *proxy,
 
2415
           struct iri *iri)
2415
2416
{
2416
2417
  int count;
2417
2418
  bool got_head = false;         /* used for time-stamping and filename detection */
2457
2458
    }
2458
2459
  else if (!opt.content_disposition)
2459
2460
    {
2460
 
      hstat.local_file = url_file_name (u);
 
2461
      hstat.local_file =
 
2462
        url_file_name (opt.trustservernames ? u : original_url);
2461
2463
      got_name = true;
2462
2464
    }
2463
2465
 
2497
2499
 
2498
2500
  /* Send preliminary HEAD request if -N is given and we have an existing
2499
2501
   * destination file. */
2500
 
  file_name = url_file_name (u);
 
2502
  file_name = url_file_name (opt.trustservernames ? u : original_url);
2501
2503
  if (opt.timestamping
2502
2504
      && !opt.content_disposition
2503
2505
      && file_exists_p (file_name))
2852
2854
 
2853
2855
          /* Remember that we downloaded the file for later ".orig" code. */
2854
2856
          if (*dt & ADDED_HTML_EXTENSION)
2855
 
            downloaded_file(FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
 
2857
            downloaded_file (FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
2856
2858
          else
2857
 
            downloaded_file(FILE_DOWNLOADED_NORMALLY, hstat.local_file);
 
2859
            downloaded_file (FILE_DOWNLOADED_NORMALLY, hstat.local_file);
2858
2860
 
2859
2861
          ret = RETROK;
2860
2862
          goto exit;
2885
2887
 
2886
2888
              /* Remember that we downloaded the file for later ".orig" code. */
2887
2889
              if (*dt & ADDED_HTML_EXTENSION)
2888
 
                downloaded_file(FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
 
2890
                downloaded_file (FILE_DOWNLOADED_AND_HTML_EXTENSION_ADDED, hstat.local_file);
2889
2891
              else
2890
 
                downloaded_file(FILE_DOWNLOADED_NORMALLY, hstat.local_file);
 
2892
                downloaded_file (FILE_DOWNLOADED_NORMALLY, hstat.local_file);
2891
2893
 
2892
2894
              ret = RETROK;
2893
2895
              goto exit;