bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Syntax for RESTful scripting options


From: Giuseppe Scrivano
Subject: Re: [Bug-wget] Syntax for RESTful scripting options
Date: Sat, 06 Apr 2013 22:06:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Hi Darshit,

thanks for this new iteration, some comments:


Darshit Shah <address@hidden> writes:

> All the changes have been squashed into one single commit. In case it is 
> preferred to send them as separate commits, I will do the same.

no, no problem, this is the preferred way.  It is a single change that
can go by itself.

> +  if (opt.method)
> +    {
> +      request_set_header (req, "Content-Type",
> +                          "application/x-www-form-urlencoded", rel_none);
> +
> +      if (opt.body_data || opt.body_file)
> +      {

please indent '{' with two empty spaces.

> +        if (opt.body_data)
> +          body_data_size = strlen (opt.body_data);
> +        else
> +          {
> +            body_data_size = file_size (opt.body_file);
> +            if (body_data_size == -1)
> +            {
> +              logprintf (LOG_NOTQUIET, _("BODY data file %s missing: %s\n"),
> +                         quote (opt.body_file), strerror (errno));
> +              return FILEBADFILE;
> +            }
> +          }
> +        request_set_header (req, "Content-Length",
> +                            xstrdup (number_to_static_string 
> (body_data_size)),
> +                            rel_value);
> +      }
> +    }
> +

maybe the previous "if (opt.post_data || opt.post_file_name)" case can
be handled here?

What will break if we just do:

if (opt.post_data || opt.post_file_name)
  {
    opt.method = "POST";
    opt.body_data = opt.post_data;
    opt.body_file = opt.post_file;
  }

before you check for if (opt.method)?

Do you think we can get ride of the old code to handle POST data?

In any case I can't still apply your patch upstream, I am waiting for
your copyright assignment papers to be processed (or received).

Thanks,
Giuseppe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]