diff mbox series

progress: Clear source after reported download progress

Message ID 20230602070009.18039-1-christian.storm@siemens.com
State Accepted
Headers show
Series progress: Clear source after reported download progress | expand

Commit Message

Storm, Christian June 2, 2023, 7 a.m. UTC
With commit 8fccd13 source is passed through on download progress.
But, core/progress_thread.c's static struct swupdate_progress progress
is stateful so source is not reset after download progress reporting.
Hence, clear it thereafter.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 core/progress_thread.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Stefano Babic June 2, 2023, 8:15 a.m. UTC | #1
On 02.06.23 09:00, 'Christian Storm' via swupdate wrote:
> With commit 8fccd13 source is passed through on download progress.
> But, core/progress_thread.c's static struct swupdate_progress progress
> is stateful so source is not reset after download progress reporting.
> Hence, clear it thereafter.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>   core/progress_thread.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/core/progress_thread.c b/core/progress_thread.c
> index ef9ccf3d..f579f302 100644
> --- a/core/progress_thread.c
> +++ b/core/progress_thread.c
> @@ -24,6 +24,7 @@
>   
>   #include "swupdate.h"
>   #include <handler.h>
> +#include "swupdate_status.h"
>   #include "util.h"
>   #include "pctl.h"
>   #include "network_ipc.h"
> @@ -120,6 +121,7 @@ static void _swupdate_download_update(unsigned int perc, unsigned long long tota
>   		pprog->msg.dwl_percent = perc;
>   		pprog->msg.dwl_bytes = totalbytes;
>   		send_progress_msg();
> +		pprog->msg.source = SOURCE_UNKNOWN;
>   	}
>   	pthread_mutex_unlock(&pprog->lock);
>   }


Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/core/progress_thread.c b/core/progress_thread.c
index ef9ccf3d..f579f302 100644
--- a/core/progress_thread.c
+++ b/core/progress_thread.c
@@ -24,6 +24,7 @@ 
 
 #include "swupdate.h"
 #include <handler.h>
+#include "swupdate_status.h"
 #include "util.h"
 #include "pctl.h"
 #include "network_ipc.h"
@@ -120,6 +121,7 @@  static void _swupdate_download_update(unsigned int perc, unsigned long long tota
 		pprog->msg.dwl_percent = perc;
 		pprog->msg.dwl_bytes = totalbytes;
 		send_progress_msg();
+		pprog->msg.source = SOURCE_UNKNOWN;
 	}
 	pthread_mutex_unlock(&pprog->lock);
 }