]> sjero.net Git - wget/commitdiff
Keep the same method on a 307 redirect
authorGijs van Tulder <gvtulder@gmail.com>
Thu, 2 May 2013 21:04:31 +0000 (23:04 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Thu, 2 May 2013 21:04:31 +0000 (23:04 +0200)
src/ChangeLog
src/retr.c

index 6a974d8b8a3cc56004c714659620806058a9716d..528d6eb974a798d896ee69b3a9a65a8cacc8ae2c 100644 (file)
@@ -1,3 +1,9 @@
+2013-05-01  Gijs van Tulder  <gvtulder@gmail.com>
+
+       * retr.c (retrieve_url): New variable `saved_method'.
+       (SUSPEND_POST_DATA): Save the method to `saved_method'.
+       (RESTORE_POST_DATA): Restore the method from `saved_method'.
+
 2013-05-01  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * init.c: Declare `cmd_string_uppercase'.
index d51b7e7f117b2a483e7a857b595af70c7f949808..9002b0ec01675751eff2cff0ec523db82557088a 100644 (file)
@@ -681,6 +681,7 @@ calc_rate (wgint bytes, double secs, int *units)
   post_data_suspended = true;                   \
   saved_post_data = opt.body_data;              \
   saved_post_file_name = opt.body_file;         \
+  saved_method = opt.method;                    \
   opt.body_data = NULL;                         \
   opt.body_file = NULL;                         \
   opt.method = NULL;                            \
@@ -691,8 +692,8 @@ calc_rate (wgint bytes, double secs, int *units)
     {                                                   \
       opt.body_data = saved_post_data;                  \
       opt.body_file = saved_post_file_name;             \
+      opt.method = saved_method;                        \
       post_data_suspended = false;                      \
-      opt.method = "POST";                              \
     }                                                   \
 } while (0)
 
@@ -722,6 +723,7 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
 
   bool post_data_suspended = false;
   char *saved_post_data = NULL;
+  char *saved_method = NULL;
   char *saved_post_file_name = NULL;
 
   /* If dt is NULL, use local storage.  */