[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH 1/2] wget: replace set_alarm with non blocking functions to support retries
From: Xabier Oneca -- xOneca <xoneca () gmail ! com>
Date: 2019-01-24 9:48:50
Message-ID: CACkgH71OHueFzSGZuWG3V3Fjqi9rCjXizcc6rdHGF80qdGnLWA () mail ! gmail ! com
[Download RAW message or body]
Hello Martin,
In your second patch:
> diff --git a/networking/wget.c b/networking/wget.c
> index 3df8e74..0a23e99 100644
> --- a/networking/wget.c
> +++ b/networking/wget.c
(snip)
> @@ -1295,15 +1352,22 @@ static void download_one_url(const char *url)
> goto socket_opened;
> }
> sfp = open_socket(lsa);
> + if (!sfp) {
> + goto retry;
> + }
> socket_opened:
> #elif ENABLE_FEATURE_WGET_HTTPS
> /* Only internal TLS support is configured */
> sfp = open_socket(lsa);
> - if (server.protocol == P_HTTPS)
> + if (!sfp)
> + goto retry;
> + if (server.protocol == P_HTTPS) {
Extra non-matched brace?
> spawn_ssl_client(server.host, fileno(sfp), /*flags*/ 0);
> #else
> /* ssl (https) support is not configured */
> sfp = open_socket(lsa);
> + if (!sfp)
> + goto retry;
> #endif
> /* Send HTTP request */
> if (use_proxy) {
(snip)
> @@ -1531,13 +1605,18 @@ However, in real world it was observed that some web servers
> free(lsa);
>
> if (!(option_mask32 & WGET_OPT_SPIDER)) {
> + int retrieve_retval;
> if (G.output_fd < 0)
> G.output_fd = xopen(G.fname_out, G.o_flags);
> - retrieve_file_data(dfp);
> + retrieve_retval = retrieve_file_data(dfp);
> if (!(option_mask32 & WGET_OPT_OUTNAME)) {
> xclose(G.output_fd);
> G.output_fd = -1;
> }
> + if (retrieve_retval < 0) { /* We timed out, if we retry so the fd is closed */
> + bb_error_msg("download timed out");
> + goto retry;
> + }
> } else {
> if (!(option_mask32 & WGET_OPT_QUIET))
> fprintf(stderr, "remote file exists\n");
Here the indentation is mixed with spaces.
Cheers,
Xabier Oneca_,,_
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic