[PATCH] wget: shrink code if https isn't supported

Denys Vlasenko vda.linux at googlemail.com
Tue Oct 13 13:01:40 UTC 2015


Applied, thanks!

On Mon, Oct 12, 2015 at 11:51 AM, Ron Yorston <rmy at pobox.com> wrote:
> If FEATURE_WGET_OPENSSL and FEATURE_WGET_SSL_HELPER are both disabled
> there's no point in checking for https URLs.
>
> function                                             old     new   delta
> P_HTTPS                                                6       -      -6
> .rodata                                           155501  155469     -32
> parse_url                                            476     423     -53
> ------------------------------------------------------------------------------
> (add/remove: 0/1 grow/shrink: 0/2 up/down: 0/-91)             Total: -91 bytes
>
> Signed-off-by: Ron Yorston <rmy at pobox.com>
> ---
>  networking/wget.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/networking/wget.c b/networking/wget.c
> index d4a9c0c..af9c53c 100644
> --- a/networking/wget.c
> +++ b/networking/wget.c
> @@ -147,7 +147,9 @@ struct host_info {
>  };
>  static const char P_FTP[] = "ftp";
>  static const char P_HTTP[] = "http";
> +#if ENABLE_FEATURE_WGET_OPENSSL || ENABLE_FEATURE_WGET_SSL_HELPER
>  static const char P_HTTPS[] = "https";
> +#endif
>
>  #if ENABLE_FEATURE_WGET_LONG_OPTIONS
>  /* User-specified headers prevent using our corresponding built-in headers.  */
> @@ -410,10 +412,12 @@ static void parse_url(const char *src_url, struct host_info *h)
>                 if (strcmp(url, P_FTP) == 0) {
>                         h->port = bb_lookup_port(P_FTP, "tcp", 21);
>                 } else
> +#if ENABLE_FEATURE_WGET_OPENSSL || ENABLE_FEATURE_WGET_SSL_HELPER
>                 if (strcmp(url, P_HTTPS) == 0) {
>                         h->port = bb_lookup_port(P_HTTPS, "tcp", 443);
>                         h->protocol = P_HTTPS;
>                 } else
> +#endif
>                 if (strcmp(url, P_HTTP) == 0) {
>   http:
>                         h->port = bb_lookup_port(P_HTTP, "tcp", 80);
> --
> 2.4.3
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list