[edk2-devel] [PATCH v3 1/1] ShellPkg/DynamicCommand: add HttpDynamicCommand

Vladimir Olovyannikov via groups.io vladimir.olovyannikov=broadcom.com at groups.io
Fri Jul 24 17:50:45 UTC 2020


> -----Original Message-----
> From: Laszlo Ersek <lersek at redhat.com>
> Sent: Friday, July 24, 2020 8:09 AM
> To: Vladimir Olovyannikov <vladimir.olovyannikov at broadcom.com>;
> devel at edk2.groups.io
> Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud at arm.com>; Zhichao
> Gao <zhichao.gao at intel.com>; Maciej Rabeda
> <maciej.rabeda at linux.intel.com>; Jiaxin Wu <jiaxin.wu at intel.com>; Siyuan
> Fu <siyuan.fu at intel.com>; Ray Ni <ray.ni at intel.com>; Liming Gao
> <liming.gao at intel.com>; Nd <nd at 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

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#63261): https://edk2.groups.io/g/devel/message/63261
Mute This Topic: https://groups.io/mt/75483573/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list