diff mbox series

mongoose: Only ignore PROGRESS status

Message ID 20211130122106.3624036-1-JPEWhacker@gmail.com
State Accepted
Headers show
Series mongoose: Only ignore PROGRESS status | expand

Commit Message

Joshua Watt Nov. 30, 2021, 12:21 p.m. UTC
2c32873 ("mongoose: Ignore PROGRESS messages") broke reporting of update
progress because the PROGRESS messages can hold valid data besides the
status. Update the code to only suppress sending the UNKNOWN status
message, but still send the other messages.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 mongoose/mongoose_interface.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Stefano Babic Dec. 1, 2021, 4:58 p.m. UTC | #1
On 30.11.21 13:21, Joshua Watt wrote:
> 2c32873 ("mongoose: Ignore PROGRESS messages") broke reporting of update
> progress because the PROGRESS messages can hold valid data besides the
> status. Update the code to only suppress sending the UNKNOWN status
> message, but still send the other messages.
> 
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>   mongoose/mongoose_interface.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/mongoose/mongoose_interface.c b/mongoose/mongoose_interface.c
> index 31548cc..7235d8d 100644
> --- a/mongoose/mongoose_interface.c
> +++ b/mongoose/mongoose_interface.c
> @@ -229,10 +229,8 @@ static void *broadcast_progress_thread(void *data)
>   		if (ret != sizeof(msg))
>   			return NULL;
>   
> -		if (msg.status == PROGRESS)
> -			continue;
> -
> -		if (msg.status != status || msg.status == FAILURE) {
> +		if (msg.status != PROGRESS &&
> +		    (msg.status != status || msg.status == FAILURE)) {
>   			status = msg.status;
>   
>   			snescape(escaped, sizeof(escaped), get_status_string(msg.status));
> 

Tested-by: Stefano Babic <sbabic@denx.de>

Regards,
Stefano
diff mbox series

Patch

diff --git a/mongoose/mongoose_interface.c b/mongoose/mongoose_interface.c
index 31548cc..7235d8d 100644
--- a/mongoose/mongoose_interface.c
+++ b/mongoose/mongoose_interface.c
@@ -229,10 +229,8 @@  static void *broadcast_progress_thread(void *data)
 		if (ret != sizeof(msg))
 			return NULL;
 
-		if (msg.status == PROGRESS)
-			continue;
-
-		if (msg.status != status || msg.status == FAILURE) {
+		if (msg.status != PROGRESS &&
+		    (msg.status != status || msg.status == FAILURE)) {
 			status = msg.status;
 
 			snescape(escaped, sizeof(escaped), get_status_string(msg.status));