public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Vladimir Olovyannikov" <vladimir.olovyannikov@broadcom.com>
To: Laszlo Ersek <lersek@redhat.com>, devel@edk2.groups.io
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
	Zhichao Gao <zhichao.gao@intel.com>,
	 Maciej Rabeda <maciej.rabeda@linux.intel.com>,
	Jiaxin Wu <jiaxin.wu@intel.com>,  Siyuan Fu <siyuan.fu@intel.com>,
	Ray Ni <ray.ni@intel.com>,  Liming Gao <liming.gao@intel.com>,
	Nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH v3 1/1] ShellPkg/DynamicCommand: add HttpDynamicCommand
Date: Fri, 24 Jul 2020 10:50:45 -0700	[thread overview]
Message-ID: <da35f44bb31a8cf2411bf48d3c976232@mail.gmail.com> (raw)
In-Reply-To: <20cc1951-cd4e-a9d5-a24a-96f273002bed@redhat.com>

> -----Original Message-----
> From: Laszlo Ersek <lersek@redhat.com>
> Sent: Friday, July 24, 2020 8:09 AM
> To: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>;
> devel@edk2.groups.io
> Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Zhichao
> Gao <zhichao.gao@intel.com>; Maciej Rabeda
> <maciej.rabeda@linux.intel.com>; Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan
> Fu <siyuan.fu@intel.com>; Ray Ni <ray.ni@intel.com>; Liming Gao
> <liming.gao@intel.com>; Nd <nd@arm.com>
> Subject: Re: [edk2-devel] [PATCH v3 1/1] ShellPkg/DynamicCommand: add
> HttpDynamicCommand
>
> On 07/23/20 19:18, Vladimir Olovyannikov wrote:
>
>
> >>> One suggestion: if the download fails for some reason, but the local
> >>> file creation succeeded, then upon exit, the local file should be
> >>> deleted. Otherwise an incomplete (possibly zero size) file is left
> >>> in the filesystem.
>
> > I was thinking about this.
> > Sometimes, an error file returned by HTTP server (say, on 404 or 503)
> > has more information than just 404, 503, etc.
> > That was the only reason I do not delete it.
> > I still return error code to the caller, so the caller can read it
> > (maybe, to provide more information to the user), and/or delete it right
> away.
> > What do you think?
>
> Seems unusual to me; at least I'm not used to it with "wget". I seem to
> remember that, whenever I get a 404 or 503 with wget, I don't have to
> clean
> up after wget.
>
> With a graphical web browser, things are different, in that case,
> rendering
> the textual (HTML etc) response can be helpful.
>
> If you decide to keep the local files in such cases (i.e., on failure), I
> suggest
> documenting that fact in the built-in help text.
Can you please take a look at the v4 patch I sent yesterday?
Now, by default, if there was an error during download, the file is deleted.
There is a way to specify -k switch on the command line to keep the file.

As I told, sometimes it is useful to have error body from the server.
Say, if I try "http google.com -k", the result would be
Downloading 'http://google.com/'
'http://google.com' reports '503 Service unavailable' for '/'
When you do "cat index.html" :
<title>Virus/Spyware Download Blocked</title>
<p>Download of the virus/spyware has been blocked in accordance with company
policy. Please contact
your system administrator if you believe this is in error.</p>
<p><b>File name:</b> google.com/ </p>
This is probably our company firewall response, but without the body it
would be hard to understand what it does not like.
This way it works (content is chunked, so the progress indicator only shows
downloaded size, no percentage) :
http google.com/index.html
Downloading 'http://google.com/index.html'
Downloading 'http://www.google.com/index.html'
[                                        ]      46 Kb
>
> Thanks!
> Laszlo
Thank you,
Vladimir

      reply	other threads:[~2020-07-24 17:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 18:31 [PATCH v3 1/1] ShellPkg/DynamicCommand: add HttpDynamicCommand Vladimir Olovyannikov
2020-07-15 12:55 ` [edk2-devel] " Laszlo Ersek
2020-07-15 12:58   ` Laszlo Ersek
2020-07-15 17:09     ` Vladimir Olovyannikov
2020-07-16 12:19       ` Laszlo Ersek
2020-07-16 15:26         ` Samer El-Haj-Mahmoud
2020-07-16 17:14           ` Vladimir Olovyannikov
2020-07-16 17:07         ` Vladimir Olovyannikov
2020-07-22 19:37 ` Laszlo Ersek
2020-07-22 19:40   ` Laszlo Ersek
2020-07-23 13:30 ` Laszlo Ersek
2020-07-23 17:20   ` Vladimir Olovyannikov
2020-07-23 14:54 ` Laszlo Ersek
2020-07-23 15:02   ` Laszlo Ersek
2020-07-23 17:18     ` Vladimir Olovyannikov
2020-07-24 15:09       ` Laszlo Ersek
2020-07-24 17:50         ` Vladimir Olovyannikov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=da35f44bb31a8cf2411bf48d3c976232@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox