[PATCH v2 08/14] net-lwip: add wget command

Jerome Forissier jerome.forissier at linaro.org
Thu Jun 6 14:14:54 CEST 2024



On 6/6/24 12:16, Maxim Uvarov wrote:
> чт, 6 июн. 2024 г. в 12:56, Jerome Forissier <jerome.forissier at linaro.org>:

[...]

>>>> diff --git a/net-lwip/wget.c b/net-lwip/wget.c
>>>> new file mode 100644
>>>> index 00000000000..25b75040806
>>>> --- /dev/null
>>>> +++ b/net-lwip/wget.c
>>>> @@ -0,0 +1,180 @@
>>>> +// SPDX-License-Identifier: GPL-2.0+
>>>> +/* Copyright (C) 2024 Linaro Ltd. */
>>>> +
>>>> +#include <command.h>
>>>> +#include <console.h>
>>>> +#include <display_options.h>
>>>> +#include <image.h>
>>>> +#include <lwip/apps/http_client.h>
>>>> +#include <lwip/timeouts.h>
>>>> +#include <net-lwip.h>
>>>> +#include <time.h>
>>>> +
>>
>> [...]
>>>> +
>>>> +static void httpc_result_cb(void *arg, httpc_result_t httpc_result,
>>>> +                           u32_t rx_content_len, u32_t srv_res, err_t err)
>>>> +{
>>>> +       ulong elapsed;
>>>> +
>>>> +       if (httpc_result != HTTPC_RESULT_OK) {
>>>> +               log_err("\nHTTP client error %d\n", httpc_result);
>>>> +               done = FAILURE;
>>>> +               return;
>>>> +       }
>>>> +
>>>> +       elapsed = get_timer(start_time);
>>>> +        log_info("\n%u bytes transferred in %lu ms (", rx_content_len,
>>>
>>> This print I commented for another patch to match current python tests.
>>
>> What do you mean? Is this text incorrect because some tests expect something
>> else? Which ones?
> 
> You modified the python test to expect this output if LWIP is enabled.

It was in the TFTP test.

> Instead of adding one
> more 'if LWIP' to the python test you can make this log_info() output
> the same as the original code.
> But this is up to you. Somebody sometime later will need to drop 'if
> LWIP' from python code.
I dropped the TFTP message change in v3. I will not change the message
for wget since I don't see any issue with that.

Thanks,
-- 
Jerome

> 
> BR,
> Maxim.


More information about the U-Boot mailing list