Giuseppe Scrivano wrote:
> what about this patch? Any comment?
Another suggestion: why not save the original opt.method, set opt.method
to NULL and put the original opt.method back later?
Gijs
diff --git a/src/retr.c b/src/retr.c
index d51b7e7..2aee578 100644
--- a/src/retr.c
+++ b/src/retr.c
@@ -679,22 +679,23 @@ calc_rate (wgint bytes, double secs, int *units)
#define SUSPEND_POST_DATA do { \
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; \
} while (0)
#define RESTORE_POST_DATA do { \
if (post_data_suspended) \
{ \
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)
static char *getproxy (struct url *);
@@ -721,10 +722,11 @@ retrieve_url (struct url * orig_parsed, const char
*origurl, char **file,
int redirection_count = 0;
bool post_data_suspended = false;
char *saved_post_data = NULL;
char *saved_post_file_name = NULL;
+ char *saved_method = NULL;
/* If dt is NULL, use local storage. */
if (!dt)
{
dt = &dummy;